better-sqlite3-multiple-ciphers 9.0.0 → 9.1.1
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 +20 -9
- package/deps/setup.ps1 +1 -1
- package/deps/sqlite3/sqlite3.c +4368 -2374
- package/deps/sqlite3/sqlite3.h +170 -33
- package/deps/sqlite3/sqlite3ext.h +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,10 +17,10 @@ The fastest and simplest library for SQLite3 in Node.js. This particular fork su
|
|
|
17
17
|
## Current versions
|
|
18
18
|
|
|
19
19
|
- ### Stable
|
|
20
|
-
- **better-sqlite3-multiple-ciphers** - [`9.
|
|
21
|
-
- **better-sqlite3** - [`9.
|
|
22
|
-
- **SQLite** - [`3.
|
|
23
|
-
- **SQLite3 Multiple Ciphers** - [`1.7.
|
|
20
|
+
- **better-sqlite3-multiple-ciphers** - [`9.1.1`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v9.1.1)
|
|
21
|
+
- **better-sqlite3** - [`9.1.1`](https://github.com/JoshuaWise/better-sqlite3/releases/tag/v9.1.1)
|
|
22
|
+
- **SQLite** - [`3.44.0`](https://www.sqlite.org/releaselog/3_44_0.html)
|
|
23
|
+
- **SQLite3 Multiple Ciphers** - [`1.7.4`](https://github.com/utelle/SQLite3MultipleCiphers/releases/tag/v1.7.4)
|
|
24
24
|
|
|
25
25
|
- ### Beta
|
|
26
26
|
- **better-sqlite3-multiple-ciphers** - [`v8.7.1-beta.0`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/releases/tag/v8.7.1-beta.0)
|
|
@@ -99,7 +99,7 @@ A database can be encrypted and decrypted simply using `key` and `rekey` `PRAGMA
|
|
|
99
99
|
```js
|
|
100
100
|
const db = require('better-sqlite3-multiple-ciphers')('foobar.db', options);
|
|
101
101
|
|
|
102
|
-
db.pragma(
|
|
102
|
+
db.pragma(`rekey='secret-key'`);
|
|
103
103
|
db.close();
|
|
104
104
|
```
|
|
105
105
|
|
|
@@ -108,8 +108,8 @@ db.close();
|
|
|
108
108
|
```js
|
|
109
109
|
const db = require('better-sqlite3-multiple-ciphers')('foobar.db', options);
|
|
110
110
|
|
|
111
|
-
db.pragma(
|
|
112
|
-
const row = db.prepare(
|
|
111
|
+
db.pragma(`key='secret-key'`);
|
|
112
|
+
const row = db.prepare('SELECT * FROM users WHERE id = ?').get(userId);
|
|
113
113
|
console.log(row.firstName, row.lastName, row.email);
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -120,14 +120,25 @@ const db = require('better-sqlite3-multiple-ciphers')('foobar.db', options);
|
|
|
120
120
|
|
|
121
121
|
db.pragma(`cipher='sqlcipher'`)
|
|
122
122
|
db.pragma(`legacy=4`)
|
|
123
|
-
db.pragma(
|
|
124
|
-
const row = db.prepare(
|
|
123
|
+
db.pragma(`key='secret-key'`);
|
|
124
|
+
const row = db.prepare('SELECT * FROM users WHERE id = ?').get(userId);
|
|
125
125
|
console.log(row.firstName, row.lastName, row.email);
|
|
126
126
|
```
|
|
127
127
|
The same method should be used if you want to create a new encrypted database that can be opened using DB Browser for SQLite.
|
|
128
128
|
|
|
129
129
|
You can also use [`key()`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/blob/master/docs/api.md#keybuffer---number) and [`rekey()`](https://github.com/m4heshd/better-sqlite3-multiple-ciphers/blob/master/docs/api.md#rekeybuffer---number) functions for encryption and decryption tasks.
|
|
130
130
|
|
|
131
|
+
**GUI database editors:**
|
|
132
|
+
|
|
133
|
+
Even though `better-sqlite3-multiple-ciphers` supports opening databases created
|
|
134
|
+
using [DB Browser for SQLite](https://github.com/sqlitebrowser/sqlitebrowser), it only supports creating/editing legacy
|
|
135
|
+
SQLCipher databases which means, it's highly likely that you won't be able to open a database created
|
|
136
|
+
using `better-sqlite3-multiple-ciphers` in DB Browser for SQLite.
|
|
137
|
+
|
|
138
|
+
To visually edit databases created using `better-sqlite3-multiple-ciphers` regardless of the cipher configuration, it's
|
|
139
|
+
recommended to use a tool like [SQLiteStudio](https://github.com/pawelsalawa/sqlitestudio) because it also
|
|
140
|
+
uses [SQLite3MultipleCiphers](https://github.com/utelle/SQLite3MultipleCiphers) under the hood.
|
|
141
|
+
|
|
131
142
|
### Read more about encryption at [SQLite3MultipleCiphers documentation](https://utelle.github.io/SQLite3MultipleCiphers/).
|
|
132
143
|
|
|
133
144
|
## Why should I use this instead of [node-sqlite3](https://github.com/mapbox/node-sqlite3)?
|