@zukhruf/sqlite-transaction 0.6.16 → 0.7.0
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 +2 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -16,12 +16,12 @@ npm install @zukhruf/sqlite-transaction
|
|
|
16
16
|
import { mkdtempDisposable } from 'node:fs/promises';
|
|
17
17
|
import { tmpdir } from 'node:os';
|
|
18
18
|
import { join } from 'node:path';
|
|
19
|
-
import { DatabaseSync } from 'node:sqlite';
|
|
20
19
|
|
|
20
|
+
import { open } from '@zukhruf/sqlite-open';
|
|
21
21
|
import { transaction } from '@zukhruf/sqlite-transaction';
|
|
22
22
|
|
|
23
23
|
await using scratch = await mkdtempDisposable(join(tmpdir(), 'transaction-'));
|
|
24
|
-
using database =
|
|
24
|
+
using database = open(join(scratch.path, 'app.sqlite'));
|
|
25
25
|
database.exec('CREATE TABLE notes (body TEXT) STRICT');
|
|
26
26
|
|
|
27
27
|
const rows = transaction(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/sqlite-transaction",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "A transaction function for node:sqlite: it commits when the function returns and rolls back when it throws. A nested call uses a savepoint. When SQLite ends the transaction itself, the caller gets the original error, not \"cannot rollback\".",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@zukhruf/
|
|
43
|
+
"@zukhruf/sqlite-open": "^0.7.0",
|
|
44
|
+
"@zukhruf/testing": "^0.7.0"
|
|
44
45
|
}
|
|
45
46
|
}
|