@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.
Files changed (287) hide show
  1. package/dist/backend/postgres/index.cjs +29 -29
  2. package/dist/backend/postgres/index.d.cts +39 -7
  3. package/dist/backend/postgres/index.d.ts +39 -7
  4. package/dist/backend/postgres/index.js +16 -16
  5. package/dist/backend/postgres/pglite.cjs +21 -21
  6. package/dist/backend/postgres/pglite.d.cts +4 -4
  7. package/dist/backend/postgres/pglite.d.ts +4 -4
  8. package/dist/backend/postgres/pglite.js +16 -16
  9. package/dist/backend/sqlite/index.cjs +25 -26
  10. package/dist/backend/sqlite/index.d.cts +8 -8
  11. package/dist/backend/sqlite/index.d.ts +8 -8
  12. package/dist/backend/sqlite/index.js +13 -14
  13. package/dist/backend/sqlite/libsql.cjs +19 -19
  14. package/dist/backend/sqlite/libsql.d.cts +4 -4
  15. package/dist/backend/sqlite/libsql.d.ts +4 -4
  16. package/dist/backend/sqlite/libsql.js +15 -15
  17. package/dist/backend/sqlite/local.cjs +101 -21
  18. package/dist/backend/sqlite/local.cjs.map +1 -1
  19. package/dist/backend/sqlite/local.d.cts +95 -5
  20. package/dist/backend/sqlite/local.d.ts +95 -5
  21. package/dist/backend/sqlite/local.js +95 -16
  22. package/dist/backend/sqlite/local.js.map +1 -1
  23. package/dist/{chunk-ZV5N4DBG.js → chunk-3TWF3SH4.js} +300 -58
  24. package/dist/chunk-3TWF3SH4.js.map +1 -0
  25. package/dist/chunk-4JEZZJ6S.cjs +1271 -0
  26. package/dist/chunk-4JEZZJ6S.cjs.map +1 -0
  27. package/dist/{chunk-UNNPKQUG.cjs → chunk-4TOD4LBZ.cjs} +246 -155
  28. package/dist/chunk-4TOD4LBZ.cjs.map +1 -0
  29. package/dist/{chunk-QV245VMN.js → chunk-55MZDDZV.js} +100 -6
  30. package/dist/chunk-55MZDDZV.js.map +1 -0
  31. package/dist/{chunk-GQANNXXT.cjs → chunk-5A6FNS6N.cjs} +75 -20
  32. package/dist/chunk-5A6FNS6N.cjs.map +1 -0
  33. package/dist/{chunk-3Z6TW3CT.cjs → chunk-5AQIKK56.cjs} +65 -25
  34. package/dist/chunk-5AQIKK56.cjs.map +1 -0
  35. package/dist/{chunk-BVTWD66D.js → chunk-5SEGFTZX.js} +3 -3
  36. package/dist/{chunk-BVTWD66D.js.map → chunk-5SEGFTZX.js.map} +1 -1
  37. package/dist/{chunk-6GNSY7AV.js → chunk-6FR2MMS6.js} +7 -7
  38. package/dist/chunk-6FR2MMS6.js.map +1 -0
  39. package/dist/chunk-7YSP4V4R.cjs +69 -0
  40. package/dist/chunk-7YSP4V4R.cjs.map +1 -0
  41. package/dist/chunk-A42GCBGX.cjs +28 -0
  42. package/dist/chunk-A42GCBGX.cjs.map +1 -0
  43. package/dist/{chunk-RHZWOJVA.cjs → chunk-BLZDPRXT.cjs} +52 -4
  44. package/dist/chunk-BLZDPRXT.cjs.map +1 -0
  45. package/dist/chunk-BYPOGQWK.js +25 -0
  46. package/dist/chunk-BYPOGQWK.js.map +1 -0
  47. package/dist/{chunk-6HVOHZHS.cjs → chunk-CK5BVQOW.cjs} +213 -168
  48. package/dist/chunk-CK5BVQOW.cjs.map +1 -0
  49. package/dist/{chunk-JJRCLAUN.cjs → chunk-CTTSDJLY.cjs} +116 -10
  50. package/dist/chunk-CTTSDJLY.cjs.map +1 -0
  51. package/dist/chunk-CUHM5CWJ.cjs +12 -0
  52. package/dist/chunk-CUHM5CWJ.cjs.map +1 -0
  53. package/dist/{chunk-A7SZZFAG.js → chunk-CZQ3FO2Q.js} +409 -99
  54. package/dist/chunk-CZQ3FO2Q.js.map +1 -0
  55. package/dist/{chunk-2JXB3NYJ.cjs → chunk-D7ZEOS56.cjs} +25 -32
  56. package/dist/chunk-D7ZEOS56.cjs.map +1 -0
  57. package/dist/chunk-DFVLCOP6.js +10 -0
  58. package/dist/chunk-DFVLCOP6.js.map +1 -0
  59. package/dist/{chunk-UJLOZYKT.cjs → chunk-EM3CWPND.cjs} +441 -115
  60. package/dist/chunk-EM3CWPND.cjs.map +1 -0
  61. package/dist/chunk-EMF62TZG.cjs +1176 -0
  62. package/dist/chunk-EMF62TZG.cjs.map +1 -0
  63. package/dist/chunk-EOLERH7Y.cjs +40 -0
  64. package/dist/chunk-EOLERH7Y.cjs.map +1 -0
  65. package/dist/{chunk-TGJE22RM.cjs → chunk-FACJJWGF.cjs} +24 -6
  66. package/dist/chunk-FACJJWGF.cjs.map +1 -0
  67. package/dist/{chunk-HK5SATYM.cjs → chunk-FL472AMI.cjs} +16 -109
  68. package/dist/chunk-FL472AMI.cjs.map +1 -0
  69. package/dist/{chunk-WVC2Q2FD.cjs → chunk-FN35DLCN.cjs} +31 -9
  70. package/dist/chunk-FN35DLCN.cjs.map +1 -0
  71. package/dist/{chunk-KUTNI6SI.js → chunk-FPIZFYHE.js} +10 -18
  72. package/dist/chunk-FPIZFYHE.js.map +1 -0
  73. package/dist/{chunk-VCGO4V26.js → chunk-FRV5Q5IO.js} +64 -9
  74. package/dist/chunk-FRV5Q5IO.js.map +1 -0
  75. package/dist/{chunk-K5P5OZXS.js → chunk-G6Q5UM7U.js} +2 -2
  76. package/dist/{chunk-K5P5OZXS.js.map → chunk-G6Q5UM7U.js.map} +1 -1
  77. package/dist/chunk-GSQ6NPH6.cjs +100 -0
  78. package/dist/chunk-GSQ6NPH6.cjs.map +1 -0
  79. package/dist/chunk-GUR2FNB5.cjs +12 -0
  80. package/dist/{chunk-HMFK4BXR.cjs.map → chunk-GUR2FNB5.cjs.map} +1 -1
  81. package/dist/{chunk-JQGIPGVL.cjs → chunk-H7YNSMA7.cjs} +43 -2
  82. package/dist/chunk-H7YNSMA7.cjs.map +1 -0
  83. package/dist/{chunk-2MRAX3UE.js → chunk-I7ZUZKFD.js} +47 -4
  84. package/dist/chunk-I7ZUZKFD.js.map +1 -0
  85. package/dist/{chunk-3BRVBQQD.cjs → chunk-J7WFGBJR.cjs} +2445 -2367
  86. package/dist/chunk-J7WFGBJR.cjs.map +1 -0
  87. package/dist/{chunk-V3QNTB7Z.js → chunk-JBTOYDMN.js} +194 -114
  88. package/dist/chunk-JBTOYDMN.js.map +1 -0
  89. package/dist/{chunk-K2TGS3EN.js → chunk-K3PPLHY7.js} +138 -89
  90. package/dist/chunk-K3PPLHY7.js.map +1 -0
  91. package/dist/{chunk-Z5XBMDXU.js → chunk-KBGQIPRQ.js} +42 -3
  92. package/dist/chunk-KBGQIPRQ.js.map +1 -0
  93. package/dist/chunk-KMI7LYAF.js +1252 -0
  94. package/dist/chunk-KMI7LYAF.js.map +1 -0
  95. package/dist/{chunk-JIEJCTDS.cjs → chunk-LGEALRC6.cjs} +21 -4
  96. package/dist/chunk-LGEALRC6.cjs.map +1 -0
  97. package/dist/{chunk-TQOYM4LN.js → chunk-MP2JQKSG.js} +21 -5
  98. package/dist/chunk-MP2JQKSG.js.map +1 -0
  99. package/dist/{chunk-ZP5WHI4C.cjs → chunk-O7UN7OXA.cjs} +358 -116
  100. package/dist/chunk-O7UN7OXA.cjs.map +1 -0
  101. package/dist/chunk-OHMP6N2J.js +47 -0
  102. package/dist/chunk-OHMP6N2J.js.map +1 -0
  103. package/dist/{chunk-4DIBPQNJ.js → chunk-OR5ZA5WP.js} +135 -25
  104. package/dist/chunk-OR5ZA5WP.js.map +1 -0
  105. package/dist/{chunk-DEQFL35G.js → chunk-Q5TEXCTB.js} +61 -7
  106. package/dist/chunk-Q5TEXCTB.js.map +1 -0
  107. package/dist/chunk-QNKSQTKQ.js +1312 -0
  108. package/dist/chunk-QNKSQTKQ.js.map +1 -0
  109. package/dist/{chunk-ZURTTSCM.js → chunk-QOTI55H7.js} +6 -94
  110. package/dist/chunk-QOTI55H7.js.map +1 -0
  111. package/dist/{chunk-CHXTTSC6.js → chunk-QWEUYILR.js} +104 -5
  112. package/dist/chunk-QWEUYILR.js.map +1 -0
  113. package/dist/{chunk-LANHCOXB.js → chunk-RGP33ZJ5.js} +485 -83
  114. package/dist/chunk-RGP33ZJ5.js.map +1 -0
  115. package/dist/chunk-RGPG7EOJ.js +94 -0
  116. package/dist/chunk-RGPG7EOJ.js.map +1 -0
  117. package/dist/{chunk-G6SOJEDI.cjs → chunk-S55OV6PW.cjs} +15 -15
  118. package/dist/chunk-S55OV6PW.cjs.map +1 -0
  119. package/dist/{chunk-3E7SNSIA.cjs → chunk-SJDMVITW.cjs} +4 -4
  120. package/dist/{chunk-3E7SNSIA.cjs.map → chunk-SJDMVITW.cjs.map} +1 -1
  121. package/dist/{chunk-XLUNB2TZ.js → chunk-SNXVDZAJ.js} +3 -3
  122. package/dist/{chunk-XLUNB2TZ.js.map → chunk-SNXVDZAJ.js.map} +1 -1
  123. package/dist/{chunk-RBV7YCQD.js → chunk-T2WUSPDA.js} +49 -9
  124. package/dist/chunk-T2WUSPDA.js.map +1 -0
  125. package/dist/{chunk-KGC4LY5T.cjs → chunk-TCOCYN2P.cjs} +75 -21
  126. package/dist/chunk-TCOCYN2P.cjs.map +1 -0
  127. package/dist/{chunk-FLRCVI2G.cjs → chunk-TDXIBCGY.cjs} +2 -2
  128. package/dist/{chunk-FLRCVI2G.cjs.map → chunk-TDXIBCGY.cjs.map} +1 -1
  129. package/dist/{chunk-ZY4GXIVN.cjs → chunk-TEDRJXOG.cjs} +5 -5
  130. package/dist/{chunk-ZY4GXIVN.cjs.map → chunk-TEDRJXOG.cjs.map} +1 -1
  131. package/dist/{chunk-WLRIWYHQ.js → chunk-UES55P7G.js} +1863 -1785
  132. package/dist/chunk-UES55P7G.js.map +1 -0
  133. package/dist/{chunk-WL2SG7ZV.cjs → chunk-UMDVATGY.cjs} +6 -6
  134. package/dist/{chunk-WL2SG7ZV.cjs.map → chunk-UMDVATGY.cjs.map} +1 -1
  135. package/dist/chunk-UT3S4SEN.js +31 -0
  136. package/dist/chunk-UT3S4SEN.js.map +1 -0
  137. package/dist/{chunk-RRKQAKD6.cjs → chunk-UUT7UN2N.cjs} +149 -39
  138. package/dist/chunk-UUT7UN2N.cjs.map +1 -0
  139. package/dist/{chunk-SHLY4MCM.js → chunk-UZV3AZKF.js} +21 -3
  140. package/dist/chunk-UZV3AZKF.js.map +1 -0
  141. package/dist/{chunk-CYX2JTDG.js → chunk-VHMPG6UL.js} +29 -7
  142. package/dist/chunk-VHMPG6UL.js.map +1 -0
  143. package/dist/{chunk-T6SPUYLX.cjs → chunk-VPYHY3LJ.cjs} +116 -10
  144. package/dist/chunk-VPYHY3LJ.cjs.map +1 -0
  145. package/dist/{chunk-T46GR2VY.js → chunk-VSPCZAXF.js} +3 -3
  146. package/dist/{chunk-T46GR2VY.js.map → chunk-VSPCZAXF.js.map} +1 -1
  147. package/dist/{chunk-K34OPSJK.js → chunk-W63OVYY4.js} +3 -3
  148. package/dist/{chunk-K34OPSJK.js.map → chunk-W63OVYY4.js.map} +1 -1
  149. package/dist/{chunk-RY2VIWAM.js → chunk-WDBCBWC4.js} +355 -32
  150. package/dist/chunk-WDBCBWC4.js.map +1 -0
  151. package/dist/chunk-WJT7OU7E.cjs +1334 -0
  152. package/dist/chunk-WJT7OU7E.cjs.map +1 -0
  153. package/dist/{chunk-5IQIX7LU.cjs → chunk-XOX22WHL.cjs} +476 -163
  154. package/dist/chunk-XOX22WHL.cjs.map +1 -0
  155. package/dist/{ddl-BrmPg61z.d.ts → ddl-C2rZ-Aen.d.ts} +4 -4
  156. package/dist/{ddl-j1-sH6lE.d.cts → ddl-CZz7a0E8.d.cts} +4 -4
  157. package/dist/{extension-types-YGFJPrzK.d.cts → extension-types-ixRpJVUp.d.cts} +24 -1
  158. package/dist/{extension-types-YGFJPrzK.d.ts → extension-types-ixRpJVUp.d.ts} +24 -1
  159. package/dist/{types-DkNnF-7K.d.cts → fulltext-strategy-B57yvC5Q.d.ts} +2562 -2133
  160. package/dist/{types-D1Sqeyxy.d.ts → fulltext-strategy-CDkSSYhq.d.cts} +2562 -2133
  161. package/dist/graph-extension/index.cjs +20 -19
  162. package/dist/graph-extension/index.d.cts +4 -4
  163. package/dist/graph-extension/index.d.ts +4 -4
  164. package/dist/graph-extension/index.js +5 -4
  165. package/dist/graph-merge/index.cjs +255 -164
  166. package/dist/graph-merge/index.cjs.map +1 -1
  167. package/dist/graph-merge/index.d.cts +63 -33
  168. package/dist/graph-merge/index.d.ts +63 -33
  169. package/dist/graph-merge/index.js +135 -44
  170. package/dist/graph-merge/index.js.map +1 -1
  171. package/dist/{index-DGX6D9j1.d.ts → index-6CSUAq-x.d.ts} +234 -93
  172. package/dist/{index-SEvUHDA6.d.cts → index-Bks_3HHK.d.cts} +234 -93
  173. package/dist/index.cjs +208 -188
  174. package/dist/index.d.cts +11 -11
  175. package/dist/index.d.ts +11 -11
  176. package/dist/index.js +33 -33
  177. package/dist/indexes/index.cjs +19 -20
  178. package/dist/indexes/index.d.cts +5 -5
  179. package/dist/indexes/index.d.ts +5 -5
  180. package/dist/indexes/index.js +10 -11
  181. package/dist/interchange/index.cjs +47 -26
  182. package/dist/interchange/index.d.cts +126 -12
  183. package/dist/interchange/index.d.ts +126 -12
  184. package/dist/interchange/index.js +14 -13
  185. package/dist/{manager-ms9cKdc6.d.cts → manager-DwQi8eV0.d.cts} +9 -2
  186. package/dist/{manager-BZUeN_BU.d.ts → manager-ejUCB52T.d.ts} +9 -2
  187. package/dist/{materialize-indexes-D20xNluI.d.cts → materialize-indexes-B4e9360H.d.cts} +20 -4
  188. package/dist/{materialize-indexes-CAkIYFV-.d.ts → materialize-indexes-te9TPMMJ.d.ts} +20 -4
  189. package/dist/{postgres-BhpxGMC5.d.cts → postgres-CfEqsRMp.d.cts} +152 -1
  190. package/dist/{postgres-CWHLwNl1.d.ts → postgres-DQ5R6rzV.d.ts} +152 -1
  191. package/dist/profiler/index.cjs +11 -11
  192. package/dist/profiler/index.d.cts +7 -7
  193. package/dist/profiler/index.d.ts +7 -7
  194. package/dist/profiler/index.js +4 -4
  195. package/dist/provenance/index.cjs +40 -41
  196. package/dist/provenance/index.cjs.map +1 -1
  197. package/dist/provenance/index.d.cts +5 -5
  198. package/dist/provenance/index.d.ts +5 -5
  199. package/dist/provenance/index.js +11 -12
  200. package/dist/provenance/index.js.map +1 -1
  201. package/dist/schema/index.cjs +53 -40
  202. package/dist/schema/index.cjs.map +1 -1
  203. package/dist/schema/index.d.cts +57 -57
  204. package/dist/schema/index.d.ts +57 -57
  205. package/dist/schema/index.js +28 -15
  206. package/dist/schema/index.js.map +1 -1
  207. package/dist/{sqlite-XrDxNaa7.d.cts → sqlite-D7zBinNR.d.cts} +92 -1
  208. package/dist/{sqlite-CGu5SLsw.d.ts → sqlite-DvQndLky.d.ts} +92 -1
  209. package/dist/{store-view-D09po4H6.d.cts → store-view-BSpqvAxK.d.cts} +415 -44
  210. package/dist/{store-view-BlgnhEYf.d.ts → store-view-CKbHFRnn.d.ts} +415 -44
  211. package/dist/{types-DiE1AO7p.d.cts → types-Bv9DcS_E.d.cts} +2 -2
  212. package/dist/{types-B1TbZJYS.d.ts → types-CoxuV7EJ.d.ts} +2 -2
  213. package/dist/{where-DKjuofPr.d.cts → where-7RKFOsXt.d.ts} +2 -2
  214. package/dist/{where-DrUIIWHb.d.ts → where-DdMIXOtH.d.cts} +2 -2
  215. package/package.json +14 -13
  216. package/dist/chunk-2EBMPJBO.js +0 -16
  217. package/dist/chunk-2EBMPJBO.js.map +0 -1
  218. package/dist/chunk-2JXB3NYJ.cjs.map +0 -1
  219. package/dist/chunk-2MRAX3UE.js.map +0 -1
  220. package/dist/chunk-3BRVBQQD.cjs.map +0 -1
  221. package/dist/chunk-3EUKJEQ3.js +0 -77
  222. package/dist/chunk-3EUKJEQ3.js.map +0 -1
  223. package/dist/chunk-3Z6TW3CT.cjs.map +0 -1
  224. package/dist/chunk-4DIBPQNJ.js.map +0 -1
  225. package/dist/chunk-4S2FXGBJ.js +0 -9
  226. package/dist/chunk-4S2FXGBJ.js.map +0 -1
  227. package/dist/chunk-5IQIX7LU.cjs.map +0 -1
  228. package/dist/chunk-6GNSY7AV.js.map +0 -1
  229. package/dist/chunk-6HVOHZHS.cjs.map +0 -1
  230. package/dist/chunk-6SCVW4AS.js +0 -20
  231. package/dist/chunk-6SCVW4AS.js.map +0 -1
  232. package/dist/chunk-A7SZZFAG.js.map +0 -1
  233. package/dist/chunk-CHXTTSC6.js.map +0 -1
  234. package/dist/chunk-CYX2JTDG.js.map +0 -1
  235. package/dist/chunk-DEQFL35G.js.map +0 -1
  236. package/dist/chunk-G6SOJEDI.cjs.map +0 -1
  237. package/dist/chunk-GQANNXXT.cjs.map +0 -1
  238. package/dist/chunk-GZCNZ7QW.js +0 -24
  239. package/dist/chunk-GZCNZ7QW.js.map +0 -1
  240. package/dist/chunk-HK5SATYM.cjs.map +0 -1
  241. package/dist/chunk-HMFK4BXR.cjs +0 -12
  242. package/dist/chunk-HTGDWIDE.cjs +0 -89
  243. package/dist/chunk-HTGDWIDE.cjs.map +0 -1
  244. package/dist/chunk-JIEJCTDS.cjs.map +0 -1
  245. package/dist/chunk-JJRCLAUN.cjs.map +0 -1
  246. package/dist/chunk-JQGIPGVL.cjs.map +0 -1
  247. package/dist/chunk-K2TGS3EN.js.map +0 -1
  248. package/dist/chunk-KGC4LY5T.cjs.map +0 -1
  249. package/dist/chunk-KNHYNQQ3.cjs +0 -663
  250. package/dist/chunk-KNHYNQQ3.cjs.map +0 -1
  251. package/dist/chunk-KUTNI6SI.js.map +0 -1
  252. package/dist/chunk-LANHCOXB.js.map +0 -1
  253. package/dist/chunk-N6WTUSBV.cjs +0 -23
  254. package/dist/chunk-N6WTUSBV.cjs.map +0 -1
  255. package/dist/chunk-NAUA4PW5.cjs +0 -28
  256. package/dist/chunk-NAUA4PW5.cjs.map +0 -1
  257. package/dist/chunk-QV245VMN.js.map +0 -1
  258. package/dist/chunk-RBV7YCQD.js.map +0 -1
  259. package/dist/chunk-RHZWOJVA.cjs.map +0 -1
  260. package/dist/chunk-RRKQAKD6.cjs.map +0 -1
  261. package/dist/chunk-RY2VIWAM.js.map +0 -1
  262. package/dist/chunk-SHLY4MCM.js.map +0 -1
  263. package/dist/chunk-T2DWPQNE.js +0 -649
  264. package/dist/chunk-T2DWPQNE.js.map +0 -1
  265. package/dist/chunk-T6SPUYLX.cjs.map +0 -1
  266. package/dist/chunk-TGJE22RM.cjs.map +0 -1
  267. package/dist/chunk-TOTPVGOG.cjs +0 -774
  268. package/dist/chunk-TOTPVGOG.cjs.map +0 -1
  269. package/dist/chunk-TQOYM4LN.js.map +0 -1
  270. package/dist/chunk-UJLOZYKT.cjs.map +0 -1
  271. package/dist/chunk-UNNPKQUG.cjs.map +0 -1
  272. package/dist/chunk-V3QNTB7Z.js.map +0 -1
  273. package/dist/chunk-VCGO4V26.js.map +0 -1
  274. package/dist/chunk-WLRIWYHQ.js.map +0 -1
  275. package/dist/chunk-WVC2Q2FD.cjs.map +0 -1
  276. package/dist/chunk-XXVEULWX.js +0 -39
  277. package/dist/chunk-XXVEULWX.js.map +0 -1
  278. package/dist/chunk-YAZE7QZR.cjs +0 -32
  279. package/dist/chunk-YAZE7QZR.cjs.map +0 -1
  280. package/dist/chunk-YC6PWTHY.cjs +0 -44
  281. package/dist/chunk-YC6PWTHY.cjs.map +0 -1
  282. package/dist/chunk-Z5HBYM7U.cjs +0 -11
  283. package/dist/chunk-Z5HBYM7U.cjs.map +0 -1
  284. package/dist/chunk-Z5XBMDXU.js.map +0 -1
  285. package/dist/chunk-ZP5WHI4C.cjs.map +0 -1
  286. package/dist/chunk-ZURTTSCM.js.map +0 -1
  287. package/dist/chunk-ZV5N4DBG.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
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');
9
- var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
3
+ var chunkEM3CWPND_cjs = require('./chunk-EM3CWPND.cjs');
4
+ var chunkFN35DLCN_cjs = require('./chunk-FN35DLCN.cjs');
5
+ var chunkCTTSDJLY_cjs = require('./chunk-CTTSDJLY.cjs');
6
+ var chunkD7ZEOS56_cjs = require('./chunk-D7ZEOS56.cjs');
7
+ var chunk4TOD4LBZ_cjs = require('./chunk-4TOD4LBZ.cjs');
8
+ var chunkBLZDPRXT_cjs = require('./chunk-BLZDPRXT.cjs');
9
+ var chunkLGEALRC6_cjs = require('./chunk-LGEALRC6.cjs');
10
10
  var drizzleOrm = require('drizzle-orm');
11
11
  var sqliteCore = require('drizzle-orm/sqlite-core');
12
12
 
@@ -64,6 +64,44 @@ function detectTransactionMode(db, profileHints, isSync) {
64
64
  if (isSync) return "sql";
65
65
  return "drizzle";
66
66
  }
67
+ var MAX_VARIABLE_NUMBER_COMPILE_OPTION = /^MAX_VARIABLE_NUMBER=(\d+)$/;
68
+ var FIRST_MODERN_BIND_LIMIT_MAJOR = 3;
69
+ var FIRST_MODERN_BIND_LIMIT_MINOR = 32;
70
+ function parseCompiledMaxVariableNumber(rows) {
71
+ for (const row of rows) {
72
+ if (typeof row !== "object" || row === null) continue;
73
+ const option = row.compile_options;
74
+ if (typeof option !== "string") continue;
75
+ const match = MAX_VARIABLE_NUMBER_COMPILE_OPTION.exec(option);
76
+ if (match !== null) return Number(match[1]);
77
+ }
78
+ return void 0;
79
+ }
80
+ function hasModernBindLimitByVersion(rows) {
81
+ const first = rows[0];
82
+ if (typeof first !== "object" || first === null) return false;
83
+ const version = first.version;
84
+ if (typeof version !== "string") return false;
85
+ const [major = 0, minor = 0] = version.split(".").map(Number);
86
+ if (!Number.isFinite(major) || !Number.isFinite(minor)) return false;
87
+ return major > FIRST_MODERN_BIND_LIMIT_MAJOR || major === FIRST_MODERN_BIND_LIMIT_MAJOR && minor >= FIRST_MODERN_BIND_LIMIT_MINOR;
88
+ }
89
+ function detectMaxBindParameters(db, sqliteClient) {
90
+ if (isD1DatabaseBySessionName(db)) return chunk4TOD4LBZ_cjs.D1_MAX_BIND_PARAMETERS;
91
+ if (sqliteClient === void 0) return chunk4TOD4LBZ_cjs.SQLITE_MAX_BIND_PARAMETERS;
92
+ try {
93
+ const compiled = parseCompiledMaxVariableNumber(
94
+ sqliteClient.prepare("PRAGMA compile_options").all()
95
+ );
96
+ if (compiled !== void 0) return compiled;
97
+ const isModern = hasModernBindLimitByVersion(
98
+ sqliteClient.prepare("SELECT sqlite_version() AS version").all()
99
+ );
100
+ return isModern ? chunk4TOD4LBZ_cjs.MODERN_SQLITE_MAX_BIND_PARAMETERS : chunk4TOD4LBZ_cjs.SQLITE_MAX_BIND_PARAMETERS;
101
+ } catch {
102
+ return chunk4TOD4LBZ_cjs.SQLITE_MAX_BIND_PARAMETERS;
103
+ }
104
+ }
67
105
  function resolveSqliteClient(db) {
68
106
  const databaseWithClient = db;
69
107
  const sqliteClient = databaseWithClient.$client;
@@ -73,7 +111,7 @@ function resolveSqliteClient(db) {
73
111
  return sqliteClient;
74
112
  }
75
113
  function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
76
- return chunkUJLOZYKT_cjs.getOrCreateLru(
114
+ return chunkEM3CWPND_cjs.getOrCreateLru(
77
115
  cache,
78
116
  sqlText,
79
117
  cacheMax,
@@ -106,10 +144,11 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
106
144
  const transactionMode = detectTransactionMode(db, profileHints, isSync);
107
145
  const profile = {
108
146
  isSync,
147
+ maxBindParameters: detectMaxBindParameters(db, sqliteClient),
109
148
  supportsCompiledExecution: sqliteClient !== void 0,
110
149
  transactionMode
111
150
  };
112
- const compile = (query) => chunkUJLOZYKT_cjs.compileQueryWithDialect(db, query, "SQLite");
151
+ const compile = (query) => chunkEM3CWPND_cjs.compileQueryWithDialect(db, query, "SQLite");
113
152
  if (sqliteClient !== void 0) {
114
153
  let executeCompiled2 = function(compiledQuery) {
115
154
  const preparedStatement = getOrCreatePreparedStatement(
@@ -120,6 +159,19 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
120
159
  );
121
160
  const rows = preparedStatement.all(...compiledQuery.params);
122
161
  return Promise.resolve(rows);
162
+ }, executeCompiledRun2 = function(compiledQuery) {
163
+ const preparedStatement = getOrCreatePreparedStatement(
164
+ statementCache,
165
+ client,
166
+ compiledQuery.sql,
167
+ statementCacheMax
168
+ );
169
+ if (preparedStatement.run === void 0 || preparedStatement.reader === true) {
170
+ preparedStatement.all(...compiledQuery.params);
171
+ } else {
172
+ preparedStatement.run(...compiledQuery.params);
173
+ }
174
+ return Promise.resolve();
123
175
  };
124
176
  const client = sqliteClient;
125
177
  const statementCache = /* @__PURE__ */ new Map();
@@ -133,6 +185,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
133
185
  return executeCompiled2(compiledQuery);
134
186
  },
135
187
  executeCompiled: executeCompiled2,
188
+ executeCompiledRun: executeCompiledRun2,
136
189
  prepare(sqlText) {
137
190
  return createPreparedStatementExecutor(
138
191
  client,
@@ -158,32 +211,58 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
158
211
  // src/backend/drizzle/sqlite.ts
159
212
  var NODE_INSERT_PARAM_COUNT = 9;
160
213
  var EDGE_INSERT_PARAM_COUNT = 12;
161
- var SQLITE_NODE_INSERT_BATCH_SIZE = Math.max(
162
- 1,
163
- Math.floor(chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS / NODE_INSERT_PARAM_COUNT)
164
- );
165
- var SQLITE_EDGE_INSERT_BATCH_SIZE = Math.max(
166
- 1,
167
- Math.floor(chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS / EDGE_INSERT_PARAM_COUNT)
168
- );
169
- var SQLITE_GET_NODES_ID_CHUNK_SIZE = Math.max(
170
- 1,
171
- chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS - 2
172
- );
173
- var SQLITE_GET_EDGES_ID_CHUNK_SIZE = Math.max(
174
- 1,
175
- chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS - 1
176
- );
214
+ var GET_NODES_FIXED_PARAM_COUNT = 2;
215
+ var GET_EDGES_FIXED_PARAM_COUNT = 1;
177
216
  var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
178
- var SQLITE_CHECK_UNIQUE_BATCH_CHUNK_SIZE = Math.max(
179
- 1,
180
- chunkUNNPKQUG_cjs.SQLITE_MAX_BIND_PARAMETERS - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
181
- );
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
217
+ var FULLTEXT_UPSERT_PARAM_COUNT = 6;
218
+ var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
219
+ var UNIQUE_INSERT_PARAM_COUNT = 6;
220
+ var SQLITE_ANALYZE_ROW_LIMIT = 1e3;
221
+ function computeSqliteBatchChunkSizes(maxBindParameters) {
222
+ return {
223
+ checkUniqueBatchChunkSize: Math.max(
224
+ 1,
225
+ maxBindParameters - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
226
+ ),
227
+ embeddingUpsertBatchSize: Math.max(
228
+ 1,
229
+ Math.floor(maxBindParameters / chunkEM3CWPND_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
230
+ ),
231
+ fulltextUpsertBatchSize: Math.max(
232
+ 1,
233
+ Math.floor(maxBindParameters / FULLTEXT_UPSERT_PARAM_COUNT)
234
+ ),
235
+ fulltextDeleteChunkSize: Math.max(
236
+ 1,
237
+ maxBindParameters - FULLTEXT_DELETE_FIXED_PARAM_COUNT
238
+ ),
239
+ edgeInsertBatchSize: Math.max(
240
+ 1,
241
+ Math.floor(maxBindParameters / EDGE_INSERT_PARAM_COUNT)
242
+ ),
243
+ getEdgesChunkSize: Math.max(
244
+ 1,
245
+ maxBindParameters - GET_EDGES_FIXED_PARAM_COUNT
246
+ ),
247
+ getNodesChunkSize: Math.max(
248
+ 1,
249
+ maxBindParameters - GET_NODES_FIXED_PARAM_COUNT
250
+ ),
251
+ nodeInsertBatchSize: Math.max(
252
+ 1,
253
+ Math.floor(maxBindParameters / NODE_INSERT_PARAM_COUNT)
254
+ ),
255
+ uniqueInsertBatchSize: Math.max(
256
+ 1,
257
+ Math.floor(maxBindParameters / UNIQUE_INSERT_PARAM_COUNT)
258
+ )
259
+ };
260
+ }
261
+ var toNodeRow = chunkCTTSDJLY_cjs.createNodeRowMapper(chunkCTTSDJLY_cjs.SQLITE_ROW_MAPPER_CONFIG);
262
+ var toEdgeRow = chunkCTTSDJLY_cjs.createEdgeRowMapper(chunkCTTSDJLY_cjs.SQLITE_ROW_MAPPER_CONFIG);
263
+ var toUniqueRow = chunkCTTSDJLY_cjs.createUniqueRowMapper(chunkCTTSDJLY_cjs.SQLITE_ROW_MAPPER_CONFIG);
264
+ var toSchemaVersionRow = chunkCTTSDJLY_cjs.createSchemaVersionRowMapper(
265
+ chunkCTTSDJLY_cjs.SQLITE_ROW_MAPPER_CONFIG
187
266
  );
188
267
  var PENDING_FOREVER = new Promise(noop);
189
268
  function pendingForever() {
@@ -202,7 +281,7 @@ async function loadQueueTaskContext() {
202
281
  void loadQueueTaskContext();
203
282
  function rejectReentrantQueueSubmission() {
204
283
  return Promise.reject(
205
- new chunkJIEJCTDS_cjs.ConfigurationError(
284
+ new chunkLGEALRC6_cjs.ConfigurationError(
206
285
  "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
286
  { backend: "sqlite", capability: "concurrentRootAccess" },
208
287
  {
@@ -223,7 +302,7 @@ function createSerializedExecutionQueue() {
223
302
  disposed = true;
224
303
  },
225
304
  runExclusive(task) {
226
- if (isDisposed()) return Promise.reject(new chunkJIEJCTDS_cjs.BackendDisposedError());
305
+ if (isDisposed()) return Promise.reject(new chunkLGEALRC6_cjs.BackendDisposedError());
227
306
  if (queueTaskContext?.getStore() === taskMarker) {
228
307
  return rejectReentrantQueueSubmission();
229
308
  }
@@ -251,18 +330,19 @@ function runWithSerializedQueue(queue, task) {
251
330
  return queue.runExclusive(task);
252
331
  }
253
332
  function throwSqliteTransactionsDisabled(message) {
254
- throw new chunkJIEJCTDS_cjs.ConfigurationError(message, {
333
+ throw new chunkLGEALRC6_cjs.ConfigurationError(message, {
255
334
  backend: "sqlite",
256
335
  capability: "transactions",
257
336
  supportsTransactions: false
258
337
  });
259
338
  }
260
339
  function buildSqliteCapabilities(options) {
261
- const base = options.transactionMode === "none" ? { ...chunkUNNPKQUG_cjs.SQLITE_CAPABILITIES, transactions: false } : chunkUNNPKQUG_cjs.SQLITE_CAPABILITIES;
340
+ const base = options.transactionMode === "none" ? { ...chunk4TOD4LBZ_cjs.SQLITE_CAPABILITIES, transactions: false } : chunk4TOD4LBZ_cjs.SQLITE_CAPABILITIES;
262
341
  return {
263
342
  ...base,
264
- fulltext: chunk2JXB3NYJ_cjs.buildFulltextCapabilities(options.fulltextStrategy),
265
- ...options.vectorStrategy === void 0 ? {} : { vector: chunk2JXB3NYJ_cjs.buildVectorCapabilities(options.vectorStrategy) }
343
+ maxBindParameters: options.maxBindParameters,
344
+ fulltext: chunkD7ZEOS56_cjs.buildFulltextCapabilities(options.fulltextStrategy),
345
+ ...options.vectorStrategy === void 0 ? {} : { vector: chunkD7ZEOS56_cjs.buildVectorCapabilities(options.vectorStrategy) }
266
346
  };
267
347
  }
268
348
  function createSqliteOperationBackend(options) {
@@ -277,36 +357,46 @@ function createSqliteOperationBackend(options) {
277
357
  vectorStrategy,
278
358
  vectorSlotLatch
279
359
  } = options;
360
+ const compiledExecute = executionAdapter.executeCompiled;
361
+ const compiledRun = executionAdapter.executeCompiledRun;
280
362
  function execGet(query) {
281
363
  return runWithSerializedQueue(serializedQueue, async () => {
282
- const rows = await db.all(query);
364
+ if (compiledExecute === void 0) {
365
+ const rows2 = await db.all(query);
366
+ return rows2[0];
367
+ }
368
+ const rows = await compiledExecute(executionAdapter.compile(query));
283
369
  return rows[0];
284
370
  });
285
371
  }
286
372
  function execAll(query) {
287
373
  return runWithSerializedQueue(serializedQueue, async () => {
288
- return await db.all(query);
374
+ if (compiledExecute === void 0) {
375
+ return await db.all(query);
376
+ }
377
+ return [...await compiledExecute(executionAdapter.compile(query))];
289
378
  });
290
379
  }
291
380
  function execRun(query) {
292
381
  return runWithSerializedQueue(serializedQueue, async () => {
293
- await db.run(query);
382
+ if (compiledRun === void 0) {
383
+ await db.run(query);
384
+ return;
385
+ }
386
+ await compiledRun(executionAdapter.compile(query));
294
387
  });
295
388
  }
296
- const commonBackend = chunkUJLOZYKT_cjs.createCommonOperationBackend({
297
- batchConfig: {
298
- checkUniqueBatchChunkSize: SQLITE_CHECK_UNIQUE_BATCH_CHUNK_SIZE,
299
- edgeInsertBatchSize: SQLITE_EDGE_INSERT_BATCH_SIZE,
300
- getEdgesChunkSize: SQLITE_GET_EDGES_ID_CHUNK_SIZE,
301
- getNodesChunkSize: SQLITE_GET_NODES_ID_CHUNK_SIZE,
302
- nodeInsertBatchSize: SQLITE_NODE_INSERT_BATCH_SIZE
303
- },
389
+ const batchConfig = computeSqliteBatchChunkSizes(
390
+ capabilities.maxBindParameters ?? chunk4TOD4LBZ_cjs.SQLITE_MAX_BIND_PARAMETERS
391
+ );
392
+ const commonBackend = chunkEM3CWPND_cjs.createCommonOperationBackend({
393
+ batchConfig,
304
394
  execution: {
305
395
  execAll,
306
396
  execGet,
307
397
  execRun
308
398
  },
309
- nowIso: chunkJJRCLAUN_cjs.nowIso,
399
+ nowIso: chunkCTTSDJLY_cjs.nowIso,
310
400
  operationStrategy,
311
401
  rowMappers: {
312
402
  toEdgeRow,
@@ -332,19 +422,61 @@ function createSqliteOperationBackend(options) {
332
422
  }
333
423
  const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
334
424
  async upsertEmbedding(params) {
335
- const slot = chunkUJLOZYKT_cjs.vectorSlotFromParams(params);
425
+ const slot = chunkEM3CWPND_cjs.vectorSlotFromParams(params);
336
426
  await ensureVectorSlotStorage(slot);
337
- const statements = vectorStrategy.buildUpsert(slot, params, chunkJJRCLAUN_cjs.nowIso());
427
+ const statements = vectorStrategy.buildUpsert(slot, params, chunkCTTSDJLY_cjs.nowIso());
338
428
  try {
339
429
  for (const statement of statements) {
340
430
  await execRun(statement);
341
431
  }
342
432
  } catch (error) {
343
- throw chunkUJLOZYKT_cjs.mapVectorWriteError(error, params);
433
+ throw chunkEM3CWPND_cjs.mapVectorWriteError(error, params);
434
+ }
435
+ },
436
+ async upsertEmbeddingBatch(params) {
437
+ if (params.rows.length === 0) return;
438
+ const slot = chunkEM3CWPND_cjs.vectorSlotFromParams(params);
439
+ await ensureVectorSlotStorage(slot);
440
+ const rowsById = new Map(
441
+ params.rows.map((row) => [row.nodeId, row])
442
+ );
443
+ const rows = [...rowsById.values()];
444
+ const timestamp = chunkCTTSDJLY_cjs.nowIso();
445
+ try {
446
+ for (const chunk2 of chunk4TOD4LBZ_cjs.chunk(
447
+ rows,
448
+ batchConfig.embeddingUpsertBatchSize
449
+ )) {
450
+ const statements = vectorStrategy.buildUpsertBatch === void 0 ? chunk2.flatMap(
451
+ (row) => vectorStrategy.buildUpsert(
452
+ slot,
453
+ {
454
+ graphId: params.graphId,
455
+ nodeKind: params.nodeKind,
456
+ nodeId: row.nodeId,
457
+ fieldPath: params.fieldPath,
458
+ embedding: row.embedding,
459
+ dimensions: params.dimensions,
460
+ metric: params.metric,
461
+ indexType: params.indexType
462
+ },
463
+ timestamp
464
+ )
465
+ ) : vectorStrategy.buildUpsertBatch(
466
+ slot,
467
+ { ...params, rows: chunk2 },
468
+ timestamp
469
+ );
470
+ for (const statement of statements) {
471
+ await execRun(statement);
472
+ }
473
+ }
474
+ } catch (error) {
475
+ throw chunkEM3CWPND_cjs.mapVectorWriteError(error, params);
344
476
  }
345
477
  },
346
478
  async deleteEmbedding(params) {
347
- const slot = chunkUJLOZYKT_cjs.vectorSlotFromParams(params);
479
+ const slot = chunkEM3CWPND_cjs.vectorSlotFromParams(params);
348
480
  await ensureVectorSlotStorage(slot);
349
481
  const statements = vectorStrategy.buildDelete(slot, params);
350
482
  for (const statement of statements) {
@@ -352,21 +484,80 @@ function createSqliteOperationBackend(options) {
352
484
  }
353
485
  },
354
486
  async vectorSearch(params) {
355
- chunk2JXB3NYJ_cjs.assertVectorSearchLimit(params.limit);
356
- const slot = chunkUJLOZYKT_cjs.vectorSlotFromParams(params);
487
+ chunkD7ZEOS56_cjs.assertVectorSearchLimit(params.limit);
488
+ const slot = chunkEM3CWPND_cjs.vectorSlotFromParams(params);
357
489
  await ensureVectorSlotStorage(slot);
358
- const query = vectorStrategy.buildSearch(slot, params);
490
+ const query = vectorStrategy.buildSearch(
491
+ slot,
492
+ params,
493
+ // Store-compiled candidates (predicates + subclass + currency)
494
+ // take precedence; the live-node default covers direct backend use.
495
+ params.candidates ?? operationStrategy.buildLiveNodeIds(
496
+ params.graphId,
497
+ params.nodeKind
498
+ )
499
+ );
359
500
  let rows;
360
501
  try {
361
502
  rows = await execAll(query);
362
503
  } catch (error) {
363
- throw chunkUJLOZYKT_cjs.mapVectorWriteError(error, params);
504
+ throw chunkEM3CWPND_cjs.mapVectorWriteError(error, params);
364
505
  }
365
506
  return rows.map((row) => ({
366
507
  nodeId: row.node_id,
367
508
  score: row.score
368
509
  }));
369
- }
510
+ },
511
+ // Single-statement hybrid needs ROW_NUMBER(); a capability profile
512
+ // that disables window functions keeps the store's multi-statement
513
+ // fallback by simply not exposing the member.
514
+ ...capabilities.windowFunctions ? {
515
+ async hybridSearch(params) {
516
+ chunkD7ZEOS56_cjs.assertVectorSearchLimit(params.limit);
517
+ chunkD7ZEOS56_cjs.assertVectorSearchLimit(params.vector.k);
518
+ const slot = chunkEM3CWPND_cjs.vectorSlotFromParams({
519
+ graphId: params.graphId,
520
+ nodeKind: params.nodeKind,
521
+ fieldPath: params.vector.fieldPath,
522
+ dimensions: params.vector.dimensions,
523
+ metric: params.vector.metric,
524
+ indexType: params.vector.indexType
525
+ });
526
+ await ensureVectorSlotStorage(slot);
527
+ const candidates = params.candidates ?? operationStrategy.buildLiveNodeIds(
528
+ params.graphId,
529
+ params.nodeKind
530
+ );
531
+ const vectorParams = {
532
+ graphId: params.graphId,
533
+ nodeKind: params.nodeKind,
534
+ fieldPath: params.vector.fieldPath,
535
+ queryEmbedding: params.vector.queryEmbedding,
536
+ metric: params.vector.metric,
537
+ dimensions: params.vector.dimensions,
538
+ indexType: params.vector.indexType,
539
+ limit: params.vector.k,
540
+ ...params.vector.minScore === void 0 ? {} : { minScore: params.vector.minScore }
541
+ };
542
+ const vectorSql = vectorStrategy.buildSearch(
543
+ slot,
544
+ vectorParams,
545
+ chunkEM3CWPND_cjs.hybridCandidatesRef()
546
+ );
547
+ const statement = operationStrategy.buildHybridSearch(
548
+ { ...params, candidates },
549
+ vectorSql,
550
+ params.vector.metric === "cosine"
551
+ );
552
+ let raw;
553
+ try {
554
+ raw = await execAll(statement);
555
+ } catch (error) {
556
+ throw chunkEM3CWPND_cjs.mapVectorWriteError(error, vectorParams);
557
+ }
558
+ return raw.map((row) => chunkEM3CWPND_cjs.mapHybridSearchRow(row, toNodeRow));
559
+ }
560
+ } : {}
370
561
  };
371
562
  const operationBackend = {
372
563
  ...commonBackend,
@@ -379,7 +570,7 @@ function createSqliteOperationBackend(options) {
379
570
  ...vectorStrategy === void 0 ? {} : { vectorStrategy },
380
571
  async createVectorIndex(params) {
381
572
  if (vectorStrategy === void 0) return;
382
- const slot = chunkUJLOZYKT_cjs.vectorSlotFromCreateIndexParams(params);
573
+ const slot = chunkEM3CWPND_cjs.vectorSlotFromCreateIndexParams(params);
383
574
  await ensureVectorSlotStorage(slot);
384
575
  const indexStatement = vectorStrategy.buildCreateIndex?.(slot);
385
576
  if (indexStatement !== void 0) {
@@ -388,18 +579,18 @@ function createSqliteOperationBackend(options) {
388
579
  },
389
580
  async dropVectorIndex(params) {
390
581
  if (vectorStrategy === void 0) return;
391
- const slot = chunkUJLOZYKT_cjs.vectorSlotFromDropIndexParams(params);
582
+ const slot = chunkEM3CWPND_cjs.vectorSlotFromDropIndexParams(params);
392
583
  const dropStatement = vectorStrategy.buildDropIndex?.(slot);
393
584
  if (dropStatement === void 0) return;
394
585
  try {
395
586
  await execRun(dropStatement);
396
587
  } catch (error) {
397
- if (!chunkRHZWOJVA_cjs.isMissingTableError(error)) throw error;
588
+ if (!chunkBLZDPRXT_cjs.isMissingTableError(error)) throw error;
398
589
  }
399
590
  },
400
591
  // === Fulltext Operations ===
401
592
  async upsertFulltext(params) {
402
- const timestamp = chunkJJRCLAUN_cjs.nowIso();
593
+ const timestamp = chunkCTTSDJLY_cjs.nowIso();
403
594
  const statements = operationStrategy.buildUpsertFulltext(
404
595
  params,
405
596
  timestamp
@@ -416,20 +607,33 @@ function createSqliteOperationBackend(options) {
416
607
  },
417
608
  async upsertFulltextBatch(params) {
418
609
  if (params.rows.length === 0) return;
419
- const timestamp = chunkJJRCLAUN_cjs.nowIso();
420
- const statements = operationStrategy.buildUpsertFulltextBatch(
421
- params,
422
- timestamp
423
- );
424
- for (const stmt of statements) {
425
- await execRun(stmt);
610
+ const timestamp = chunkCTTSDJLY_cjs.nowIso();
611
+ for (const rows of chunk4TOD4LBZ_cjs.chunk(
612
+ params.rows,
613
+ batchConfig.fulltextUpsertBatchSize
614
+ )) {
615
+ const statements = operationStrategy.buildUpsertFulltextBatch(
616
+ { ...params, rows },
617
+ timestamp
618
+ );
619
+ for (const stmt of statements) {
620
+ await execRun(stmt);
621
+ }
426
622
  }
427
623
  },
428
624
  async deleteFulltextBatch(params) {
429
625
  if (params.nodeIds.length === 0) return;
430
- const statements = operationStrategy.buildDeleteFulltextBatch(params);
431
- for (const stmt of statements) {
432
- await execRun(stmt);
626
+ for (const nodeIds of chunk4TOD4LBZ_cjs.chunk(
627
+ params.nodeIds,
628
+ batchConfig.fulltextDeleteChunkSize
629
+ )) {
630
+ const statements = operationStrategy.buildDeleteFulltextBatch({
631
+ ...params,
632
+ nodeIds
633
+ });
634
+ for (const stmt of statements) {
635
+ await execRun(stmt);
636
+ }
433
637
  }
434
638
  },
435
639
  async fulltextSearch(params) {
@@ -437,7 +641,7 @@ function createSqliteOperationBackend(options) {
437
641
  const rows = await execAll(query);
438
642
  return rows.map((row, index) => ({
439
643
  nodeId: row.node_id,
440
- score: chunkJJRCLAUN_cjs.coerceNumericScore(row.score),
644
+ score: chunkCTTSDJLY_cjs.coerceNumericScore(row.score),
441
645
  rank: index + 1,
442
646
  ...row.snippet === null ? {} : { snippet: row.snippet }
443
647
  }));
@@ -456,18 +660,19 @@ function createSqliteOperationBackend(options) {
456
660
  return operationBackend;
457
661
  }
458
662
  function createSqliteBackend(db, options = {}) {
459
- const tables2 = options.tables ?? chunkWVC2Q2FD_cjs.tables;
460
- const fulltextStrategy = options.fulltext ?? chunk2JXB3NYJ_cjs.fts5Strategy;
663
+ const tables2 = options.tables ?? chunkFN35DLCN_cjs.tables;
664
+ const fulltextStrategy = options.fulltext ?? chunkD7ZEOS56_cjs.fts5Strategy;
461
665
  const profileHints = options.executionProfile ?? {};
462
666
  const executionAdapter = createSqliteExecutionAdapter(db, { profileHints });
463
667
  const { isSync, transactionMode } = executionAdapter.profile;
464
668
  const vectorStrategy = options.vector;
465
- const vectorSlotLatch = vectorStrategy === void 0 ? void 0 : chunkUJLOZYKT_cjs.createVectorSlotLatch();
669
+ const vectorSlotLatch = vectorStrategy === void 0 ? void 0 : chunkEM3CWPND_cjs.createVectorSlotLatch();
466
670
  const capabilities = {
467
671
  ...buildSqliteCapabilities({
468
672
  fulltextStrategy,
469
673
  vectorStrategy,
470
- transactionMode
674
+ transactionMode,
675
+ maxBindParameters: executionAdapter.profile.maxBindParameters
471
676
  }),
472
677
  ...options.capabilities
473
678
  };
@@ -477,10 +682,22 @@ function createSqliteBackend(db, options = {}) {
477
682
  recordedNodes: drizzleOrm.getTableName(tables2.recordedNodes),
478
683
  recordedEdges: drizzleOrm.getTableName(tables2.recordedEdges),
479
684
  recordedClock: drizzleOrm.getTableName(tables2.recordedClock),
685
+ revisionOrigins: drizzleOrm.getTableName(tables2.revisionOrigins),
480
686
  fulltext: tables2.fulltextTableName,
481
687
  uniques: drizzleOrm.getTableName(tables2.uniques)
482
688
  };
483
- const operationStrategy = chunkUJLOZYKT_cjs.createSqliteOperationStrategy(
689
+ const coreAnalyzeTables = [
690
+ tableNames.nodes,
691
+ tableNames.edges,
692
+ tableNames.uniques,
693
+ tableNames.fulltext
694
+ ];
695
+ const recordedAnalyzeTables = [
696
+ tableNames.recordedNodes,
697
+ tableNames.recordedEdges,
698
+ tableNames.recordedClock
699
+ ];
700
+ const operationStrategy = chunkEM3CWPND_cjs.createSqliteOperationStrategy(
484
701
  tables2,
485
702
  fulltextStrategy
486
703
  );
@@ -509,6 +726,14 @@ function createSqliteBackend(db, options = {}) {
509
726
  async () => storageTransaction.call(storage, run)
510
727
  );
511
728
  }
729
+ async function runFrameStatement(query) {
730
+ const compiledRun = executionAdapter.executeCompiledRun;
731
+ if (compiledRun === void 0) {
732
+ await db.run(query);
733
+ return;
734
+ }
735
+ await compiledRun(executionAdapter.compile(query));
736
+ }
512
737
  function runSchemaWriteTransaction(fn) {
513
738
  if (transactionMode === "none") {
514
739
  throwSqliteTransactionsDisabled(
@@ -526,13 +751,13 @@ function createSqliteBackend(db, options = {}) {
526
751
  tableNames,
527
752
  fulltextStrategy,
528
753
  vectorStrategy});
529
- await db.run(drizzleOrm.sql`BEGIN IMMEDIATE`);
754
+ await runFrameStatement(drizzleOrm.sql`BEGIN IMMEDIATE`);
530
755
  try {
531
756
  const result = await fn(txBackend);
532
- await db.run(drizzleOrm.sql`COMMIT`);
757
+ await runFrameStatement(drizzleOrm.sql`COMMIT`);
533
758
  return result;
534
759
  } catch (error) {
535
- await db.run(drizzleOrm.sql`ROLLBACK`);
760
+ await runFrameStatement(drizzleOrm.sql`ROLLBACK`);
536
761
  throw error;
537
762
  }
538
763
  });
@@ -570,7 +795,7 @@ function createSqliteBackend(db, options = {}) {
570
795
  }
571
796
  const matTable = tables2.contributionMaterializations;
572
797
  async function ensureContributionMaterializationsTableImpl() {
573
- await db.run(drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(matTable)));
798
+ await db.run(drizzleOrm.sql.raw(chunkEM3CWPND_cjs.generateSqliteCreateTableSQL(matTable)));
574
799
  }
575
800
  async function getContributionMaterializationRow(identity) {
576
801
  const rows = await db.select().from(matTable).where(
@@ -583,16 +808,16 @@ function createSqliteBackend(db, options = {}) {
583
808
  );
584
809
  const row = rows[0];
585
810
  if (row === void 0) return void 0;
586
- return chunkUJLOZYKT_cjs.mapContributionMaterializationRow(
811
+ return chunkEM3CWPND_cjs.mapContributionMaterializationRow(
587
812
  row,
588
- chunkUJLOZYKT_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
813
+ chunkEM3CWPND_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
589
814
  );
590
815
  }
591
816
  async function recordContributionMaterializationRow(params) {
592
817
  await db.insert(matTable).values(
593
- chunkUJLOZYKT_cjs.buildContributionInsertValues(
818
+ chunkEM3CWPND_cjs.buildContributionInsertValues(
594
819
  params,
595
- chunkUJLOZYKT_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
820
+ chunkEM3CWPND_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
596
821
  )
597
822
  ).onConflictDoUpdate({
598
823
  target: [
@@ -601,13 +826,13 @@ function createSqliteBackend(db, options = {}) {
601
826
  matTable.owner,
602
827
  matTable.tableName
603
828
  ],
604
- set: chunkUJLOZYKT_cjs.buildContributionOnConflictSet(
829
+ set: chunkEM3CWPND_cjs.buildContributionOnConflictSet(
605
830
  matTable.materializedAt,
606
831
  params.materializedAt
607
832
  )
608
833
  });
609
834
  }
610
- const contributionMaterializer = chunkUJLOZYKT_cjs.createContributionMaterializer({
835
+ const contributionMaterializer = chunkEM3CWPND_cjs.createContributionMaterializer({
611
836
  dialect: "sqlite",
612
837
  fulltextStrategy,
613
838
  fulltextTableName: tables2.fulltextTableName,
@@ -627,22 +852,27 @@ function createSqliteBackend(db, options = {}) {
627
852
  tableNames,
628
853
  fulltextStrategy,
629
854
  vectorStrategy});
630
- return chunkUJLOZYKT_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
855
+ return chunkEM3CWPND_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
631
856
  }
632
857
  const backend = {
633
858
  ...operations,
634
859
  async bootstrapTables() {
635
- const statements = chunkUJLOZYKT_cjs.generateSqliteDDL(tables2, fulltextStrategy);
860
+ const statements = chunkEM3CWPND_cjs.generateSqliteDDL(tables2, fulltextStrategy);
636
861
  for (const statement of statements) {
637
862
  await db.run(drizzleOrm.sql.raw(statement));
638
863
  }
639
864
  },
865
+ async ensureRevisionOriginsTable() {
866
+ await db.run(
867
+ drizzleOrm.sql.raw(chunkEM3CWPND_cjs.generateSqliteCreateTableSQL(tables2.revisionOrigins))
868
+ );
869
+ },
640
870
  // Every fulltext-touching method asserts the durable marker instead
641
871
  // of lazily emitting DDL. Steady state performs zero ensure; an
642
872
  // uninitialized database throws `StoreNotInitializedError` rather
643
873
  // than self-healing (#135). Shared verbatim with the tx-scoped gate
644
874
  // via `gateFulltextMethods`.
645
- ...chunkUJLOZYKT_cjs.gateFulltextMethods(
875
+ ...chunkEM3CWPND_cjs.gateFulltextMethods(
646
876
  operations,
647
877
  contributionMaterializer.assertInitialized
648
878
  ),
@@ -651,7 +881,7 @@ function createSqliteBackend(db, options = {}) {
651
881
  },
652
882
  async ensureIndexMaterializationsTable() {
653
883
  await db.run(
654
- drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
884
+ drizzleOrm.sql.raw(chunkEM3CWPND_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
655
885
  );
656
886
  },
657
887
  async getIndexMaterialization(indexName) {
@@ -659,26 +889,26 @@ function createSqliteBackend(db, options = {}) {
659
889
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
660
890
  const row = rows[0];
661
891
  if (row === void 0) return void 0;
662
- return chunkUJLOZYKT_cjs.mapMaterializationRow(row, chunkUJLOZYKT_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
892
+ return chunkEM3CWPND_cjs.mapMaterializationRow(row, chunkEM3CWPND_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
663
893
  },
664
894
  async getIndexMaterializations(statusKeys) {
665
895
  if (statusKeys.length === 0) return [];
666
896
  const t = tables2.indexMaterializations;
667
897
  const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
668
898
  return rows.map(
669
- (row) => chunkUJLOZYKT_cjs.mapMaterializationRow(row, chunkUJLOZYKT_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
899
+ (row) => chunkEM3CWPND_cjs.mapMaterializationRow(row, chunkEM3CWPND_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
670
900
  );
671
901
  },
672
902
  async recordIndexMaterialization(params) {
673
903
  const t = tables2.indexMaterializations;
674
904
  await db.insert(t).values(
675
- chunkUJLOZYKT_cjs.buildMaterializationInsertValues(
905
+ chunkEM3CWPND_cjs.buildMaterializationInsertValues(
676
906
  params,
677
- chunkUJLOZYKT_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
907
+ chunkEM3CWPND_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
678
908
  )
679
909
  ).onConflictDoUpdate({
680
910
  target: t.indexName,
681
- set: chunkUJLOZYKT_cjs.buildMaterializationOnConflictSet(
911
+ set: chunkEM3CWPND_cjs.buildMaterializationOnConflictSet(
682
912
  t.materializedAt,
683
913
  params.materializedAt
684
914
  )
@@ -697,37 +927,37 @@ function createSqliteBackend(db, options = {}) {
697
927
  await contributionMaterializer.assertInitialized(graphId);
698
928
  },
699
929
  async ensureKindRemovalsTable() {
700
- await db.run(drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
930
+ await db.run(drizzleOrm.sql.raw(chunkEM3CWPND_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
701
931
  },
702
932
  async getPendingKindRemovals(graphId) {
703
933
  const t = tables2.kindRemovals;
704
934
  const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
705
935
  return rows.map(
706
- (row) => chunkUJLOZYKT_cjs.mapKindRemovalRow(row, chunkUJLOZYKT_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
936
+ (row) => chunkEM3CWPND_cjs.mapKindRemovalRow(row, chunkEM3CWPND_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
707
937
  );
708
938
  },
709
939
  async getAllKindRemovals(graphId) {
710
940
  const t = tables2.kindRemovals;
711
941
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
712
942
  return rows.map(
713
- (row) => chunkUJLOZYKT_cjs.mapKindRemovalRow(row, chunkUJLOZYKT_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
943
+ (row) => chunkEM3CWPND_cjs.mapKindRemovalRow(row, chunkEM3CWPND_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
714
944
  );
715
945
  },
716
946
  async recordKindRemoval(params) {
717
947
  const t = tables2.kindRemovals;
718
948
  await db.insert(t).values(
719
- chunkUJLOZYKT_cjs.buildKindRemovalInsertValues(
949
+ chunkEM3CWPND_cjs.buildKindRemovalInsertValues(
720
950
  params,
721
- chunkUJLOZYKT_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
951
+ chunkEM3CWPND_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
722
952
  )
723
953
  ).onConflictDoUpdate({
724
954
  target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
725
- set: chunkUJLOZYKT_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
955
+ set: chunkEM3CWPND_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
726
956
  });
727
957
  },
728
958
  async ensureReconciliationMarkersTable() {
729
959
  await db.run(
730
- drizzleOrm.sql.raw(chunkUJLOZYKT_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
960
+ drizzleOrm.sql.raw(chunkEM3CWPND_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
731
961
  );
732
962
  },
733
963
  async ensureRuntimeContributions(graphId) {
@@ -754,7 +984,19 @@ function createSqliteBackend(db, options = {}) {
754
984
  });
755
985
  },
756
986
  async refreshStatistics() {
757
- await db.run(drizzleOrm.sql`ANALYZE`);
987
+ await db.run(
988
+ drizzleOrm.sql`PRAGMA analysis_limit = ${drizzleOrm.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`
989
+ );
990
+ for (const tableName of coreAnalyzeTables) {
991
+ await db.run(drizzleOrm.sql`ANALYZE ${chunkCTTSDJLY_cjs.quoteIdentifier(tableName)}`);
992
+ }
993
+ for (const tableName of recordedAnalyzeTables) {
994
+ try {
995
+ await db.run(drizzleOrm.sql`ANALYZE ${chunkCTTSDJLY_cjs.quoteIdentifier(tableName)}`);
996
+ } catch (error) {
997
+ if (!chunkBLZDPRXT_cjs.isMissingTableError(error)) throw error;
998
+ }
999
+ }
758
1000
  },
759
1001
  async commitSchemaVersion(params) {
760
1002
  return runSchemaWriteTransaction(
@@ -783,19 +1025,19 @@ function createSqliteBackend(db, options = {}) {
783
1025
  tableNames,
784
1026
  fulltextStrategy,
785
1027
  vectorStrategy});
786
- await db.run(drizzleOrm.sql`BEGIN IMMEDIATE`);
1028
+ await runFrameStatement(drizzleOrm.sql`BEGIN IMMEDIATE`);
787
1029
  try {
788
1030
  const result = await fn(
789
- chunkUJLOZYKT_cjs.gateFulltext(
1031
+ chunkEM3CWPND_cjs.gateFulltext(
790
1032
  txBackend,
791
1033
  contributionMaterializer.assertInitialized
792
1034
  ),
793
1035
  db
794
1036
  );
795
- await db.run(drizzleOrm.sql`COMMIT`);
1037
+ await runFrameStatement(drizzleOrm.sql`COMMIT`);
796
1038
  return result;
797
1039
  } catch (error) {
798
- await db.run(drizzleOrm.sql`ROLLBACK`);
1040
+ await runFrameStatement(drizzleOrm.sql`ROLLBACK`);
799
1041
  throw error;
800
1042
  }
801
1043
  });
@@ -818,7 +1060,7 @@ function createSqliteBackend(db, options = {}) {
818
1060
  "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)."
819
1061
  );
820
1062
  }
821
- chunkUJLOZYKT_cjs.assertAdoptedDialect(
1063
+ chunkEM3CWPND_cjs.assertAdoptedDialect(
822
1064
  externalTx,
823
1065
  sqliteCore.BaseSQLiteDatabase,
824
1066
  "sqlite"
@@ -844,10 +1086,10 @@ function createTransactionBackend(options) {
844
1086
  tableNames: options.tableNames,
845
1087
  fulltextStrategy: options.fulltextStrategy,
846
1088
  vectorStrategy: options.vectorStrategy,
847
- ...options.vectorStrategy === void 0 ? {} : { vectorSlotLatch: chunkUJLOZYKT_cjs.createVectorSlotLatch() }
1089
+ ...options.vectorStrategy === void 0 ? {} : { vectorSlotLatch: chunkEM3CWPND_cjs.createVectorSlotLatch() }
848
1090
  });
849
1091
  }
850
1092
 
851
1093
  exports.createSqliteBackend = createSqliteBackend;
852
- //# sourceMappingURL=chunk-ZP5WHI4C.cjs.map
853
- //# sourceMappingURL=chunk-ZP5WHI4C.cjs.map
1094
+ //# sourceMappingURL=chunk-O7UN7OXA.cjs.map
1095
+ //# sourceMappingURL=chunk-O7UN7OXA.cjs.map