Commit eb4e5a30 by Nathan Rajlich

Syntax highlighting in the README.

parent 812c5d39
...@@ -8,24 +8,26 @@ node-sqlite3 - Asynchronous, non-blocking [SQLite3](http://sqlite.org/) bindings ...@@ -8,24 +8,26 @@ node-sqlite3 - Asynchronous, non-blocking [SQLite3](http://sqlite.org/) bindings
Install with `npm install sqlite3`. Install with `npm install sqlite3`.
var sqlite3 = require('sqlite3').verbose(); ``` js
var db = new sqlite3.Database(':memory:'); var sqlite3 = require('sqlite3').verbose();
var db = new sqlite3.Database(':memory:');
db.serialize(function() {
db.run("CREATE TABLE lorem (info TEXT)"); db.serialize(function() {
db.run("CREATE TABLE lorem (info TEXT)");
var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
for (var i = 0; i < 10; i++) { var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
stmt.run("Ipsum " + i); for (var i = 0; i < 10; i++) {
} stmt.run("Ipsum " + i);
stmt.finalize(); }
stmt.finalize();
db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
console.log(row.id + ": " + row.info); db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
}); console.log(row.id + ": " + row.info);
}); });
});
db.close();
db.close();
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment