@ocap/indexdb-sqlite 1.29.11 → 1.29.12
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/esm/kysely.d.mts +2 -0
- package/esm/kysely.mjs +3 -2
- package/lib/kysely.cjs +3 -2
- package/lib/kysely.d.cts +2 -0
- package/package.json +6 -6
package/esm/kysely.d.mts
CHANGED
|
@@ -15,6 +15,8 @@ interface SqliteConfig {
|
|
|
15
15
|
create?: boolean;
|
|
16
16
|
/** Enable WAL mode (default: true) */
|
|
17
17
|
walMode?: boolean;
|
|
18
|
+
/** Busy timeout in ms (default: SQLITE_BUSY_TIMEOUT env or 5000) */
|
|
19
|
+
busyTimeout?: number;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Create a Kysely instance with SQLite dialect
|
package/esm/kysely.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { __require } from "./_virtual/rolldown_runtime.mjs";
|
|
|
2
2
|
import { Kysely, SqliteDialect } from "kysely";
|
|
3
3
|
|
|
4
4
|
//#region src/kysely.ts
|
|
5
|
+
const DEFAULT_BUSY_TIMEOUT = Number(process.env.SQLITE_BUSY_TIMEOUT) || 5e3;
|
|
5
6
|
function isBunRuntime() {
|
|
6
7
|
return typeof globalThis.Bun !== "undefined";
|
|
7
8
|
}
|
|
@@ -34,7 +35,7 @@ function createKysely(config) {
|
|
|
34
35
|
sqlite$1.exec("PRAGMA synchronous = NORMAL");
|
|
35
36
|
}
|
|
36
37
|
sqlite$1.exec("PRAGMA foreign_keys = ON");
|
|
37
|
-
sqlite$1.exec(
|
|
38
|
+
sqlite$1.exec(`PRAGMA busy_timeout = ${config.busyTimeout ?? DEFAULT_BUSY_TIMEOUT}`);
|
|
38
39
|
return new Kysely({ dialect: new BunSqliteDialect({ database: sqlite$1 }) });
|
|
39
40
|
}
|
|
40
41
|
const sqlite = new (__require("better-sqlite3"))(config.filename, {
|
|
@@ -46,7 +47,7 @@ function createKysely(config) {
|
|
|
46
47
|
sqlite.pragma("synchronous = NORMAL");
|
|
47
48
|
}
|
|
48
49
|
sqlite.pragma("foreign_keys = ON");
|
|
49
|
-
sqlite.pragma(
|
|
50
|
+
sqlite.pragma(`busy_timeout = ${config.busyTimeout ?? DEFAULT_BUSY_TIMEOUT}`);
|
|
50
51
|
return new Kysely({ dialect: new SqliteDialect({ database: sqlite }) });
|
|
51
52
|
}
|
|
52
53
|
/**
|
package/lib/kysely.cjs
CHANGED
|
@@ -2,6 +2,7 @@ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
|
2
2
|
let kysely = require("kysely");
|
|
3
3
|
|
|
4
4
|
//#region src/kysely.ts
|
|
5
|
+
const DEFAULT_BUSY_TIMEOUT = Number(process.env.SQLITE_BUSY_TIMEOUT) || 5e3;
|
|
5
6
|
function isBunRuntime() {
|
|
6
7
|
return typeof globalThis.Bun !== "undefined";
|
|
7
8
|
}
|
|
@@ -34,7 +35,7 @@ function createKysely(config) {
|
|
|
34
35
|
sqlite$1.exec("PRAGMA synchronous = NORMAL");
|
|
35
36
|
}
|
|
36
37
|
sqlite$1.exec("PRAGMA foreign_keys = ON");
|
|
37
|
-
sqlite$1.exec(
|
|
38
|
+
sqlite$1.exec(`PRAGMA busy_timeout = ${config.busyTimeout ?? DEFAULT_BUSY_TIMEOUT}`);
|
|
38
39
|
return new kysely.Kysely({ dialect: new BunSqliteDialect({ database: sqlite$1 }) });
|
|
39
40
|
}
|
|
40
41
|
const sqlite = new (require("better-sqlite3"))(config.filename, {
|
|
@@ -46,7 +47,7 @@ function createKysely(config) {
|
|
|
46
47
|
sqlite.pragma("synchronous = NORMAL");
|
|
47
48
|
}
|
|
48
49
|
sqlite.pragma("foreign_keys = ON");
|
|
49
|
-
sqlite.pragma(
|
|
50
|
+
sqlite.pragma(`busy_timeout = ${config.busyTimeout ?? DEFAULT_BUSY_TIMEOUT}`);
|
|
50
51
|
return new kysely.Kysely({ dialect: new kysely.SqliteDialect({ database: sqlite }) });
|
|
51
52
|
}
|
|
52
53
|
/**
|
package/lib/kysely.d.cts
CHANGED
|
@@ -15,6 +15,8 @@ interface SqliteConfig {
|
|
|
15
15
|
create?: boolean;
|
|
16
16
|
/** Enable WAL mode (default: true) */
|
|
17
17
|
walMode?: boolean;
|
|
18
|
+
/** Busy timeout in ms (default: SQLITE_BUSY_TIMEOUT env or 5000) */
|
|
19
|
+
busyTimeout?: number;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Create a Kysely instance with SQLite dialect
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ocap/indexdb-sqlite",
|
|
3
3
|
"description": "OCAP indexdb adapter that uses SQLite as backend",
|
|
4
|
-
"version": "1.29.
|
|
4
|
+
"version": "1.29.12",
|
|
5
5
|
"author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/ArcBlock/blockchain/issues",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"wangshijun <shijun@arcblock.io> (https://www.arcblock.io)"
|
|
15
15
|
],
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@ocap/indexdb-test": "1.29.
|
|
17
|
+
"@ocap/indexdb-test": "1.29.12"
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://github.com/ArcBlock/blockchain/tree/master/indexdb/sqlite",
|
|
20
20
|
"keywords": [
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"clean": "rm -rf lib esm"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@arcblock/did": "1.29.
|
|
67
|
-
"@ocap/indexdb": "1.29.
|
|
68
|
-
"@ocap/types": "1.29.
|
|
69
|
-
"@ocap/util": "1.29.
|
|
66
|
+
"@arcblock/did": "1.29.12",
|
|
67
|
+
"@ocap/indexdb": "1.29.12",
|
|
68
|
+
"@ocap/types": "1.29.12",
|
|
69
|
+
"@ocap/util": "1.29.12",
|
|
70
70
|
"debug": "^4.4.3",
|
|
71
71
|
"better-sqlite3": "^11.8.1",
|
|
72
72
|
"kysely": "^0.27.0",
|