@nicia-ai/typegraph 0.34.0 → 0.35.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/dist/backend/postgres/index.cjs +29 -29
- package/dist/backend/postgres/index.d.cts +39 -7
- package/dist/backend/postgres/index.d.ts +39 -7
- package/dist/backend/postgres/index.js +16 -16
- package/dist/backend/postgres/pglite.cjs +21 -21
- package/dist/backend/postgres/pglite.d.cts +4 -4
- package/dist/backend/postgres/pglite.d.ts +4 -4
- package/dist/backend/postgres/pglite.js +16 -16
- package/dist/backend/sqlite/index.cjs +25 -26
- package/dist/backend/sqlite/index.d.cts +8 -8
- package/dist/backend/sqlite/index.d.ts +8 -8
- package/dist/backend/sqlite/index.js +13 -14
- package/dist/backend/sqlite/libsql.cjs +19 -19
- package/dist/backend/sqlite/libsql.d.cts +4 -4
- package/dist/backend/sqlite/libsql.d.ts +4 -4
- package/dist/backend/sqlite/libsql.js +15 -15
- package/dist/backend/sqlite/local.cjs +101 -21
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +95 -5
- package/dist/backend/sqlite/local.d.ts +95 -5
- package/dist/backend/sqlite/local.js +95 -16
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-ZV5N4DBG.js → chunk-3TWF3SH4.js} +300 -58
- package/dist/chunk-3TWF3SH4.js.map +1 -0
- package/dist/chunk-4JEZZJ6S.cjs +1271 -0
- package/dist/chunk-4JEZZJ6S.cjs.map +1 -0
- package/dist/{chunk-UNNPKQUG.cjs → chunk-4TOD4LBZ.cjs} +246 -155
- package/dist/chunk-4TOD4LBZ.cjs.map +1 -0
- package/dist/{chunk-QV245VMN.js → chunk-55MZDDZV.js} +100 -6
- package/dist/chunk-55MZDDZV.js.map +1 -0
- package/dist/{chunk-GQANNXXT.cjs → chunk-5A6FNS6N.cjs} +75 -20
- package/dist/chunk-5A6FNS6N.cjs.map +1 -0
- package/dist/{chunk-3Z6TW3CT.cjs → chunk-5AQIKK56.cjs} +65 -25
- package/dist/chunk-5AQIKK56.cjs.map +1 -0
- package/dist/{chunk-BVTWD66D.js → chunk-5SEGFTZX.js} +3 -3
- package/dist/{chunk-BVTWD66D.js.map → chunk-5SEGFTZX.js.map} +1 -1
- package/dist/{chunk-6GNSY7AV.js → chunk-6FR2MMS6.js} +7 -7
- package/dist/chunk-6FR2MMS6.js.map +1 -0
- package/dist/chunk-7YSP4V4R.cjs +69 -0
- package/dist/chunk-7YSP4V4R.cjs.map +1 -0
- package/dist/chunk-A42GCBGX.cjs +28 -0
- package/dist/chunk-A42GCBGX.cjs.map +1 -0
- package/dist/{chunk-RHZWOJVA.cjs → chunk-BLZDPRXT.cjs} +52 -4
- package/dist/chunk-BLZDPRXT.cjs.map +1 -0
- package/dist/chunk-BYPOGQWK.js +25 -0
- package/dist/chunk-BYPOGQWK.js.map +1 -0
- package/dist/{chunk-6HVOHZHS.cjs → chunk-CK5BVQOW.cjs} +213 -168
- package/dist/chunk-CK5BVQOW.cjs.map +1 -0
- package/dist/{chunk-JJRCLAUN.cjs → chunk-CTTSDJLY.cjs} +116 -10
- package/dist/chunk-CTTSDJLY.cjs.map +1 -0
- package/dist/chunk-CUHM5CWJ.cjs +12 -0
- package/dist/chunk-CUHM5CWJ.cjs.map +1 -0
- package/dist/{chunk-A7SZZFAG.js → chunk-CZQ3FO2Q.js} +409 -99
- package/dist/chunk-CZQ3FO2Q.js.map +1 -0
- package/dist/{chunk-2JXB3NYJ.cjs → chunk-D7ZEOS56.cjs} +25 -32
- package/dist/chunk-D7ZEOS56.cjs.map +1 -0
- package/dist/chunk-DFVLCOP6.js +10 -0
- package/dist/chunk-DFVLCOP6.js.map +1 -0
- package/dist/{chunk-UJLOZYKT.cjs → chunk-EM3CWPND.cjs} +441 -115
- package/dist/chunk-EM3CWPND.cjs.map +1 -0
- package/dist/chunk-EMF62TZG.cjs +1176 -0
- package/dist/chunk-EMF62TZG.cjs.map +1 -0
- package/dist/chunk-EOLERH7Y.cjs +40 -0
- package/dist/chunk-EOLERH7Y.cjs.map +1 -0
- package/dist/{chunk-TGJE22RM.cjs → chunk-FACJJWGF.cjs} +24 -6
- package/dist/chunk-FACJJWGF.cjs.map +1 -0
- package/dist/{chunk-HK5SATYM.cjs → chunk-FL472AMI.cjs} +16 -109
- package/dist/chunk-FL472AMI.cjs.map +1 -0
- package/dist/{chunk-WVC2Q2FD.cjs → chunk-FN35DLCN.cjs} +31 -9
- package/dist/chunk-FN35DLCN.cjs.map +1 -0
- package/dist/{chunk-KUTNI6SI.js → chunk-FPIZFYHE.js} +10 -18
- package/dist/chunk-FPIZFYHE.js.map +1 -0
- package/dist/{chunk-VCGO4V26.js → chunk-FRV5Q5IO.js} +64 -9
- package/dist/chunk-FRV5Q5IO.js.map +1 -0
- package/dist/{chunk-K5P5OZXS.js → chunk-G6Q5UM7U.js} +2 -2
- package/dist/{chunk-K5P5OZXS.js.map → chunk-G6Q5UM7U.js.map} +1 -1
- package/dist/chunk-GSQ6NPH6.cjs +100 -0
- package/dist/chunk-GSQ6NPH6.cjs.map +1 -0
- package/dist/chunk-GUR2FNB5.cjs +12 -0
- package/dist/{chunk-HMFK4BXR.cjs.map → chunk-GUR2FNB5.cjs.map} +1 -1
- package/dist/{chunk-JQGIPGVL.cjs → chunk-H7YNSMA7.cjs} +43 -2
- package/dist/chunk-H7YNSMA7.cjs.map +1 -0
- package/dist/{chunk-2MRAX3UE.js → chunk-I7ZUZKFD.js} +47 -4
- package/dist/chunk-I7ZUZKFD.js.map +1 -0
- package/dist/{chunk-3BRVBQQD.cjs → chunk-J7WFGBJR.cjs} +2445 -2367
- package/dist/chunk-J7WFGBJR.cjs.map +1 -0
- package/dist/{chunk-V3QNTB7Z.js → chunk-JBTOYDMN.js} +194 -114
- package/dist/chunk-JBTOYDMN.js.map +1 -0
- package/dist/{chunk-K2TGS3EN.js → chunk-K3PPLHY7.js} +138 -89
- package/dist/chunk-K3PPLHY7.js.map +1 -0
- package/dist/{chunk-Z5XBMDXU.js → chunk-KBGQIPRQ.js} +42 -3
- package/dist/chunk-KBGQIPRQ.js.map +1 -0
- package/dist/chunk-KMI7LYAF.js +1252 -0
- package/dist/chunk-KMI7LYAF.js.map +1 -0
- package/dist/{chunk-JIEJCTDS.cjs → chunk-LGEALRC6.cjs} +21 -4
- package/dist/chunk-LGEALRC6.cjs.map +1 -0
- package/dist/{chunk-TQOYM4LN.js → chunk-MP2JQKSG.js} +21 -5
- package/dist/chunk-MP2JQKSG.js.map +1 -0
- package/dist/{chunk-ZP5WHI4C.cjs → chunk-O7UN7OXA.cjs} +358 -116
- package/dist/chunk-O7UN7OXA.cjs.map +1 -0
- package/dist/chunk-OHMP6N2J.js +47 -0
- package/dist/chunk-OHMP6N2J.js.map +1 -0
- package/dist/{chunk-4DIBPQNJ.js → chunk-OR5ZA5WP.js} +135 -25
- package/dist/chunk-OR5ZA5WP.js.map +1 -0
- package/dist/{chunk-DEQFL35G.js → chunk-Q5TEXCTB.js} +61 -7
- package/dist/chunk-Q5TEXCTB.js.map +1 -0
- package/dist/chunk-QNKSQTKQ.js +1312 -0
- package/dist/chunk-QNKSQTKQ.js.map +1 -0
- package/dist/{chunk-ZURTTSCM.js → chunk-QOTI55H7.js} +6 -94
- package/dist/chunk-QOTI55H7.js.map +1 -0
- package/dist/{chunk-CHXTTSC6.js → chunk-QWEUYILR.js} +104 -5
- package/dist/chunk-QWEUYILR.js.map +1 -0
- package/dist/{chunk-LANHCOXB.js → chunk-RGP33ZJ5.js} +485 -83
- package/dist/chunk-RGP33ZJ5.js.map +1 -0
- package/dist/chunk-RGPG7EOJ.js +94 -0
- package/dist/chunk-RGPG7EOJ.js.map +1 -0
- package/dist/{chunk-G6SOJEDI.cjs → chunk-S55OV6PW.cjs} +15 -15
- package/dist/chunk-S55OV6PW.cjs.map +1 -0
- package/dist/{chunk-3E7SNSIA.cjs → chunk-SJDMVITW.cjs} +4 -4
- package/dist/{chunk-3E7SNSIA.cjs.map → chunk-SJDMVITW.cjs.map} +1 -1
- package/dist/{chunk-XLUNB2TZ.js → chunk-SNXVDZAJ.js} +3 -3
- package/dist/{chunk-XLUNB2TZ.js.map → chunk-SNXVDZAJ.js.map} +1 -1
- package/dist/{chunk-RBV7YCQD.js → chunk-T2WUSPDA.js} +49 -9
- package/dist/chunk-T2WUSPDA.js.map +1 -0
- package/dist/{chunk-KGC4LY5T.cjs → chunk-TCOCYN2P.cjs} +75 -21
- package/dist/chunk-TCOCYN2P.cjs.map +1 -0
- package/dist/{chunk-FLRCVI2G.cjs → chunk-TDXIBCGY.cjs} +2 -2
- package/dist/{chunk-FLRCVI2G.cjs.map → chunk-TDXIBCGY.cjs.map} +1 -1
- package/dist/{chunk-ZY4GXIVN.cjs → chunk-TEDRJXOG.cjs} +5 -5
- package/dist/{chunk-ZY4GXIVN.cjs.map → chunk-TEDRJXOG.cjs.map} +1 -1
- package/dist/{chunk-WLRIWYHQ.js → chunk-UES55P7G.js} +1863 -1785
- package/dist/chunk-UES55P7G.js.map +1 -0
- package/dist/{chunk-WL2SG7ZV.cjs → chunk-UMDVATGY.cjs} +6 -6
- package/dist/{chunk-WL2SG7ZV.cjs.map → chunk-UMDVATGY.cjs.map} +1 -1
- package/dist/chunk-UT3S4SEN.js +31 -0
- package/dist/chunk-UT3S4SEN.js.map +1 -0
- package/dist/{chunk-RRKQAKD6.cjs → chunk-UUT7UN2N.cjs} +149 -39
- package/dist/chunk-UUT7UN2N.cjs.map +1 -0
- package/dist/{chunk-SHLY4MCM.js → chunk-UZV3AZKF.js} +21 -3
- package/dist/chunk-UZV3AZKF.js.map +1 -0
- package/dist/{chunk-CYX2JTDG.js → chunk-VHMPG6UL.js} +29 -7
- package/dist/chunk-VHMPG6UL.js.map +1 -0
- package/dist/{chunk-T6SPUYLX.cjs → chunk-VPYHY3LJ.cjs} +116 -10
- package/dist/chunk-VPYHY3LJ.cjs.map +1 -0
- package/dist/{chunk-T46GR2VY.js → chunk-VSPCZAXF.js} +3 -3
- package/dist/{chunk-T46GR2VY.js.map → chunk-VSPCZAXF.js.map} +1 -1
- package/dist/{chunk-K34OPSJK.js → chunk-W63OVYY4.js} +3 -3
- package/dist/{chunk-K34OPSJK.js.map → chunk-W63OVYY4.js.map} +1 -1
- package/dist/{chunk-RY2VIWAM.js → chunk-WDBCBWC4.js} +355 -32
- package/dist/chunk-WDBCBWC4.js.map +1 -0
- package/dist/chunk-WJT7OU7E.cjs +1334 -0
- package/dist/chunk-WJT7OU7E.cjs.map +1 -0
- package/dist/{chunk-5IQIX7LU.cjs → chunk-XOX22WHL.cjs} +476 -163
- package/dist/chunk-XOX22WHL.cjs.map +1 -0
- package/dist/{ddl-BrmPg61z.d.ts → ddl-C2rZ-Aen.d.ts} +4 -4
- package/dist/{ddl-j1-sH6lE.d.cts → ddl-CZz7a0E8.d.cts} +4 -4
- package/dist/{extension-types-YGFJPrzK.d.cts → extension-types-ixRpJVUp.d.cts} +24 -1
- package/dist/{extension-types-YGFJPrzK.d.ts → extension-types-ixRpJVUp.d.ts} +24 -1
- package/dist/{types-DkNnF-7K.d.cts → fulltext-strategy-B57yvC5Q.d.ts} +2562 -2133
- package/dist/{types-D1Sqeyxy.d.ts → fulltext-strategy-CDkSSYhq.d.cts} +2562 -2133
- package/dist/graph-extension/index.cjs +20 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +5 -4
- package/dist/graph-merge/index.cjs +255 -164
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +63 -33
- package/dist/graph-merge/index.d.ts +63 -33
- package/dist/graph-merge/index.js +135 -44
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-DGX6D9j1.d.ts → index-6CSUAq-x.d.ts} +234 -93
- package/dist/{index-SEvUHDA6.d.cts → index-Bks_3HHK.d.cts} +234 -93
- package/dist/index.cjs +208 -188
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +33 -33
- package/dist/indexes/index.cjs +19 -20
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +10 -11
- package/dist/interchange/index.cjs +47 -26
- package/dist/interchange/index.d.cts +126 -12
- package/dist/interchange/index.d.ts +126 -12
- package/dist/interchange/index.js +14 -13
- package/dist/{manager-ms9cKdc6.d.cts → manager-DwQi8eV0.d.cts} +9 -2
- package/dist/{manager-BZUeN_BU.d.ts → manager-ejUCB52T.d.ts} +9 -2
- package/dist/{materialize-indexes-D20xNluI.d.cts → materialize-indexes-B4e9360H.d.cts} +20 -4
- package/dist/{materialize-indexes-CAkIYFV-.d.ts → materialize-indexes-te9TPMMJ.d.ts} +20 -4
- package/dist/{postgres-BhpxGMC5.d.cts → postgres-CfEqsRMp.d.cts} +152 -1
- package/dist/{postgres-CWHLwNl1.d.ts → postgres-DQ5R6rzV.d.ts} +152 -1
- package/dist/profiler/index.cjs +11 -11
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +4 -4
- package/dist/provenance/index.cjs +40 -41
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +5 -5
- package/dist/provenance/index.d.ts +5 -5
- package/dist/provenance/index.js +11 -12
- package/dist/provenance/index.js.map +1 -1
- package/dist/schema/index.cjs +53 -40
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +57 -57
- package/dist/schema/index.d.ts +57 -57
- package/dist/schema/index.js +28 -15
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-XrDxNaa7.d.cts → sqlite-D7zBinNR.d.cts} +92 -1
- package/dist/{sqlite-CGu5SLsw.d.ts → sqlite-DvQndLky.d.ts} +92 -1
- package/dist/{store-view-D09po4H6.d.cts → store-view-BSpqvAxK.d.cts} +415 -44
- package/dist/{store-view-BlgnhEYf.d.ts → store-view-CKbHFRnn.d.ts} +415 -44
- package/dist/{types-DiE1AO7p.d.cts → types-Bv9DcS_E.d.cts} +2 -2
- package/dist/{types-B1TbZJYS.d.ts → types-CoxuV7EJ.d.ts} +2 -2
- package/dist/{where-DKjuofPr.d.cts → where-7RKFOsXt.d.ts} +2 -2
- package/dist/{where-DrUIIWHb.d.ts → where-DdMIXOtH.d.cts} +2 -2
- package/package.json +14 -13
- package/dist/chunk-2EBMPJBO.js +0 -16
- package/dist/chunk-2EBMPJBO.js.map +0 -1
- package/dist/chunk-2JXB3NYJ.cjs.map +0 -1
- package/dist/chunk-2MRAX3UE.js.map +0 -1
- package/dist/chunk-3BRVBQQD.cjs.map +0 -1
- package/dist/chunk-3EUKJEQ3.js +0 -77
- package/dist/chunk-3EUKJEQ3.js.map +0 -1
- package/dist/chunk-3Z6TW3CT.cjs.map +0 -1
- package/dist/chunk-4DIBPQNJ.js.map +0 -1
- package/dist/chunk-4S2FXGBJ.js +0 -9
- package/dist/chunk-4S2FXGBJ.js.map +0 -1
- package/dist/chunk-5IQIX7LU.cjs.map +0 -1
- package/dist/chunk-6GNSY7AV.js.map +0 -1
- package/dist/chunk-6HVOHZHS.cjs.map +0 -1
- package/dist/chunk-6SCVW4AS.js +0 -20
- package/dist/chunk-6SCVW4AS.js.map +0 -1
- package/dist/chunk-A7SZZFAG.js.map +0 -1
- package/dist/chunk-CHXTTSC6.js.map +0 -1
- package/dist/chunk-CYX2JTDG.js.map +0 -1
- package/dist/chunk-DEQFL35G.js.map +0 -1
- package/dist/chunk-G6SOJEDI.cjs.map +0 -1
- package/dist/chunk-GQANNXXT.cjs.map +0 -1
- package/dist/chunk-GZCNZ7QW.js +0 -24
- package/dist/chunk-GZCNZ7QW.js.map +0 -1
- package/dist/chunk-HK5SATYM.cjs.map +0 -1
- package/dist/chunk-HMFK4BXR.cjs +0 -12
- package/dist/chunk-HTGDWIDE.cjs +0 -89
- package/dist/chunk-HTGDWIDE.cjs.map +0 -1
- package/dist/chunk-JIEJCTDS.cjs.map +0 -1
- package/dist/chunk-JJRCLAUN.cjs.map +0 -1
- package/dist/chunk-JQGIPGVL.cjs.map +0 -1
- package/dist/chunk-K2TGS3EN.js.map +0 -1
- package/dist/chunk-KGC4LY5T.cjs.map +0 -1
- package/dist/chunk-KNHYNQQ3.cjs +0 -663
- package/dist/chunk-KNHYNQQ3.cjs.map +0 -1
- package/dist/chunk-KUTNI6SI.js.map +0 -1
- package/dist/chunk-LANHCOXB.js.map +0 -1
- package/dist/chunk-N6WTUSBV.cjs +0 -23
- package/dist/chunk-N6WTUSBV.cjs.map +0 -1
- package/dist/chunk-NAUA4PW5.cjs +0 -28
- package/dist/chunk-NAUA4PW5.cjs.map +0 -1
- package/dist/chunk-QV245VMN.js.map +0 -1
- package/dist/chunk-RBV7YCQD.js.map +0 -1
- package/dist/chunk-RHZWOJVA.cjs.map +0 -1
- package/dist/chunk-RRKQAKD6.cjs.map +0 -1
- package/dist/chunk-RY2VIWAM.js.map +0 -1
- package/dist/chunk-SHLY4MCM.js.map +0 -1
- package/dist/chunk-T2DWPQNE.js +0 -649
- package/dist/chunk-T2DWPQNE.js.map +0 -1
- package/dist/chunk-T6SPUYLX.cjs.map +0 -1
- package/dist/chunk-TGJE22RM.cjs.map +0 -1
- package/dist/chunk-TOTPVGOG.cjs +0 -774
- package/dist/chunk-TOTPVGOG.cjs.map +0 -1
- package/dist/chunk-TQOYM4LN.js.map +0 -1
- package/dist/chunk-UJLOZYKT.cjs.map +0 -1
- package/dist/chunk-UNNPKQUG.cjs.map +0 -1
- package/dist/chunk-V3QNTB7Z.js.map +0 -1
- package/dist/chunk-VCGO4V26.js.map +0 -1
- package/dist/chunk-WLRIWYHQ.js.map +0 -1
- package/dist/chunk-WVC2Q2FD.cjs.map +0 -1
- package/dist/chunk-XXVEULWX.js +0 -39
- package/dist/chunk-XXVEULWX.js.map +0 -1
- package/dist/chunk-YAZE7QZR.cjs +0 -32
- package/dist/chunk-YAZE7QZR.cjs.map +0 -1
- package/dist/chunk-YC6PWTHY.cjs +0 -44
- package/dist/chunk-YC6PWTHY.cjs.map +0 -1
- package/dist/chunk-Z5HBYM7U.cjs +0 -11
- package/dist/chunk-Z5HBYM7U.cjs.map +0 -1
- package/dist/chunk-Z5XBMDXU.js.map +0 -1
- package/dist/chunk-ZP5WHI4C.cjs.map +0 -1
- package/dist/chunk-ZURTTSCM.js.map +0 -1
- package/dist/chunk-ZV5N4DBG.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createVectorSlotLatch, createSqliteOperationStrategy, createContributionMaterializer, gateFulltextMethods, generateSqliteCreateTableSQL, mapContributionMaterializationRow, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, assertAdoptedDialect, buildKindRemovalInsertValues, SQLITE_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, SQLITE_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, generateSqliteDDL, createCommonOperationBackend, gateFulltext, compileQueryWithDialect, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams,
|
|
2
|
-
import { tables } from './chunk-
|
|
3
|
-
import { createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-
|
|
4
|
-
import { fts5Strategy, buildVectorCapabilities, buildFulltextCapabilities, assertVectorSearchLimit } from './chunk-
|
|
5
|
-
import { SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS } from './chunk-
|
|
6
|
-
import { isMissingTableError } from './chunk-
|
|
7
|
-
import { ConfigurationError, BackendDisposedError } from './chunk-
|
|
1
|
+
import { createVectorSlotLatch, createSqliteOperationStrategy, createContributionMaterializer, gateFulltextMethods, generateSqliteCreateTableSQL, mapContributionMaterializationRow, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, assertAdoptedDialect, buildKindRemovalInsertValues, SQLITE_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, SQLITE_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, generateSqliteDDL, createCommonOperationBackend, vectorSlotFromParams, hybridCandidatesRef, mapVectorWriteError, mapHybridSearchRow, gateFulltext, compileQueryWithDialect, EMBEDDING_UPSERT_PARAM_COUNT, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, getOrCreateLru } from './chunk-WDBCBWC4.js';
|
|
2
|
+
import { tables } from './chunk-VHMPG6UL.js';
|
|
3
|
+
import { createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, quoteIdentifier, nowIso, coerceNumericScore } from './chunk-55MZDDZV.js';
|
|
4
|
+
import { fts5Strategy, buildVectorCapabilities, buildFulltextCapabilities, assertVectorSearchLimit } from './chunk-FPIZFYHE.js';
|
|
5
|
+
import { SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS, D1_MAX_BIND_PARAMETERS, MODERN_SQLITE_MAX_BIND_PARAMETERS, chunk } from './chunk-JBTOYDMN.js';
|
|
6
|
+
import { isMissingTableError } from './chunk-I7ZUZKFD.js';
|
|
7
|
+
import { ConfigurationError, BackendDisposedError } from './chunk-MP2JQKSG.js';
|
|
8
8
|
import { getTableName, sql, and, eq, isNull, inArray } from 'drizzle-orm';
|
|
9
9
|
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
10
10
|
|
|
@@ -62,6 +62,44 @@ function detectTransactionMode(db, profileHints, isSync) {
|
|
|
62
62
|
if (isSync) return "sql";
|
|
63
63
|
return "drizzle";
|
|
64
64
|
}
|
|
65
|
+
var MAX_VARIABLE_NUMBER_COMPILE_OPTION = /^MAX_VARIABLE_NUMBER=(\d+)$/;
|
|
66
|
+
var FIRST_MODERN_BIND_LIMIT_MAJOR = 3;
|
|
67
|
+
var FIRST_MODERN_BIND_LIMIT_MINOR = 32;
|
|
68
|
+
function parseCompiledMaxVariableNumber(rows) {
|
|
69
|
+
for (const row of rows) {
|
|
70
|
+
if (typeof row !== "object" || row === null) continue;
|
|
71
|
+
const option = row.compile_options;
|
|
72
|
+
if (typeof option !== "string") continue;
|
|
73
|
+
const match = MAX_VARIABLE_NUMBER_COMPILE_OPTION.exec(option);
|
|
74
|
+
if (match !== null) return Number(match[1]);
|
|
75
|
+
}
|
|
76
|
+
return void 0;
|
|
77
|
+
}
|
|
78
|
+
function hasModernBindLimitByVersion(rows) {
|
|
79
|
+
const first = rows[0];
|
|
80
|
+
if (typeof first !== "object" || first === null) return false;
|
|
81
|
+
const version = first.version;
|
|
82
|
+
if (typeof version !== "string") return false;
|
|
83
|
+
const [major = 0, minor = 0] = version.split(".").map(Number);
|
|
84
|
+
if (!Number.isFinite(major) || !Number.isFinite(minor)) return false;
|
|
85
|
+
return major > FIRST_MODERN_BIND_LIMIT_MAJOR || major === FIRST_MODERN_BIND_LIMIT_MAJOR && minor >= FIRST_MODERN_BIND_LIMIT_MINOR;
|
|
86
|
+
}
|
|
87
|
+
function detectMaxBindParameters(db, sqliteClient) {
|
|
88
|
+
if (isD1DatabaseBySessionName(db)) return D1_MAX_BIND_PARAMETERS;
|
|
89
|
+
if (sqliteClient === void 0) return SQLITE_MAX_BIND_PARAMETERS;
|
|
90
|
+
try {
|
|
91
|
+
const compiled = parseCompiledMaxVariableNumber(
|
|
92
|
+
sqliteClient.prepare("PRAGMA compile_options").all()
|
|
93
|
+
);
|
|
94
|
+
if (compiled !== void 0) return compiled;
|
|
95
|
+
const isModern = hasModernBindLimitByVersion(
|
|
96
|
+
sqliteClient.prepare("SELECT sqlite_version() AS version").all()
|
|
97
|
+
);
|
|
98
|
+
return isModern ? MODERN_SQLITE_MAX_BIND_PARAMETERS : SQLITE_MAX_BIND_PARAMETERS;
|
|
99
|
+
} catch {
|
|
100
|
+
return SQLITE_MAX_BIND_PARAMETERS;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
65
103
|
function resolveSqliteClient(db) {
|
|
66
104
|
const databaseWithClient = db;
|
|
67
105
|
const sqliteClient = databaseWithClient.$client;
|
|
@@ -104,6 +142,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
104
142
|
const transactionMode = detectTransactionMode(db, profileHints, isSync);
|
|
105
143
|
const profile = {
|
|
106
144
|
isSync,
|
|
145
|
+
maxBindParameters: detectMaxBindParameters(db, sqliteClient),
|
|
107
146
|
supportsCompiledExecution: sqliteClient !== void 0,
|
|
108
147
|
transactionMode
|
|
109
148
|
};
|
|
@@ -118,6 +157,19 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
118
157
|
);
|
|
119
158
|
const rows = preparedStatement.all(...compiledQuery.params);
|
|
120
159
|
return Promise.resolve(rows);
|
|
160
|
+
}, executeCompiledRun2 = function(compiledQuery) {
|
|
161
|
+
const preparedStatement = getOrCreatePreparedStatement(
|
|
162
|
+
statementCache,
|
|
163
|
+
client,
|
|
164
|
+
compiledQuery.sql,
|
|
165
|
+
statementCacheMax
|
|
166
|
+
);
|
|
167
|
+
if (preparedStatement.run === void 0 || preparedStatement.reader === true) {
|
|
168
|
+
preparedStatement.all(...compiledQuery.params);
|
|
169
|
+
} else {
|
|
170
|
+
preparedStatement.run(...compiledQuery.params);
|
|
171
|
+
}
|
|
172
|
+
return Promise.resolve();
|
|
121
173
|
};
|
|
122
174
|
const client = sqliteClient;
|
|
123
175
|
const statementCache = /* @__PURE__ */ new Map();
|
|
@@ -131,6 +183,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
131
183
|
return executeCompiled2(compiledQuery);
|
|
132
184
|
},
|
|
133
185
|
executeCompiled: executeCompiled2,
|
|
186
|
+
executeCompiledRun: executeCompiledRun2,
|
|
134
187
|
prepare(sqlText) {
|
|
135
188
|
return createPreparedStatementExecutor(
|
|
136
189
|
client,
|
|
@@ -156,27 +209,53 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
|
|
|
156
209
|
// src/backend/drizzle/sqlite.ts
|
|
157
210
|
var NODE_INSERT_PARAM_COUNT = 9;
|
|
158
211
|
var EDGE_INSERT_PARAM_COUNT = 12;
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
Math.floor(SQLITE_MAX_BIND_PARAMETERS / NODE_INSERT_PARAM_COUNT)
|
|
162
|
-
);
|
|
163
|
-
var SQLITE_EDGE_INSERT_BATCH_SIZE = Math.max(
|
|
164
|
-
1,
|
|
165
|
-
Math.floor(SQLITE_MAX_BIND_PARAMETERS / EDGE_INSERT_PARAM_COUNT)
|
|
166
|
-
);
|
|
167
|
-
var SQLITE_GET_NODES_ID_CHUNK_SIZE = Math.max(
|
|
168
|
-
1,
|
|
169
|
-
SQLITE_MAX_BIND_PARAMETERS - 2
|
|
170
|
-
);
|
|
171
|
-
var SQLITE_GET_EDGES_ID_CHUNK_SIZE = Math.max(
|
|
172
|
-
1,
|
|
173
|
-
SQLITE_MAX_BIND_PARAMETERS - 1
|
|
174
|
-
);
|
|
212
|
+
var GET_NODES_FIXED_PARAM_COUNT = 2;
|
|
213
|
+
var GET_EDGES_FIXED_PARAM_COUNT = 1;
|
|
175
214
|
var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
215
|
+
var FULLTEXT_UPSERT_PARAM_COUNT = 6;
|
|
216
|
+
var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
|
|
217
|
+
var UNIQUE_INSERT_PARAM_COUNT = 6;
|
|
218
|
+
var SQLITE_ANALYZE_ROW_LIMIT = 1e3;
|
|
219
|
+
function computeSqliteBatchChunkSizes(maxBindParameters) {
|
|
220
|
+
return {
|
|
221
|
+
checkUniqueBatchChunkSize: Math.max(
|
|
222
|
+
1,
|
|
223
|
+
maxBindParameters - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
|
|
224
|
+
),
|
|
225
|
+
embeddingUpsertBatchSize: Math.max(
|
|
226
|
+
1,
|
|
227
|
+
Math.floor(maxBindParameters / EMBEDDING_UPSERT_PARAM_COUNT)
|
|
228
|
+
),
|
|
229
|
+
fulltextUpsertBatchSize: Math.max(
|
|
230
|
+
1,
|
|
231
|
+
Math.floor(maxBindParameters / FULLTEXT_UPSERT_PARAM_COUNT)
|
|
232
|
+
),
|
|
233
|
+
fulltextDeleteChunkSize: Math.max(
|
|
234
|
+
1,
|
|
235
|
+
maxBindParameters - FULLTEXT_DELETE_FIXED_PARAM_COUNT
|
|
236
|
+
),
|
|
237
|
+
edgeInsertBatchSize: Math.max(
|
|
238
|
+
1,
|
|
239
|
+
Math.floor(maxBindParameters / EDGE_INSERT_PARAM_COUNT)
|
|
240
|
+
),
|
|
241
|
+
getEdgesChunkSize: Math.max(
|
|
242
|
+
1,
|
|
243
|
+
maxBindParameters - GET_EDGES_FIXED_PARAM_COUNT
|
|
244
|
+
),
|
|
245
|
+
getNodesChunkSize: Math.max(
|
|
246
|
+
1,
|
|
247
|
+
maxBindParameters - GET_NODES_FIXED_PARAM_COUNT
|
|
248
|
+
),
|
|
249
|
+
nodeInsertBatchSize: Math.max(
|
|
250
|
+
1,
|
|
251
|
+
Math.floor(maxBindParameters / NODE_INSERT_PARAM_COUNT)
|
|
252
|
+
),
|
|
253
|
+
uniqueInsertBatchSize: Math.max(
|
|
254
|
+
1,
|
|
255
|
+
Math.floor(maxBindParameters / UNIQUE_INSERT_PARAM_COUNT)
|
|
256
|
+
)
|
|
257
|
+
};
|
|
258
|
+
}
|
|
180
259
|
var toNodeRow = createNodeRowMapper(SQLITE_ROW_MAPPER_CONFIG);
|
|
181
260
|
var toEdgeRow = createEdgeRowMapper(SQLITE_ROW_MAPPER_CONFIG);
|
|
182
261
|
var toUniqueRow = createUniqueRowMapper(SQLITE_ROW_MAPPER_CONFIG);
|
|
@@ -259,6 +338,7 @@ function buildSqliteCapabilities(options) {
|
|
|
259
338
|
const base = options.transactionMode === "none" ? { ...SQLITE_CAPABILITIES, transactions: false } : SQLITE_CAPABILITIES;
|
|
260
339
|
return {
|
|
261
340
|
...base,
|
|
341
|
+
maxBindParameters: options.maxBindParameters,
|
|
262
342
|
fulltext: buildFulltextCapabilities(options.fulltextStrategy),
|
|
263
343
|
...options.vectorStrategy === void 0 ? {} : { vector: buildVectorCapabilities(options.vectorStrategy) }
|
|
264
344
|
};
|
|
@@ -275,30 +355,40 @@ function createSqliteOperationBackend(options) {
|
|
|
275
355
|
vectorStrategy,
|
|
276
356
|
vectorSlotLatch
|
|
277
357
|
} = options;
|
|
358
|
+
const compiledExecute = executionAdapter.executeCompiled;
|
|
359
|
+
const compiledRun = executionAdapter.executeCompiledRun;
|
|
278
360
|
function execGet(query) {
|
|
279
361
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
280
|
-
|
|
362
|
+
if (compiledExecute === void 0) {
|
|
363
|
+
const rows2 = await db.all(query);
|
|
364
|
+
return rows2[0];
|
|
365
|
+
}
|
|
366
|
+
const rows = await compiledExecute(executionAdapter.compile(query));
|
|
281
367
|
return rows[0];
|
|
282
368
|
});
|
|
283
369
|
}
|
|
284
370
|
function execAll(query) {
|
|
285
371
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
286
|
-
|
|
372
|
+
if (compiledExecute === void 0) {
|
|
373
|
+
return await db.all(query);
|
|
374
|
+
}
|
|
375
|
+
return [...await compiledExecute(executionAdapter.compile(query))];
|
|
287
376
|
});
|
|
288
377
|
}
|
|
289
378
|
function execRun(query) {
|
|
290
379
|
return runWithSerializedQueue(serializedQueue, async () => {
|
|
291
|
-
|
|
380
|
+
if (compiledRun === void 0) {
|
|
381
|
+
await db.run(query);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
await compiledRun(executionAdapter.compile(query));
|
|
292
385
|
});
|
|
293
386
|
}
|
|
387
|
+
const batchConfig = computeSqliteBatchChunkSizes(
|
|
388
|
+
capabilities.maxBindParameters ?? SQLITE_MAX_BIND_PARAMETERS
|
|
389
|
+
);
|
|
294
390
|
const commonBackend = createCommonOperationBackend({
|
|
295
|
-
batchConfig
|
|
296
|
-
checkUniqueBatchChunkSize: SQLITE_CHECK_UNIQUE_BATCH_CHUNK_SIZE,
|
|
297
|
-
edgeInsertBatchSize: SQLITE_EDGE_INSERT_BATCH_SIZE,
|
|
298
|
-
getEdgesChunkSize: SQLITE_GET_EDGES_ID_CHUNK_SIZE,
|
|
299
|
-
getNodesChunkSize: SQLITE_GET_NODES_ID_CHUNK_SIZE,
|
|
300
|
-
nodeInsertBatchSize: SQLITE_NODE_INSERT_BATCH_SIZE
|
|
301
|
-
},
|
|
391
|
+
batchConfig,
|
|
302
392
|
execution: {
|
|
303
393
|
execAll,
|
|
304
394
|
execGet,
|
|
@@ -341,6 +431,48 @@ function createSqliteOperationBackend(options) {
|
|
|
341
431
|
throw mapVectorWriteError(error, params);
|
|
342
432
|
}
|
|
343
433
|
},
|
|
434
|
+
async upsertEmbeddingBatch(params) {
|
|
435
|
+
if (params.rows.length === 0) return;
|
|
436
|
+
const slot = vectorSlotFromParams(params);
|
|
437
|
+
await ensureVectorSlotStorage(slot);
|
|
438
|
+
const rowsById = new Map(
|
|
439
|
+
params.rows.map((row) => [row.nodeId, row])
|
|
440
|
+
);
|
|
441
|
+
const rows = [...rowsById.values()];
|
|
442
|
+
const timestamp = nowIso();
|
|
443
|
+
try {
|
|
444
|
+
for (const chunk2 of chunk(
|
|
445
|
+
rows,
|
|
446
|
+
batchConfig.embeddingUpsertBatchSize
|
|
447
|
+
)) {
|
|
448
|
+
const statements = vectorStrategy.buildUpsertBatch === void 0 ? chunk2.flatMap(
|
|
449
|
+
(row) => vectorStrategy.buildUpsert(
|
|
450
|
+
slot,
|
|
451
|
+
{
|
|
452
|
+
graphId: params.graphId,
|
|
453
|
+
nodeKind: params.nodeKind,
|
|
454
|
+
nodeId: row.nodeId,
|
|
455
|
+
fieldPath: params.fieldPath,
|
|
456
|
+
embedding: row.embedding,
|
|
457
|
+
dimensions: params.dimensions,
|
|
458
|
+
metric: params.metric,
|
|
459
|
+
indexType: params.indexType
|
|
460
|
+
},
|
|
461
|
+
timestamp
|
|
462
|
+
)
|
|
463
|
+
) : vectorStrategy.buildUpsertBatch(
|
|
464
|
+
slot,
|
|
465
|
+
{ ...params, rows: chunk2 },
|
|
466
|
+
timestamp
|
|
467
|
+
);
|
|
468
|
+
for (const statement of statements) {
|
|
469
|
+
await execRun(statement);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
} catch (error) {
|
|
473
|
+
throw mapVectorWriteError(error, params);
|
|
474
|
+
}
|
|
475
|
+
},
|
|
344
476
|
async deleteEmbedding(params) {
|
|
345
477
|
const slot = vectorSlotFromParams(params);
|
|
346
478
|
await ensureVectorSlotStorage(slot);
|
|
@@ -353,7 +485,16 @@ function createSqliteOperationBackend(options) {
|
|
|
353
485
|
assertVectorSearchLimit(params.limit);
|
|
354
486
|
const slot = vectorSlotFromParams(params);
|
|
355
487
|
await ensureVectorSlotStorage(slot);
|
|
356
|
-
const query = vectorStrategy.buildSearch(
|
|
488
|
+
const query = vectorStrategy.buildSearch(
|
|
489
|
+
slot,
|
|
490
|
+
params,
|
|
491
|
+
// Store-compiled candidates (predicates + subclass + currency)
|
|
492
|
+
// take precedence; the live-node default covers direct backend use.
|
|
493
|
+
params.candidates ?? operationStrategy.buildLiveNodeIds(
|
|
494
|
+
params.graphId,
|
|
495
|
+
params.nodeKind
|
|
496
|
+
)
|
|
497
|
+
);
|
|
357
498
|
let rows;
|
|
358
499
|
try {
|
|
359
500
|
rows = await execAll(query);
|
|
@@ -364,7 +505,57 @@ function createSqliteOperationBackend(options) {
|
|
|
364
505
|
nodeId: row.node_id,
|
|
365
506
|
score: row.score
|
|
366
507
|
}));
|
|
367
|
-
}
|
|
508
|
+
},
|
|
509
|
+
// Single-statement hybrid needs ROW_NUMBER(); a capability profile
|
|
510
|
+
// that disables window functions keeps the store's multi-statement
|
|
511
|
+
// fallback by simply not exposing the member.
|
|
512
|
+
...capabilities.windowFunctions ? {
|
|
513
|
+
async hybridSearch(params) {
|
|
514
|
+
assertVectorSearchLimit(params.limit);
|
|
515
|
+
assertVectorSearchLimit(params.vector.k);
|
|
516
|
+
const slot = vectorSlotFromParams({
|
|
517
|
+
graphId: params.graphId,
|
|
518
|
+
nodeKind: params.nodeKind,
|
|
519
|
+
fieldPath: params.vector.fieldPath,
|
|
520
|
+
dimensions: params.vector.dimensions,
|
|
521
|
+
metric: params.vector.metric,
|
|
522
|
+
indexType: params.vector.indexType
|
|
523
|
+
});
|
|
524
|
+
await ensureVectorSlotStorage(slot);
|
|
525
|
+
const candidates = params.candidates ?? operationStrategy.buildLiveNodeIds(
|
|
526
|
+
params.graphId,
|
|
527
|
+
params.nodeKind
|
|
528
|
+
);
|
|
529
|
+
const vectorParams = {
|
|
530
|
+
graphId: params.graphId,
|
|
531
|
+
nodeKind: params.nodeKind,
|
|
532
|
+
fieldPath: params.vector.fieldPath,
|
|
533
|
+
queryEmbedding: params.vector.queryEmbedding,
|
|
534
|
+
metric: params.vector.metric,
|
|
535
|
+
dimensions: params.vector.dimensions,
|
|
536
|
+
indexType: params.vector.indexType,
|
|
537
|
+
limit: params.vector.k,
|
|
538
|
+
...params.vector.minScore === void 0 ? {} : { minScore: params.vector.minScore }
|
|
539
|
+
};
|
|
540
|
+
const vectorSql = vectorStrategy.buildSearch(
|
|
541
|
+
slot,
|
|
542
|
+
vectorParams,
|
|
543
|
+
hybridCandidatesRef()
|
|
544
|
+
);
|
|
545
|
+
const statement = operationStrategy.buildHybridSearch(
|
|
546
|
+
{ ...params, candidates },
|
|
547
|
+
vectorSql,
|
|
548
|
+
params.vector.metric === "cosine"
|
|
549
|
+
);
|
|
550
|
+
let raw;
|
|
551
|
+
try {
|
|
552
|
+
raw = await execAll(statement);
|
|
553
|
+
} catch (error) {
|
|
554
|
+
throw mapVectorWriteError(error, vectorParams);
|
|
555
|
+
}
|
|
556
|
+
return raw.map((row) => mapHybridSearchRow(row, toNodeRow));
|
|
557
|
+
}
|
|
558
|
+
} : {}
|
|
368
559
|
};
|
|
369
560
|
const operationBackend = {
|
|
370
561
|
...commonBackend,
|
|
@@ -415,19 +606,32 @@ function createSqliteOperationBackend(options) {
|
|
|
415
606
|
async upsertFulltextBatch(params) {
|
|
416
607
|
if (params.rows.length === 0) return;
|
|
417
608
|
const timestamp = nowIso();
|
|
418
|
-
const
|
|
419
|
-
params,
|
|
420
|
-
|
|
421
|
-
)
|
|
422
|
-
|
|
423
|
-
|
|
609
|
+
for (const rows of chunk(
|
|
610
|
+
params.rows,
|
|
611
|
+
batchConfig.fulltextUpsertBatchSize
|
|
612
|
+
)) {
|
|
613
|
+
const statements = operationStrategy.buildUpsertFulltextBatch(
|
|
614
|
+
{ ...params, rows },
|
|
615
|
+
timestamp
|
|
616
|
+
);
|
|
617
|
+
for (const stmt of statements) {
|
|
618
|
+
await execRun(stmt);
|
|
619
|
+
}
|
|
424
620
|
}
|
|
425
621
|
},
|
|
426
622
|
async deleteFulltextBatch(params) {
|
|
427
623
|
if (params.nodeIds.length === 0) return;
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
624
|
+
for (const nodeIds of chunk(
|
|
625
|
+
params.nodeIds,
|
|
626
|
+
batchConfig.fulltextDeleteChunkSize
|
|
627
|
+
)) {
|
|
628
|
+
const statements = operationStrategy.buildDeleteFulltextBatch({
|
|
629
|
+
...params,
|
|
630
|
+
nodeIds
|
|
631
|
+
});
|
|
632
|
+
for (const stmt of statements) {
|
|
633
|
+
await execRun(stmt);
|
|
634
|
+
}
|
|
431
635
|
}
|
|
432
636
|
},
|
|
433
637
|
async fulltextSearch(params) {
|
|
@@ -465,7 +669,8 @@ function createSqliteBackend(db, options = {}) {
|
|
|
465
669
|
...buildSqliteCapabilities({
|
|
466
670
|
fulltextStrategy,
|
|
467
671
|
vectorStrategy,
|
|
468
|
-
transactionMode
|
|
672
|
+
transactionMode,
|
|
673
|
+
maxBindParameters: executionAdapter.profile.maxBindParameters
|
|
469
674
|
}),
|
|
470
675
|
...options.capabilities
|
|
471
676
|
};
|
|
@@ -475,9 +680,21 @@ function createSqliteBackend(db, options = {}) {
|
|
|
475
680
|
recordedNodes: getTableName(tables2.recordedNodes),
|
|
476
681
|
recordedEdges: getTableName(tables2.recordedEdges),
|
|
477
682
|
recordedClock: getTableName(tables2.recordedClock),
|
|
683
|
+
revisionOrigins: getTableName(tables2.revisionOrigins),
|
|
478
684
|
fulltext: tables2.fulltextTableName,
|
|
479
685
|
uniques: getTableName(tables2.uniques)
|
|
480
686
|
};
|
|
687
|
+
const coreAnalyzeTables = [
|
|
688
|
+
tableNames.nodes,
|
|
689
|
+
tableNames.edges,
|
|
690
|
+
tableNames.uniques,
|
|
691
|
+
tableNames.fulltext
|
|
692
|
+
];
|
|
693
|
+
const recordedAnalyzeTables = [
|
|
694
|
+
tableNames.recordedNodes,
|
|
695
|
+
tableNames.recordedEdges,
|
|
696
|
+
tableNames.recordedClock
|
|
697
|
+
];
|
|
481
698
|
const operationStrategy = createSqliteOperationStrategy(
|
|
482
699
|
tables2,
|
|
483
700
|
fulltextStrategy
|
|
@@ -507,6 +724,14 @@ function createSqliteBackend(db, options = {}) {
|
|
|
507
724
|
async () => storageTransaction.call(storage, run)
|
|
508
725
|
);
|
|
509
726
|
}
|
|
727
|
+
async function runFrameStatement(query) {
|
|
728
|
+
const compiledRun = executionAdapter.executeCompiledRun;
|
|
729
|
+
if (compiledRun === void 0) {
|
|
730
|
+
await db.run(query);
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
await compiledRun(executionAdapter.compile(query));
|
|
734
|
+
}
|
|
510
735
|
function runSchemaWriteTransaction(fn) {
|
|
511
736
|
if (transactionMode === "none") {
|
|
512
737
|
throwSqliteTransactionsDisabled(
|
|
@@ -524,13 +749,13 @@ function createSqliteBackend(db, options = {}) {
|
|
|
524
749
|
tableNames,
|
|
525
750
|
fulltextStrategy,
|
|
526
751
|
vectorStrategy});
|
|
527
|
-
await
|
|
752
|
+
await runFrameStatement(sql`BEGIN IMMEDIATE`);
|
|
528
753
|
try {
|
|
529
754
|
const result = await fn(txBackend);
|
|
530
|
-
await
|
|
755
|
+
await runFrameStatement(sql`COMMIT`);
|
|
531
756
|
return result;
|
|
532
757
|
} catch (error) {
|
|
533
|
-
await
|
|
758
|
+
await runFrameStatement(sql`ROLLBACK`);
|
|
534
759
|
throw error;
|
|
535
760
|
}
|
|
536
761
|
});
|
|
@@ -635,6 +860,11 @@ function createSqliteBackend(db, options = {}) {
|
|
|
635
860
|
await db.run(sql.raw(statement));
|
|
636
861
|
}
|
|
637
862
|
},
|
|
863
|
+
async ensureRevisionOriginsTable() {
|
|
864
|
+
await db.run(
|
|
865
|
+
sql.raw(generateSqliteCreateTableSQL(tables2.revisionOrigins))
|
|
866
|
+
);
|
|
867
|
+
},
|
|
638
868
|
// Every fulltext-touching method asserts the durable marker instead
|
|
639
869
|
// of lazily emitting DDL. Steady state performs zero ensure; an
|
|
640
870
|
// uninitialized database throws `StoreNotInitializedError` rather
|
|
@@ -752,7 +982,19 @@ function createSqliteBackend(db, options = {}) {
|
|
|
752
982
|
});
|
|
753
983
|
},
|
|
754
984
|
async refreshStatistics() {
|
|
755
|
-
await db.run(
|
|
985
|
+
await db.run(
|
|
986
|
+
sql`PRAGMA analysis_limit = ${sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`
|
|
987
|
+
);
|
|
988
|
+
for (const tableName of coreAnalyzeTables) {
|
|
989
|
+
await db.run(sql`ANALYZE ${quoteIdentifier(tableName)}`);
|
|
990
|
+
}
|
|
991
|
+
for (const tableName of recordedAnalyzeTables) {
|
|
992
|
+
try {
|
|
993
|
+
await db.run(sql`ANALYZE ${quoteIdentifier(tableName)}`);
|
|
994
|
+
} catch (error) {
|
|
995
|
+
if (!isMissingTableError(error)) throw error;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
756
998
|
},
|
|
757
999
|
async commitSchemaVersion(params) {
|
|
758
1000
|
return runSchemaWriteTransaction(
|
|
@@ -781,7 +1023,7 @@ function createSqliteBackend(db, options = {}) {
|
|
|
781
1023
|
tableNames,
|
|
782
1024
|
fulltextStrategy,
|
|
783
1025
|
vectorStrategy});
|
|
784
|
-
await
|
|
1026
|
+
await runFrameStatement(sql`BEGIN IMMEDIATE`);
|
|
785
1027
|
try {
|
|
786
1028
|
const result = await fn(
|
|
787
1029
|
gateFulltext(
|
|
@@ -790,10 +1032,10 @@ function createSqliteBackend(db, options = {}) {
|
|
|
790
1032
|
),
|
|
791
1033
|
db
|
|
792
1034
|
);
|
|
793
|
-
await
|
|
1035
|
+
await runFrameStatement(sql`COMMIT`);
|
|
794
1036
|
return result;
|
|
795
1037
|
} catch (error) {
|
|
796
|
-
await
|
|
1038
|
+
await runFrameStatement(sql`ROLLBACK`);
|
|
797
1039
|
throw error;
|
|
798
1040
|
}
|
|
799
1041
|
});
|
|
@@ -847,5 +1089,5 @@ function createTransactionBackend(options) {
|
|
|
847
1089
|
}
|
|
848
1090
|
|
|
849
1091
|
export { createSqliteBackend };
|
|
850
|
-
//# sourceMappingURL=chunk-
|
|
851
|
-
//# sourceMappingURL=chunk-
|
|
1092
|
+
//# sourceMappingURL=chunk-3TWF3SH4.js.map
|
|
1093
|
+
//# sourceMappingURL=chunk-3TWF3SH4.js.map
|