@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,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, vectorSlotFromParams, mapVectorWriteError, getOrCreateLru } from './chunk-RY2VIWAM.js';
2
- import { tables } from './chunk-CYX2JTDG.js';
3
- import { createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-QV245VMN.js';
4
- import { fts5Strategy, buildVectorCapabilities, buildFulltextCapabilities, assertVectorSearchLimit } from './chunk-KUTNI6SI.js';
5
- import { SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS } from './chunk-V3QNTB7Z.js';
6
- import { isMissingTableError } from './chunk-2MRAX3UE.js';
7
- import { ConfigurationError, BackendDisposedError } from './chunk-TQOYM4LN.js';
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 SQLITE_NODE_INSERT_BATCH_SIZE = Math.max(
160
- 1,
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 SQLITE_CHECK_UNIQUE_BATCH_CHUNK_SIZE = Math.max(
177
- 1,
178
- SQLITE_MAX_BIND_PARAMETERS - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
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
- const rows = await db.all(query);
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
- return await db.all(query);
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
- await db.run(query);
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(slot, params);
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 statements = operationStrategy.buildUpsertFulltextBatch(
419
- params,
420
- timestamp
421
- );
422
- for (const stmt of statements) {
423
- await execRun(stmt);
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 statements = operationStrategy.buildDeleteFulltextBatch(params);
429
- for (const stmt of statements) {
430
- await execRun(stmt);
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 db.run(sql`BEGIN IMMEDIATE`);
752
+ await runFrameStatement(sql`BEGIN IMMEDIATE`);
528
753
  try {
529
754
  const result = await fn(txBackend);
530
- await db.run(sql`COMMIT`);
755
+ await runFrameStatement(sql`COMMIT`);
531
756
  return result;
532
757
  } catch (error) {
533
- await db.run(sql`ROLLBACK`);
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(sql`ANALYZE`);
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 db.run(sql`BEGIN IMMEDIATE`);
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 db.run(sql`COMMIT`);
1035
+ await runFrameStatement(sql`COMMIT`);
794
1036
  return result;
795
1037
  } catch (error) {
796
- await db.run(sql`ROLLBACK`);
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-ZV5N4DBG.js.map
851
- //# sourceMappingURL=chunk-ZV5N4DBG.js.map
1092
+ //# sourceMappingURL=chunk-3TWF3SH4.js.map
1093
+ //# sourceMappingURL=chunk-3TWF3SH4.js.map