@easy-cms/db-sqlite 0.48.0 → 0.60.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/dist/index.d.ts +2 -2
- package/dist/index.js +4 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ interface SQLiteAdapterOptions extends DrizzleAdapterOptions {
|
|
|
8
8
|
/** Auth token for Turso / remote libSQL. */
|
|
9
9
|
readonly authToken?: string;
|
|
10
10
|
/**
|
|
11
|
-
* Local files: how long (ms) a write waits while another process (a second server, the CLI)
|
|
11
|
+
* Local files: how long (in ms) a write waits while another process (a second server, the CLI)
|
|
12
12
|
* is writing to the same file. Default 10000.
|
|
13
13
|
*/
|
|
14
|
-
readonly
|
|
14
|
+
readonly busyTimeoutMs?: number;
|
|
15
15
|
}
|
|
16
16
|
declare const sqliteDialect: Dialect;
|
|
17
17
|
/** SQLite / libSQL database adapter. */
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { readFileSync } from "fs";
|
|
|
3
3
|
import { createRequire } from "module";
|
|
4
4
|
import { dirname, isAbsolute, join, resolve } from "path";
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
|
+
import { checkRenamedOptions } from "@easy-cms/core/internal";
|
|
6
7
|
import {
|
|
7
8
|
connectDatabase
|
|
8
9
|
} from "@easy-cms/drizzle";
|
|
@@ -70,9 +71,11 @@ var sqliteDialect = {
|
|
|
70
71
|
migration: async (prev, cur) => (await kit()).generateSQLiteMigration(prev, cur)
|
|
71
72
|
};
|
|
72
73
|
function sqlite(options) {
|
|
74
|
+
checkRenamedOptions("sqlite", options, { busyTimeout: "busyTimeoutMs" });
|
|
73
75
|
let traceInclude;
|
|
74
76
|
return {
|
|
75
77
|
name: "sqlite",
|
|
78
|
+
apiVersion: 1,
|
|
76
79
|
init: async (args) => {
|
|
77
80
|
const url = resolveUrl(options.url, args.cwd);
|
|
78
81
|
const client = createClient({
|
|
@@ -80,7 +83,7 @@ function sqlite(options) {
|
|
|
80
83
|
...options.authToken ? { authToken: options.authToken } : {},
|
|
81
84
|
// SQLite has one writer. Writes in this process share a queue (`writeQueue`); this waits
|
|
82
85
|
// for other processes. Its wait blocks the process, but only for another's short write.
|
|
83
|
-
timeout: options.
|
|
86
|
+
timeout: options.busyTimeoutMs ?? 1e4
|
|
84
87
|
});
|
|
85
88
|
if (options.url.startsWith("file:")) await client.execute("PRAGMA journal_mode = WAL");
|
|
86
89
|
const toStatement = (s) => ({ sql: s.sql, args: [...s.params ?? []] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-cms/db-sqlite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "SQLite / libSQL database adapter for Easy CMS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"@libsql/client": "^0.18.0",
|
|
23
23
|
"drizzle-kit": "0.31.11",
|
|
24
24
|
"drizzle-orm": "0.45.3",
|
|
25
|
-
"@easy-cms/drizzle": "^0.
|
|
25
|
+
"@easy-cms/drizzle": "^0.60.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@easy-cms/core": "^0.
|
|
28
|
+
"@easy-cms/core": "^0.60.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"sharp": "^0.35.5",
|
|
32
|
-
"@easy-cms/core": "^0.
|
|
32
|
+
"@easy-cms/core": "^0.60.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|