jayralencar / sqlite-sync.js

Node module to sqlite sync and async
MIT License
78 stars 30 forks source link

Error when using update function #23

Open TaffarelXavier opened 5 years ago

TaffarelXavier commented 5 years ago

There is an error trying to update some data


var sqlite = require("sqlite-sync"); //requiring

//Connecting - if the file does not exist it will be created
sqlite.connect("C:/Users/Taffarel/AppData/Local/codenotetx/notes_db.db");

// var rows = sqlite.run("SELECT * FROM users;");

var nome = "My Name";
var id = 1;

sqlite.run("UPDATE users SET name = ? WHERE id = ?;", [nome, id], function(ok) {
  console.log(ok); //not return true if success, alws zero (false)
  var rows = sqlite.run("SELECT * FROM users WHERE id = ?", [id]);
  console.log(rows);
});

sqlite.close();

But when I open SQLite Studio, the data be updated.
buaaluwentao commented 4 years ago

the same problem