@nicia-ai/typegraph 0.32.0 → 0.34.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/README.md +51 -0
- package/dist/backend/postgres/index.cjs +36 -19
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +14 -9
- package/dist/backend/postgres/pglite.cjs +18 -13
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +14 -9
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +34 -17
- package/dist/backend/sqlite/index.d.cts +7 -7
- package/dist/backend/sqlite/index.d.ts +7 -7
- package/dist/backend/sqlite/index.js +13 -8
- package/dist/backend/sqlite/libsql.cjs +19 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +12 -5
- package/dist/backend/sqlite/libsql.d.ts +12 -5
- package/dist/backend/sqlite/libsql.js +15 -10
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +19 -14
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +14 -9
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-2EBMPJBO.js +16 -0
- package/dist/chunk-2EBMPJBO.js.map +1 -0
- package/dist/{chunk-CFNT3ITG.cjs → chunk-2JXB3NYJ.cjs} +15 -35
- package/dist/chunk-2JXB3NYJ.cjs.map +1 -0
- package/dist/chunk-2MRAX3UE.js +105 -0
- package/dist/chunk-2MRAX3UE.js.map +1 -0
- package/dist/{chunk-2LAT5BIK.cjs → chunk-3BRVBQQD.cjs} +2328 -3131
- package/dist/chunk-3BRVBQQD.cjs.map +1 -0
- package/dist/chunk-3E7SNSIA.cjs +55 -0
- package/dist/chunk-3E7SNSIA.cjs.map +1 -0
- package/dist/{chunk-FDN43KXV.cjs → chunk-3Z6TW3CT.cjs} +20 -19
- package/dist/chunk-3Z6TW3CT.cjs.map +1 -0
- package/dist/{chunk-IJORSAC3.js → chunk-4DIBPQNJ.js} +6 -4
- package/dist/chunk-4DIBPQNJ.js.map +1 -0
- package/dist/chunk-4S2FXGBJ.js +9 -0
- package/dist/chunk-4S2FXGBJ.js.map +1 -0
- package/dist/chunk-5IQIX7LU.cjs +2070 -0
- package/dist/chunk-5IQIX7LU.cjs.map +1 -0
- package/dist/{chunk-CWFPJ3RC.js → chunk-6GNSY7AV.js} +3 -3
- package/dist/{chunk-CWFPJ3RC.js.map → chunk-6GNSY7AV.js.map} +1 -1
- package/dist/{chunk-LAZGHOZW.cjs → chunk-6HVOHZHS.cjs} +184 -117
- package/dist/chunk-6HVOHZHS.cjs.map +1 -0
- package/dist/chunk-6SCVW4AS.js +20 -0
- package/dist/chunk-6SCVW4AS.js.map +1 -0
- package/dist/chunk-A7SZZFAG.js +2010 -0
- package/dist/chunk-A7SZZFAG.js.map +1 -0
- package/dist/chunk-ACSVZPK7.cjs +21 -0
- package/dist/chunk-ACSVZPK7.cjs.map +1 -0
- package/dist/{chunk-MXE2U3EX.js → chunk-BVTWD66D.js} +4 -115
- package/dist/chunk-BVTWD66D.js.map +1 -0
- package/dist/{chunk-W4ZX2GCP.js → chunk-CHXTTSC6.js} +5 -39
- package/dist/chunk-CHXTTSC6.js.map +1 -0
- package/dist/{chunk-XQFAJVYW.js → chunk-CYX2JTDG.js} +124 -5
- package/dist/chunk-CYX2JTDG.js.map +1 -0
- package/dist/{chunk-PRMKPFN5.js → chunk-DEQFL35G.js} +4 -3
- package/dist/chunk-DEQFL35G.js.map +1 -0
- package/dist/chunk-DI74SMXS.cjs +29 -0
- package/dist/chunk-DI74SMXS.cjs.map +1 -0
- package/dist/{chunk-WWVV44DY.cjs → chunk-G6SOJEDI.cjs} +11 -11
- package/dist/{chunk-WWVV44DY.cjs.map → chunk-G6SOJEDI.cjs.map} +1 -1
- package/dist/{chunk-LM2IC4ZJ.cjs → chunk-GQANNXXT.cjs} +15 -14
- package/dist/chunk-GQANNXXT.cjs.map +1 -0
- package/dist/chunk-GZCNZ7QW.js +24 -0
- package/dist/chunk-GZCNZ7QW.js.map +1 -0
- package/dist/{chunk-KTIEB7VH.cjs → chunk-HK5SATYM.cjs} +35 -58
- package/dist/chunk-HK5SATYM.cjs.map +1 -0
- package/dist/chunk-HMFK4BXR.cjs +12 -0
- package/dist/{chunk-6ZR4QC3O.cjs.map → chunk-HMFK4BXR.cjs.map} +1 -1
- package/dist/chunk-ITE4IXAK.js +25 -0
- package/dist/chunk-ITE4IXAK.js.map +1 -0
- package/dist/chunk-JJRCLAUN.cjs +155 -0
- package/dist/chunk-JJRCLAUN.cjs.map +1 -0
- package/dist/{chunk-ZFWNO3GE.cjs → chunk-JQGIPGVL.cjs} +66 -2
- package/dist/chunk-JQGIPGVL.cjs.map +1 -0
- package/dist/{chunk-2BVHPOIG.js → chunk-K2TGS3EN.js} +105 -38
- package/dist/chunk-K2TGS3EN.js.map +1 -0
- package/dist/chunk-K34OPSJK.js +29 -0
- package/dist/chunk-K34OPSJK.js.map +1 -0
- package/dist/{chunk-YW7GHMF4.cjs → chunk-KGC4LY5T.cjs} +18 -17
- package/dist/chunk-KGC4LY5T.cjs.map +1 -0
- package/dist/{chunk-SB65GJNY.cjs → chunk-KNHYNQQ3.cjs} +111 -72
- package/dist/chunk-KNHYNQQ3.cjs.map +1 -0
- package/dist/{chunk-C4C4Q7A6.js → chunk-KUTNI6SI.js} +6 -21
- package/dist/chunk-KUTNI6SI.js.map +1 -0
- package/dist/{chunk-NDM5PXEH.js → chunk-LANHCOXB.js} +44 -11
- package/dist/chunk-LANHCOXB.js.map +1 -0
- package/dist/chunk-N6WTUSBV.cjs +23 -0
- package/dist/chunk-N6WTUSBV.cjs.map +1 -0
- package/dist/{chunk-73KASJGO.cjs → chunk-NAUA4PW5.cjs} +4 -28
- package/dist/chunk-NAUA4PW5.cjs.map +1 -0
- package/dist/chunk-QV245VMN.js +145 -0
- package/dist/chunk-QV245VMN.js.map +1 -0
- package/dist/{chunk-CEF2QOTO.js → chunk-RBV7YCQD.js} +4 -3
- package/dist/chunk-RBV7YCQD.js.map +1 -0
- package/dist/chunk-RHZWOJVA.cjs +109 -0
- package/dist/chunk-RHZWOJVA.cjs.map +1 -0
- package/dist/{chunk-6RMLO5O4.cjs → chunk-RRKQAKD6.cjs} +13 -11
- package/dist/chunk-RRKQAKD6.cjs.map +1 -0
- package/dist/{chunk-TUA3MEJJ.js → chunk-RY2VIWAM.js} +612 -564
- package/dist/chunk-RY2VIWAM.js.map +1 -0
- package/dist/{chunk-PIHXFF73.js → chunk-SHLY4MCM.js} +3 -3
- package/dist/{chunk-PIHXFF73.js.map → chunk-SHLY4MCM.js.map} +1 -1
- package/dist/{chunk-HFBRAOF7.js → chunk-T2DWPQNE.js} +103 -64
- package/dist/chunk-T2DWPQNE.js.map +1 -0
- package/dist/{chunk-WYTUF3QO.js → chunk-T46GR2VY.js} +3 -3
- package/dist/{chunk-WYTUF3QO.js.map → chunk-T46GR2VY.js.map} +1 -1
- package/dist/{chunk-EEYV6UOE.cjs → chunk-T6SPUYLX.cjs} +5 -43
- package/dist/chunk-T6SPUYLX.cjs.map +1 -0
- package/dist/{chunk-3QRBXYT5.cjs → chunk-TGJE22RM.cjs} +6 -6
- package/dist/{chunk-3QRBXYT5.cjs.map → chunk-TGJE22RM.cjs.map} +1 -1
- package/dist/{chunk-YL4F3CMD.cjs → chunk-TOTPVGOG.cjs} +105 -72
- package/dist/chunk-TOTPVGOG.cjs.map +1 -0
- package/dist/{chunk-3HQDMOBK.cjs → chunk-UJLOZYKT.cjs} +680 -636
- package/dist/chunk-UJLOZYKT.cjs.map +1 -0
- package/dist/chunk-UNNPKQUG.cjs +1390 -0
- package/dist/chunk-UNNPKQUG.cjs.map +1 -0
- package/dist/chunk-UR7W5YQK.js +18 -0
- package/dist/chunk-UR7W5YQK.js.map +1 -0
- package/dist/chunk-V3QNTB7Z.js +1351 -0
- package/dist/chunk-V3QNTB7Z.js.map +1 -0
- package/dist/{chunk-XKNAK27R.js → chunk-VCGO4V26.js} +4 -3
- package/dist/chunk-VCGO4V26.js.map +1 -0
- package/dist/{chunk-YQGLVWB2.cjs → chunk-WL2SG7ZV.cjs} +6 -122
- package/dist/chunk-WL2SG7ZV.cjs.map +1 -0
- package/dist/{chunk-WNORITK6.js → chunk-WLRIWYHQ.js} +2041 -2834
- package/dist/chunk-WLRIWYHQ.js.map +1 -0
- package/dist/{chunk-JKRKIEVA.cjs → chunk-WVC2Q2FD.cjs} +128 -6
- package/dist/chunk-WVC2Q2FD.cjs.map +1 -0
- package/dist/chunk-XLUNB2TZ.js +53 -0
- package/dist/chunk-XLUNB2TZ.js.map +1 -0
- package/dist/chunk-XXVEULWX.js +39 -0
- package/dist/chunk-XXVEULWX.js.map +1 -0
- package/dist/chunk-YAZE7QZR.cjs +32 -0
- package/dist/chunk-YAZE7QZR.cjs.map +1 -0
- package/dist/chunk-YC6PWTHY.cjs +44 -0
- package/dist/chunk-YC6PWTHY.cjs.map +1 -0
- package/dist/chunk-Z5HBYM7U.cjs +11 -0
- package/dist/chunk-Z5HBYM7U.cjs.map +1 -0
- package/dist/{chunk-454I6GDF.js → chunk-Z5XBMDXU.js} +63 -3
- package/dist/chunk-Z5XBMDXU.js.map +1 -0
- package/dist/{chunk-CAMMC3E4.cjs → chunk-ZP5WHI4C.cjs} +109 -81
- package/dist/chunk-ZP5WHI4C.cjs.map +1 -0
- package/dist/{chunk-YCV72E6L.js → chunk-ZURTTSCM.js} +4 -25
- package/dist/chunk-ZURTTSCM.js.map +1 -0
- package/dist/{chunk-7WW3WL6E.js → chunk-ZV5N4DBG.js} +49 -21
- package/dist/chunk-ZV5N4DBG.js.map +1 -0
- package/dist/chunk-ZY4GXIVN.cjs +32 -0
- package/dist/chunk-ZY4GXIVN.cjs.map +1 -0
- package/dist/{ddl-C8e8zDAE.d.ts → ddl-BrmPg61z.d.ts} +3 -3
- package/dist/{ddl-CwyG4HoQ.d.cts → ddl-j1-sH6lE.d.cts} +3 -3
- package/dist/{extension-types-D1k0inWU.d.cts → extension-types-YGFJPrzK.d.cts} +1 -1
- package/dist/{extension-types-D1k0inWU.d.ts → extension-types-YGFJPrzK.d.ts} +1 -1
- package/dist/graph-extension/index.cjs +18 -17
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +3 -2
- package/dist/graph-merge/index.cjs +295 -146
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +6 -6
- package/dist/graph-merge/index.d.ts +6 -6
- package/dist/graph-merge/index.js +173 -24
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-BEK0VtNB.d.ts → index-DGX6D9j1.d.ts} +2 -2
- package/dist/{index-C8sSTErx.d.cts → index-SEvUHDA6.d.cts} +2 -2
- package/dist/index.cjs +206 -172
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -55
- package/dist/index.d.ts +25 -55
- package/dist/index.js +32 -22
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +28 -25
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +10 -7
- package/dist/interchange/index.cjs +25 -16
- package/dist/interchange/index.d.cts +5 -5
- package/dist/interchange/index.d.ts +5 -5
- package/dist/interchange/index.js +12 -3
- package/dist/{manager-8htmuGr-.d.ts → manager-BZUeN_BU.d.ts} +2 -2
- package/dist/{manager-aVgxbGt-.d.cts → manager-ms9cKdc6.d.cts} +2 -2
- package/dist/{materialize-indexes-CAGhqPHQ.d.ts → materialize-indexes-CAkIYFV-.d.ts} +1 -1
- package/dist/{materialize-indexes-DEYkU-wr.d.cts → materialize-indexes-D20xNluI.d.cts} +1 -1
- package/dist/{postgres-Dhom7iiX.d.ts → postgres-BhpxGMC5.d.cts} +2651 -596
- package/dist/{postgres-jgXmD45C.d.cts → postgres-CWHLwNl1.d.ts} +2651 -596
- package/dist/profiler/index.cjs +5 -4
- package/dist/profiler/index.cjs.map +1 -1
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +3 -2
- package/dist/profiler/index.js.map +1 -1
- package/dist/provenance/index.cjs +591 -0
- package/dist/provenance/index.cjs.map +1 -0
- package/dist/provenance/index.d.cts +73 -0
- package/dist/provenance/index.d.ts +73 -0
- package/dist/provenance/index.js +589 -0
- package/dist/provenance/index.js.map +1 -0
- package/dist/schema/index.cjs +37 -32
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +14 -9
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-DcQ_BCUW.d.cts → sqlite-CGu5SLsw.d.ts} +2726 -455
- package/dist/{sqlite-BfLsCEqO.d.ts → sqlite-XrDxNaa7.d.cts} +2726 -455
- package/dist/{store-view-pBOUrQte.d.ts → store-view-BlgnhEYf.d.ts} +467 -131
- package/dist/{store-view-lTcb_cnp.d.cts → store-view-D09po4H6.d.cts} +467 -131
- package/dist/{types-DGDiXAYc.d.ts → types-B1TbZJYS.d.ts} +2 -2
- package/dist/{types-Dk8r09KY.d.ts → types-D1Sqeyxy.d.ts} +161 -26
- package/dist/{types-5RQwzWXx.d.cts → types-DiE1AO7p.d.cts} +2 -2
- package/dist/{types-Dvmn-eal.d.cts → types-DkNnF-7K.d.cts} +161 -26
- package/dist/{where-Cx_glEEB.d.cts → where-DKjuofPr.d.cts} +2 -2
- package/dist/{where-CHZFELX0.d.ts → where-DrUIIWHb.d.ts} +2 -2
- package/package.json +8 -2
- package/dist/chunk-2BVHPOIG.js.map +0 -1
- package/dist/chunk-2LAT5BIK.cjs.map +0 -1
- package/dist/chunk-2YMGNYXY.js +0 -40
- package/dist/chunk-2YMGNYXY.js.map +0 -1
- package/dist/chunk-3HQDMOBK.cjs.map +0 -1
- package/dist/chunk-454I6GDF.js.map +0 -1
- package/dist/chunk-6G35I3VW.cjs +0 -40
- package/dist/chunk-6G35I3VW.cjs.map +0 -1
- package/dist/chunk-6RMLO5O4.cjs.map +0 -1
- package/dist/chunk-6ZR4QC3O.cjs +0 -12
- package/dist/chunk-73KASJGO.cjs.map +0 -1
- package/dist/chunk-7WW3WL6E.js.map +0 -1
- package/dist/chunk-C4C4Q7A6.js.map +0 -1
- package/dist/chunk-CAMMC3E4.cjs.map +0 -1
- package/dist/chunk-CEF2QOTO.js.map +0 -1
- package/dist/chunk-CFNT3ITG.cjs.map +0 -1
- package/dist/chunk-EEYV6UOE.cjs.map +0 -1
- package/dist/chunk-FDN43KXV.cjs.map +0 -1
- package/dist/chunk-HFBRAOF7.js.map +0 -1
- package/dist/chunk-IJORSAC3.js.map +0 -1
- package/dist/chunk-JKRKIEVA.cjs.map +0 -1
- package/dist/chunk-KTIEB7VH.cjs.map +0 -1
- package/dist/chunk-LAZGHOZW.cjs.map +0 -1
- package/dist/chunk-LM2IC4ZJ.cjs.map +0 -1
- package/dist/chunk-M6OC455F.js +0 -65
- package/dist/chunk-M6OC455F.js.map +0 -1
- package/dist/chunk-MXE2U3EX.js.map +0 -1
- package/dist/chunk-NDM5PXEH.js.map +0 -1
- package/dist/chunk-PRMKPFN5.js.map +0 -1
- package/dist/chunk-RP7YITHX.cjs +0 -70
- package/dist/chunk-RP7YITHX.cjs.map +0 -1
- package/dist/chunk-SAJSMR2B.js +0 -35
- package/dist/chunk-SAJSMR2B.js.map +0 -1
- package/dist/chunk-SB65GJNY.cjs.map +0 -1
- package/dist/chunk-TUA3MEJJ.js.map +0 -1
- package/dist/chunk-W4ZX2GCP.js.map +0 -1
- package/dist/chunk-WNORITK6.js.map +0 -1
- package/dist/chunk-XKNAK27R.js.map +0 -1
- package/dist/chunk-XQFAJVYW.js.map +0 -1
- package/dist/chunk-YCV72E6L.js.map +0 -1
- package/dist/chunk-YL4F3CMD.cjs.map +0 -1
- package/dist/chunk-YQGLVWB2.cjs.map +0 -1
- package/dist/chunk-YW7GHMF4.cjs.map +0 -1
- package/dist/chunk-ZFWNO3GE.cjs.map +0 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkUJLOZYKT_cjs = require('./chunk-UJLOZYKT.cjs');
|
|
4
|
+
var chunkWVC2Q2FD_cjs = require('./chunk-WVC2Q2FD.cjs');
|
|
5
|
+
var chunkJJRCLAUN_cjs = require('./chunk-JJRCLAUN.cjs');
|
|
6
|
+
var chunk2JXB3NYJ_cjs = require('./chunk-2JXB3NYJ.cjs');
|
|
7
|
+
var chunkUNNPKQUG_cjs = require('./chunk-UNNPKQUG.cjs');
|
|
8
|
+
var chunkRHZWOJVA_cjs = require('./chunk-RHZWOJVA.cjs');
|
|
8
9
|
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
9
10
|
var drizzleOrm = require('drizzle-orm');
|
|
10
11
|
var sqliteCore = require('drizzle-orm/sqlite-core');
|
|
@@ -72,7 +73,7 @@ function resolveSqliteClient(db) {
|
|
|
72
73
|
return sqliteClient;
|
|
73
74
|
}
|
|
74
75
|
function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
|
|
75
|
-
return
|
|
76
|
+
return chunkUJLOZYKT_cjs.getOrCreateLru(
|
|
76
77
|
cache,
|
|
77
78
|
sqlText,
|
|
78
79
|
cacheMax,
|
|
@@ -108,7 +109,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
108
109
|
supportsCompiledExecution: sqliteClient !== void 0,
|
|
109
110
|
transactionMode
|
|
110
111
|
};
|
|
111
|
-
const compile = (query) =>
|
|
112
|
+
const compile = (query) => chunkUJLOZYKT_cjs.compileQueryWithDialect(db, query, "SQLite");
|
|
112
113
|
if (sqliteClient !== void 0) {
|
|
113
114
|
let executeCompiled2 = function(compiledQuery) {
|
|
114
115
|
const preparedStatement = getOrCreatePreparedStatement(
|
|
@@ -155,35 +156,34 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
// src/backend/drizzle/sqlite.ts
|
|
158
|
-
var SQLITE_MAX_BIND_PARAMETERS = 999;
|
|
159
159
|
var NODE_INSERT_PARAM_COUNT = 9;
|
|
160
160
|
var EDGE_INSERT_PARAM_COUNT = 12;
|
|
161
161
|
var SQLITE_NODE_INSERT_BATCH_SIZE = Math.max(
|
|
162
162
|
1,
|
|
163
|
-
Math.floor(SQLITE_MAX_BIND_PARAMETERS / NODE_INSERT_PARAM_COUNT)
|
|
163
|
+
Math.floor(chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS / NODE_INSERT_PARAM_COUNT)
|
|
164
164
|
);
|
|
165
165
|
var SQLITE_EDGE_INSERT_BATCH_SIZE = Math.max(
|
|
166
166
|
1,
|
|
167
|
-
Math.floor(SQLITE_MAX_BIND_PARAMETERS / EDGE_INSERT_PARAM_COUNT)
|
|
167
|
+
Math.floor(chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS / EDGE_INSERT_PARAM_COUNT)
|
|
168
168
|
);
|
|
169
169
|
var SQLITE_GET_NODES_ID_CHUNK_SIZE = Math.max(
|
|
170
170
|
1,
|
|
171
|
-
SQLITE_MAX_BIND_PARAMETERS - 2
|
|
171
|
+
chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS - 2
|
|
172
172
|
);
|
|
173
173
|
var SQLITE_GET_EDGES_ID_CHUNK_SIZE = Math.max(
|
|
174
174
|
1,
|
|
175
|
-
SQLITE_MAX_BIND_PARAMETERS - 1
|
|
175
|
+
chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS - 1
|
|
176
176
|
);
|
|
177
177
|
var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
|
|
178
178
|
var SQLITE_CHECK_UNIQUE_BATCH_CHUNK_SIZE = Math.max(
|
|
179
179
|
1,
|
|
180
|
-
SQLITE_MAX_BIND_PARAMETERS - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
|
|
180
|
+
chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
|
|
181
181
|
);
|
|
182
|
-
var toNodeRow =
|
|
183
|
-
var toEdgeRow =
|
|
184
|
-
var toUniqueRow =
|
|
185
|
-
var toSchemaVersionRow =
|
|
186
|
-
|
|
182
|
+
var toNodeRow = chunkJJRCLAUN_cjs.createNodeRowMapper(chunkJJRCLAUN_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
183
|
+
var toEdgeRow = chunkJJRCLAUN_cjs.createEdgeRowMapper(chunkJJRCLAUN_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
184
|
+
var toUniqueRow = chunkJJRCLAUN_cjs.createUniqueRowMapper(chunkJJRCLAUN_cjs.SQLITE_ROW_MAPPER_CONFIG);
|
|
185
|
+
var toSchemaVersionRow = chunkJJRCLAUN_cjs.createSchemaVersionRowMapper(
|
|
186
|
+
chunkJJRCLAUN_cjs.SQLITE_ROW_MAPPER_CONFIG
|
|
187
187
|
);
|
|
188
188
|
var PENDING_FOREVER = new Promise(noop);
|
|
189
189
|
function pendingForever() {
|
|
@@ -191,9 +191,30 @@ function pendingForever() {
|
|
|
191
191
|
}
|
|
192
192
|
function noop() {
|
|
193
193
|
}
|
|
194
|
+
var queueTaskContext;
|
|
195
|
+
async function loadQueueTaskContext() {
|
|
196
|
+
try {
|
|
197
|
+
const asyncHooks = await import('async_hooks');
|
|
198
|
+
queueTaskContext = new asyncHooks.AsyncLocalStorage();
|
|
199
|
+
} catch {
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
void loadQueueTaskContext();
|
|
203
|
+
function rejectReentrantQueueSubmission() {
|
|
204
|
+
return Promise.reject(
|
|
205
|
+
new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
206
|
+
"This operation was awaited from inside a transaction running on the same SQLite backend and would deadlock: the transaction holds the backend's serialized execution slot until it completes, so the operation could never run.",
|
|
207
|
+
{ backend: "sqlite", capability: "concurrentRootAccess" },
|
|
208
|
+
{
|
|
209
|
+
suggestion: "Inside a store.transaction callback, use the transaction-scoped context (tx.nodes / tx.edges / tx.backend) instead of the root store or backend, or move the operation outside the transaction."
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
);
|
|
213
|
+
}
|
|
194
214
|
function createSerializedExecutionQueue() {
|
|
195
215
|
let tail = Promise.resolve();
|
|
196
216
|
let disposed = false;
|
|
217
|
+
const taskMarker = {};
|
|
197
218
|
function isDisposed() {
|
|
198
219
|
return disposed;
|
|
199
220
|
}
|
|
@@ -203,10 +224,14 @@ function createSerializedExecutionQueue() {
|
|
|
203
224
|
},
|
|
204
225
|
runExclusive(task) {
|
|
205
226
|
if (isDisposed()) return Promise.reject(new chunkJIEJCTDS_cjs.BackendDisposedError());
|
|
227
|
+
if (queueTaskContext?.getStore() === taskMarker) {
|
|
228
|
+
return rejectReentrantQueueSubmission();
|
|
229
|
+
}
|
|
206
230
|
const runTask = async () => {
|
|
207
231
|
if (isDisposed()) return pendingForever();
|
|
208
232
|
try {
|
|
209
|
-
|
|
233
|
+
const context = queueTaskContext;
|
|
234
|
+
return context === void 0 ? await task() : await context.run(taskMarker, () => task());
|
|
210
235
|
} catch (error) {
|
|
211
236
|
if (isDisposed()) return pendingForever();
|
|
212
237
|
throw error;
|
|
@@ -233,11 +258,11 @@ function throwSqliteTransactionsDisabled(message) {
|
|
|
233
258
|
});
|
|
234
259
|
}
|
|
235
260
|
function buildSqliteCapabilities(options) {
|
|
236
|
-
const base = options.transactionMode === "none" ? { ...
|
|
261
|
+
const base = options.transactionMode === "none" ? { ...chunkUNNPKQUG_cjs.SQLITE_CAPABILITIES, transactions: false } : chunkUNNPKQUG_cjs.SQLITE_CAPABILITIES;
|
|
237
262
|
return {
|
|
238
263
|
...base,
|
|
239
|
-
fulltext:
|
|
240
|
-
...options.vectorStrategy === void 0 ? {} : { vector:
|
|
264
|
+
fulltext: chunk2JXB3NYJ_cjs.buildFulltextCapabilities(options.fulltextStrategy),
|
|
265
|
+
...options.vectorStrategy === void 0 ? {} : { vector: chunk2JXB3NYJ_cjs.buildVectorCapabilities(options.vectorStrategy) }
|
|
241
266
|
};
|
|
242
267
|
}
|
|
243
268
|
function createSqliteOperationBackend(options) {
|
|
@@ -268,7 +293,7 @@ function createSqliteOperationBackend(options) {
|
|
|
268
293
|
await db.run(query);
|
|
269
294
|
});
|
|
270
295
|
}
|
|
271
|
-
const commonBackend =
|
|
296
|
+
const commonBackend = chunkUJLOZYKT_cjs.createCommonOperationBackend({
|
|
272
297
|
batchConfig: {
|
|
273
298
|
checkUniqueBatchChunkSize: SQLITE_CHECK_UNIQUE_BATCH_CHUNK_SIZE,
|
|
274
299
|
edgeInsertBatchSize: SQLITE_EDGE_INSERT_BATCH_SIZE,
|
|
@@ -281,7 +306,7 @@ function createSqliteOperationBackend(options) {
|
|
|
281
306
|
execGet,
|
|
282
307
|
execRun
|
|
283
308
|
},
|
|
284
|
-
nowIso:
|
|
309
|
+
nowIso: chunkJJRCLAUN_cjs.nowIso,
|
|
285
310
|
operationStrategy,
|
|
286
311
|
rowMappers: {
|
|
287
312
|
toEdgeRow,
|
|
@@ -307,19 +332,19 @@ function createSqliteOperationBackend(options) {
|
|
|
307
332
|
}
|
|
308
333
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
309
334
|
async upsertEmbedding(params) {
|
|
310
|
-
const slot =
|
|
335
|
+
const slot = chunkUJLOZYKT_cjs.vectorSlotFromParams(params);
|
|
311
336
|
await ensureVectorSlotStorage(slot);
|
|
312
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
337
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkJJRCLAUN_cjs.nowIso());
|
|
313
338
|
try {
|
|
314
339
|
for (const statement of statements) {
|
|
315
340
|
await execRun(statement);
|
|
316
341
|
}
|
|
317
342
|
} catch (error) {
|
|
318
|
-
throw
|
|
343
|
+
throw chunkUJLOZYKT_cjs.mapVectorWriteError(error, params);
|
|
319
344
|
}
|
|
320
345
|
},
|
|
321
346
|
async deleteEmbedding(params) {
|
|
322
|
-
const slot =
|
|
347
|
+
const slot = chunkUJLOZYKT_cjs.vectorSlotFromParams(params);
|
|
323
348
|
await ensureVectorSlotStorage(slot);
|
|
324
349
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
325
350
|
for (const statement of statements) {
|
|
@@ -327,15 +352,15 @@ function createSqliteOperationBackend(options) {
|
|
|
327
352
|
}
|
|
328
353
|
},
|
|
329
354
|
async vectorSearch(params) {
|
|
330
|
-
|
|
331
|
-
const slot =
|
|
355
|
+
chunk2JXB3NYJ_cjs.assertVectorSearchLimit(params.limit);
|
|
356
|
+
const slot = chunkUJLOZYKT_cjs.vectorSlotFromParams(params);
|
|
332
357
|
await ensureVectorSlotStorage(slot);
|
|
333
358
|
const query = vectorStrategy.buildSearch(slot, params);
|
|
334
359
|
let rows;
|
|
335
360
|
try {
|
|
336
361
|
rows = await execAll(query);
|
|
337
362
|
} catch (error) {
|
|
338
|
-
throw
|
|
363
|
+
throw chunkUJLOZYKT_cjs.mapVectorWriteError(error, params);
|
|
339
364
|
}
|
|
340
365
|
return rows.map((row) => ({
|
|
341
366
|
nodeId: row.node_id,
|
|
@@ -354,7 +379,7 @@ function createSqliteOperationBackend(options) {
|
|
|
354
379
|
...vectorStrategy === void 0 ? {} : { vectorStrategy },
|
|
355
380
|
async createVectorIndex(params) {
|
|
356
381
|
if (vectorStrategy === void 0) return;
|
|
357
|
-
const slot =
|
|
382
|
+
const slot = chunkUJLOZYKT_cjs.vectorSlotFromCreateIndexParams(params);
|
|
358
383
|
await ensureVectorSlotStorage(slot);
|
|
359
384
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot);
|
|
360
385
|
if (indexStatement !== void 0) {
|
|
@@ -363,18 +388,18 @@ function createSqliteOperationBackend(options) {
|
|
|
363
388
|
},
|
|
364
389
|
async dropVectorIndex(params) {
|
|
365
390
|
if (vectorStrategy === void 0) return;
|
|
366
|
-
const slot =
|
|
391
|
+
const slot = chunkUJLOZYKT_cjs.vectorSlotFromDropIndexParams(params);
|
|
367
392
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
368
393
|
if (dropStatement === void 0) return;
|
|
369
394
|
try {
|
|
370
395
|
await execRun(dropStatement);
|
|
371
396
|
} catch (error) {
|
|
372
|
-
if (!
|
|
397
|
+
if (!chunkRHZWOJVA_cjs.isMissingTableError(error)) throw error;
|
|
373
398
|
}
|
|
374
399
|
},
|
|
375
400
|
// === Fulltext Operations ===
|
|
376
401
|
async upsertFulltext(params) {
|
|
377
|
-
const timestamp =
|
|
402
|
+
const timestamp = chunkJJRCLAUN_cjs.nowIso();
|
|
378
403
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
379
404
|
params,
|
|
380
405
|
timestamp
|
|
@@ -391,7 +416,7 @@ function createSqliteOperationBackend(options) {
|
|
|
391
416
|
},
|
|
392
417
|
async upsertFulltextBatch(params) {
|
|
393
418
|
if (params.rows.length === 0) return;
|
|
394
|
-
const timestamp =
|
|
419
|
+
const timestamp = chunkJJRCLAUN_cjs.nowIso();
|
|
395
420
|
const statements = operationStrategy.buildUpsertFulltextBatch(
|
|
396
421
|
params,
|
|
397
422
|
timestamp
|
|
@@ -412,7 +437,7 @@ function createSqliteOperationBackend(options) {
|
|
|
412
437
|
const rows = await execAll(query);
|
|
413
438
|
return rows.map((row, index) => ({
|
|
414
439
|
nodeId: row.node_id,
|
|
415
|
-
score:
|
|
440
|
+
score: chunkJJRCLAUN_cjs.coerceNumericScore(row.score),
|
|
416
441
|
rank: index + 1,
|
|
417
442
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
418
443
|
}));
|
|
@@ -431,13 +456,13 @@ function createSqliteOperationBackend(options) {
|
|
|
431
456
|
return operationBackend;
|
|
432
457
|
}
|
|
433
458
|
function createSqliteBackend(db, options = {}) {
|
|
434
|
-
const tables2 = options.tables ??
|
|
435
|
-
const fulltextStrategy = options.fulltext ??
|
|
459
|
+
const tables2 = options.tables ?? chunkWVC2Q2FD_cjs.tables;
|
|
460
|
+
const fulltextStrategy = options.fulltext ?? chunk2JXB3NYJ_cjs.fts5Strategy;
|
|
436
461
|
const profileHints = options.executionProfile ?? {};
|
|
437
462
|
const executionAdapter = createSqliteExecutionAdapter(db, { profileHints });
|
|
438
463
|
const { isSync, transactionMode } = executionAdapter.profile;
|
|
439
464
|
const vectorStrategy = options.vector;
|
|
440
|
-
const vectorSlotLatch = vectorStrategy === void 0 ? void 0 :
|
|
465
|
+
const vectorSlotLatch = vectorStrategy === void 0 ? void 0 : chunkUJLOZYKT_cjs.createVectorSlotLatch();
|
|
441
466
|
const capabilities = {
|
|
442
467
|
...buildSqliteCapabilities({
|
|
443
468
|
fulltextStrategy,
|
|
@@ -449,14 +474,17 @@ function createSqliteBackend(db, options = {}) {
|
|
|
449
474
|
const tableNames = {
|
|
450
475
|
nodes: drizzleOrm.getTableName(tables2.nodes),
|
|
451
476
|
edges: drizzleOrm.getTableName(tables2.edges),
|
|
477
|
+
recordedNodes: drizzleOrm.getTableName(tables2.recordedNodes),
|
|
478
|
+
recordedEdges: drizzleOrm.getTableName(tables2.recordedEdges),
|
|
479
|
+
recordedClock: drizzleOrm.getTableName(tables2.recordedClock),
|
|
452
480
|
fulltext: tables2.fulltextTableName,
|
|
453
481
|
uniques: drizzleOrm.getTableName(tables2.uniques)
|
|
454
482
|
};
|
|
455
|
-
const operationStrategy =
|
|
483
|
+
const operationStrategy = chunkUJLOZYKT_cjs.createSqliteOperationStrategy(
|
|
456
484
|
tables2,
|
|
457
485
|
fulltextStrategy
|
|
458
486
|
);
|
|
459
|
-
const serializedQueue =
|
|
487
|
+
const serializedQueue = transactionMode === "none" ? void 0 : createSerializedExecutionQueue();
|
|
460
488
|
const operations = createSqliteOperationBackend({
|
|
461
489
|
capabilities,
|
|
462
490
|
db,
|
|
@@ -494,17 +522,17 @@ function createSqliteBackend(db, options = {}) {
|
|
|
494
522
|
db,
|
|
495
523
|
executionAdapter,
|
|
496
524
|
operationStrategy,
|
|
497
|
-
profileHints: { isSync
|
|
525
|
+
profileHints: { isSync },
|
|
498
526
|
tableNames,
|
|
499
527
|
fulltextStrategy,
|
|
500
528
|
vectorStrategy});
|
|
501
|
-
db.run(drizzleOrm.sql`BEGIN IMMEDIATE`);
|
|
529
|
+
await db.run(drizzleOrm.sql`BEGIN IMMEDIATE`);
|
|
502
530
|
try {
|
|
503
531
|
const result = await fn(txBackend);
|
|
504
|
-
db.run(drizzleOrm.sql`COMMIT`);
|
|
532
|
+
await db.run(drizzleOrm.sql`COMMIT`);
|
|
505
533
|
return result;
|
|
506
534
|
} catch (error) {
|
|
507
|
-
db.run(drizzleOrm.sql`ROLLBACK`);
|
|
535
|
+
await db.run(drizzleOrm.sql`ROLLBACK`);
|
|
508
536
|
throw error;
|
|
509
537
|
}
|
|
510
538
|
});
|
|
@@ -542,7 +570,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
542
570
|
}
|
|
543
571
|
const matTable = tables2.contributionMaterializations;
|
|
544
572
|
async function ensureContributionMaterializationsTableImpl() {
|
|
545
|
-
await db.run(drizzleOrm.sql.raw(
|
|
573
|
+
await db.run(drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(matTable)));
|
|
546
574
|
}
|
|
547
575
|
async function getContributionMaterializationRow(identity) {
|
|
548
576
|
const rows = await db.select().from(matTable).where(
|
|
@@ -555,16 +583,16 @@ function createSqliteBackend(db, options = {}) {
|
|
|
555
583
|
);
|
|
556
584
|
const row = rows[0];
|
|
557
585
|
if (row === void 0) return void 0;
|
|
558
|
-
return
|
|
586
|
+
return chunkUJLOZYKT_cjs.mapContributionMaterializationRow(
|
|
559
587
|
row,
|
|
560
|
-
|
|
588
|
+
chunkUJLOZYKT_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
561
589
|
);
|
|
562
590
|
}
|
|
563
591
|
async function recordContributionMaterializationRow(params) {
|
|
564
592
|
await db.insert(matTable).values(
|
|
565
|
-
|
|
593
|
+
chunkUJLOZYKT_cjs.buildContributionInsertValues(
|
|
566
594
|
params,
|
|
567
|
-
|
|
595
|
+
chunkUJLOZYKT_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
568
596
|
)
|
|
569
597
|
).onConflictDoUpdate({
|
|
570
598
|
target: [
|
|
@@ -573,13 +601,13 @@ function createSqliteBackend(db, options = {}) {
|
|
|
573
601
|
matTable.owner,
|
|
574
602
|
matTable.tableName
|
|
575
603
|
],
|
|
576
|
-
set:
|
|
604
|
+
set: chunkUJLOZYKT_cjs.buildContributionOnConflictSet(
|
|
577
605
|
matTable.materializedAt,
|
|
578
606
|
params.materializedAt
|
|
579
607
|
)
|
|
580
608
|
});
|
|
581
609
|
}
|
|
582
|
-
const contributionMaterializer =
|
|
610
|
+
const contributionMaterializer = chunkUJLOZYKT_cjs.createContributionMaterializer({
|
|
583
611
|
dialect: "sqlite",
|
|
584
612
|
fulltextStrategy,
|
|
585
613
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -599,12 +627,12 @@ function createSqliteBackend(db, options = {}) {
|
|
|
599
627
|
tableNames,
|
|
600
628
|
fulltextStrategy,
|
|
601
629
|
vectorStrategy});
|
|
602
|
-
return
|
|
630
|
+
return chunkUJLOZYKT_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
|
|
603
631
|
}
|
|
604
632
|
const backend = {
|
|
605
633
|
...operations,
|
|
606
634
|
async bootstrapTables() {
|
|
607
|
-
const statements =
|
|
635
|
+
const statements = chunkUJLOZYKT_cjs.generateSqliteDDL(tables2, fulltextStrategy);
|
|
608
636
|
for (const statement of statements) {
|
|
609
637
|
await db.run(drizzleOrm.sql.raw(statement));
|
|
610
638
|
}
|
|
@@ -614,7 +642,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
614
642
|
// uninitialized database throws `StoreNotInitializedError` rather
|
|
615
643
|
// than self-healing (#135). Shared verbatim with the tx-scoped gate
|
|
616
644
|
// via `gateFulltextMethods`.
|
|
617
|
-
...
|
|
645
|
+
...chunkUJLOZYKT_cjs.gateFulltextMethods(
|
|
618
646
|
operations,
|
|
619
647
|
contributionMaterializer.assertInitialized
|
|
620
648
|
),
|
|
@@ -623,7 +651,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
623
651
|
},
|
|
624
652
|
async ensureIndexMaterializationsTable() {
|
|
625
653
|
await db.run(
|
|
626
|
-
drizzleOrm.sql.raw(
|
|
654
|
+
drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
|
|
627
655
|
);
|
|
628
656
|
},
|
|
629
657
|
async getIndexMaterialization(indexName) {
|
|
@@ -631,26 +659,26 @@ function createSqliteBackend(db, options = {}) {
|
|
|
631
659
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
632
660
|
const row = rows[0];
|
|
633
661
|
if (row === void 0) return void 0;
|
|
634
|
-
return
|
|
662
|
+
return chunkUJLOZYKT_cjs.mapMaterializationRow(row, chunkUJLOZYKT_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
|
|
635
663
|
},
|
|
636
664
|
async getIndexMaterializations(statusKeys) {
|
|
637
665
|
if (statusKeys.length === 0) return [];
|
|
638
666
|
const t = tables2.indexMaterializations;
|
|
639
667
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
640
668
|
return rows.map(
|
|
641
|
-
(row) =>
|
|
669
|
+
(row) => chunkUJLOZYKT_cjs.mapMaterializationRow(row, chunkUJLOZYKT_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
|
|
642
670
|
);
|
|
643
671
|
},
|
|
644
672
|
async recordIndexMaterialization(params) {
|
|
645
673
|
const t = tables2.indexMaterializations;
|
|
646
674
|
await db.insert(t).values(
|
|
647
|
-
|
|
675
|
+
chunkUJLOZYKT_cjs.buildMaterializationInsertValues(
|
|
648
676
|
params,
|
|
649
|
-
|
|
677
|
+
chunkUJLOZYKT_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
|
|
650
678
|
)
|
|
651
679
|
).onConflictDoUpdate({
|
|
652
680
|
target: t.indexName,
|
|
653
|
-
set:
|
|
681
|
+
set: chunkUJLOZYKT_cjs.buildMaterializationOnConflictSet(
|
|
654
682
|
t.materializedAt,
|
|
655
683
|
params.materializedAt
|
|
656
684
|
)
|
|
@@ -669,37 +697,37 @@ function createSqliteBackend(db, options = {}) {
|
|
|
669
697
|
await contributionMaterializer.assertInitialized(graphId);
|
|
670
698
|
},
|
|
671
699
|
async ensureKindRemovalsTable() {
|
|
672
|
-
await db.run(drizzleOrm.sql.raw(
|
|
700
|
+
await db.run(drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
|
|
673
701
|
},
|
|
674
702
|
async getPendingKindRemovals(graphId) {
|
|
675
703
|
const t = tables2.kindRemovals;
|
|
676
704
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
677
705
|
return rows.map(
|
|
678
|
-
(row) =>
|
|
706
|
+
(row) => chunkUJLOZYKT_cjs.mapKindRemovalRow(row, chunkUJLOZYKT_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
679
707
|
);
|
|
680
708
|
},
|
|
681
709
|
async getAllKindRemovals(graphId) {
|
|
682
710
|
const t = tables2.kindRemovals;
|
|
683
711
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
684
712
|
return rows.map(
|
|
685
|
-
(row) =>
|
|
713
|
+
(row) => chunkUJLOZYKT_cjs.mapKindRemovalRow(row, chunkUJLOZYKT_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
686
714
|
);
|
|
687
715
|
},
|
|
688
716
|
async recordKindRemoval(params) {
|
|
689
717
|
const t = tables2.kindRemovals;
|
|
690
718
|
await db.insert(t).values(
|
|
691
|
-
|
|
719
|
+
chunkUJLOZYKT_cjs.buildKindRemovalInsertValues(
|
|
692
720
|
params,
|
|
693
|
-
|
|
721
|
+
chunkUJLOZYKT_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
|
|
694
722
|
)
|
|
695
723
|
).onConflictDoUpdate({
|
|
696
724
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
697
|
-
set:
|
|
725
|
+
set: chunkUJLOZYKT_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
698
726
|
});
|
|
699
727
|
},
|
|
700
728
|
async ensureReconciliationMarkersTable() {
|
|
701
729
|
await db.run(
|
|
702
|
-
drizzleOrm.sql.raw(
|
|
730
|
+
drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
|
|
703
731
|
);
|
|
704
732
|
},
|
|
705
733
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -751,23 +779,23 @@ function createSqliteBackend(db, options = {}) {
|
|
|
751
779
|
db,
|
|
752
780
|
executionAdapter,
|
|
753
781
|
operationStrategy,
|
|
754
|
-
profileHints: { isSync
|
|
782
|
+
profileHints: { isSync },
|
|
755
783
|
tableNames,
|
|
756
784
|
fulltextStrategy,
|
|
757
785
|
vectorStrategy});
|
|
758
|
-
db.run(drizzleOrm.sql`BEGIN`);
|
|
786
|
+
await db.run(drizzleOrm.sql`BEGIN IMMEDIATE`);
|
|
759
787
|
try {
|
|
760
788
|
const result = await fn(
|
|
761
|
-
|
|
789
|
+
chunkUJLOZYKT_cjs.gateFulltext(
|
|
762
790
|
txBackend,
|
|
763
791
|
contributionMaterializer.assertInitialized
|
|
764
792
|
),
|
|
765
793
|
db
|
|
766
794
|
);
|
|
767
|
-
db.run(drizzleOrm.sql`COMMIT`);
|
|
795
|
+
await db.run(drizzleOrm.sql`COMMIT`);
|
|
768
796
|
return result;
|
|
769
797
|
} catch (error) {
|
|
770
|
-
db.run(drizzleOrm.sql`ROLLBACK`);
|
|
798
|
+
await db.run(drizzleOrm.sql`ROLLBACK`);
|
|
771
799
|
throw error;
|
|
772
800
|
}
|
|
773
801
|
});
|
|
@@ -779,9 +807,9 @@ function createSqliteBackend(db, options = {}) {
|
|
|
779
807
|
}
|
|
780
808
|
return runWithSerializedQueue(
|
|
781
809
|
serializedQueue,
|
|
782
|
-
async () => db.transaction(
|
|
783
|
-
|
|
784
|
-
)
|
|
810
|
+
async () => db.transaction(async (tx) => fn(bindTransactionBackend(tx), tx), {
|
|
811
|
+
behavior: "immediate"
|
|
812
|
+
})
|
|
785
813
|
);
|
|
786
814
|
},
|
|
787
815
|
adoptTransaction(externalTx) {
|
|
@@ -790,7 +818,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
790
818
|
"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)."
|
|
791
819
|
);
|
|
792
820
|
}
|
|
793
|
-
|
|
821
|
+
chunkUJLOZYKT_cjs.assertAdoptedDialect(
|
|
794
822
|
externalTx,
|
|
795
823
|
sqliteCore.BaseSQLiteDatabase,
|
|
796
824
|
"sqlite"
|
|
@@ -816,10 +844,10 @@ function createTransactionBackend(options) {
|
|
|
816
844
|
tableNames: options.tableNames,
|
|
817
845
|
fulltextStrategy: options.fulltextStrategy,
|
|
818
846
|
vectorStrategy: options.vectorStrategy,
|
|
819
|
-
...options.vectorStrategy === void 0 ? {} : { vectorSlotLatch:
|
|
847
|
+
...options.vectorStrategy === void 0 ? {} : { vectorSlotLatch: chunkUJLOZYKT_cjs.createVectorSlotLatch() }
|
|
820
848
|
});
|
|
821
849
|
}
|
|
822
850
|
|
|
823
851
|
exports.createSqliteBackend = createSqliteBackend;
|
|
824
|
-
//# sourceMappingURL=chunk-
|
|
825
|
-
//# sourceMappingURL=chunk-
|
|
852
|
+
//# sourceMappingURL=chunk-ZP5WHI4C.cjs.map
|
|
853
|
+
//# sourceMappingURL=chunk-ZP5WHI4C.cjs.map
|