catence 0.2.0-beta.14 → 0.2.0-beta.15
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Keep these values synchronized with release/manifest.json; release checks
|
|
4
4
|
* deliberately reject drift before a package can be published.
|
|
5
5
|
*/
|
|
6
|
-
export declare const CATENCE_RUNTIME_VERSION = "0.2.0-beta.
|
|
6
|
+
export declare const CATENCE_RUNTIME_VERSION = "0.2.0-beta.15";
|
|
7
7
|
export declare const CATENCE_PROTOCOL_VERSION = 1;
|
|
8
8
|
export type CatenceRuntimeCapabilities = {
|
|
9
9
|
mcp: true;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Keep these values synchronized with release/manifest.json; release checks
|
|
4
4
|
* deliberately reject drift before a package can be published.
|
|
5
5
|
*/
|
|
6
|
-
export const CATENCE_RUNTIME_VERSION = '0.2.0-beta.
|
|
6
|
+
export const CATENCE_RUNTIME_VERSION = '0.2.0-beta.15';
|
|
7
7
|
export const CATENCE_PROTOCOL_VERSION = 1;
|
|
8
8
|
export function catenceRuntimeHealth() {
|
|
9
9
|
return {
|
|
@@ -5,6 +5,28 @@ import { ReadOnlyRepository } from '../../core/query/repository.js';
|
|
|
5
5
|
import { SYNC_STAGES, STALE_RUN_TIMEOUT_MS } from '../../contracts/progress.js';
|
|
6
6
|
import { migrations } from './migrations.js';
|
|
7
7
|
import { json } from './sql.js';
|
|
8
|
+
/**
|
|
9
|
+
* DuckDB's node API throws "Cannot create values of type ANY" when a bound
|
|
10
|
+
* parameter resolves to an untyped value. JS `Date` objects surface as `ANY`
|
|
11
|
+
* (and are not auto-coerced the way strings are), so any date/timestamp
|
|
12
|
+
* parameter read back from the database and re-bound crashes the statement.
|
|
13
|
+
* Serializing dates to ISO strings keeps every parameter concretely typed.
|
|
14
|
+
*/
|
|
15
|
+
function serializeValue(value) {
|
|
16
|
+
if (value instanceof Date)
|
|
17
|
+
return value.toISOString();
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
function serializeBindings(bindings) {
|
|
21
|
+
if (!bindings)
|
|
22
|
+
return bindings;
|
|
23
|
+
if (Array.isArray(bindings))
|
|
24
|
+
return bindings.map(serializeValue);
|
|
25
|
+
const out = {};
|
|
26
|
+
for (const [key, value] of Object.entries(bindings))
|
|
27
|
+
out[key] = serializeValue(value);
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
8
30
|
export class CatenceDatabase {
|
|
9
31
|
instance;
|
|
10
32
|
connection;
|
|
@@ -62,10 +84,10 @@ export class CatenceDatabase {
|
|
|
62
84
|
}
|
|
63
85
|
}
|
|
64
86
|
async run(sql, values) {
|
|
65
|
-
await this.connection.run(sql, values);
|
|
87
|
+
await this.connection.run(sql, serializeBindings(values));
|
|
66
88
|
}
|
|
67
89
|
async rows(sql, values) {
|
|
68
|
-
const result = await this.connection.runAndReadAll(sql, values);
|
|
90
|
+
const result = await this.connection.runAndReadAll(sql, serializeBindings(values));
|
|
69
91
|
return result.getRowObjectsJS();
|
|
70
92
|
}
|
|
71
93
|
async tableNames(query) {
|
package/package.json
CHANGED