@homeofthings/sqlite3 0.0.1-alpha0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/index.js +1 -0
- package/package.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @homeofthings/sqlite3
|
|
2
|
+
|
|
3
|
+
Asynchronous, non-blocking [SQLite3](https://sqlite.org/) bindings for [Node.js](http://nodejs.org/).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Straightforward query and parameter binding interface
|
|
8
|
+
- Full Buffer/Blob support
|
|
9
|
+
- Extensive [debugging support](https://github.com/gms1/node-sqlite3/wiki/Debugging)
|
|
10
|
+
- [Query serialization](https://github.com/gms1/node-sqlite3/wiki/Control-Flow) API
|
|
11
|
+
- [Extension support](https://github.com/gms1/node-sqlite3/wiki/API#databaseloadextensionpath-callback)
|
|
12
|
+
|
|
13
|
+
## Installing
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @homeofthings/sqlite3
|
|
17
|
+
# or
|
|
18
|
+
yarn add @homeofthings/sqlite3
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
const sqlite3 = require('@homeofthings/sqlite3').verbose();
|
|
25
|
+
const db = new sqlite3.Database(':memory:');
|
|
26
|
+
|
|
27
|
+
db.serialize(() => {
|
|
28
|
+
db.run("CREATE TABLE lorem (info TEXT)");
|
|
29
|
+
|
|
30
|
+
const stmt = db.prepare("INSERT INTO lorem VALUES (?)");
|
|
31
|
+
for (let i = 0; i < 10; i++) {
|
|
32
|
+
stmt.run("Ipsum " + i);
|
|
33
|
+
}
|
|
34
|
+
stmt.finalize();
|
|
35
|
+
|
|
36
|
+
db.each("SELECT rowid AS id, info FROM lorem", (err, row) => {
|
|
37
|
+
console.log(row.id + ": " + row.info);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
db.close();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Source
|
|
45
|
+
|
|
46
|
+
[GitHub Repository](https://github.com/gms1/node-sqlite3)
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
BSD-3-Clause
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./lib/sqlite3');
|
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@homeofthings/sqlite3",
|
|
3
|
+
"version": "0.0.1-alpha0",
|
|
4
|
+
"description": "Asynchronous, non-blocking SQLite3 bindings",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/gms1/node-sqlite3.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "BSD-3-Clause",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
}
|
|
14
|
+
}
|