Merge remote-tracking branch 'upstream/master' into merge_7_25

This commit is contained in:
Ryan Cavanaugh
2016-07-27 10:57:46 -07:00
312 changed files with 30700 additions and 5251 deletions

View File

@@ -31,10 +31,17 @@ function readAllRows() {
rows.forEach(function (row) {
console.log(row.id + ": " + row.info);
});
closeDb();
readSomeRows();
});
}
function readSomeRows() {
console.log("readAllRows lorem");
db.each("SELECT rowid AS id, info FROM lorem WHERE rowid < ? ", 5, function(err, row) {
console.log(row.id + ": " + row.info);
}, closeDb);
}
function closeDb() {
console.log("closeDb");
db.close();
@@ -63,7 +70,7 @@ db.serialize(function() {
db.serialize(function() {
// These two queries will run sequentially.
db.run("CREATE TABLE foo (num)");
db.run("INSERT INTO foo VALUES (?)", 1, function() {
db.run("INSERT INTO foo VALUES (?)", 1, function(err) {
// These queries will run in parallel and the second query will probably
// fail because the table might not exist yet.
db.run("CREATE TABLE bar (num)");
@@ -82,6 +89,9 @@ db.run("UPDATE tbl SET name = $name WHERE id = $id", {
$id: 2,
$name: "bar"
});
db.run("UPDATE tbl SET name = $name WHERE id = $id", { $id: 2, $name: "bar" },
function(err) { }
);
db.run("UPDATE tbl SET name = ?5 WHERE id = ?", {
1: 2,