From 04aaf61b08eb28b77ff4ea26fd18c0b7f5853ccd Mon Sep 17 00:00:00 2001 From: zeus Date: Thu, 30 Dec 2021 17:41:47 +0200 Subject: [PATCH] add --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 2238694..353658e 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,32 @@ The sqlite3 module provides a rich set of features: - Bundles SQLite as a fallback +See the API documentation: https://github.com/mapbox/node-sqlite3/wiki + + + Usage Example + +> +> var sqlite3 = require('sqlite3').verbose(); +> var db = new sqlite3.Database(':memory:'); +> +> 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++) { +> stmt.run("Ipsum " + i); +> } +> stmt.finalize(); +> +> db.each("SELECT rowid AS id, info FROM lorem", function(err, row) { +> console.log(row.id + ": " + row.info); +> }); +> }); +> +> db.close(); +> + ## Quickstart