@jxsuite/connector 0.5.2 → 0.5.3
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/package.json +4 -4
- package/src/dialects/bun-sqlite.ts +10 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/connector",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Jx database connections and dynamic data tables served over /_jx/data",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"@jxsuite/schema": "^1.8.0",
|
|
61
61
|
"kysely": "^0.29.5",
|
|
62
62
|
"kysely-d1": "^0.4.0",
|
|
63
|
-
"kysely-postgres-js": "^
|
|
63
|
+
"kysely-postgres-js": "^4.0.0",
|
|
64
64
|
"postgres": "^3.4.9"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@cloudflare/workers-types": "^5.
|
|
67
|
+
"@cloudflare/workers-types": "^5.20260823.1",
|
|
68
68
|
"ajv": "^8.20.0",
|
|
69
|
-
"hono": "^4.13.
|
|
69
|
+
"hono": "^4.13.4"
|
|
70
70
|
},
|
|
71
71
|
"jx": "./jx-extension.json"
|
|
72
72
|
}
|
|
@@ -23,7 +23,8 @@ export interface BunSqliteStatementLike {
|
|
|
23
23
|
/** The subset of `bun:sqlite`'s Database the driver uses. */
|
|
24
24
|
export interface BunSqliteDatabaseLike {
|
|
25
25
|
prepare: (sql: string) => BunSqliteStatementLike;
|
|
26
|
-
close
|
|
26
|
+
/** `throwOnError` forces the close instead of deferring it — see {@link createDriver}'s destroy. */
|
|
27
|
+
close?: (throwOnError?: boolean) => void;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export interface BunSqliteDialectConfig {
|
|
@@ -113,7 +114,14 @@ function createDriver(config: BunSqliteDialectConfig): Driver {
|
|
|
113
114
|
},
|
|
114
115
|
destroy: async () => {
|
|
115
116
|
if (owned) {
|
|
116
|
-
|
|
117
|
+
/* `close(true)`, not `close()`. bun:sqlite defers a bare close while prepared statements
|
|
118
|
+
are outstanding, and `executeQuery` above prepares one per query and finalizes none, so
|
|
119
|
+
the bare form returns without releasing the file. Measured directly: open a database,
|
|
120
|
+
prepare three statements, then `close()` — the file cannot be deleted (EBUSY on
|
|
121
|
+
Windows); `close(true)`, or finalizing each statement first, releases it. POSIX hides
|
|
122
|
+
the difference because a file can be unlinked while open, but the handle leaks on every
|
|
123
|
+
platform, once per connection the driver believes it has closed. */
|
|
124
|
+
db?.close?.(true);
|
|
117
125
|
}
|
|
118
126
|
db = null;
|
|
119
127
|
},
|