@holo-js/db-sqlite 0.3.28 → 0.4.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/LICENSE +21 -0
- package/dist/.holo-build-fingerprint +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +5 -2
- package/package.json +15 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Holo-JS contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3e2d8f4c3994a21717ef2b6abeb3effc805c9b95a5ba6ca0df1d6c971d156dd0
|
package/dist/index.d.ts
CHANGED
|
@@ -56,4 +56,5 @@ declare class SQLiteAdapter implements DriverAdapter {
|
|
|
56
56
|
declare function createSQLiteAdapter(options?: SQLiteAdapterOptions): SQLiteAdapter;
|
|
57
57
|
declare const sqliteDatabaseDriverFactory: DatabaseDriverFactory;
|
|
58
58
|
|
|
59
|
-
export { SQLiteAdapter,
|
|
59
|
+
export { SQLiteAdapter, createSQLiteAdapter, sqliteDatabaseDriverFactory };
|
|
60
|
+
export type { SQLiteAdapterOptions, SQLiteDatabaseLike, SQLiteStatementLike };
|
package/dist/index.mjs
CHANGED
|
@@ -8,6 +8,9 @@ import {
|
|
|
8
8
|
var TransactionError = class extends Error {
|
|
9
9
|
};
|
|
10
10
|
var transactionTails = /* @__PURE__ */ new Map();
|
|
11
|
+
function normalizeBinding(value) {
|
|
12
|
+
return typeof value === "boolean" ? Number(value) : value;
|
|
13
|
+
}
|
|
11
14
|
var SQLiteAdapter = class {
|
|
12
15
|
database;
|
|
13
16
|
connected;
|
|
@@ -96,7 +99,7 @@ var SQLiteAdapter = class {
|
|
|
96
99
|
}
|
|
97
100
|
async query(sql, bindings = []) {
|
|
98
101
|
const statement = this.getDatabase().prepare(sql);
|
|
99
|
-
const rows = statement.all(...bindings);
|
|
102
|
+
const rows = statement.all(...bindings.map(normalizeBinding));
|
|
100
103
|
return {
|
|
101
104
|
rows,
|
|
102
105
|
rowCount: rows.length
|
|
@@ -108,7 +111,7 @@ var SQLiteAdapter = class {
|
|
|
108
111
|
async execute(sql, bindings = []) {
|
|
109
112
|
return this.runWithTransactionScope(async () => {
|
|
110
113
|
const statement = this.getDatabase().prepare(sql);
|
|
111
|
-
const result = statement.run(...bindings);
|
|
114
|
+
const result = statement.run(...bindings.map(normalizeBinding));
|
|
112
115
|
return {
|
|
113
116
|
affectedRows: result.changes,
|
|
114
117
|
lastInsertId: typeof result.lastInsertRowid === "bigint" ? Number(result.lastInsertRowid) : result.lastInsertRowid
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/db-sqlite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Holo-JS Framework - SQLite database adapter",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/cobraprojects/holo-js.git",
|
|
10
|
+
"directory": "packages/db-sqlite"
|
|
11
|
+
},
|
|
7
12
|
"exports": {
|
|
8
13
|
".": {
|
|
9
14
|
"types": "./dist/index.d.ts",
|
|
@@ -14,7 +19,8 @@
|
|
|
14
19
|
"main": "./dist/index.mjs",
|
|
15
20
|
"types": "./dist/index.d.ts",
|
|
16
21
|
"files": [
|
|
17
|
-
"dist"
|
|
22
|
+
"dist",
|
|
23
|
+
"LICENSE"
|
|
18
24
|
],
|
|
19
25
|
"scripts": {
|
|
20
26
|
"build": "tsup",
|
|
@@ -23,19 +29,19 @@
|
|
|
23
29
|
"test": "vitest --run"
|
|
24
30
|
},
|
|
25
31
|
"engines": {
|
|
26
|
-
"node": "^22.
|
|
32
|
+
"node": "^22.18.0 || ^24.0.0 || ^26.0.0"
|
|
27
33
|
},
|
|
28
34
|
"peerDependencies": {
|
|
29
|
-
"@holo-js/db": "^0.
|
|
35
|
+
"@holo-js/db": "^0.4.0"
|
|
30
36
|
},
|
|
31
37
|
"dependencies": {
|
|
32
38
|
"better-sqlite3": "^13.0.3"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {
|
|
35
|
-
"@holo-js/db": "^0.
|
|
36
|
-
"@types/better-sqlite3": "^
|
|
37
|
-
"tsup": "^
|
|
38
|
-
"typescript": "^
|
|
39
|
-
"vitest": "^
|
|
41
|
+
"@holo-js/db": "^0.4.0",
|
|
42
|
+
"@types/better-sqlite3": "^9.6.0",
|
|
43
|
+
"tsup": "^9.0.0",
|
|
44
|
+
"typescript": "^6.0.3",
|
|
45
|
+
"vitest": "^5.0.5"
|
|
40
46
|
}
|
|
41
47
|
}
|