@litejs/sqlite3

21.0.0-rc.1 • Public • Published

Sqlite3 – size

Small sqlite3 command wrapper with buffer and boolean support.

var sqlite3 = require("@litejs/sqlite3")
, db = sqlite3("./test.db", {
	bin: "/bin/sqlite3",     // Default: sqlite3
	migration: "./db/test/"  // Migration sql files. Default: null
	nice: 1                  // Default: null
})

// update db.real, db.user and db.sys for each query
db.run(".timer on")

// report a number of rows affected by INSERT, DELETE, or UPDATE statement
db.run(".changes on")

db.run("CREATE TABLE t1 (id INT PRIMARY KEY, enabled BLOB, val BLOB)")
db.run("INSERT INTO t1 VALUES (?, ?)", [1, true, "str"])
db.get("SELECT id, val FROM t1 WHERE t=?", [1], function(err, row) {
	// row = { id: 1, val: 'str' }
})
db.close()

// allow the parent to exit without waiting for a child to exit
db.child.unref()

External links

GitHub repo | npm package

Licence

Copyright (c) 2013-2020 Lauri Rooden <lauri@rooden.ee>
The MIT License

/@litejs/sqlite3/

    Package Sidebar

    Install

    npm i @litejs/sqlite3

    Weekly Downloads

    0

    Version

    21.0.0-rc.1

    License

    MIT

    Unpacked Size

    10.3 kB

    Total Files

    3

    Last publish

    Collaborators

    • lauriro