https://github.com/litejs/sqlite3
https://github.com/litejs/sqlite3
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/litejs/sqlite3
- Owner: litejs
- Created: 2020-11-25T07:24:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-25T07:25:17.000Z (over 5 years ago)
- Last Synced: 2025-03-10T17:59:59.237Z (over 1 year ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[LiteJS]: https://www.litejs.com/
[npm package]: https://npmjs.org/package/@litejs/sqlite3
[GitHub repo]: https://github.com/litejs/@litejs/sqlite3
[size]: https://packagephobia.now.sh/badge?p=@litejs/sqlite3
[size-src]: https://packagephobia.now.sh/result?p=@litejs/sqlite3
Sqlite3 – [![size][size]][size-src]
=======
Small sqlite3 command wrapper with buffer and boolean support.
```javascript
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](http://lauri.rooden.ee/mit-license.txt)