@gobing-ai/ts-db 0.4.14 → 0.4.16
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
CHANGED
|
@@ -229,7 +229,8 @@ import { QueueJobDao } from '@gobing-ai/ts-db';
|
|
|
229
229
|
|
|
230
230
|
const queue = new QueueJobDao(adapter);
|
|
231
231
|
|
|
232
|
-
// Enqueue
|
|
232
|
+
// Enqueue — maxRetries is a total attempt budget, not retries after the first:
|
|
233
|
+
// 5 means up to 5 attempts, and `maxRetries: 1` runs the job once with no retry.
|
|
233
234
|
const jobId = await queue.enqueue('send-email', { to: 'user@test.com' }, { maxRetries: 5 });
|
|
234
235
|
|
|
235
236
|
// Consumer: claim ready jobs atomically
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bun-sqlite.d.ts","sourceRoot":"","sources":["../../src/adapters/bun-sqlite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAW,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAS5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,OAAO,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACL;
|
|
1
|
+
{"version":3,"file":"bun-sqlite.d.ts","sourceRoot":"","sources":["../../src/adapters/bun-sqlite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAW,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,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AGhB"}
|
|
@@ -6,6 +6,7 @@ const DEFAULT_PRAGMAS = {
|
|
|
6
6
|
journalMode: 'PRAGMA journal_mode = WAL',
|
|
7
7
|
synchronous: 'PRAGMA synchronous = NORMAL',
|
|
8
8
|
foreignKeys: 'PRAGMA foreign_keys = ON',
|
|
9
|
+
busyTimeout: 'PRAGMA busy_timeout = 5000',
|
|
9
10
|
};
|
|
10
11
|
const DEFAULT_DB_PATH = '.spur/spur.db';
|
|
11
12
|
/**
|
|
@@ -40,6 +41,7 @@ export class BunSqliteAdapter {
|
|
|
40
41
|
this.sqlite.run(pragmas.journalMode);
|
|
41
42
|
this.sqlite.run(pragmas.synchronous);
|
|
42
43
|
this.sqlite.run(pragmas.foreignKeys);
|
|
44
|
+
this.sqlite.run(pragmas.busyTimeout);
|
|
43
45
|
this.drizzleDb = drizzle({ client: this.sqlite, schema });
|
|
44
46
|
}
|
|
45
47
|
/** The internal typed drizzle database (ts-db DAO layer + migrations only). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobing-ai/ts-db",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.16",
|
|
4
4
|
"description": "@gobing-ai/ts-db — a drizzle-free database facade: typed DAOs over Bun SQLite / Cloudflare D1, a small predicate query spec, single-source-of-truth tables, and migrations. Drizzle stays an internal detail.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-db-v<version> && git push --tags' && exit 1"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@gobing-ai/ts-runtime": "^0.4.
|
|
70
|
-
"@gobing-ai/ts-utils": "^0.4.
|
|
69
|
+
"@gobing-ai/ts-runtime": "^0.4.16",
|
|
70
|
+
"@gobing-ai/ts-utils": "^0.4.16"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"drizzle-orm": ">=0.38.0",
|
|
@@ -22,6 +22,7 @@ export interface BunSqliteOptions {
|
|
|
22
22
|
journalMode?: string;
|
|
23
23
|
synchronous?: string;
|
|
24
24
|
foreignKeys?: string;
|
|
25
|
+
busyTimeout?: string;
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
|
|
@@ -29,6 +30,7 @@ const DEFAULT_PRAGMAS = {
|
|
|
29
30
|
journalMode: 'PRAGMA journal_mode = WAL',
|
|
30
31
|
synchronous: 'PRAGMA synchronous = NORMAL',
|
|
31
32
|
foreignKeys: 'PRAGMA foreign_keys = ON',
|
|
33
|
+
busyTimeout: 'PRAGMA busy_timeout = 5000',
|
|
32
34
|
} as const;
|
|
33
35
|
|
|
34
36
|
const DEFAULT_DB_PATH = '.spur/spur.db';
|
|
@@ -70,6 +72,7 @@ export class BunSqliteAdapter implements DbAdapter {
|
|
|
70
72
|
this.sqlite.run(pragmas.journalMode);
|
|
71
73
|
this.sqlite.run(pragmas.synchronous);
|
|
72
74
|
this.sqlite.run(pragmas.foreignKeys);
|
|
75
|
+
this.sqlite.run(pragmas.busyTimeout);
|
|
73
76
|
|
|
74
77
|
this.drizzleDb = drizzle({ client: this.sqlite, schema });
|
|
75
78
|
}
|