Skip to content

litejs/sqlite3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 <[email protected]>
The MIT License

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published