@nicia-ai/typegraph 0.55.0 → 0.56.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/CHANGELOG.md +14 -0
- package/dist/backend/index.cjs +86 -86
- package/dist/backend/index.js +7 -7
- package/dist/backend/postgres/index.cjs +22 -22
- package/dist/backend/postgres/index.js +8 -8
- package/dist/backend/postgres/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +2 -2
- package/dist/backend/postgres/pglite-store.d.ts +2 -2
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/postgres/pglite.cjs +10 -10
- package/dist/backend/postgres/pglite.js +9 -9
- package/dist/backend/sqlite/index.cjs +21 -21
- package/dist/backend/sqlite/index.js +8 -8
- package/dist/backend/sqlite/libsql.cjs +12 -12
- package/dist/backend/sqlite/libsql.js +8 -8
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.d.cts +2 -2
- package/dist/backend/sqlite/local-store.d.ts +2 -2
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/backend/sqlite/local.cjs +10 -10
- package/dist/backend/sqlite/local.js +9 -9
- package/dist/{chunk-S5WG5AFG.cjs → chunk-2XUAUSMI.cjs} +12 -12
- package/dist/{chunk-S5WG5AFG.cjs.map → chunk-2XUAUSMI.cjs.map} +1 -1
- package/dist/{chunk-MTE255N3.cjs → chunk-36XLQHZA.cjs} +4 -4
- package/dist/{chunk-MTE255N3.cjs.map → chunk-36XLQHZA.cjs.map} +1 -1
- package/dist/{chunk-FWSGKOBN.js → chunk-6LTRZOUU.js} +6 -6
- package/dist/{chunk-FWSGKOBN.js.map → chunk-6LTRZOUU.js.map} +1 -1
- package/dist/{chunk-YVKPUSHS.js → chunk-75KH6Y2W.js} +16 -7
- package/dist/chunk-75KH6Y2W.js.map +1 -0
- package/dist/{chunk-MJXEO7YA.js → chunk-762VPGHN.js} +5 -5
- package/dist/{chunk-MJXEO7YA.js.map → chunk-762VPGHN.js.map} +1 -1
- package/dist/{chunk-GGDTMBNA.cjs → chunk-7CCVR2QF.cjs} +54 -54
- package/dist/{chunk-GGDTMBNA.cjs.map → chunk-7CCVR2QF.cjs.map} +1 -1
- package/dist/{chunk-7EOJO6QB.js → chunk-7MHENVRG.js} +3 -3
- package/dist/{chunk-7EOJO6QB.js.map → chunk-7MHENVRG.js.map} +1 -1
- package/dist/{chunk-7B3DSFX3.cjs → chunk-AUTRK6WM.cjs} +4 -4
- package/dist/{chunk-7B3DSFX3.cjs.map → chunk-AUTRK6WM.cjs.map} +1 -1
- package/dist/{chunk-SIQ4BFL5.js → chunk-AZP5CCHL.js} +4 -4
- package/dist/{chunk-SIQ4BFL5.js.map → chunk-AZP5CCHL.js.map} +1 -1
- package/dist/{chunk-WTW7RWAG.cjs → chunk-BYUIOM4L.cjs} +6 -6
- package/dist/{chunk-WTW7RWAG.cjs.map → chunk-BYUIOM4L.cjs.map} +1 -1
- package/dist/{chunk-74FNI3PT.js → chunk-C3TJU4KQ.js} +6 -6
- package/dist/chunk-C3TJU4KQ.js.map +1 -0
- package/dist/{chunk-7V2R4MH6.js → chunk-CEQOTZGB.js} +5 -5
- package/dist/{chunk-7V2R4MH6.js.map → chunk-CEQOTZGB.js.map} +1 -1
- package/dist/{chunk-TKFQLKH2.cjs → chunk-CYKHSH5O.cjs} +36 -36
- package/dist/{chunk-TKFQLKH2.cjs.map → chunk-CYKHSH5O.cjs.map} +1 -1
- package/dist/{chunk-D5TCKAQT.cjs → chunk-DGIA64DM.cjs} +4 -4
- package/dist/{chunk-D5TCKAQT.cjs.map → chunk-DGIA64DM.cjs.map} +1 -1
- package/dist/{chunk-FFR3YUY2.js → chunk-E4QYEWVH.js} +5 -5
- package/dist/{chunk-FFR3YUY2.js.map → chunk-E4QYEWVH.js.map} +1 -1
- package/dist/{chunk-467YITD4.cjs → chunk-ETU5IILQ.cjs} +13 -13
- package/dist/{chunk-467YITD4.cjs.map → chunk-ETU5IILQ.cjs.map} +1 -1
- package/dist/{chunk-HW3IX2RF.js → chunk-EWRLWI7W.js} +4 -4
- package/dist/{chunk-HW3IX2RF.js.map → chunk-EWRLWI7W.js.map} +1 -1
- package/dist/{chunk-KZ6OHFDV.js → chunk-F2S5JWCT.js} +3 -3
- package/dist/{chunk-KZ6OHFDV.js.map → chunk-F2S5JWCT.js.map} +1 -1
- package/dist/{chunk-45WPPI64.js → chunk-FMCPKMQI.js} +3 -3
- package/dist/{chunk-45WPPI64.js.map → chunk-FMCPKMQI.js.map} +1 -1
- package/dist/{chunk-QM6IQW7B.js → chunk-ILHVYKXJ.js} +7 -7
- package/dist/{chunk-QM6IQW7B.js.map → chunk-ILHVYKXJ.js.map} +1 -1
- package/dist/{chunk-ECYEWFEH.cjs → chunk-J34FSPSC.cjs} +16 -6
- package/dist/chunk-J34FSPSC.cjs.map +1 -0
- package/dist/{chunk-GFYCLCGU.cjs → chunk-KM3CLHDB.cjs} +9 -9
- package/dist/{chunk-GFYCLCGU.cjs.map → chunk-KM3CLHDB.cjs.map} +1 -1
- package/dist/{chunk-SLNH62T3.js → chunk-KQYUKOGX.js} +3 -3
- package/dist/{chunk-SLNH62T3.js.map → chunk-KQYUKOGX.js.map} +1 -1
- package/dist/{chunk-7I2PYI4U.cjs → chunk-KR3N6Y7O.cjs} +67 -67
- package/dist/{chunk-7I2PYI4U.cjs.map → chunk-KR3N6Y7O.cjs.map} +1 -1
- package/dist/{chunk-HZCOCNIX.cjs → chunk-L2REUAJB.cjs} +24 -24
- package/dist/{chunk-HZCOCNIX.cjs.map → chunk-L2REUAJB.cjs.map} +1 -1
- package/dist/{chunk-VU65FXEG.js → chunk-LFXBFPI2.js} +66 -29
- package/dist/chunk-LFXBFPI2.js.map +1 -0
- package/dist/{chunk-NXRSR6QG.js → chunk-MHM6OGZR.js} +9 -9
- package/dist/{chunk-NXRSR6QG.js.map → chunk-MHM6OGZR.js.map} +1 -1
- package/dist/{chunk-FCUSVSYX.js → chunk-MRGWM5LE.js} +10 -10
- package/dist/{chunk-FCUSVSYX.js.map → chunk-MRGWM5LE.js.map} +1 -1
- package/dist/{chunk-WXGMDROJ.js → chunk-QDNEXTON.js} +7 -7
- package/dist/{chunk-WXGMDROJ.js.map → chunk-QDNEXTON.js.map} +1 -1
- package/dist/{chunk-VYU5H4FO.js → chunk-RXA2D3UR.js} +3 -3
- package/dist/{chunk-VYU5H4FO.js.map → chunk-RXA2D3UR.js.map} +1 -1
- package/dist/{chunk-XODNY4QI.js → chunk-TIBSLFHR.js} +6 -6
- package/dist/{chunk-XODNY4QI.js.map → chunk-TIBSLFHR.js.map} +1 -1
- package/dist/{chunk-KZG7HQSN.cjs → chunk-UVMSWO6X.cjs} +173 -173
- package/dist/{chunk-KZG7HQSN.cjs.map → chunk-UVMSWO6X.cjs.map} +1 -1
- package/dist/{chunk-ORPT5EQW.cjs → chunk-UZ6CJUC5.cjs} +27 -27
- package/dist/chunk-UZ6CJUC5.cjs.map +1 -0
- package/dist/{chunk-GNF3PHEQ.cjs → chunk-VF2IMMZT.cjs} +17 -17
- package/dist/{chunk-GNF3PHEQ.cjs.map → chunk-VF2IMMZT.cjs.map} +1 -1
- package/dist/{chunk-PGZV3E3I.cjs → chunk-VXEHEPC4.cjs} +4 -4
- package/dist/{chunk-PGZV3E3I.cjs.map → chunk-VXEHEPC4.cjs.map} +1 -1
- package/dist/{chunk-OJ47LMOB.cjs → chunk-WIUHN6SZ.cjs} +669 -628
- package/dist/chunk-WIUHN6SZ.cjs.map +1 -0
- package/dist/{chunk-HNW5IDB3.js → chunk-WIZB5U6N.js} +7 -7
- package/dist/{chunk-HNW5IDB3.js.map → chunk-WIZB5U6N.js.map} +1 -1
- package/dist/{chunk-IDQZI6GL.js → chunk-XH75W3O5.js} +3 -3
- package/dist/{chunk-IDQZI6GL.js.map → chunk-XH75W3O5.js.map} +1 -1
- package/dist/{chunk-T7LSSV7J.cjs → chunk-XXEFDJHY.cjs} +45 -45
- package/dist/{chunk-T7LSSV7J.cjs.map → chunk-XXEFDJHY.cjs.map} +1 -1
- package/dist/{chunk-GORCU2GR.cjs → chunk-Z4NU4MYB.cjs} +123 -123
- package/dist/{chunk-GORCU2GR.cjs.map → chunk-Z4NU4MYB.cjs.map} +1 -1
- package/dist/{chunk-KFC3OUV4.cjs → chunk-ZHK3HEZ2.cjs} +130 -130
- package/dist/{chunk-KFC3OUV4.cjs.map → chunk-ZHK3HEZ2.cjs.map} +1 -1
- package/dist/{chunk-FYMYLZGX.cjs → chunk-ZXXGMQC3.cjs} +10 -10
- package/dist/{chunk-FYMYLZGX.cjs.map → chunk-ZXXGMQC3.cjs.map} +1 -1
- package/dist/graph-merge/index.cjs +577 -99
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +108 -4
- package/dist/graph-merge/index.d.ts +108 -4
- package/dist/graph-merge/index.js +495 -21
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{graph-templates-qraW63Ry.d.ts → graph-templates-BSA9VU_O.d.ts} +1 -1
- package/dist/{graph-templates--hp2U4kn.d.cts → graph-templates-Cg7DpEOF.d.cts} +1 -1
- package/dist/index.cjs +95 -95
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -16
- package/dist/interchange/index.cjs +33 -33
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +10 -10
- package/dist/{local-store-impl-HXBO3VF4.js → local-store-impl-77DCLAAY.js} +18 -18
- package/dist/{local-store-impl-HXBO3VF4.js.map → local-store-impl-77DCLAAY.js.map} +1 -1
- package/dist/{local-store-impl-CUQKHHOZ.cjs → local-store-impl-NJCWM3KR.cjs} +22 -22
- package/dist/{local-store-impl-CUQKHHOZ.cjs.map → local-store-impl-NJCWM3KR.cjs.map} +1 -1
- package/dist/{pglite-store-impl-BD3AVOUH.js → pglite-store-impl-3VFSYLAJ.js} +18 -18
- package/dist/{pglite-store-impl-BD3AVOUH.js.map → pglite-store-impl-3VFSYLAJ.js.map} +1 -1
- package/dist/{pglite-store-impl-C3MQ72LT.cjs → pglite-store-impl-LHLJ3GBQ.cjs} +22 -22
- package/dist/{pglite-store-impl-C3MQ72LT.cjs.map → pglite-store-impl-LHLJ3GBQ.cjs.map} +1 -1
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/provenance/index.cjs +21 -21
- package/dist/provenance/index.d.cts +1 -1
- package/dist/provenance/index.d.ts +1 -1
- package/dist/provenance/index.js +5 -5
- package/dist/schema/index.cjs +36 -36
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +6 -6
- package/dist/{store-stw2AEB4.d.ts → store-CQ3uzXla.d.ts} +58 -27
- package/dist/{store-DTEkUQ0k.d.cts → store-DbHAgVMH.d.cts} +58 -27
- package/package.json +1 -1
- package/dist/chunk-74FNI3PT.js.map +0 -1
- package/dist/chunk-ECYEWFEH.cjs.map +0 -1
- package/dist/chunk-OJ47LMOB.cjs.map +0 -1
- package/dist/chunk-ORPT5EQW.cjs.map +0 -1
- package/dist/chunk-VU65FXEG.js.map +0 -1
- package/dist/chunk-YVKPUSHS.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7CCVR2QF_cjs = require('./chunk-7CCVR2QF.cjs');
|
|
4
4
|
var chunkIZKJF3ZP_cjs = require('./chunk-IZKJF3ZP.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkBYUIOM4L_cjs = require('./chunk-BYUIOM4L.cjs');
|
|
6
|
+
var chunkVXEHEPC4_cjs = require('./chunk-VXEHEPC4.cjs');
|
|
7
|
+
var chunkDGIA64DM_cjs = require('./chunk-DGIA64DM.cjs');
|
|
8
8
|
var chunk5X46XWNH_cjs = require('./chunk-5X46XWNH.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkJ34FSPSC_cjs = require('./chunk-J34FSPSC.cjs');
|
|
10
10
|
var chunkI2W5N2LC_cjs = require('./chunk-I2W5N2LC.cjs');
|
|
11
11
|
var chunkAYQBEVQY_cjs = require('./chunk-AYQBEVQY.cjs');
|
|
12
12
|
var chunkASKXTVK5_cjs = require('./chunk-ASKXTVK5.cjs');
|
|
@@ -152,14 +152,14 @@ function hasModernBindLimitByVersion(rows) {
|
|
|
152
152
|
}
|
|
153
153
|
function detectHardMaxBindParameters(transactionMode, hostedPlatform) {
|
|
154
154
|
if (hostedPlatform === "durable-object" || transactionMode === "do-sqlite") {
|
|
155
|
-
return
|
|
155
|
+
return chunkJ34FSPSC_cjs.DURABLE_OBJECT_MAX_BIND_PARAMETERS;
|
|
156
156
|
}
|
|
157
|
-
if (hostedPlatform === "d1") return
|
|
157
|
+
if (hostedPlatform === "d1") return chunkJ34FSPSC_cjs.D1_MAX_BIND_PARAMETERS;
|
|
158
158
|
return void 0;
|
|
159
159
|
}
|
|
160
160
|
function detectMaxBindParameters(sqliteClient, hardMaxBindParameters) {
|
|
161
161
|
if (hardMaxBindParameters !== void 0) return hardMaxBindParameters;
|
|
162
|
-
if (sqliteClient === void 0) return
|
|
162
|
+
if (sqliteClient === void 0) return chunkJ34FSPSC_cjs.SQLITE_MAX_BIND_PARAMETERS;
|
|
163
163
|
try {
|
|
164
164
|
const compiled = parseCompiledMaxVariableNumber(
|
|
165
165
|
sqliteClient.prepare("PRAGMA compile_options").all()
|
|
@@ -168,9 +168,9 @@ function detectMaxBindParameters(sqliteClient, hardMaxBindParameters) {
|
|
|
168
168
|
const isModern = hasModernBindLimitByVersion(
|
|
169
169
|
sqliteClient.prepare("SELECT sqlite_version() AS version").all()
|
|
170
170
|
);
|
|
171
|
-
return isModern ?
|
|
171
|
+
return isModern ? chunkJ34FSPSC_cjs.MODERN_SQLITE_MAX_BIND_PARAMETERS : chunkJ34FSPSC_cjs.SQLITE_MAX_BIND_PARAMETERS;
|
|
172
172
|
} catch {
|
|
173
|
-
return
|
|
173
|
+
return chunkJ34FSPSC_cjs.SQLITE_MAX_BIND_PARAMETERS;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
function preparingClient(client) {
|
|
@@ -200,7 +200,7 @@ function resolveSqliteClient(db) {
|
|
|
200
200
|
return sqliteClient;
|
|
201
201
|
}
|
|
202
202
|
function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
|
|
203
|
-
return
|
|
203
|
+
return chunk7CCVR2QF_cjs.getOrCreateLru(
|
|
204
204
|
cache,
|
|
205
205
|
sqlText,
|
|
206
206
|
cacheMax,
|
|
@@ -385,7 +385,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
385
385
|
),
|
|
386
386
|
embeddingUpsertBatchSize: Math.max(
|
|
387
387
|
1,
|
|
388
|
-
Math.floor(maxBindParameters /
|
|
388
|
+
Math.floor(maxBindParameters / chunk7CCVR2QF_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
389
389
|
),
|
|
390
390
|
fulltextUpsertBatchSize: Math.max(
|
|
391
391
|
1,
|
|
@@ -407,7 +407,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
407
407
|
),
|
|
408
408
|
findEdgesEndpointChunkSize: Math.max(
|
|
409
409
|
1,
|
|
410
|
-
maxBindParameters -
|
|
410
|
+
maxBindParameters - chunk7CCVR2QF_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
411
411
|
),
|
|
412
412
|
getEdgesChunkSize: Math.max(
|
|
413
413
|
1,
|
|
@@ -437,11 +437,11 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
|
437
437
|
)
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
|
-
var toNodeRow =
|
|
441
|
-
var toEdgeRow =
|
|
442
|
-
var toUniqueRow =
|
|
443
|
-
var toSchemaVersionRow =
|
|
444
|
-
|
|
440
|
+
var toNodeRow = chunkBYUIOM4L_cjs.createNodeRowMapper(chunkBYUIOM4L_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
441
|
+
var toEdgeRow = chunkBYUIOM4L_cjs.createEdgeRowMapper(chunkBYUIOM4L_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
442
|
+
var toUniqueRow = chunkBYUIOM4L_cjs.createUniqueRowMapper(chunkBYUIOM4L_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
443
|
+
var toSchemaVersionRow = chunkBYUIOM4L_cjs.createSchemaVersionRowMapper(
|
|
444
|
+
chunkBYUIOM4L_cjs.SQLITE_ROW_MAPPER_CONFIG
|
|
445
445
|
);
|
|
446
446
|
var PENDING_FOREVER = new Promise(noop);
|
|
447
447
|
function pendingForever() {
|
|
@@ -517,18 +517,18 @@ function throwSqliteTransactionsDisabled(message) {
|
|
|
517
517
|
}
|
|
518
518
|
function buildSqliteCapabilities(options) {
|
|
519
519
|
const base = options.transactionMode === "none" ? {
|
|
520
|
-
...
|
|
520
|
+
...chunkJ34FSPSC_cjs.SQLITE_CAPABILITIES,
|
|
521
521
|
execution: {
|
|
522
|
-
...
|
|
522
|
+
...chunkJ34FSPSC_cjs.SQLITE_CAPABILITIES.execution,
|
|
523
523
|
interactiveTransactions: false
|
|
524
524
|
},
|
|
525
525
|
graphAnalytics: {
|
|
526
|
-
...
|
|
526
|
+
...chunkJ34FSPSC_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
|
|
527
527
|
mathFunctions: false
|
|
528
528
|
},
|
|
529
529
|
supported: false
|
|
530
530
|
}
|
|
531
|
-
} :
|
|
531
|
+
} : chunkJ34FSPSC_cjs.SQLITE_CAPABILITIES;
|
|
532
532
|
return {
|
|
533
533
|
...base,
|
|
534
534
|
maxBindParameters: options.maxBindParameters,
|
|
@@ -541,7 +541,7 @@ function resolveMaxBindParametersCapability(profile, override) {
|
|
|
541
541
|
return profile.hardMaxBindParameters === void 0 ? requested : Math.min(requested, profile.hardMaxBindParameters);
|
|
542
542
|
}
|
|
543
543
|
function resolveSqliteGraphAnalyticsCapabilities(profile, override) {
|
|
544
|
-
const requested = override ??
|
|
544
|
+
const requested = override ?? chunkJ34FSPSC_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
|
|
545
545
|
supported: false,
|
|
546
546
|
mathFunctions: false
|
|
547
547
|
};
|
|
@@ -596,9 +596,9 @@ function createSqliteOperationBackend(options) {
|
|
|
596
596
|
});
|
|
597
597
|
}
|
|
598
598
|
const batchConfig = computeSqliteBatchChunkSizes(
|
|
599
|
-
capabilities.maxBindParameters ??
|
|
599
|
+
capabilities.maxBindParameters ?? chunkJ34FSPSC_cjs.SQLITE_MAX_BIND_PARAMETERS
|
|
600
600
|
);
|
|
601
|
-
const commonOperationMembers =
|
|
601
|
+
const commonOperationMembers = chunk7CCVR2QF_cjs.createCommonOperationBackend({
|
|
602
602
|
batchConfig,
|
|
603
603
|
commandSession: transactionScoped ? "transaction" : "root",
|
|
604
604
|
execution: {
|
|
@@ -608,8 +608,8 @@ function createSqliteOperationBackend(options) {
|
|
|
608
608
|
execRun
|
|
609
609
|
},
|
|
610
610
|
...transactionScoped || atomicSqlProgramExecutor === void 0 ? {} : { atomicSqlProgramExecutor },
|
|
611
|
-
nowIso:
|
|
612
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
611
|
+
nowIso: chunkBYUIOM4L_cjs.nowIso,
|
|
612
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkJ34FSPSC_cjs.SQLITE_MAX_BIND_PARAMETERS,
|
|
613
613
|
operationStrategy,
|
|
614
614
|
rowMappers: {
|
|
615
615
|
toEdgeRow,
|
|
@@ -619,7 +619,7 @@ function createSqliteOperationBackend(options) {
|
|
|
619
619
|
},
|
|
620
620
|
schemaFenceLockClause: drizzleOrm.sql.raw(""),
|
|
621
621
|
async resolveAtomicNodeProjectionEvidence(creates, updates) {
|
|
622
|
-
const requirements =
|
|
622
|
+
const requirements = chunk7CCVR2QF_cjs.resolveAtomicNodeProjectionRequirements(
|
|
623
623
|
creates,
|
|
624
624
|
updates
|
|
625
625
|
);
|
|
@@ -630,7 +630,7 @@ function createSqliteOperationBackend(options) {
|
|
|
630
630
|
);
|
|
631
631
|
},
|
|
632
632
|
async diagnoseAtomicNodeProjectionEvidence(creates, updates) {
|
|
633
|
-
const requirements =
|
|
633
|
+
const requirements = chunk7CCVR2QF_cjs.resolveAtomicNodeProjectionRequirements(
|
|
634
634
|
creates,
|
|
635
635
|
updates
|
|
636
636
|
);
|
|
@@ -641,7 +641,7 @@ function createSqliteOperationBackend(options) {
|
|
|
641
641
|
);
|
|
642
642
|
},
|
|
643
643
|
async refuseAtomicNodeProjectionError(creates, updates, error) {
|
|
644
|
-
const requirements =
|
|
644
|
+
const requirements = chunk7CCVR2QF_cjs.resolveAtomicNodeProjectionRequirements(
|
|
645
645
|
creates,
|
|
646
646
|
updates
|
|
647
647
|
);
|
|
@@ -664,26 +664,26 @@ function createSqliteOperationBackend(options) {
|
|
|
664
664
|
};
|
|
665
665
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
666
666
|
async upsertEmbedding(params) {
|
|
667
|
-
const slot =
|
|
667
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
668
668
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
669
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
669
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkBYUIOM4L_cjs.nowIso());
|
|
670
670
|
try {
|
|
671
671
|
for (const statement of statements) {
|
|
672
672
|
await execRun(statement);
|
|
673
673
|
}
|
|
674
674
|
} catch (error) {
|
|
675
|
-
throw
|
|
675
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, params);
|
|
676
676
|
}
|
|
677
677
|
},
|
|
678
678
|
async upsertEmbeddingBatch(params) {
|
|
679
679
|
if (params.rows.length === 0) return;
|
|
680
|
-
const slot =
|
|
680
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
681
681
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
682
682
|
const rowsById = new Map(
|
|
683
683
|
params.rows.map((row) => [row.nodeId, row])
|
|
684
684
|
);
|
|
685
685
|
const rows = [...rowsById.values()];
|
|
686
|
-
const timestamp =
|
|
686
|
+
const timestamp = chunkBYUIOM4L_cjs.nowIso();
|
|
687
687
|
try {
|
|
688
688
|
for (const chunk2 of chunk5X46XWNH_cjs.chunk(
|
|
689
689
|
rows,
|
|
@@ -714,11 +714,11 @@ function createSqliteOperationBackend(options) {
|
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
} catch (error) {
|
|
717
|
-
throw
|
|
717
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, params);
|
|
718
718
|
}
|
|
719
719
|
},
|
|
720
720
|
async deleteEmbedding(params) {
|
|
721
|
-
const slot =
|
|
721
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
722
722
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
723
723
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
724
724
|
for (const statement of statements) {
|
|
@@ -727,7 +727,7 @@ function createSqliteOperationBackend(options) {
|
|
|
727
727
|
},
|
|
728
728
|
async deleteEmbeddingBatch(params) {
|
|
729
729
|
if (params.nodeIds.length === 0) return;
|
|
730
|
-
const slot =
|
|
730
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
731
731
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
732
732
|
for (const nodeIds of chunk5X46XWNH_cjs.chunk(
|
|
733
733
|
[...new Set(params.nodeIds)],
|
|
@@ -750,24 +750,24 @@ function createSqliteOperationBackend(options) {
|
|
|
750
750
|
dialect: "SQLite",
|
|
751
751
|
engine: vectorStrategy.name
|
|
752
752
|
});
|
|
753
|
-
const slot =
|
|
753
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
754
754
|
const query = vectorStrategy.buildSearch(
|
|
755
755
|
slot,
|
|
756
756
|
params,
|
|
757
757
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
758
758
|
// take precedence; the live-node default covers direct backend use.
|
|
759
|
-
params.candidates ??
|
|
759
|
+
params.candidates ?? chunk7CCVR2QF_cjs.buildLiveNodeCandidates(
|
|
760
760
|
tableNames.nodes,
|
|
761
761
|
params.graphId,
|
|
762
762
|
params.nodeKind,
|
|
763
|
-
|
|
763
|
+
chunkBYUIOM4L_cjs.nowIso()
|
|
764
764
|
)
|
|
765
765
|
);
|
|
766
766
|
let rows;
|
|
767
767
|
try {
|
|
768
768
|
rows = await execAll(query);
|
|
769
769
|
} catch (error) {
|
|
770
|
-
throw
|
|
770
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, params);
|
|
771
771
|
}
|
|
772
772
|
return rows.map((row) => ({
|
|
773
773
|
nodeId: row.node_id,
|
|
@@ -789,7 +789,7 @@ function createSqliteOperationBackend(options) {
|
|
|
789
789
|
dialect: "SQLite",
|
|
790
790
|
engine: vectorStrategy.name
|
|
791
791
|
});
|
|
792
|
-
const slot =
|
|
792
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams({
|
|
793
793
|
graphId: params.graphId,
|
|
794
794
|
nodeKind: params.nodeKind,
|
|
795
795
|
fieldPath: params.vector.fieldPath,
|
|
@@ -797,11 +797,11 @@ function createSqliteOperationBackend(options) {
|
|
|
797
797
|
metric: params.vector.metric,
|
|
798
798
|
indexType: params.vector.indexType
|
|
799
799
|
});
|
|
800
|
-
const candidates = params.candidates ??
|
|
800
|
+
const candidates = params.candidates ?? chunk7CCVR2QF_cjs.buildLiveNodeCandidates(
|
|
801
801
|
tableNames.nodes,
|
|
802
802
|
params.graphId,
|
|
803
803
|
params.nodeKind,
|
|
804
|
-
|
|
804
|
+
chunkBYUIOM4L_cjs.nowIso()
|
|
805
805
|
);
|
|
806
806
|
const vectorParams = {
|
|
807
807
|
graphId: params.graphId,
|
|
@@ -828,9 +828,9 @@ function createSqliteOperationBackend(options) {
|
|
|
828
828
|
try {
|
|
829
829
|
raw = await execAll(statement);
|
|
830
830
|
} catch (error) {
|
|
831
|
-
throw
|
|
831
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, vectorParams);
|
|
832
832
|
}
|
|
833
|
-
return raw.map((row) =>
|
|
833
|
+
return raw.map((row) => chunk7CCVR2QF_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
834
834
|
}
|
|
835
835
|
} : {}
|
|
836
836
|
};
|
|
@@ -886,7 +886,7 @@ function createSqliteOperationBackend(options) {
|
|
|
886
886
|
const active = await commonOperationMembers.getActiveSchema(
|
|
887
887
|
params.graphId
|
|
888
888
|
);
|
|
889
|
-
|
|
889
|
+
chunk7CCVR2QF_cjs.assertActiveSchemaVersion(
|
|
890
890
|
params.graphId,
|
|
891
891
|
params.expectedVersion,
|
|
892
892
|
active?.version ?? 0
|
|
@@ -894,7 +894,7 @@ function createSqliteOperationBackend(options) {
|
|
|
894
894
|
},
|
|
895
895
|
async createVectorIndex(params) {
|
|
896
896
|
if (vectorStrategy === void 0) return;
|
|
897
|
-
const slot =
|
|
897
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromCreateIndexParams(params);
|
|
898
898
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
899
899
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot);
|
|
900
900
|
if (indexStatement !== void 0) {
|
|
@@ -903,7 +903,7 @@ function createSqliteOperationBackend(options) {
|
|
|
903
903
|
},
|
|
904
904
|
async dropVectorIndex(params) {
|
|
905
905
|
if (vectorStrategy === void 0) return;
|
|
906
|
-
const slot =
|
|
906
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromDropIndexParams(params);
|
|
907
907
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
908
908
|
if (dropStatement === void 0) return;
|
|
909
909
|
try {
|
|
@@ -914,7 +914,7 @@ function createSqliteOperationBackend(options) {
|
|
|
914
914
|
},
|
|
915
915
|
// === Fulltext Operations ===
|
|
916
916
|
async upsertFulltext(params) {
|
|
917
|
-
const timestamp =
|
|
917
|
+
const timestamp = chunkBYUIOM4L_cjs.nowIso();
|
|
918
918
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
919
919
|
params,
|
|
920
920
|
timestamp
|
|
@@ -931,7 +931,7 @@ function createSqliteOperationBackend(options) {
|
|
|
931
931
|
},
|
|
932
932
|
async upsertFulltextBatch(params) {
|
|
933
933
|
if (params.rows.length === 0) return;
|
|
934
|
-
const timestamp =
|
|
934
|
+
const timestamp = chunkBYUIOM4L_cjs.nowIso();
|
|
935
935
|
for (const rows of chunk5X46XWNH_cjs.chunk(
|
|
936
936
|
params.rows,
|
|
937
937
|
batchConfig.fulltextUpsertBatchSize
|
|
@@ -965,7 +965,7 @@ function createSqliteOperationBackend(options) {
|
|
|
965
965
|
const rows = await execAll(query);
|
|
966
966
|
return rows.map((row, index) => ({
|
|
967
967
|
nodeId: row.node_id,
|
|
968
|
-
score:
|
|
968
|
+
score: chunkBYUIOM4L_cjs.coerceNumericScore(row.score),
|
|
969
969
|
rank: index + 1,
|
|
970
970
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
971
971
|
}));
|
|
@@ -993,16 +993,16 @@ function getSerializedSqliteConnection(db) {
|
|
|
993
993
|
return isLocalLibsqlClient(client) ? client : void 0;
|
|
994
994
|
}
|
|
995
995
|
function createSqliteBackend(db, options = {}) {
|
|
996
|
-
|
|
997
|
-
const resourceAudit =
|
|
996
|
+
chunk7CCVR2QF_cjs.assertNoLegacyTransactionCapability(options.capabilities);
|
|
997
|
+
const resourceAudit = chunkJ34FSPSC_cjs.resolveDeclaredBackendResource(
|
|
998
998
|
getSerializedSqliteConnection(db),
|
|
999
999
|
options.serializedResource
|
|
1000
1000
|
);
|
|
1001
|
-
const tables2 = options.tables ??
|
|
1001
|
+
const tables2 = options.tables ?? chunk7CCVR2QF_cjs.tables2;
|
|
1002
1002
|
const fulltextStrategy = options.fulltext ?? chunkI2W5N2LC_cjs.fts5Strategy;
|
|
1003
1003
|
const profileHints = options.executionProfile ?? {};
|
|
1004
1004
|
const executionAdapter = createSqliteExecutionAdapter(db, { profileHints });
|
|
1005
|
-
const atomicSqlProgramExecutor =
|
|
1005
|
+
const atomicSqlProgramExecutor = chunkDGIA64DM_cjs.createAtomicSqlProgramExecutor(executionAdapter);
|
|
1006
1006
|
const { isSync, transactionMode } = executionAdapter.profile;
|
|
1007
1007
|
const vectorStrategy = options.vector;
|
|
1008
1008
|
const capabilityOverrides = options.capabilities ?? {};
|
|
@@ -1012,7 +1012,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1012
1012
|
transactionMode,
|
|
1013
1013
|
maxBindParameters: executionAdapter.profile.maxBindParameters
|
|
1014
1014
|
});
|
|
1015
|
-
const declaredCapabilities =
|
|
1015
|
+
const declaredCapabilities = chunkJ34FSPSC_cjs.normalizeGraphAnalyticsCapabilities({
|
|
1016
1016
|
...baseCapabilities,
|
|
1017
1017
|
...capabilityOverrides,
|
|
1018
1018
|
execution: {
|
|
@@ -1028,13 +1028,13 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1028
1028
|
capabilityOverrides.graphAnalytics
|
|
1029
1029
|
)
|
|
1030
1030
|
});
|
|
1031
|
-
const capabilities =
|
|
1031
|
+
const capabilities = chunk7CCVR2QF_cjs.assertBundledCapabilityDeclarations(
|
|
1032
1032
|
{
|
|
1033
1033
|
...declaredCapabilities,
|
|
1034
1034
|
contributions: {
|
|
1035
1035
|
supported: true,
|
|
1036
1036
|
probe: true,
|
|
1037
|
-
rebuild:
|
|
1037
|
+
rebuild: chunk7CCVR2QF_cjs.contributionRebuildSupported(
|
|
1038
1038
|
fulltextStrategy,
|
|
1039
1039
|
tables2.fulltextTableName,
|
|
1040
1040
|
declaredCapabilities.execution.interactiveTransactions
|
|
@@ -1076,7 +1076,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1076
1076
|
tableNames.identityClosure,
|
|
1077
1077
|
tableNames.identitySeparation
|
|
1078
1078
|
];
|
|
1079
|
-
const operationStrategy =
|
|
1079
|
+
const operationStrategy = chunk7CCVR2QF_cjs.createSqliteOperationStrategy(
|
|
1080
1080
|
tables2,
|
|
1081
1081
|
fulltextStrategy,
|
|
1082
1082
|
vectorStrategy
|
|
@@ -1084,7 +1084,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1084
1084
|
const serializedQueue = transactionMode === "none" ? void 0 : createSerializedExecutionQueue();
|
|
1085
1085
|
const matTable = tables2.contributionMaterializations;
|
|
1086
1086
|
async function ensureContributionMaterializationsTableImpl() {
|
|
1087
|
-
await db.run(drizzleOrm.sql.raw(
|
|
1087
|
+
await db.run(drizzleOrm.sql.raw(chunk7CCVR2QF_cjs.generateSqliteCreateTableSQL(matTable)));
|
|
1088
1088
|
}
|
|
1089
1089
|
async function getContributionMaterializationRow(identity) {
|
|
1090
1090
|
const rows = await db.select().from(matTable).where(
|
|
@@ -1097,25 +1097,25 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1097
1097
|
);
|
|
1098
1098
|
const row = rows[0];
|
|
1099
1099
|
if (row === void 0) return void 0;
|
|
1100
|
-
return
|
|
1100
|
+
return chunk7CCVR2QF_cjs.mapContributionMaterializationRow(
|
|
1101
1101
|
row,
|
|
1102
|
-
|
|
1102
|
+
chunk7CCVR2QF_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
1103
1103
|
);
|
|
1104
1104
|
}
|
|
1105
1105
|
async function getContributionMaterializationRows(graphId) {
|
|
1106
1106
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
1107
1107
|
return rows.map(
|
|
1108
|
-
(row) =>
|
|
1108
|
+
(row) => chunk7CCVR2QF_cjs.mapContributionMaterializationRow(
|
|
1109
1109
|
row,
|
|
1110
|
-
|
|
1110
|
+
chunk7CCVR2QF_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
1111
1111
|
)
|
|
1112
1112
|
);
|
|
1113
1113
|
}
|
|
1114
1114
|
async function recordContributionMaterializationRow(params) {
|
|
1115
1115
|
await db.insert(matTable).values(
|
|
1116
|
-
|
|
1116
|
+
chunk7CCVR2QF_cjs.buildContributionInsertValues(
|
|
1117
1117
|
params,
|
|
1118
|
-
|
|
1118
|
+
chunk7CCVR2QF_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
1119
1119
|
)
|
|
1120
1120
|
).onConflictDoUpdate({
|
|
1121
1121
|
target: [
|
|
@@ -1124,7 +1124,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1124
1124
|
matTable.owner,
|
|
1125
1125
|
matTable.tableName
|
|
1126
1126
|
],
|
|
1127
|
-
set:
|
|
1127
|
+
set: chunk7CCVR2QF_cjs.buildContributionOnConflictSet(
|
|
1128
1128
|
matTable.materializedAt,
|
|
1129
1129
|
params.materializedAt
|
|
1130
1130
|
)
|
|
@@ -1144,32 +1144,32 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1144
1144
|
const rows = await executionAdapter.execute(
|
|
1145
1145
|
operationStrategy.buildTableExists(tableName)
|
|
1146
1146
|
);
|
|
1147
|
-
return
|
|
1147
|
+
return chunk7CCVR2QF_cjs.tableExistsFromRow(rows[0]);
|
|
1148
1148
|
}
|
|
1149
1149
|
function identityContributionsFor(identityTableNames) {
|
|
1150
|
-
const identityTables =
|
|
1150
|
+
const identityTables = chunk7CCVR2QF_cjs.createSqliteTables({
|
|
1151
1151
|
identityAssertions: identityTableNames.identityAssertions,
|
|
1152
1152
|
recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
|
|
1153
1153
|
identityClosure: identityTableNames.identityClosure,
|
|
1154
1154
|
identitySeparation: identityTableNames.identitySeparation
|
|
1155
1155
|
});
|
|
1156
|
-
return
|
|
1156
|
+
return chunk7CCVR2QF_cjs.sqliteContributions(identityTables, fulltextStrategy).filter(
|
|
1157
1157
|
(contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
1158
1158
|
);
|
|
1159
1159
|
}
|
|
1160
1160
|
function recordedContributionsFor(recordedTableNames) {
|
|
1161
|
-
const recordedTables =
|
|
1161
|
+
const recordedTables = chunk7CCVR2QF_cjs.createSqliteTables({
|
|
1162
1162
|
recordedNodes: recordedTableNames.recordedNodes,
|
|
1163
1163
|
recordedEdges: recordedTableNames.recordedEdges,
|
|
1164
1164
|
recordedClock: recordedTableNames.recordedClock
|
|
1165
1165
|
});
|
|
1166
|
-
return
|
|
1166
|
+
return chunk7CCVR2QF_cjs.sqliteContributions(recordedTables, fulltextStrategy).filter(
|
|
1167
1167
|
(contribution) => RECORDED_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
1168
1168
|
);
|
|
1169
1169
|
}
|
|
1170
|
-
const contributionMaterializer =
|
|
1170
|
+
const contributionMaterializer = chunk7CCVR2QF_cjs.createContributionMaterializer({
|
|
1171
1171
|
dialect: "sqlite",
|
|
1172
|
-
fenceTarget:
|
|
1172
|
+
fenceTarget: chunkJ34FSPSC_cjs.markFirstPartyFactory({ dialect: "sqlite", capabilities }),
|
|
1173
1173
|
fulltextStrategy,
|
|
1174
1174
|
fulltextTableName: tables2.fulltextTableName,
|
|
1175
1175
|
vectorStrategy,
|
|
@@ -1309,7 +1309,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1309
1309
|
vectorStrategy,
|
|
1310
1310
|
contributionMaterializer
|
|
1311
1311
|
});
|
|
1312
|
-
return
|
|
1312
|
+
return chunk7CCVR2QF_cjs.gateFulltext(
|
|
1313
1313
|
txBackend,
|
|
1314
1314
|
contributionMaterializer.assertInitialized,
|
|
1315
1315
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -1325,7 +1325,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1325
1325
|
)
|
|
1326
1326
|
);
|
|
1327
1327
|
try {
|
|
1328
|
-
for (const statement of
|
|
1328
|
+
for (const statement of chunk7CCVR2QF_cjs.planSqliteEdgeMatchIdentityAdoption(
|
|
1329
1329
|
edgeTableName,
|
|
1330
1330
|
columns
|
|
1331
1331
|
)) {
|
|
@@ -1353,12 +1353,12 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
async function ensureBaseSchemaVersionTable() {
|
|
1355
1355
|
await db.run(
|
|
1356
|
-
drizzleOrm.sql.raw(
|
|
1356
|
+
drizzleOrm.sql.raw(chunk7CCVR2QF_cjs.generateSqliteCreateTableSQL(tables2.baseSchemaVersions))
|
|
1357
1357
|
);
|
|
1358
1358
|
}
|
|
1359
1359
|
async function writeBaseSchemaVersion(version) {
|
|
1360
1360
|
const marker = tables2.baseSchemaVersions;
|
|
1361
|
-
const timestamp =
|
|
1361
|
+
const timestamp = chunkBYUIOM4L_cjs.nowIso();
|
|
1362
1362
|
await db.insert(marker).values({ installation: 1, version, updatedAt: timestamp }).onConflictDoUpdate({
|
|
1363
1363
|
target: marker.installation,
|
|
1364
1364
|
set: { version, updatedAt: timestamp },
|
|
@@ -1367,9 +1367,9 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1367
1367
|
return readBaseSchemaVersion();
|
|
1368
1368
|
}
|
|
1369
1369
|
async function ensureGraphTemplatesTable() {
|
|
1370
|
-
await db.run(drizzleOrm.sql.raw(
|
|
1370
|
+
await db.run(drizzleOrm.sql.raw(chunk7CCVR2QF_cjs.generateSqliteCreateTableSQL(tables2.graphTemplates)));
|
|
1371
1371
|
}
|
|
1372
|
-
const baseSchemaLifecycle =
|
|
1372
|
+
const baseSchemaLifecycle = chunk7CCVR2QF_cjs.createBaseSchemaLifecycle({
|
|
1373
1373
|
readVersion: readBaseSchemaVersion,
|
|
1374
1374
|
ensureVersionTable: ensureBaseSchemaVersionTable,
|
|
1375
1375
|
writeVersion: writeBaseSchemaVersion,
|
|
@@ -1399,16 +1399,16 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1399
1399
|
...options_.schemaWrite
|
|
1400
1400
|
});
|
|
1401
1401
|
}
|
|
1402
|
-
await
|
|
1403
|
-
const indexDefinitions = await
|
|
1402
|
+
await chunk7CCVR2QF_cjs.assertTrustedImportDatabaseEmpty(tx, tableNames);
|
|
1403
|
+
const indexDefinitions = await chunk7CCVR2QF_cjs.suspendSqliteSecondaryIndexes(
|
|
1404
1404
|
tx,
|
|
1405
1405
|
tableNames
|
|
1406
1406
|
);
|
|
1407
1407
|
const result = await fn(
|
|
1408
|
-
|
|
1408
|
+
chunk7CCVR2QF_cjs.createSqliteTrustedImportSession(executionAdapter, tableNames)
|
|
1409
1409
|
);
|
|
1410
|
-
await
|
|
1411
|
-
await
|
|
1410
|
+
await chunk7CCVR2QF_cjs.restoreSecondaryIndexes(tx, indexDefinitions);
|
|
1411
|
+
await chunk7CCVR2QF_cjs.analyzeImportedTables(tx, tableNames);
|
|
1412
1412
|
return result;
|
|
1413
1413
|
});
|
|
1414
1414
|
}
|
|
@@ -1416,7 +1416,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1416
1416
|
async bootstrapTables() {
|
|
1417
1417
|
const startingBaseSchemaVersion = await baseSchemaLifecycle.prepareBootstrap();
|
|
1418
1418
|
await baseSchemaLifecycle.adoptBeforeBootstrap(startingBaseSchemaVersion);
|
|
1419
|
-
const statements =
|
|
1419
|
+
const statements = chunk7CCVR2QF_cjs.generateSqliteDDL(tables2, fulltextStrategy);
|
|
1420
1420
|
for (const statement of statements) {
|
|
1421
1421
|
await db.run(drizzleOrm.sql.raw(statement));
|
|
1422
1422
|
}
|
|
@@ -1428,7 +1428,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1428
1428
|
templateId: params.templateId,
|
|
1429
1429
|
schemaHash: params.schemaHash,
|
|
1430
1430
|
schemaDoc: JSON.stringify(params.schemaDoc),
|
|
1431
|
-
createdAt:
|
|
1431
|
+
createdAt: chunkBYUIOM4L_cjs.nowIso()
|
|
1432
1432
|
}).onConflictDoNothing();
|
|
1433
1433
|
const templateRows = await db.select().from(t).where(drizzleOrm.eq(t.templateId, params.templateId));
|
|
1434
1434
|
const row = templateRows.at(0);
|
|
@@ -1450,7 +1450,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1450
1450
|
},
|
|
1451
1451
|
async instantiateGraphTemplate(params) {
|
|
1452
1452
|
const rows = await operations.execute(
|
|
1453
|
-
|
|
1453
|
+
chunk7CCVR2QF_cjs.instantiateGraphTemplateSql({
|
|
1454
1454
|
dialect: "sqlite",
|
|
1455
1455
|
graphId: params.graphId,
|
|
1456
1456
|
schemaHash: params.schemaHash,
|
|
@@ -1466,7 +1466,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1466
1466
|
const row = rows[0];
|
|
1467
1467
|
if (row === void 0) return { status: "refused" };
|
|
1468
1468
|
await operations.execute(
|
|
1469
|
-
|
|
1469
|
+
chunk7CCVR2QF_cjs.copyGraphTemplateContributionMarkersStatement({
|
|
1470
1470
|
graphId: params.graphId,
|
|
1471
1471
|
schemaHash: params.schemaHash,
|
|
1472
1472
|
schemaVersionsTableName: drizzleOrm.getTableName(tables2.schemaVersions),
|
|
@@ -1482,7 +1482,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1482
1482
|
},
|
|
1483
1483
|
async ensureRevisionOriginsTable() {
|
|
1484
1484
|
await db.run(
|
|
1485
|
-
drizzleOrm.sql.raw(
|
|
1485
|
+
drizzleOrm.sql.raw(chunk7CCVR2QF_cjs.generateSqliteCreateTableSQL(tables2.revisionOrigins))
|
|
1486
1486
|
);
|
|
1487
1487
|
},
|
|
1488
1488
|
ensureEdgeMatchIdentityStorage,
|
|
@@ -1534,7 +1534,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1534
1534
|
// uninitialized database throws `StoreNotInitializedError` rather
|
|
1535
1535
|
// than self-healing (#135). Shared verbatim with the tx-scoped gate
|
|
1536
1536
|
// via `gateFulltextMethods`.
|
|
1537
|
-
...
|
|
1537
|
+
...chunk7CCVR2QF_cjs.gateFulltextMethods(
|
|
1538
1538
|
operations,
|
|
1539
1539
|
contributionMaterializer.assertInitialized,
|
|
1540
1540
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -1544,7 +1544,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1544
1544
|
},
|
|
1545
1545
|
async ensureIndexMaterializationsTable() {
|
|
1546
1546
|
await db.run(
|
|
1547
|
-
drizzleOrm.sql.raw(
|
|
1547
|
+
drizzleOrm.sql.raw(chunk7CCVR2QF_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
|
|
1548
1548
|
);
|
|
1549
1549
|
},
|
|
1550
1550
|
async getIndexMaterialization(indexName) {
|
|
@@ -1552,26 +1552,26 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1552
1552
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
1553
1553
|
const row = rows[0];
|
|
1554
1554
|
if (row === void 0) return void 0;
|
|
1555
|
-
return
|
|
1555
|
+
return chunk7CCVR2QF_cjs.mapMaterializationRow(row, chunk7CCVR2QF_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
|
|
1556
1556
|
},
|
|
1557
1557
|
async getIndexMaterializations(statusKeys) {
|
|
1558
1558
|
if (statusKeys.length === 0) return [];
|
|
1559
1559
|
const t = tables2.indexMaterializations;
|
|
1560
1560
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
1561
1561
|
return rows.map(
|
|
1562
|
-
(row) =>
|
|
1562
|
+
(row) => chunk7CCVR2QF_cjs.mapMaterializationRow(row, chunk7CCVR2QF_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
|
|
1563
1563
|
);
|
|
1564
1564
|
},
|
|
1565
1565
|
async recordIndexMaterialization(params) {
|
|
1566
1566
|
const t = tables2.indexMaterializations;
|
|
1567
1567
|
await db.insert(t).values(
|
|
1568
|
-
|
|
1568
|
+
chunk7CCVR2QF_cjs.buildMaterializationInsertValues(
|
|
1569
1569
|
params,
|
|
1570
|
-
|
|
1570
|
+
chunk7CCVR2QF_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
|
|
1571
1571
|
)
|
|
1572
1572
|
).onConflictDoUpdate({
|
|
1573
1573
|
target: t.indexName,
|
|
1574
|
-
set:
|
|
1574
|
+
set: chunk7CCVR2QF_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
1575
1575
|
});
|
|
1576
1576
|
},
|
|
1577
1577
|
async ensureContributionMaterializationsTable() {
|
|
@@ -1587,37 +1587,37 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1587
1587
|
await contributionMaterializer.assertInitialized(graphId);
|
|
1588
1588
|
},
|
|
1589
1589
|
async ensureKindRemovalsTable() {
|
|
1590
|
-
await db.run(drizzleOrm.sql.raw(
|
|
1590
|
+
await db.run(drizzleOrm.sql.raw(chunk7CCVR2QF_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
|
|
1591
1591
|
},
|
|
1592
1592
|
async getPendingKindRemovals(graphId) {
|
|
1593
1593
|
const t = tables2.kindRemovals;
|
|
1594
1594
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
1595
1595
|
return rows.map(
|
|
1596
|
-
(row) =>
|
|
1596
|
+
(row) => chunk7CCVR2QF_cjs.mapKindRemovalRow(row, chunk7CCVR2QF_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1597
1597
|
);
|
|
1598
1598
|
},
|
|
1599
1599
|
async getAllKindRemovals(graphId) {
|
|
1600
1600
|
const t = tables2.kindRemovals;
|
|
1601
1601
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
1602
1602
|
return rows.map(
|
|
1603
|
-
(row) =>
|
|
1603
|
+
(row) => chunk7CCVR2QF_cjs.mapKindRemovalRow(row, chunk7CCVR2QF_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1604
1604
|
);
|
|
1605
1605
|
},
|
|
1606
1606
|
async recordKindRemoval(params) {
|
|
1607
1607
|
const t = tables2.kindRemovals;
|
|
1608
1608
|
await db.insert(t).values(
|
|
1609
|
-
|
|
1609
|
+
chunk7CCVR2QF_cjs.buildKindRemovalInsertValues(
|
|
1610
1610
|
params,
|
|
1611
|
-
|
|
1611
|
+
chunk7CCVR2QF_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
|
|
1612
1612
|
)
|
|
1613
1613
|
).onConflictDoUpdate({
|
|
1614
1614
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
1615
|
-
set:
|
|
1615
|
+
set: chunk7CCVR2QF_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
1616
1616
|
});
|
|
1617
1617
|
},
|
|
1618
1618
|
async ensureReconciliationMarkersTable() {
|
|
1619
1619
|
await db.run(
|
|
1620
|
-
drizzleOrm.sql.raw(
|
|
1620
|
+
drizzleOrm.sql.raw(chunk7CCVR2QF_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
|
|
1621
1621
|
);
|
|
1622
1622
|
},
|
|
1623
1623
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -1719,7 +1719,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1719
1719
|
},
|
|
1720
1720
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
1721
1721
|
return runSchemaWriteTransaction(
|
|
1722
|
-
(target) =>
|
|
1722
|
+
(target) => chunk7CCVR2QF_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
1723
1723
|
);
|
|
1724
1724
|
},
|
|
1725
1725
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -1740,7 +1740,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1740
1740
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1741
1741
|
},
|
|
1742
1742
|
async transactionWithNative(fn, options2) {
|
|
1743
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1743
|
+
const temporaryWrites = options2?.temporaryWrites === chunkJ34FSPSC_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
1744
1744
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1745
1745
|
throw new chunkASKXTVK5_cjs.ConfigurationError(
|
|
1746
1746
|
"Temporary-write transactions must be semantically read-only.",
|
|
@@ -1770,8 +1770,8 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1770
1770
|
);
|
|
1771
1771
|
try {
|
|
1772
1772
|
const result = await fn(
|
|
1773
|
-
|
|
1774
|
-
|
|
1773
|
+
chunkJ34FSPSC_cjs.markSchemaFencedInsertEligible(
|
|
1774
|
+
chunk7CCVR2QF_cjs.gateFulltext(
|
|
1775
1775
|
txBackend,
|
|
1776
1776
|
contributionMaterializer.assertInitialized,
|
|
1777
1777
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -1789,14 +1789,14 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1789
1789
|
}
|
|
1790
1790
|
if (transactionMode === "do-sqlite") {
|
|
1791
1791
|
return runDoSqliteStorageTransaction(
|
|
1792
|
-
async () => fn(
|
|
1792
|
+
async () => fn(chunkJ34FSPSC_cjs.markSchemaFencedInsertEligible(bindTransactionBackend(db)), db)
|
|
1793
1793
|
);
|
|
1794
1794
|
}
|
|
1795
1795
|
return runWithSerializedQueue(
|
|
1796
1796
|
serializedQueue,
|
|
1797
1797
|
async () => db.transaction(
|
|
1798
1798
|
async (tx) => fn(
|
|
1799
|
-
|
|
1799
|
+
chunkJ34FSPSC_cjs.markSchemaFencedInsertEligible(bindTransactionBackend(tx)),
|
|
1800
1800
|
tx
|
|
1801
1801
|
),
|
|
1802
1802
|
{
|
|
@@ -1811,7 +1811,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1811
1811
|
"Cross-store atomicity is unavailable on this SQLite backend: transactions are disabled (transactionMode: 'none'). Adopting an external transaction here would let the caller's relational write commit with no way to roll back the graph write. Configure a driver that supports transactions (better-sqlite3, libsql, bun:sqlite)."
|
|
1812
1812
|
);
|
|
1813
1813
|
}
|
|
1814
|
-
|
|
1814
|
+
chunk7CCVR2QF_cjs.assertAdoptedDialect(
|
|
1815
1815
|
externalTx,
|
|
1816
1816
|
sqliteCore.BaseSQLiteDatabase,
|
|
1817
1817
|
"sqlite"
|
|
@@ -1823,13 +1823,13 @@ function createSqliteBackend(db, options = {}) {
|
|
|
1823
1823
|
return Promise.resolve();
|
|
1824
1824
|
}
|
|
1825
1825
|
};
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1826
|
+
chunkJ34FSPSC_cjs.auditBackendResource(backend, resourceAudit);
|
|
1827
|
+
chunkJ34FSPSC_cjs.markFirstPartyFactory(backend);
|
|
1828
|
+
chunkJ34FSPSC_cjs.markSchemaFencedInsertEligible(backend);
|
|
1829
|
+
chunkVXEHEPC4_cjs.markBundledRootAutocommitEligible(backend);
|
|
1830
1830
|
if (atomicSqlProgramExecutor !== void 0) {
|
|
1831
|
-
|
|
1832
|
-
|
|
1831
|
+
chunkDGIA64DM_cjs.registerAtomicSqlProgram(backend, executionAdapter);
|
|
1832
|
+
chunkDGIA64DM_cjs.registerAtomicMutationPrograms(backend, {
|
|
1833
1833
|
createNodes: operations.executeAtomicNodeBatch,
|
|
1834
1834
|
replaceNodes: operations.executeAtomicNodeReplacementBatch,
|
|
1835
1835
|
createEdges: operations.executeAtomicEdgeBatch,
|
|
@@ -1847,9 +1847,9 @@ function createTransactionBackend(options) {
|
|
|
1847
1847
|
const txExecutionAdapter = options.executionAdapter ?? createSqliteExecutionAdapter(options.db, {
|
|
1848
1848
|
profileHints: options.profileHints
|
|
1849
1849
|
});
|
|
1850
|
-
return
|
|
1850
|
+
return chunkJ34FSPSC_cjs.markFirstPartyFactory(
|
|
1851
1851
|
createSqliteOperationBackend({
|
|
1852
|
-
capabilities:
|
|
1852
|
+
capabilities: chunkJ34FSPSC_cjs.downgradeAtomicBatch(options.capabilities),
|
|
1853
1853
|
db: options.db,
|
|
1854
1854
|
executionAdapter: txExecutionAdapter,
|
|
1855
1855
|
operationStrategy: options.operationStrategy,
|
|
@@ -1864,5 +1864,5 @@ function createTransactionBackend(options) {
|
|
|
1864
1864
|
|
|
1865
1865
|
exports.createSqliteBackend = createSqliteBackend;
|
|
1866
1866
|
exports.isLocalLibsqlClient = isLocalLibsqlClient;
|
|
1867
|
-
//# sourceMappingURL=chunk-
|
|
1868
|
-
//# sourceMappingURL=chunk-
|
|
1867
|
+
//# sourceMappingURL=chunk-Z4NU4MYB.cjs.map
|
|
1868
|
+
//# sourceMappingURL=chunk-Z4NU4MYB.cjs.map
|