@nicia-ai/typegraph 0.44.0 → 0.46.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 (392) hide show
  1. package/dist/backend/drizzle/indexes.cjs +11 -11
  2. package/dist/backend/drizzle/indexes.d.cts +1 -1
  3. package/dist/backend/drizzle/indexes.d.ts +1 -1
  4. package/dist/backend/drizzle/indexes.js +7 -7
  5. package/dist/backend/index.cjs +53 -54
  6. package/dist/backend/index.d.cts +3 -3
  7. package/dist/backend/index.d.ts +3 -3
  8. package/dist/backend/index.js +13 -14
  9. package/dist/backend/postgres/index.cjs +29 -30
  10. package/dist/backend/postgres/index.d.cts +7 -7
  11. package/dist/backend/postgres/index.d.ts +7 -7
  12. package/dist/backend/postgres/index.js +16 -17
  13. package/dist/backend/postgres/pglite-store.cjs +48 -43
  14. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  15. package/dist/backend/postgres/pglite-store.d.cts +15 -9
  16. package/dist/backend/postgres/pglite-store.d.ts +15 -9
  17. package/dist/backend/postgres/pglite-store.js +44 -39
  18. package/dist/backend/postgres/pglite-store.js.map +1 -1
  19. package/dist/backend/postgres/pglite.cjs +18 -19
  20. package/dist/backend/postgres/pglite.d.cts +4 -4
  21. package/dist/backend/postgres/pglite.d.ts +4 -4
  22. package/dist/backend/postgres/pglite.js +17 -18
  23. package/dist/backend/sqlite/index.cjs +26 -27
  24. package/dist/backend/sqlite/index.d.cts +6 -6
  25. package/dist/backend/sqlite/index.d.ts +6 -6
  26. package/dist/backend/sqlite/index.js +14 -15
  27. package/dist/backend/sqlite/libsql.cjs +21 -22
  28. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  29. package/dist/backend/sqlite/libsql.d.cts +15 -8
  30. package/dist/backend/sqlite/libsql.d.ts +15 -8
  31. package/dist/backend/sqlite/libsql.js +17 -18
  32. package/dist/backend/sqlite/libsql.js.map +1 -1
  33. package/dist/backend/sqlite/local-store.cjs +49 -44
  34. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  35. package/dist/backend/sqlite/local-store.d.cts +15 -10
  36. package/dist/backend/sqlite/local-store.d.ts +15 -10
  37. package/dist/backend/sqlite/local-store.js +45 -40
  38. package/dist/backend/sqlite/local-store.js.map +1 -1
  39. package/dist/backend/sqlite/local.cjs +19 -20
  40. package/dist/backend/sqlite/local.d.cts +3 -3
  41. package/dist/backend/sqlite/local.d.ts +3 -3
  42. package/dist/backend/sqlite/local.js +17 -18
  43. package/dist/{chunk-XMYJY7NI.js → chunk-2LG2XB2M.js} +3 -3
  44. package/dist/{chunk-XMYJY7NI.js.map → chunk-2LG2XB2M.js.map} +1 -1
  45. package/dist/{chunk-QGKILWGZ.cjs → chunk-2NA5DYLO.cjs} +4 -4
  46. package/dist/{chunk-QGKILWGZ.cjs.map → chunk-2NA5DYLO.cjs.map} +1 -1
  47. package/dist/{chunk-5MUSU4ZP.cjs → chunk-3DHZCOT7.cjs} +20 -20
  48. package/dist/chunk-3DHZCOT7.cjs.map +1 -0
  49. package/dist/{chunk-OVUUTCPJ.cjs → chunk-4UGOKMI5.cjs} +268 -150
  50. package/dist/chunk-4UGOKMI5.cjs.map +1 -0
  51. package/dist/{chunk-FRHHDHKH.js → chunk-5262ZMTR.js} +26 -5
  52. package/dist/chunk-5262ZMTR.js.map +1 -0
  53. package/dist/{chunk-HOIFFY4M.js → chunk-5763DULU.js} +248 -76
  54. package/dist/chunk-5763DULU.js.map +1 -0
  55. package/dist/{chunk-7G32LIQM.js → chunk-5UVRGXD3.js} +277 -7
  56. package/dist/chunk-5UVRGXD3.js.map +1 -0
  57. package/dist/{chunk-IIT5K7SK.cjs → chunk-62ZP23AW.cjs} +15 -15
  58. package/dist/{chunk-IIT5K7SK.cjs.map → chunk-62ZP23AW.cjs.map} +1 -1
  59. package/dist/{chunk-S4KQ5LV4.js → chunk-775A4ZMN.js} +40 -6
  60. package/dist/chunk-775A4ZMN.js.map +1 -0
  61. package/dist/{chunk-QYWINYEA.cjs → chunk-7BQXPCGN.cjs} +830 -170
  62. package/dist/chunk-7BQXPCGN.cjs.map +1 -0
  63. package/dist/{chunk-FJMPR3OH.cjs → chunk-7EO3TCQB.cjs} +33 -7
  64. package/dist/chunk-7EO3TCQB.cjs.map +1 -0
  65. package/dist/chunk-7GT72YHH.cjs +1979 -0
  66. package/dist/chunk-7GT72YHH.cjs.map +1 -0
  67. package/dist/{chunk-SQRD2CYF.js → chunk-7VQXLT5O.js} +717 -76
  68. package/dist/chunk-7VQXLT5O.js.map +1 -0
  69. package/dist/{chunk-BCP7LLOY.js → chunk-7Z5OR7KO.js} +2706 -625
  70. package/dist/chunk-7Z5OR7KO.js.map +1 -0
  71. package/dist/chunk-A4OC4DVN.cjs +12 -0
  72. package/dist/{chunk-4SZ6XPTG.cjs.map → chunk-A4OC4DVN.cjs.map} +1 -1
  73. package/dist/{chunk-TDXIBCGY.cjs → chunk-A7J2YDDI.cjs} +5 -3
  74. package/dist/chunk-A7J2YDDI.cjs.map +1 -0
  75. package/dist/{chunk-FMMIX6N4.js → chunk-AKLS3BYZ.js} +56 -5
  76. package/dist/chunk-AKLS3BYZ.js.map +1 -0
  77. package/dist/{chunk-D7PG5D5K.js → chunk-AMKPPFUO.js} +32 -6
  78. package/dist/chunk-AMKPPFUO.js.map +1 -0
  79. package/dist/{chunk-PAW2XUZN.js → chunk-ASTI57H3.js} +3 -3
  80. package/dist/{chunk-PAW2XUZN.js.map → chunk-ASTI57H3.js.map} +1 -1
  81. package/dist/{chunk-FMGEZBAQ.js → chunk-BKCUOV7A.js} +27 -5
  82. package/dist/chunk-BKCUOV7A.js.map +1 -0
  83. package/dist/chunk-BSFJMMV3.cjs +268 -0
  84. package/dist/chunk-BSFJMMV3.cjs.map +1 -0
  85. package/dist/{chunk-63KCKSSH.js → chunk-C23WSN5E.js} +209 -24
  86. package/dist/chunk-C23WSN5E.js.map +1 -0
  87. package/dist/{chunk-JRP3VGHS.js → chunk-CBTIUB76.js} +3 -3
  88. package/dist/{chunk-JRP3VGHS.js.map → chunk-CBTIUB76.js.map} +1 -1
  89. package/dist/chunk-CNV4TXJG.js +58 -0
  90. package/dist/chunk-CNV4TXJG.js.map +1 -0
  91. package/dist/{chunk-QB6VMOJ2.cjs → chunk-CXBHOOIQ.cjs} +45 -10
  92. package/dist/chunk-CXBHOOIQ.cjs.map +1 -0
  93. package/dist/{chunk-46GDII45.js → chunk-DCQVHAYQ.js} +5 -5
  94. package/dist/{chunk-46GDII45.js.map → chunk-DCQVHAYQ.js.map} +1 -1
  95. package/dist/chunk-DLNROMQ7.js +306 -0
  96. package/dist/chunk-DLNROMQ7.js.map +1 -0
  97. package/dist/chunk-DYATYRY4.js +47 -0
  98. package/dist/chunk-DYATYRY4.js.map +1 -0
  99. package/dist/chunk-E4WNQBEF.cjs +217 -0
  100. package/dist/chunk-E4WNQBEF.cjs.map +1 -0
  101. package/dist/{chunk-G6Q5UM7U.js → chunk-FWJKWH6U.js} +5 -3
  102. package/dist/chunk-FWJKWH6U.js.map +1 -0
  103. package/dist/{chunk-BNUFUFAU.js → chunk-HFHTMECK.js} +7 -7
  104. package/dist/chunk-HFHTMECK.js.map +1 -0
  105. package/dist/{chunk-TFMVL4QH.js → chunk-I5MOXA4H.js} +20 -14
  106. package/dist/chunk-I5MOXA4H.js.map +1 -0
  107. package/dist/{chunk-4MB3AQAQ.js → chunk-J3WZ3FA2.js} +77 -3
  108. package/dist/chunk-J3WZ3FA2.js.map +1 -0
  109. package/dist/{chunk-UR7W5YQK.js → chunk-JBQQ7THH.js} +5 -3
  110. package/dist/chunk-JBQQ7THH.js.map +1 -0
  111. package/dist/chunk-JIVMTW7W.js +3393 -0
  112. package/dist/chunk-JIVMTW7W.js.map +1 -0
  113. package/dist/{chunk-2Y4IFKW7.js → chunk-JXA2ZP2Q.js} +6 -17
  114. package/dist/chunk-JXA2ZP2Q.js.map +1 -0
  115. package/dist/{chunk-GYA4JRP5.js → chunk-JXXDZTMN.js} +2 -2
  116. package/dist/chunk-JXXDZTMN.js.map +1 -0
  117. package/dist/chunk-JZUR7ZWE.js +254 -0
  118. package/dist/chunk-JZUR7ZWE.js.map +1 -0
  119. package/dist/chunk-K5ELX2GT.js +248 -0
  120. package/dist/chunk-K5ELX2GT.js.map +1 -0
  121. package/dist/chunk-LBJKZXDE.cjs +257 -0
  122. package/dist/chunk-LBJKZXDE.cjs.map +1 -0
  123. package/dist/{chunk-FGO5JFVJ.cjs → chunk-M4BDU5RX.cjs} +12 -12
  124. package/dist/{chunk-FGO5JFVJ.cjs.map → chunk-M4BDU5RX.cjs.map} +1 -1
  125. package/dist/{chunk-MIJKEVV7.js → chunk-MSY7FSX4.js} +37 -4
  126. package/dist/chunk-MSY7FSX4.js.map +1 -0
  127. package/dist/{chunk-ST3LPB2V.cjs → chunk-MUK4BU7K.cjs} +788 -146
  128. package/dist/chunk-MUK4BU7K.cjs.map +1 -0
  129. package/dist/{chunk-MCHP7RHZ.cjs → chunk-MXJDTH5B.cjs} +64 -41
  130. package/dist/chunk-MXJDTH5B.cjs.map +1 -0
  131. package/dist/{chunk-2VLBGQBY.cjs → chunk-N3257XE6.cjs} +724 -577
  132. package/dist/chunk-N3257XE6.cjs.map +1 -0
  133. package/dist/chunk-N66HCGCY.cjs +57 -0
  134. package/dist/chunk-N66HCGCY.cjs.map +1 -0
  135. package/dist/{chunk-CPEL3YIR.cjs → chunk-NFCVHQ5P.cjs} +55 -22
  136. package/dist/chunk-NFCVHQ5P.cjs.map +1 -0
  137. package/dist/{chunk-C4F7VJ5D.cjs → chunk-NI72YOJB.cjs} +84 -2
  138. package/dist/chunk-NI72YOJB.cjs.map +1 -0
  139. package/dist/{chunk-EE7N5XXQ.cjs → chunk-NK5Q7UNE.cjs} +10 -21
  140. package/dist/chunk-NK5Q7UNE.cjs.map +1 -0
  141. package/dist/{chunk-PHXITZE4.js → chunk-NMWDXFPH.js} +4 -4
  142. package/dist/{chunk-PHXITZE4.js.map → chunk-NMWDXFPH.js.map} +1 -1
  143. package/dist/{chunk-FSXTPBRN.js → chunk-NQ6BRJBE.js} +416 -850
  144. package/dist/chunk-NQ6BRJBE.js.map +1 -0
  145. package/dist/chunk-OH5E5KIO.js +2057 -0
  146. package/dist/chunk-OH5E5KIO.js.map +1 -0
  147. package/dist/chunk-ONU3HIED.cjs +2082 -0
  148. package/dist/chunk-ONU3HIED.cjs.map +1 -0
  149. package/dist/{chunk-STQ3BSED.cjs → chunk-PNN7RHVR.cjs} +66 -44
  150. package/dist/chunk-PNN7RHVR.cjs.map +1 -0
  151. package/dist/{chunk-6DCB664D.js → chunk-PQBQG7IM.js} +3 -3
  152. package/dist/{chunk-6DCB664D.js.map → chunk-PQBQG7IM.js.map} +1 -1
  153. package/dist/{chunk-ACSVZPK7.cjs → chunk-PWLJ77UV.cjs} +5 -3
  154. package/dist/chunk-PWLJ77UV.cjs.map +1 -0
  155. package/dist/chunk-Q7Q4WSLJ.cjs +328 -0
  156. package/dist/chunk-Q7Q4WSLJ.cjs.map +1 -0
  157. package/dist/{chunk-BEFM74L2.js → chunk-QLRESYPU.js} +637 -493
  158. package/dist/chunk-QLRESYPU.js.map +1 -0
  159. package/dist/{chunk-SBPC5IP3.js → chunk-QWX5YA3K.js} +784 -202
  160. package/dist/chunk-QWX5YA3K.js.map +1 -0
  161. package/dist/{chunk-TCRIQMBU.js → chunk-RJS7DECT.js} +8 -9
  162. package/dist/chunk-RJS7DECT.js.map +1 -0
  163. package/dist/{chunk-6JZUSDY2.cjs → chunk-RMQLSPA2.cjs} +297 -27
  164. package/dist/chunk-RMQLSPA2.cjs.map +1 -0
  165. package/dist/{chunk-SJDMVITW.cjs → chunk-RT5ZY4XA.cjs} +6 -5
  166. package/dist/chunk-RT5ZY4XA.cjs.map +1 -0
  167. package/dist/{chunk-IJTLXNGJ.js → chunk-T4XNKYXB.js} +780 -127
  168. package/dist/chunk-T4XNKYXB.js.map +1 -0
  169. package/dist/{chunk-PDGEXGS6.cjs → chunk-TQR4KBY2.cjs} +354 -182
  170. package/dist/chunk-TQR4KBY2.cjs.map +1 -0
  171. package/dist/chunk-TTAITEPJ.cjs +755 -0
  172. package/dist/chunk-TTAITEPJ.cjs.map +1 -0
  173. package/dist/{chunk-NN3QSOVS.cjs → chunk-U5SON7R2.cjs} +27 -27
  174. package/dist/{chunk-NN3QSOVS.cjs.map → chunk-U5SON7R2.cjs.map} +1 -1
  175. package/dist/{chunk-A2I2XO52.cjs → chunk-U63GDNRC.cjs} +32 -26
  176. package/dist/chunk-U63GDNRC.cjs.map +1 -0
  177. package/dist/{chunk-YNULOIR5.cjs → chunk-UDISNXDL.cjs} +64 -43
  178. package/dist/chunk-UDISNXDL.cjs.map +1 -0
  179. package/dist/{chunk-GWEDD3DH.js → chunk-UV3SN74I.js} +5 -5
  180. package/dist/{chunk-GWEDD3DH.js.map → chunk-UV3SN74I.js.map} +1 -1
  181. package/dist/{chunk-U5W4LKZV.cjs → chunk-VCRRKBLN.cjs} +9 -9
  182. package/dist/{chunk-U5W4LKZV.cjs.map → chunk-VCRRKBLN.cjs.map} +1 -1
  183. package/dist/{chunk-EFELJVLA.js → chunk-VGTJPTIC.js} +28 -5
  184. package/dist/chunk-VGTJPTIC.js.map +1 -0
  185. package/dist/chunk-VQH4VAWD.cjs +12 -0
  186. package/dist/{chunk-EPTSMFH7.cjs.map → chunk-VQH4VAWD.cjs.map} +1 -1
  187. package/dist/{chunk-SNXVDZAJ.js → chunk-W6OG3HDG.js} +5 -4
  188. package/dist/chunk-W6OG3HDG.js.map +1 -0
  189. package/dist/chunk-WDGA7IYB.js +207 -0
  190. package/dist/chunk-WDGA7IYB.js.map +1 -0
  191. package/dist/chunk-WEVQJ5LH.js +736 -0
  192. package/dist/chunk-WEVQJ5LH.js.map +1 -0
  193. package/dist/{chunk-3PRKZW6D.cjs → chunk-XBYVV3MP.cjs} +60 -5
  194. package/dist/chunk-XBYVV3MP.cjs.map +1 -0
  195. package/dist/{chunk-GFRGG2US.cjs → chunk-XCAGZAKP.cjs} +7 -7
  196. package/dist/{chunk-GFRGG2US.cjs.map → chunk-XCAGZAKP.cjs.map} +1 -1
  197. package/dist/{chunk-XR4YZFKW.cjs → chunk-XDF2UPEQ.cjs} +3864 -1783
  198. package/dist/chunk-XDF2UPEQ.cjs.map +1 -0
  199. package/dist/{chunk-7V2FGGI2.cjs → chunk-XMQSEJCF.cjs} +632 -1080
  200. package/dist/chunk-XMQSEJCF.cjs.map +1 -0
  201. package/dist/chunk-XNLIZYRZ.cjs +3432 -0
  202. package/dist/chunk-XNLIZYRZ.cjs.map +1 -0
  203. package/dist/{chunk-66UVLHQA.cjs → chunk-XNSI2FJO.cjs} +99 -100
  204. package/dist/chunk-XNSI2FJO.cjs.map +1 -0
  205. package/dist/chunk-XQSCL77R.cjs +60 -0
  206. package/dist/chunk-XQSCL77R.cjs.map +1 -0
  207. package/dist/{chunk-SVJ5GEXW.cjs → chunk-XUO3KQFO.cjs} +2 -2
  208. package/dist/chunk-XUO3KQFO.cjs.map +1 -0
  209. package/dist/{chunk-HJH3RMXG.cjs → chunk-YAAM3M2S.cjs} +10 -10
  210. package/dist/{chunk-HJH3RMXG.cjs.map → chunk-YAAM3M2S.cjs.map} +1 -1
  211. package/dist/{chunk-ATLN63JA.js → chunk-YBFHZUXX.js} +6 -6
  212. package/dist/{chunk-ATLN63JA.js.map → chunk-YBFHZUXX.js.map} +1 -1
  213. package/dist/{chunk-K3BUWSFR.js → chunk-YDFDBE6D.js} +119 -6
  214. package/dist/chunk-YDFDBE6D.js.map +1 -0
  215. package/dist/{chunk-OSZPLZIV.cjs → chunk-YVWGEQJE.cjs} +318 -132
  216. package/dist/chunk-YVWGEQJE.cjs.map +1 -0
  217. package/dist/{chunk-QT6V3YRH.js → chunk-YWGVVALJ.js} +3 -3
  218. package/dist/{chunk-QT6V3YRH.js.map → chunk-YWGVVALJ.js.map} +1 -1
  219. package/dist/core/index.cjs +40 -41
  220. package/dist/core/index.d.cts +4 -5
  221. package/dist/core/index.d.ts +4 -5
  222. package/dist/core/index.js +8 -9
  223. package/dist/{ddl-eWg7hx6R.d.cts → ddl-BJcOp4WZ.d.cts} +3 -3
  224. package/dist/{ddl-D5369kOY.d.ts → ddl-BXfGHbPN.d.ts} +3 -3
  225. package/dist/graph-extension/index.cjs +26 -23
  226. package/dist/graph-extension/index.d.cts +16 -6
  227. package/dist/graph-extension/index.d.ts +16 -6
  228. package/dist/graph-extension/index.js +7 -8
  229. package/dist/graph-merge/index.cjs +2459 -655
  230. package/dist/graph-merge/index.cjs.map +1 -1
  231. package/dist/graph-merge/index.d.cts +170 -33
  232. package/dist/graph-merge/index.d.ts +170 -33
  233. package/dist/graph-merge/index.js +2269 -468
  234. package/dist/graph-merge/index.js.map +1 -1
  235. package/dist/{index-By89Sezh.d.ts → index-BSHvKfok.d.ts} +221 -10
  236. package/dist/{index-DcQ3Sxs-.d.cts → index-DxaYCv8Y.d.cts} +221 -10
  237. package/dist/index.cjs +330 -269
  238. package/dist/index.cjs.map +1 -1
  239. package/dist/index.d.cts +590 -576
  240. package/dist/index.d.ts +590 -576
  241. package/dist/index.js +73 -50
  242. package/dist/index.js.map +1 -1
  243. package/dist/indexes/index.cjs +17 -17
  244. package/dist/indexes/index.d.cts +4 -4
  245. package/dist/indexes/index.d.ts +4 -4
  246. package/dist/indexes/index.js +10 -10
  247. package/dist/interchange/index.cjs +165 -50
  248. package/dist/interchange/index.cjs.map +1 -1
  249. package/dist/interchange/index.d.cts +261 -16
  250. package/dist/interchange/index.d.ts +261 -16
  251. package/dist/interchange/index.js +128 -24
  252. package/dist/interchange/index.js.map +1 -1
  253. package/dist/{manager-B0KjKE93.d.ts → manager-CfZAimti.d.ts} +36 -5
  254. package/dist/{manager-Cn0NFIhN.d.cts → manager-HGk6E_HW.d.cts} +36 -5
  255. package/dist/{materialize-indexes-BD4V3svD.d.ts → materialize-indexes-6A7dWGtb.d.cts} +10 -2
  256. package/dist/{materialize-indexes-DVRhd5h4.d.cts → materialize-indexes-BMJP6Tms.d.ts} +10 -2
  257. package/dist/{postgres-DaEWvN4x.d.cts → postgres-DFYWENdR.d.cts} +1961 -439
  258. package/dist/{postgres-u0a0HN2D.d.ts → postgres-e7a9TdvR.d.ts} +1961 -439
  259. package/dist/profiler/index.cjs +15 -15
  260. package/dist/profiler/index.d.cts +9 -10
  261. package/dist/profiler/index.d.ts +9 -10
  262. package/dist/profiler/index.js +4 -4
  263. package/dist/provenance/index.cjs +46 -48
  264. package/dist/provenance/index.cjs.map +1 -1
  265. package/dist/provenance/index.d.cts +7 -7
  266. package/dist/provenance/index.d.ts +7 -7
  267. package/dist/provenance/index.js +12 -14
  268. package/dist/provenance/index.js.map +1 -1
  269. package/dist/schema/index.cjs +50 -49
  270. package/dist/schema/index.d.cts +9 -16
  271. package/dist/schema/index.d.ts +9 -16
  272. package/dist/schema/index.js +23 -22
  273. package/dist/{searchable-CnYEancP.d.ts → searchable-9OQoPuRs.d.ts} +1 -2
  274. package/dist/{searchable-BT7j9_IK.d.cts → searchable-CIje5XYD.d.cts} +1 -2
  275. package/dist/{sqlite-BrMoSsI7.d.cts → sqlite-DerU5tc7.d.ts} +2029 -347
  276. package/dist/{sqlite-CHhZUyO5.d.ts → sqlite-DitnISa9.d.cts} +2029 -347
  277. package/dist/{store-view-Bvdku0Ht.d.ts → store-DawaWWjJ.d.ts} +3145 -2556
  278. package/dist/{store-view-w-md0nQ4.d.cts → store-RwTJx8LX.d.cts} +3145 -2556
  279. package/dist/{temporal-BCORwUau.d.cts → temporal-Bn-Fi8FJ.d.cts} +1 -1
  280. package/dist/{temporal--x9T8K4S.d.ts → temporal-BtM4UALv.d.ts} +1 -1
  281. package/dist/{types-6-WJmSD4.d.cts → types-CoIx8HX5.d.cts} +1 -1
  282. package/dist/{types-Cjvkj0jA.d.ts → types-HkveCCx0.d.cts} +866 -21
  283. package/dist/{types-Cjvkj0jA.d.cts → types-HkveCCx0.d.ts} +866 -21
  284. package/dist/{types-COODtTJU.d.ts → types-KFfk-8Ah.d.ts} +1 -1
  285. package/dist/{where-CUQmCR6d.d.cts → where--fk7_0kv.d.cts} +1 -1
  286. package/dist/{where-5xVawAwL.d.ts → where-ws5hf-Ov.d.ts} +1 -1
  287. package/package.json +1 -1
  288. package/dist/chunk-2BIG7U6E.cjs +0 -83
  289. package/dist/chunk-2BIG7U6E.cjs.map +0 -1
  290. package/dist/chunk-2L54C2C2.js +0 -144
  291. package/dist/chunk-2L54C2C2.js.map +0 -1
  292. package/dist/chunk-2VLBGQBY.cjs.map +0 -1
  293. package/dist/chunk-2WDD2NO3.js +0 -59
  294. package/dist/chunk-2WDD2NO3.js.map +0 -1
  295. package/dist/chunk-2Y4IFKW7.js.map +0 -1
  296. package/dist/chunk-35S6P5ZU.js +0 -27
  297. package/dist/chunk-35S6P5ZU.js.map +0 -1
  298. package/dist/chunk-3PRKZW6D.cjs.map +0 -1
  299. package/dist/chunk-4MB3AQAQ.js.map +0 -1
  300. package/dist/chunk-4SZ6XPTG.cjs +0 -12
  301. package/dist/chunk-5MUSU4ZP.cjs.map +0 -1
  302. package/dist/chunk-63KCKSSH.js.map +0 -1
  303. package/dist/chunk-66UVLHQA.cjs.map +0 -1
  304. package/dist/chunk-6JZUSDY2.cjs.map +0 -1
  305. package/dist/chunk-764JHTLT.cjs +0 -15
  306. package/dist/chunk-764JHTLT.cjs.map +0 -1
  307. package/dist/chunk-7G32LIQM.js.map +0 -1
  308. package/dist/chunk-7V2FGGI2.cjs.map +0 -1
  309. package/dist/chunk-A2I2XO52.cjs.map +0 -1
  310. package/dist/chunk-A4PBRX4C.cjs +0 -100
  311. package/dist/chunk-A4PBRX4C.cjs.map +0 -1
  312. package/dist/chunk-ACSVZPK7.cjs.map +0 -1
  313. package/dist/chunk-ALFUGRYB.cjs +0 -1282
  314. package/dist/chunk-ALFUGRYB.cjs.map +0 -1
  315. package/dist/chunk-B75XRV3O.js +0 -125
  316. package/dist/chunk-B75XRV3O.js.map +0 -1
  317. package/dist/chunk-BCP7LLOY.js.map +0 -1
  318. package/dist/chunk-BEFM74L2.js.map +0 -1
  319. package/dist/chunk-BNUFUFAU.js.map +0 -1
  320. package/dist/chunk-C4F7VJ5D.cjs.map +0 -1
  321. package/dist/chunk-CPEL3YIR.cjs.map +0 -1
  322. package/dist/chunk-D7PG5D5K.js.map +0 -1
  323. package/dist/chunk-DI74SMXS.cjs +0 -29
  324. package/dist/chunk-DI74SMXS.cjs.map +0 -1
  325. package/dist/chunk-DK2S42XB.js +0 -77
  326. package/dist/chunk-DK2S42XB.js.map +0 -1
  327. package/dist/chunk-DRACN6XG.js +0 -27
  328. package/dist/chunk-DRACN6XG.js.map +0 -1
  329. package/dist/chunk-EE7N5XXQ.cjs.map +0 -1
  330. package/dist/chunk-EFELJVLA.js.map +0 -1
  331. package/dist/chunk-EPTSMFH7.cjs +0 -12
  332. package/dist/chunk-EQ7JKLZO.cjs +0 -157
  333. package/dist/chunk-EQ7JKLZO.cjs.map +0 -1
  334. package/dist/chunk-FJMPR3OH.cjs.map +0 -1
  335. package/dist/chunk-FMGEZBAQ.js.map +0 -1
  336. package/dist/chunk-FMMIX6N4.js.map +0 -1
  337. package/dist/chunk-FRHHDHKH.js.map +0 -1
  338. package/dist/chunk-FSXTPBRN.js.map +0 -1
  339. package/dist/chunk-G6Q5UM7U.js.map +0 -1
  340. package/dist/chunk-GYA4JRP5.js.map +0 -1
  341. package/dist/chunk-HOHAJ2NR.cjs +0 -61
  342. package/dist/chunk-HOHAJ2NR.cjs.map +0 -1
  343. package/dist/chunk-HOIFFY4M.js.map +0 -1
  344. package/dist/chunk-IIMQJYAM.js +0 -81
  345. package/dist/chunk-IIMQJYAM.js.map +0 -1
  346. package/dist/chunk-IJTLXNGJ.js.map +0 -1
  347. package/dist/chunk-ITE4IXAK.js +0 -25
  348. package/dist/chunk-ITE4IXAK.js.map +0 -1
  349. package/dist/chunk-K3BUWSFR.js.map +0 -1
  350. package/dist/chunk-KCO5EFJU.js +0 -79
  351. package/dist/chunk-KCO5EFJU.js.map +0 -1
  352. package/dist/chunk-KKYELPZ2.cjs +0 -83
  353. package/dist/chunk-KKYELPZ2.cjs.map +0 -1
  354. package/dist/chunk-MCHP7RHZ.cjs.map +0 -1
  355. package/dist/chunk-MIJKEVV7.js.map +0 -1
  356. package/dist/chunk-NCX65HBY.cjs +0 -1396
  357. package/dist/chunk-NCX65HBY.cjs.map +0 -1
  358. package/dist/chunk-OSZPLZIV.cjs.map +0 -1
  359. package/dist/chunk-OVUUTCPJ.cjs.map +0 -1
  360. package/dist/chunk-PDGEXGS6.cjs.map +0 -1
  361. package/dist/chunk-QB6VMOJ2.cjs.map +0 -1
  362. package/dist/chunk-QMQLUA66.js +0 -12
  363. package/dist/chunk-QMQLUA66.js.map +0 -1
  364. package/dist/chunk-QYWINYEA.cjs.map +0 -1
  365. package/dist/chunk-S4KQ5LV4.js.map +0 -1
  366. package/dist/chunk-SBPC5IP3.js.map +0 -1
  367. package/dist/chunk-SJDMVITW.cjs.map +0 -1
  368. package/dist/chunk-SNXVDZAJ.js.map +0 -1
  369. package/dist/chunk-SQRD2CYF.js.map +0 -1
  370. package/dist/chunk-ST3LPB2V.cjs.map +0 -1
  371. package/dist/chunk-STQ3BSED.cjs.map +0 -1
  372. package/dist/chunk-SVJ5GEXW.cjs.map +0 -1
  373. package/dist/chunk-TCRIQMBU.js.map +0 -1
  374. package/dist/chunk-TDXIBCGY.cjs.map +0 -1
  375. package/dist/chunk-TFMVL4QH.js.map +0 -1
  376. package/dist/chunk-TRF4EBJT.cjs +0 -30
  377. package/dist/chunk-TRF4EBJT.cjs.map +0 -1
  378. package/dist/chunk-TVLKA4AY.js +0 -94
  379. package/dist/chunk-TVLKA4AY.js.map +0 -1
  380. package/dist/chunk-UR7W5YQK.js.map +0 -1
  381. package/dist/chunk-VITTKBWF.js +0 -1263
  382. package/dist/chunk-VITTKBWF.js.map +0 -1
  383. package/dist/chunk-WBUFJ7BS.cjs +0 -131
  384. package/dist/chunk-WBUFJ7BS.cjs.map +0 -1
  385. package/dist/chunk-XR4YZFKW.cjs.map +0 -1
  386. package/dist/chunk-YNULOIR5.cjs.map +0 -1
  387. package/dist/chunk-ZDH3DX3C.cjs +0 -30
  388. package/dist/chunk-ZDH3DX3C.cjs.map +0 -1
  389. package/dist/chunk-ZTAJL4DT.cjs +0 -85
  390. package/dist/chunk-ZTAJL4DT.cjs.map +0 -1
  391. package/dist/define-graph-DVF-oN1i.d.cts +0 -173
  392. package/dist/define-graph-SvYXOl78.d.ts +0 -173
@@ -1,16 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkST3LPB2V_cjs = require('./chunk-ST3LPB2V.cjs');
4
- var chunkHJH3RMXG_cjs = require('./chunk-HJH3RMXG.cjs');
5
- var chunk6JZUSDY2_cjs = require('./chunk-6JZUSDY2.cjs');
6
- var chunkNN3QSOVS_cjs = require('./chunk-NN3QSOVS.cjs');
7
- var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
8
- var chunk3PRKZW6D_cjs = require('./chunk-3PRKZW6D.cjs');
9
- var chunkWBUFJ7BS_cjs = require('./chunk-WBUFJ7BS.cjs');
10
- var chunkOVUUTCPJ_cjs = require('./chunk-OVUUTCPJ.cjs');
11
- var chunkU5W4LKZV_cjs = require('./chunk-U5W4LKZV.cjs');
12
- var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
13
- var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
3
+ var chunkMUK4BU7K_cjs = require('./chunk-MUK4BU7K.cjs');
4
+ var chunkYAAM3M2S_cjs = require('./chunk-YAAM3M2S.cjs');
5
+ var chunkRMQLSPA2_cjs = require('./chunk-RMQLSPA2.cjs');
6
+ var chunkU5SON7R2_cjs = require('./chunk-U5SON7R2.cjs');
7
+ var chunkBSFJMMV3_cjs = require('./chunk-BSFJMMV3.cjs');
8
+ var chunkXBYVV3MP_cjs = require('./chunk-XBYVV3MP.cjs');
9
+ var chunk4UGOKMI5_cjs = require('./chunk-4UGOKMI5.cjs');
10
+ var chunkVCRRKBLN_cjs = require('./chunk-VCRRKBLN.cjs');
11
+ var chunkNI72YOJB_cjs = require('./chunk-NI72YOJB.cjs');
12
+ var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
14
13
  var drizzleOrm = require('drizzle-orm');
15
14
  var sqliteCore = require('drizzle-orm/sqlite-core');
16
15
 
@@ -101,14 +100,14 @@ function hasModernBindLimitByVersion(rows) {
101
100
  }
102
101
  function detectHardMaxBindParameters(transactionMode, hostedPlatform) {
103
102
  if (hostedPlatform === "durable-object" || transactionMode === "do-sqlite") {
104
- return chunk3PRKZW6D_cjs.DURABLE_OBJECT_MAX_BIND_PARAMETERS;
103
+ return chunkXBYVV3MP_cjs.DURABLE_OBJECT_MAX_BIND_PARAMETERS;
105
104
  }
106
- if (hostedPlatform === "d1") return chunk3PRKZW6D_cjs.D1_MAX_BIND_PARAMETERS;
105
+ if (hostedPlatform === "d1") return chunkXBYVV3MP_cjs.D1_MAX_BIND_PARAMETERS;
107
106
  return void 0;
108
107
  }
109
108
  function detectMaxBindParameters(sqliteClient, hardMaxBindParameters) {
110
109
  if (hardMaxBindParameters !== void 0) return hardMaxBindParameters;
111
- if (sqliteClient === void 0) return chunk3PRKZW6D_cjs.SQLITE_MAX_BIND_PARAMETERS;
110
+ if (sqliteClient === void 0) return chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS;
112
111
  try {
113
112
  const compiled = parseCompiledMaxVariableNumber(
114
113
  sqliteClient.prepare("PRAGMA compile_options").all()
@@ -117,20 +116,39 @@ function detectMaxBindParameters(sqliteClient, hardMaxBindParameters) {
117
116
  const isModern = hasModernBindLimitByVersion(
118
117
  sqliteClient.prepare("SELECT sqlite_version() AS version").all()
119
118
  );
120
- return isModern ? chunk3PRKZW6D_cjs.MODERN_SQLITE_MAX_BIND_PARAMETERS : chunk3PRKZW6D_cjs.SQLITE_MAX_BIND_PARAMETERS;
119
+ return isModern ? chunkXBYVV3MP_cjs.MODERN_SQLITE_MAX_BIND_PARAMETERS : chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS;
121
120
  } catch {
122
- return chunk3PRKZW6D_cjs.SQLITE_MAX_BIND_PARAMETERS;
121
+ return chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS;
123
122
  }
124
123
  }
124
+ function preparingClient(client) {
125
+ if (typeof client !== "object" || client === null) return void 0;
126
+ const candidate = client;
127
+ return typeof candidate["prepare"] === "function" ? candidate : void 0;
128
+ }
129
+ function hasMethods(client, methods) {
130
+ return methods.every((method) => typeof client[method] === "function");
131
+ }
132
+ function isBetterSqlite3Client(client) {
133
+ const candidate = preparingClient(client);
134
+ return candidate !== void 0 && hasMethods(candidate, ["pragma"]);
135
+ }
136
+ function isBunSqliteClient(client) {
137
+ const candidate = preparingClient(client);
138
+ return candidate !== void 0 && hasMethods(candidate, ["query", "run", "exec", "serialize"]) && typeof candidate["filename"] === "string";
139
+ }
140
+ function isSqlJsClient(client) {
141
+ const candidate = preparingClient(client);
142
+ return candidate !== void 0 && hasMethods(candidate, ["exec", "run", "export", "getRowsModified"]);
143
+ }
125
144
  function resolveSqliteClient(db) {
126
145
  const sqliteClient = db.$client;
127
- if (typeof sqliteClient !== "object" || sqliteClient === null) return;
128
- const candidate = sqliteClient;
129
- if (typeof candidate["prepare"] !== "function") return;
146
+ if (preparingClient(sqliteClient) === void 0) return;
147
+ if (isSqlJsClient(sqliteClient)) return;
130
148
  return sqliteClient;
131
149
  }
132
150
  function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
133
- return chunkST3LPB2V_cjs.getOrCreateLru(
151
+ return chunkMUK4BU7K_cjs.getOrCreateLru(
134
152
  cache,
135
153
  sqlText,
136
154
  cacheMax,
@@ -182,7 +200,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
182
200
  supportsCompiledExecution: sqliteClient !== void 0,
183
201
  transactionMode
184
202
  };
185
- const compile = (query) => chunkNN3QSOVS_cjs.compileQueryWithDialect(db, query, "SQLite");
203
+ const compile = (query) => chunkU5SON7R2_cjs.compileQueryWithDialect(db, query, "SQLite");
186
204
  if (sqliteClient !== void 0) {
187
205
  let executeCompiled2 = function(compiledQuery) {
188
206
  const preparedStatement = getOrCreatePreparedStatement(
@@ -255,7 +273,7 @@ function createSqliteExecutionAdapter(db, statementCacheMaxOrOptions = {}) {
255
273
  execute(query) {
256
274
  return executeDrizzleQuery(
257
275
  db,
258
- chunkU5W4LKZV_cjs.isSqlFragment(query) ? chunkNN3QSOVS_cjs.toDrizzleSql(query, "sqlite") : query
276
+ chunkVCRRKBLN_cjs.isSqlFragment(query) ? chunkU5SON7R2_cjs.toDrizzleSql(query, "sqlite") : query
259
277
  );
260
278
  },
261
279
  profile
@@ -270,8 +288,15 @@ var GET_EDGES_FIXED_PARAM_COUNT = 1;
270
288
  var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
271
289
  var FULLTEXT_UPSERT_PARAM_COUNT = 6;
272
290
  var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
291
+ var UNIQUE_DELETE_FIXED_PARAM_COUNT = 2;
273
292
  var UNIQUE_INSERT_PARAM_COUNT = 6;
274
293
  var SQLITE_ANALYZE_ROW_LIMIT = 1e3;
294
+ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
295
+ "identityAssertions",
296
+ "recordedIdentityAssertions",
297
+ "identityClosure",
298
+ "identitySeparation"
299
+ ]);
275
300
  function computeSqliteBatchChunkSizes(maxBindParameters) {
276
301
  return {
277
302
  checkUniqueBatchChunkSize: Math.max(
@@ -280,7 +305,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
280
305
  ),
281
306
  embeddingUpsertBatchSize: Math.max(
282
307
  1,
283
- Math.floor(maxBindParameters / chunkST3LPB2V_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
308
+ Math.floor(maxBindParameters / chunkMUK4BU7K_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
284
309
  ),
285
310
  fulltextUpsertBatchSize: Math.max(
286
311
  1,
@@ -296,7 +321,7 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
296
321
  ),
297
322
  findEdgesEndpointChunkSize: Math.max(
298
323
  1,
299
- maxBindParameters - chunkST3LPB2V_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
324
+ maxBindParameters - chunkMUK4BU7K_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
300
325
  ),
301
326
  getEdgesChunkSize: Math.max(
302
327
  1,
@@ -310,17 +335,21 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
310
335
  1,
311
336
  Math.floor(maxBindParameters / NODE_INSERT_PARAM_COUNT)
312
337
  ),
338
+ uniqueDeleteChunkSize: Math.max(
339
+ 1,
340
+ maxBindParameters - UNIQUE_DELETE_FIXED_PARAM_COUNT
341
+ ),
313
342
  uniqueInsertBatchSize: Math.max(
314
343
  1,
315
344
  Math.floor(maxBindParameters / UNIQUE_INSERT_PARAM_COUNT)
316
345
  )
317
346
  };
318
347
  }
319
- var toNodeRow = chunkHJH3RMXG_cjs.createNodeRowMapper(chunkHJH3RMXG_cjs.SQLITE_ROW_MAPPER_CONFIG);
320
- var toEdgeRow = chunkHJH3RMXG_cjs.createEdgeRowMapper(chunkHJH3RMXG_cjs.SQLITE_ROW_MAPPER_CONFIG);
321
- var toUniqueRow = chunkHJH3RMXG_cjs.createUniqueRowMapper(chunkHJH3RMXG_cjs.SQLITE_ROW_MAPPER_CONFIG);
322
- var toSchemaVersionRow = chunkHJH3RMXG_cjs.createSchemaVersionRowMapper(
323
- chunkHJH3RMXG_cjs.SQLITE_ROW_MAPPER_CONFIG
348
+ var toNodeRow = chunkYAAM3M2S_cjs.createNodeRowMapper(chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG);
349
+ var toEdgeRow = chunkYAAM3M2S_cjs.createEdgeRowMapper(chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG);
350
+ var toUniqueRow = chunkYAAM3M2S_cjs.createUniqueRowMapper(chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG);
351
+ var toSchemaVersionRow = chunkYAAM3M2S_cjs.createSchemaVersionRowMapper(
352
+ chunkYAAM3M2S_cjs.SQLITE_ROW_MAPPER_CONFIG
324
353
  );
325
354
  var PENDING_FOREVER = new Promise(noop);
326
355
  function pendingForever() {
@@ -339,7 +368,7 @@ async function loadQueueTaskContext() {
339
368
  void loadQueueTaskContext();
340
369
  function rejectReentrantQueueSubmission() {
341
370
  return Promise.reject(
342
- new chunkC4F7VJ5D_cjs.ConfigurationError(
371
+ new chunkNI72YOJB_cjs.ConfigurationError(
343
372
  "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.",
344
373
  { backend: "sqlite", capability: "concurrentRootAccess" },
345
374
  {
@@ -360,7 +389,7 @@ function createSerializedExecutionQueue() {
360
389
  disposed = true;
361
390
  },
362
391
  runExclusive(task) {
363
- if (isDisposed()) return Promise.reject(new chunkC4F7VJ5D_cjs.BackendDisposedError());
392
+ if (isDisposed()) return Promise.reject(new chunkNI72YOJB_cjs.BackendDisposedError());
364
393
  if (queueTaskContext?.getStore() === taskMarker) {
365
394
  return rejectReentrantQueueSubmission();
366
395
  }
@@ -388,7 +417,7 @@ function runWithSerializedQueue(queue, task) {
388
417
  return queue.runExclusive(task);
389
418
  }
390
419
  function throwSqliteTransactionsDisabled(message) {
391
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(message, {
420
+ throw new chunkNI72YOJB_cjs.ConfigurationError(message, {
392
421
  backend: "sqlite",
393
422
  capability: "transactions",
394
423
  supportsTransactions: false
@@ -396,20 +425,20 @@ function throwSqliteTransactionsDisabled(message) {
396
425
  }
397
426
  function buildSqliteCapabilities(options) {
398
427
  const base = options.transactionMode === "none" ? {
399
- ...chunk3PRKZW6D_cjs.SQLITE_CAPABILITIES,
428
+ ...chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES,
400
429
  transactions: false,
401
430
  graphAnalytics: {
402
- ...chunk3PRKZW6D_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
431
+ ...chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
403
432
  mathFunctions: false
404
433
  },
405
434
  supported: false
406
435
  }
407
- } : chunk3PRKZW6D_cjs.SQLITE_CAPABILITIES;
436
+ } : chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES;
408
437
  return {
409
438
  ...base,
410
439
  maxBindParameters: options.maxBindParameters,
411
- fulltext: chunkOVUUTCPJ_cjs.buildFulltextCapabilities(options.fulltextStrategy),
412
- ...options.vectorStrategy === void 0 ? {} : { vector: chunkOVUUTCPJ_cjs.buildVectorCapabilities(options.vectorStrategy) }
440
+ fulltext: chunk4UGOKMI5_cjs.buildFulltextCapabilities(options.fulltextStrategy),
441
+ ...options.vectorStrategy === void 0 ? {} : { vector: chunk4UGOKMI5_cjs.buildVectorCapabilities(options.vectorStrategy) }
413
442
  };
414
443
  }
415
444
  function resolveMaxBindParametersCapability(profile, override) {
@@ -417,7 +446,7 @@ function resolveMaxBindParametersCapability(profile, override) {
417
446
  return profile.hardMaxBindParameters === void 0 ? requested : Math.min(requested, profile.hardMaxBindParameters);
418
447
  }
419
448
  function resolveSqliteGraphAnalyticsCapabilities(profile, override) {
420
- const requested = override ?? chunk3PRKZW6D_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
449
+ const requested = override ?? chunkXBYVV3MP_cjs.SQLITE_CAPABILITIES.graphAnalytics ?? {
421
450
  supported: false,
422
451
  mathFunctions: false
423
452
  };
@@ -463,7 +492,7 @@ function createSqliteOperationBackend(options) {
463
492
  return runWithSerializedQueue(serializedQueue, async () => {
464
493
  if (compiledRun === void 0) {
465
494
  await db.run(
466
- chunkU5W4LKZV_cjs.isSqlFragment(query) ? chunkNN3QSOVS_cjs.toDrizzleSql(query, "sqlite") : query
495
+ chunkVCRRKBLN_cjs.isSqlFragment(query) ? chunkU5SON7R2_cjs.toDrizzleSql(query, "sqlite") : query
467
496
  );
468
497
  return;
469
498
  }
@@ -471,16 +500,17 @@ function createSqliteOperationBackend(options) {
471
500
  });
472
501
  }
473
502
  const batchConfig = computeSqliteBatchChunkSizes(
474
- capabilities.maxBindParameters ?? chunk3PRKZW6D_cjs.SQLITE_MAX_BIND_PARAMETERS
503
+ capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS
475
504
  );
476
- const commonBackend = chunkST3LPB2V_cjs.createCommonOperationBackend({
505
+ const commonBackend = chunkMUK4BU7K_cjs.createCommonOperationBackend({
477
506
  batchConfig,
478
507
  execution: {
479
508
  execAll,
480
509
  execGet,
481
510
  execRun
482
511
  },
483
- nowIso: chunkHJH3RMXG_cjs.nowIso,
512
+ nowIso: chunkYAAM3M2S_cjs.nowIso,
513
+ maxBindParameters: capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.SQLITE_MAX_BIND_PARAMETERS,
484
514
  operationStrategy,
485
515
  rowMappers: {
486
516
  toEdgeRow,
@@ -500,28 +530,28 @@ function createSqliteOperationBackend(options) {
500
530
  };
501
531
  const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
502
532
  async upsertEmbedding(params) {
503
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
533
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
504
534
  await contributionMaterializer.assertVectorSlot(slot);
505
- const statements = vectorStrategy.buildUpsert(slot, params, chunkHJH3RMXG_cjs.nowIso());
535
+ const statements = vectorStrategy.buildUpsert(slot, params, chunkYAAM3M2S_cjs.nowIso());
506
536
  try {
507
537
  for (const statement of statements) {
508
538
  await execRun(statement);
509
539
  }
510
540
  } catch (error) {
511
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
541
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
512
542
  }
513
543
  },
514
544
  async upsertEmbeddingBatch(params) {
515
545
  if (params.rows.length === 0) return;
516
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
546
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
517
547
  await contributionMaterializer.assertVectorSlot(slot);
518
548
  const rowsById = new Map(
519
549
  params.rows.map((row) => [row.nodeId, row])
520
550
  );
521
551
  const rows = [...rowsById.values()];
522
- const timestamp = chunkHJH3RMXG_cjs.nowIso();
552
+ const timestamp = chunkYAAM3M2S_cjs.nowIso();
523
553
  try {
524
- for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
554
+ for (const chunk2 of chunkBSFJMMV3_cjs.chunk(
525
555
  rows,
526
556
  batchConfig.embeddingUpsertBatchSize
527
557
  )) {
@@ -550,37 +580,60 @@ function createSqliteOperationBackend(options) {
550
580
  }
551
581
  }
552
582
  } catch (error) {
553
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
583
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
554
584
  }
555
585
  },
556
586
  async deleteEmbedding(params) {
557
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
587
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
558
588
  await contributionMaterializer.assertVectorSlot(slot);
559
589
  const statements = vectorStrategy.buildDelete(slot, params);
560
590
  for (const statement of statements) {
561
591
  await execRun(statement);
562
592
  }
563
593
  },
594
+ async deleteEmbeddingBatch(params) {
595
+ if (params.nodeIds.length === 0) return;
596
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
597
+ await contributionMaterializer.assertVectorSlot(slot);
598
+ for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
599
+ [...new Set(params.nodeIds)],
600
+ batchConfig.embeddingUpsertBatchSize
601
+ )) {
602
+ const statements = vectorStrategy.buildDeleteBatch(slot, {
603
+ ...params,
604
+ nodeIds
605
+ });
606
+ for (const statement of statements) await execRun(statement);
607
+ }
608
+ },
564
609
  async vectorSearch(params) {
565
- chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.limit);
566
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
610
+ chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.limit);
611
+ chunk4UGOKMI5_cjs.resolveEfSearchOverride({
612
+ efSearch: params.efSearch,
613
+ indexType: params.indexType,
614
+ tuning: chunk4UGOKMI5_cjs.vectorSearchFrontierTuning(vectorStrategy),
615
+ transactions: capabilities.transactions,
616
+ dialect: "SQLite",
617
+ engine: vectorStrategy.name
618
+ });
619
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
567
620
  const query = vectorStrategy.buildSearch(
568
621
  slot,
569
622
  params,
570
623
  // Store-compiled candidates (predicates + subclass + currency)
571
624
  // take precedence; the live-node default covers direct backend use.
572
- params.candidates ?? chunkST3LPB2V_cjs.buildLiveNodeCandidates(
625
+ params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
573
626
  tableNames.nodes,
574
627
  params.graphId,
575
628
  params.nodeKind,
576
- chunkHJH3RMXG_cjs.nowIso()
629
+ chunkYAAM3M2S_cjs.nowIso()
577
630
  )
578
631
  );
579
632
  let rows;
580
633
  try {
581
634
  rows = await execAll(query);
582
635
  } catch (error) {
583
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
636
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
584
637
  }
585
638
  return rows.map((row) => ({
586
639
  nodeId: row.node_id,
@@ -592,9 +645,17 @@ function createSqliteOperationBackend(options) {
592
645
  // fallback by simply not exposing the member.
593
646
  ...capabilities.windowFunctions ? {
594
647
  async hybridSearch(params) {
595
- chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.limit);
596
- chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.vector.k);
597
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams({
648
+ chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.limit);
649
+ chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.vector.k);
650
+ chunk4UGOKMI5_cjs.resolveEfSearchOverride({
651
+ efSearch: params.vector.efSearch,
652
+ indexType: params.vector.indexType,
653
+ tuning: chunk4UGOKMI5_cjs.vectorSearchFrontierTuning(vectorStrategy),
654
+ transactions: capabilities.transactions,
655
+ dialect: "SQLite",
656
+ engine: vectorStrategy.name
657
+ });
658
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams({
598
659
  graphId: params.graphId,
599
660
  nodeKind: params.nodeKind,
600
661
  fieldPath: params.vector.fieldPath,
@@ -602,11 +663,11 @@ function createSqliteOperationBackend(options) {
602
663
  metric: params.vector.metric,
603
664
  indexType: params.vector.indexType
604
665
  });
605
- const candidates = params.candidates ?? chunkST3LPB2V_cjs.buildLiveNodeCandidates(
666
+ const candidates = params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
606
667
  tableNames.nodes,
607
668
  params.graphId,
608
669
  params.nodeKind,
609
- chunkHJH3RMXG_cjs.nowIso()
670
+ chunkYAAM3M2S_cjs.nowIso()
610
671
  );
611
672
  const vectorParams = {
612
673
  graphId: params.graphId,
@@ -622,20 +683,20 @@ function createSqliteOperationBackend(options) {
622
683
  const vectorSql = vectorStrategy.buildSearch(
623
684
  slot,
624
685
  vectorParams,
625
- chunkU5W4LKZV_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
686
+ chunkVCRRKBLN_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
626
687
  );
627
688
  const statement = operationStrategy.buildHybridSearch(
628
689
  { ...params, candidates },
629
- chunkNN3QSOVS_cjs.toDrizzleSql(vectorSql, "sqlite"),
690
+ chunkU5SON7R2_cjs.toDrizzleSql(vectorSql, "sqlite"),
630
691
  params.vector.metric === "cosine"
631
692
  );
632
693
  let raw;
633
694
  try {
634
695
  raw = await execAll(statement);
635
696
  } catch (error) {
636
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, vectorParams);
697
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, vectorParams);
637
698
  }
638
- return raw.map((row) => chunkST3LPB2V_cjs.mapHybridSearchRow(row, toNodeRow));
699
+ return raw.map((row) => chunkMUK4BU7K_cjs.mapHybridSearchRow(row, toNodeRow));
639
700
  }
640
701
  } : {}
641
702
  };
@@ -643,6 +704,22 @@ function createSqliteOperationBackend(options) {
643
704
  ...commonBackend,
644
705
  ...executeRawMethod,
645
706
  ...vectorEmbeddingMethods,
707
+ /**
708
+ * Transaction-scoped contribution marker stamp. Present so the
709
+ * destructive rebuild can commit its marker with the DDL that
710
+ * produced it; without it the stamp would land outside the
711
+ * transaction and could survive a rolled-back drop.
712
+ *
713
+ * States the row outright rather than reusing the top-level upsert,
714
+ * whose `materialized_at` COALESCE preserves an earlier success so a
715
+ * failed re-attempt cannot erase it. A completed rebuild replaced the
716
+ * storage, so the recorded timestamp must be the rebuild's.
717
+ */
718
+ async recordContributionMaterialization(params) {
719
+ await execRun(
720
+ operationStrategy.buildInsertContributionMaterialization(params)
721
+ );
722
+ },
646
723
  async deleteSchemaVectorSlotContribution(slot) {
647
724
  if (vectorStrategy === void 0) return;
648
725
  for (const contribution of vectorStrategy.ownedTables(slot)) {
@@ -664,7 +741,7 @@ function createSqliteOperationBackend(options) {
664
741
  ...vectorStrategy === void 0 ? {} : { vectorStrategy },
665
742
  async lockSchemaVersionForWrite(params) {
666
743
  if (!transactionScoped) {
667
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
744
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
668
745
  "The schema write fence requires an explicit SQLite transaction.",
669
746
  {
670
747
  code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
@@ -673,7 +750,7 @@ function createSqliteOperationBackend(options) {
673
750
  );
674
751
  }
675
752
  const active = await commonBackend.getActiveSchema(params.graphId);
676
- chunkST3LPB2V_cjs.assertActiveSchemaVersion(
753
+ chunkMUK4BU7K_cjs.assertActiveSchemaVersion(
677
754
  params.graphId,
678
755
  params.expectedVersion,
679
756
  active?.version ?? 0
@@ -681,7 +758,7 @@ function createSqliteOperationBackend(options) {
681
758
  },
682
759
  async createVectorIndex(params) {
683
760
  if (vectorStrategy === void 0) return;
684
- const slot = chunkST3LPB2V_cjs.vectorSlotFromCreateIndexParams(params);
761
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromCreateIndexParams(params);
685
762
  await contributionMaterializer.ensureVectorSlot(slot);
686
763
  const indexStatement = vectorStrategy.buildCreateIndex?.(slot);
687
764
  if (indexStatement !== void 0) {
@@ -690,18 +767,18 @@ function createSqliteOperationBackend(options) {
690
767
  },
691
768
  async dropVectorIndex(params) {
692
769
  if (vectorStrategy === void 0) return;
693
- const slot = chunkST3LPB2V_cjs.vectorSlotFromDropIndexParams(params);
770
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromDropIndexParams(params);
694
771
  const dropStatement = vectorStrategy.buildDropIndex?.(slot);
695
772
  if (dropStatement === void 0) return;
696
773
  try {
697
774
  await execRun(dropStatement);
698
775
  } catch (error) {
699
- if (!chunkWBUFJ7BS_cjs.isMissingTableError(error)) throw error;
776
+ if (!chunkBSFJMMV3_cjs.isMissingTableError(error)) throw error;
700
777
  }
701
778
  },
702
779
  // === Fulltext Operations ===
703
780
  async upsertFulltext(params) {
704
- const timestamp = chunkHJH3RMXG_cjs.nowIso();
781
+ const timestamp = chunkYAAM3M2S_cjs.nowIso();
705
782
  const statements = operationStrategy.buildUpsertFulltext(
706
783
  params,
707
784
  timestamp
@@ -718,8 +795,8 @@ function createSqliteOperationBackend(options) {
718
795
  },
719
796
  async upsertFulltextBatch(params) {
720
797
  if (params.rows.length === 0) return;
721
- const timestamp = chunkHJH3RMXG_cjs.nowIso();
722
- for (const rows of chunkZDH3DX3C_cjs.chunk(
798
+ const timestamp = chunkYAAM3M2S_cjs.nowIso();
799
+ for (const rows of chunkBSFJMMV3_cjs.chunk(
723
800
  params.rows,
724
801
  batchConfig.fulltextUpsertBatchSize
725
802
  )) {
@@ -734,7 +811,7 @@ function createSqliteOperationBackend(options) {
734
811
  },
735
812
  async deleteFulltextBatch(params) {
736
813
  if (params.nodeIds.length === 0) return;
737
- for (const nodeIds of chunkZDH3DX3C_cjs.chunk(
814
+ for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
738
815
  params.nodeIds,
739
816
  batchConfig.fulltextDeleteChunkSize
740
817
  )) {
@@ -752,7 +829,7 @@ function createSqliteOperationBackend(options) {
752
829
  const rows = await execAll(query);
753
830
  return rows.map((row, index) => ({
754
831
  nodeId: row.node_id,
755
- score: chunkHJH3RMXG_cjs.coerceNumericScore(row.score),
832
+ score: chunkYAAM3M2S_cjs.coerceNumericScore(row.score),
756
833
  rank: index + 1,
757
834
  ...row.snippet === null ? {} : { snippet: row.snippet }
758
835
  }));
@@ -770,15 +847,30 @@ function createSqliteOperationBackend(options) {
770
847
  };
771
848
  return operationBackend;
772
849
  }
850
+ function isLocalLibsqlClient(client) {
851
+ if (typeof client !== "object" || client === null) return false;
852
+ const candidate = client;
853
+ return candidate["protocol"] === "file" && typeof candidate["execute"] === "function" && typeof candidate["batch"] === "function" && typeof candidate["executeMultiple"] === "function";
854
+ }
855
+ function getSerializedSqliteConnection(db) {
856
+ const client = db.$client;
857
+ if (isBetterSqlite3Client(client) || isBunSqliteClient(client) || isSqlJsClient(client)) {
858
+ return client;
859
+ }
860
+ const storageClient = getDurableObjectStorageClient(db);
861
+ if (storageClient !== void 0) return storageClient;
862
+ return isLocalLibsqlClient(client) ? client : void 0;
863
+ }
773
864
  function createSqliteBackend(db, options = {}) {
774
- const tables2 = options.tables ?? chunk6JZUSDY2_cjs.tables2;
775
- const fulltextStrategy = options.fulltext ?? chunkOVUUTCPJ_cjs.fts5Strategy;
865
+ const serializedConnection = getSerializedSqliteConnection(db);
866
+ const tables2 = options.tables ?? chunkRMQLSPA2_cjs.tables2;
867
+ const fulltextStrategy = options.fulltext ?? chunk4UGOKMI5_cjs.fts5Strategy;
776
868
  const profileHints = options.executionProfile ?? {};
777
869
  const executionAdapter = createSqliteExecutionAdapter(db, { profileHints });
778
870
  const { isSync, transactionMode } = executionAdapter.profile;
779
871
  const vectorStrategy = options.vector;
780
872
  const capabilityOverrides = options.capabilities ?? {};
781
- const capabilities = chunk3PRKZW6D_cjs.normalizeGraphAnalyticsCapabilities({
873
+ const declaredCapabilities = chunkXBYVV3MP_cjs.normalizeGraphAnalyticsCapabilities({
782
874
  ...buildSqliteCapabilities({
783
875
  fulltextStrategy,
784
876
  vectorStrategy,
@@ -795,6 +887,18 @@ function createSqliteBackend(db, options = {}) {
795
887
  capabilityOverrides.graphAnalytics
796
888
  )
797
889
  });
890
+ const capabilities = {
891
+ ...declaredCapabilities,
892
+ contributions: {
893
+ supported: true,
894
+ probe: true,
895
+ rebuild: chunkMUK4BU7K_cjs.contributionRebuildSupported(
896
+ fulltextStrategy,
897
+ tables2.fulltextTableName,
898
+ declaredCapabilities.transactions
899
+ )
900
+ }
901
+ };
798
902
  const tableNames = {
799
903
  nodes: drizzleOrm.getTableName(tables2.nodes),
800
904
  edges: drizzleOrm.getTableName(tables2.edges),
@@ -802,6 +906,10 @@ function createSqliteBackend(db, options = {}) {
802
906
  recordedEdges: drizzleOrm.getTableName(tables2.recordedEdges),
803
907
  recordedClock: drizzleOrm.getTableName(tables2.recordedClock),
804
908
  revisionOrigins: drizzleOrm.getTableName(tables2.revisionOrigins),
909
+ identityAssertions: drizzleOrm.getTableName(tables2.identityAssertions),
910
+ recordedIdentityAssertions: drizzleOrm.getTableName(tables2.recordedIdentityAssertions),
911
+ identityClosure: drizzleOrm.getTableName(tables2.identityClosure),
912
+ identitySeparation: drizzleOrm.getTableName(tables2.identitySeparation),
805
913
  fulltext: tables2.fulltextTableName,
806
914
  uniques: drizzleOrm.getTableName(tables2.uniques)
807
915
  };
@@ -811,19 +919,23 @@ function createSqliteBackend(db, options = {}) {
811
919
  tableNames.uniques,
812
920
  tableNames.fulltext
813
921
  ];
814
- const recordedAnalyzeTables = [
922
+ const guardedAnalyzeTables = [
815
923
  tableNames.recordedNodes,
816
924
  tableNames.recordedEdges,
817
- tableNames.recordedClock
925
+ tableNames.recordedClock,
926
+ tableNames.recordedIdentityAssertions,
927
+ tableNames.identityAssertions,
928
+ tableNames.identityClosure,
929
+ tableNames.identitySeparation
818
930
  ];
819
- const operationStrategy = chunkST3LPB2V_cjs.createSqliteOperationStrategy(
931
+ const operationStrategy = chunkMUK4BU7K_cjs.createSqliteOperationStrategy(
820
932
  tables2,
821
933
  fulltextStrategy
822
934
  );
823
935
  const serializedQueue = transactionMode === "none" ? void 0 : createSerializedExecutionQueue();
824
936
  const matTable = tables2.contributionMaterializations;
825
937
  async function ensureContributionMaterializationsTableImpl() {
826
- await db.run(drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generateSqliteCreateTableSQL(matTable)));
938
+ await db.run(drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(matTable)));
827
939
  }
828
940
  async function getContributionMaterializationRow(identity) {
829
941
  const rows = await db.select().from(matTable).where(
@@ -836,25 +948,25 @@ function createSqliteBackend(db, options = {}) {
836
948
  );
837
949
  const row = rows[0];
838
950
  if (row === void 0) return void 0;
839
- return chunkST3LPB2V_cjs.mapContributionMaterializationRow(
951
+ return chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
840
952
  row,
841
- chunkST3LPB2V_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
953
+ chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
842
954
  );
843
955
  }
844
956
  async function getContributionMaterializationRows(graphId) {
845
957
  const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
846
958
  return rows.map(
847
- (row) => chunkST3LPB2V_cjs.mapContributionMaterializationRow(
959
+ (row) => chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
848
960
  row,
849
- chunkST3LPB2V_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
961
+ chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.decode
850
962
  )
851
963
  );
852
964
  }
853
965
  async function recordContributionMaterializationRow(params) {
854
966
  await db.insert(matTable).values(
855
- chunkST3LPB2V_cjs.buildContributionInsertValues(
967
+ chunkMUK4BU7K_cjs.buildContributionInsertValues(
856
968
  params,
857
- chunkST3LPB2V_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
969
+ chunkMUK4BU7K_cjs.SQLITE_CONTRIBUTION_MAT_TIMESTAMPS.encode
858
970
  )
859
971
  ).onConflictDoUpdate({
860
972
  target: [
@@ -863,7 +975,7 @@ function createSqliteBackend(db, options = {}) {
863
975
  matTable.owner,
864
976
  matTable.tableName
865
977
  ],
866
- set: chunkST3LPB2V_cjs.buildContributionOnConflictSet(
978
+ set: chunkMUK4BU7K_cjs.buildContributionOnConflictSet(
867
979
  matTable.materializedAt,
868
980
  params.materializedAt
869
981
  )
@@ -883,9 +995,20 @@ function createSqliteBackend(db, options = {}) {
883
995
  const rows = await executionAdapter.execute(
884
996
  operationStrategy.buildTableExists(tableName)
885
997
  );
886
- return chunkST3LPB2V_cjs.tableExistsFromRow(rows[0]);
998
+ return chunkMUK4BU7K_cjs.tableExistsFromRow(rows[0]);
999
+ }
1000
+ function identityContributionsFor(identityTableNames) {
1001
+ const identityTables = chunkRMQLSPA2_cjs.createSqliteTables({
1002
+ identityAssertions: identityTableNames.identityAssertions,
1003
+ recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
1004
+ identityClosure: identityTableNames.identityClosure,
1005
+ identitySeparation: identityTableNames.identitySeparation
1006
+ });
1007
+ return chunkRMQLSPA2_cjs.sqliteContributions(identityTables, fulltextStrategy).filter(
1008
+ (contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
1009
+ );
887
1010
  }
888
- const contributionMaterializer = chunkST3LPB2V_cjs.createContributionMaterializer({
1011
+ const contributionMaterializer = chunkMUK4BU7K_cjs.createContributionMaterializer({
889
1012
  dialect: "sqlite",
890
1013
  fulltextStrategy,
891
1014
  fulltextTableName: tables2.fulltextTableName,
@@ -897,7 +1020,15 @@ function createSqliteBackend(db, options = {}) {
897
1020
  getMarkers: getContributionMaterializationRows,
898
1021
  recordMarker: recordContributionMaterializationRow,
899
1022
  deleteMarker: deleteContributionMaterializationRow,
900
- tableExists: contributionTableExists
1023
+ tableExists: contributionTableExists,
1024
+ // Withheld rather than wired-and-throwing when transactions are
1025
+ // disabled: the rebuild must refuse with its own typed error naming
1026
+ // the absent fence, matching `capabilities.contributions.rebuild`.
1027
+ // The graph id the materializer passes is unused — this backend's
1028
+ // schema lock is per connection, not per graph.
1029
+ ...capabilities.transactions ? {
1030
+ schemaWriteTransaction: (_graphId, fn) => runSchemaWriteTransaction((target) => fn(target))
1031
+ } : {}
901
1032
  });
902
1033
  const operations = createSqliteOperationBackend({
903
1034
  capabilities,
@@ -931,6 +1062,16 @@ function createSqliteBackend(db, options = {}) {
931
1062
  }
932
1063
  await compiledRun(executionAdapter.compile(query));
933
1064
  }
1065
+ async function rollbackFrameQuietly() {
1066
+ try {
1067
+ await runFrameStatement(drizzleOrm.sql`ROLLBACK`);
1068
+ } catch (rollbackError) {
1069
+ console.warn(
1070
+ "typegraph: ROLLBACK failed while unwinding a failed SQLite transaction; the original failure is the one thrown. Either the frame was already closed (SQLite auto-rolls-back on SQLITE_FULL / SQLITE_IOERR / SQLITE_NOMEM) and nothing is leaked, or it is still open on this connection, in which case the next BEGIN here fails.",
1071
+ rollbackError
1072
+ );
1073
+ }
1074
+ }
934
1075
  function runSchemaWriteTransaction(fn) {
935
1076
  if (transactionMode === "none") {
936
1077
  throwSqliteTransactionsDisabled(
@@ -956,7 +1097,7 @@ function createSqliteBackend(db, options = {}) {
956
1097
  await runFrameStatement(drizzleOrm.sql`COMMIT`);
957
1098
  return result;
958
1099
  } catch (error) {
959
- await runFrameStatement(drizzleOrm.sql`ROLLBACK`);
1100
+ await rollbackFrameQuietly();
960
1101
  throw error;
961
1102
  }
962
1103
  });
@@ -1007,7 +1148,7 @@ function createSqliteBackend(db, options = {}) {
1007
1148
  vectorStrategy,
1008
1149
  contributionMaterializer
1009
1150
  });
1010
- return chunkST3LPB2V_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
1151
+ return chunkMUK4BU7K_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
1011
1152
  }
1012
1153
  const backend = {
1013
1154
  ...operations,
@@ -1015,33 +1156,55 @@ function createSqliteBackend(db, options = {}) {
1015
1156
  async trustedImport(fn, options_) {
1016
1157
  return backend.transaction(async (tx) => {
1017
1158
  if (options_?.schemaWrite !== void 0) {
1018
- await chunk764JHTLT_cjs.requireDefined(tx.lockSchemaVersionForWrite)({
1159
+ await chunkN66HCGCY_cjs.requireDefined(tx.lockSchemaVersionForWrite)({
1019
1160
  ...options_.schemaWrite
1020
1161
  });
1021
1162
  }
1022
- await chunkST3LPB2V_cjs.assertTrustedImportDatabaseEmpty(tx, tableNames);
1023
- const indexDefinitions = await chunkST3LPB2V_cjs.suspendSqliteSecondaryIndexes(
1163
+ await chunkMUK4BU7K_cjs.assertTrustedImportDatabaseEmpty(tx, tableNames);
1164
+ const indexDefinitions = await chunkMUK4BU7K_cjs.suspendSqliteSecondaryIndexes(
1024
1165
  tx,
1025
1166
  tableNames
1026
1167
  );
1027
1168
  const result = await fn(
1028
- chunkST3LPB2V_cjs.createSqliteTrustedImportSession(executionAdapter, tableNames)
1169
+ chunkMUK4BU7K_cjs.createSqliteTrustedImportSession(executionAdapter, tableNames)
1029
1170
  );
1030
- await chunkST3LPB2V_cjs.restoreSecondaryIndexes(tx, indexDefinitions);
1031
- await chunkST3LPB2V_cjs.analyzeImportedTables(tx, tableNames);
1171
+ await chunkMUK4BU7K_cjs.restoreSecondaryIndexes(tx, indexDefinitions);
1172
+ await chunkMUK4BU7K_cjs.analyzeImportedTables(tx, tableNames);
1032
1173
  return result;
1033
1174
  });
1034
1175
  }
1035
1176
  } : {},
1036
1177
  async bootstrapTables() {
1037
- const statements = chunk6JZUSDY2_cjs.generateSqliteDDL(tables2, fulltextStrategy);
1178
+ const statements = chunkRMQLSPA2_cjs.generateSqliteDDL(tables2, fulltextStrategy);
1038
1179
  for (const statement of statements) {
1039
1180
  await db.run(drizzleOrm.sql.raw(statement));
1040
1181
  }
1041
1182
  },
1042
1183
  async ensureRevisionOriginsTable() {
1043
1184
  await db.run(
1044
- drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generateSqliteCreateTableSQL(tables2.revisionOrigins))
1185
+ drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.revisionOrigins))
1186
+ );
1187
+ },
1188
+ async ensureIdentityTables(identityTableNames, options2) {
1189
+ const identityContributions = identityContributionsFor(identityTableNames);
1190
+ const missing = [];
1191
+ for (const contribution of identityContributions) {
1192
+ if (!await contributionTableExists(contribution.tableName)) {
1193
+ missing.push(contribution.logicalName);
1194
+ }
1195
+ }
1196
+ if (missing.length === 0 || options2.provisionMissing) {
1197
+ for (const contribution of identityContributions) {
1198
+ for (const ddl of contribution.createDdl) {
1199
+ await db.run(drizzleOrm.sql.raw(ddl));
1200
+ }
1201
+ }
1202
+ }
1203
+ return missing;
1204
+ },
1205
+ identityTableDdl(identityTableNames) {
1206
+ return identityContributionsFor(identityTableNames).flatMap(
1207
+ (contribution) => [...contribution.createDdl]
1045
1208
  );
1046
1209
  },
1047
1210
  // Every fulltext-touching method asserts the durable marker instead
@@ -1049,7 +1212,7 @@ function createSqliteBackend(db, options = {}) {
1049
1212
  // uninitialized database throws `StoreNotInitializedError` rather
1050
1213
  // than self-healing (#135). Shared verbatim with the tx-scoped gate
1051
1214
  // via `gateFulltextMethods`.
1052
- ...chunkST3LPB2V_cjs.gateFulltextMethods(
1215
+ ...chunkMUK4BU7K_cjs.gateFulltextMethods(
1053
1216
  operations,
1054
1217
  contributionMaterializer.assertInitialized
1055
1218
  ),
@@ -1058,7 +1221,7 @@ function createSqliteBackend(db, options = {}) {
1058
1221
  },
1059
1222
  async ensureIndexMaterializationsTable() {
1060
1223
  await db.run(
1061
- drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
1224
+ drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.indexMaterializations))
1062
1225
  );
1063
1226
  },
1064
1227
  async getIndexMaterialization(indexName) {
@@ -1066,26 +1229,26 @@ function createSqliteBackend(db, options = {}) {
1066
1229
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
1067
1230
  const row = rows[0];
1068
1231
  if (row === void 0) return void 0;
1069
- return chunkST3LPB2V_cjs.mapMaterializationRow(row, chunkST3LPB2V_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
1232
+ return chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode);
1070
1233
  },
1071
1234
  async getIndexMaterializations(statusKeys) {
1072
1235
  if (statusKeys.length === 0) return [];
1073
1236
  const t = tables2.indexMaterializations;
1074
1237
  const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
1075
1238
  return rows.map(
1076
- (row) => chunkST3LPB2V_cjs.mapMaterializationRow(row, chunkST3LPB2V_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
1239
+ (row) => chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.decode)
1077
1240
  );
1078
1241
  },
1079
1242
  async recordIndexMaterialization(params) {
1080
1243
  const t = tables2.indexMaterializations;
1081
1244
  await db.insert(t).values(
1082
- chunkST3LPB2V_cjs.buildMaterializationInsertValues(
1245
+ chunkMUK4BU7K_cjs.buildMaterializationInsertValues(
1083
1246
  params,
1084
- chunkST3LPB2V_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
1247
+ chunkMUK4BU7K_cjs.SQLITE_INDEX_MAT_TIMESTAMPS.encode
1085
1248
  )
1086
1249
  ).onConflictDoUpdate({
1087
1250
  target: t.indexName,
1088
- set: chunkST3LPB2V_cjs.buildMaterializationOnConflictSet(params.materializedAt)
1251
+ set: chunkMUK4BU7K_cjs.buildMaterializationOnConflictSet(params.materializedAt)
1089
1252
  });
1090
1253
  },
1091
1254
  async ensureContributionMaterializationsTable() {
@@ -1101,37 +1264,37 @@ function createSqliteBackend(db, options = {}) {
1101
1264
  await contributionMaterializer.assertInitialized(graphId);
1102
1265
  },
1103
1266
  async ensureKindRemovalsTable() {
1104
- await db.run(drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
1267
+ await db.run(drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.kindRemovals)));
1105
1268
  },
1106
1269
  async getPendingKindRemovals(graphId) {
1107
1270
  const t = tables2.kindRemovals;
1108
1271
  const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
1109
1272
  return rows.map(
1110
- (row) => chunkST3LPB2V_cjs.mapKindRemovalRow(row, chunkST3LPB2V_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1273
+ (row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1111
1274
  );
1112
1275
  },
1113
1276
  async getAllKindRemovals(graphId) {
1114
1277
  const t = tables2.kindRemovals;
1115
1278
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
1116
1279
  return rows.map(
1117
- (row) => chunkST3LPB2V_cjs.mapKindRemovalRow(row, chunkST3LPB2V_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1280
+ (row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.decode)
1118
1281
  );
1119
1282
  },
1120
1283
  async recordKindRemoval(params) {
1121
1284
  const t = tables2.kindRemovals;
1122
1285
  await db.insert(t).values(
1123
- chunkST3LPB2V_cjs.buildKindRemovalInsertValues(
1286
+ chunkMUK4BU7K_cjs.buildKindRemovalInsertValues(
1124
1287
  params,
1125
- chunkST3LPB2V_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
1288
+ chunkMUK4BU7K_cjs.SQLITE_KIND_REMOVAL_TIMESTAMPS.encode
1126
1289
  )
1127
1290
  ).onConflictDoUpdate({
1128
1291
  target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
1129
- set: chunkST3LPB2V_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
1292
+ set: chunkMUK4BU7K_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
1130
1293
  });
1131
1294
  },
1132
1295
  async ensureReconciliationMarkersTable() {
1133
1296
  await db.run(
1134
- drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
1297
+ drizzleOrm.sql.raw(chunkRMQLSPA2_cjs.generateSqliteCreateTableSQL(tables2.reconciliationMarkers))
1135
1298
  );
1136
1299
  },
1137
1300
  async ensureRuntimeContributions(graphId) {
@@ -1148,6 +1311,19 @@ function createSqliteBackend(db, options = {}) {
1148
1311
  async verifyContributions(graphId, vectorSlots) {
1149
1312
  return contributionMaterializer.verifyContributions(graphId, vectorSlots);
1150
1313
  },
1314
+ async repairContributions(graphId, vectorSlots) {
1315
+ return contributionMaterializer.repairContributions(graphId, vectorSlots);
1316
+ },
1317
+ async probeContributions(graphId, vectorSlots) {
1318
+ return contributionMaterializer.probeContributions(graphId, vectorSlots);
1319
+ },
1320
+ async rebuildContribution(graphId, scope, repopulate) {
1321
+ return contributionMaterializer.rebuildContribution(
1322
+ graphId,
1323
+ scope,
1324
+ repopulate
1325
+ );
1326
+ },
1151
1327
  // Vector counterparts of the runtime-contribution methods. Present
1152
1328
  // only when a vector strategy is wired (omitted on a plain SQLite
1153
1329
  // connection with no vector extension), mirroring the embedding/
@@ -1184,32 +1360,32 @@ function createSqliteBackend(db, options = {}) {
1184
1360
  async refreshStatistics() {
1185
1361
  try {
1186
1362
  await db.run(
1187
- chunkNN3QSOVS_cjs.toDrizzleSql(
1188
- chunkU5W4LKZV_cjs.sql`PRAGMA analysis_limit = ${chunkU5W4LKZV_cjs.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
1363
+ chunkU5SON7R2_cjs.toDrizzleSql(
1364
+ chunkVCRRKBLN_cjs.sql`PRAGMA analysis_limit = ${chunkVCRRKBLN_cjs.sql.raw(String(SQLITE_ANALYZE_ROW_LIMIT))}`,
1189
1365
  "sqlite"
1190
1366
  )
1191
1367
  );
1192
1368
  } catch (error) {
1193
- if (!chunkWBUFJ7BS_cjs.isSqliteNotAuthorizedError(error)) throw error;
1369
+ if (!chunkBSFJMMV3_cjs.isSqliteNotAuthorizedError(error)) throw error;
1194
1370
  }
1195
1371
  for (const tableName of coreAnalyzeTables) {
1196
1372
  await db.run(
1197
- chunkNN3QSOVS_cjs.toDrizzleSql(
1198
- chunkU5W4LKZV_cjs.sql`ANALYZE ${chunkU5W4LKZV_cjs.sql.identifier(tableName)}`,
1373
+ chunkU5SON7R2_cjs.toDrizzleSql(
1374
+ chunkVCRRKBLN_cjs.sql`ANALYZE ${chunkVCRRKBLN_cjs.sql.identifier(tableName)}`,
1199
1375
  "sqlite"
1200
1376
  )
1201
1377
  );
1202
1378
  }
1203
- for (const tableName of recordedAnalyzeTables) {
1379
+ for (const tableName of guardedAnalyzeTables) {
1204
1380
  try {
1205
1381
  await db.run(
1206
- chunkNN3QSOVS_cjs.toDrizzleSql(
1207
- chunkU5W4LKZV_cjs.sql`ANALYZE ${chunkU5W4LKZV_cjs.sql.identifier(tableName)}`,
1382
+ chunkU5SON7R2_cjs.toDrizzleSql(
1383
+ chunkVCRRKBLN_cjs.sql`ANALYZE ${chunkVCRRKBLN_cjs.sql.identifier(tableName)}`,
1208
1384
  "sqlite"
1209
1385
  )
1210
1386
  );
1211
1387
  } catch (error) {
1212
- if (!chunkWBUFJ7BS_cjs.isMissingTableError(error)) throw error;
1388
+ if (!chunkBSFJMMV3_cjs.isMissingTableError(error)) throw error;
1213
1389
  }
1214
1390
  }
1215
1391
  },
@@ -1220,9 +1396,15 @@ function createSqliteBackend(db, options = {}) {
1220
1396
  },
1221
1397
  async commitSchemaVersionIfKindsEmpty(params, probes) {
1222
1398
  return runSchemaWriteTransaction(
1223
- (target) => chunkST3LPB2V_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
1399
+ (target) => chunkMUK4BU7K_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
1224
1400
  );
1225
1401
  },
1402
+ async commitSchemaVersionWithPreflight(params, preflight) {
1403
+ return runSchemaWriteTransaction(async (target) => {
1404
+ await preflight(target);
1405
+ return target.commitSchemaVersion(params);
1406
+ });
1407
+ },
1226
1408
  async setActiveVersion(params) {
1227
1409
  await runSchemaWriteTransaction(
1228
1410
  (target) => target.setActiveVersion(params)
@@ -1235,9 +1417,9 @@ function createSqliteBackend(db, options = {}) {
1235
1417
  return backend.transactionWithNative((tx) => fn(tx), options2);
1236
1418
  },
1237
1419
  async transactionWithNative(fn, options2) {
1238
- const temporaryWrites = options2?.temporaryWrites === chunk3PRKZW6D_cjs.INTERNAL_TEMPORARY_WRITES;
1420
+ const temporaryWrites = options2?.temporaryWrites === chunkXBYVV3MP_cjs.INTERNAL_TEMPORARY_WRITES;
1239
1421
  if (temporaryWrites && options2.accessMode !== "read_only") {
1240
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
1422
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
1241
1423
  "Temporary-write transactions must be semantically read-only.",
1242
1424
  { dialect: "sqlite" }
1243
1425
  );
@@ -1265,7 +1447,7 @@ function createSqliteBackend(db, options = {}) {
1265
1447
  );
1266
1448
  try {
1267
1449
  const result = await fn(
1268
- chunkST3LPB2V_cjs.gateFulltext(
1450
+ chunkMUK4BU7K_cjs.gateFulltext(
1269
1451
  txBackend,
1270
1452
  contributionMaterializer.assertInitialized
1271
1453
  ),
@@ -1274,7 +1456,7 @@ function createSqliteBackend(db, options = {}) {
1274
1456
  await runFrameStatement(drizzleOrm.sql`COMMIT`);
1275
1457
  return result;
1276
1458
  } catch (error) {
1277
- await runFrameStatement(drizzleOrm.sql`ROLLBACK`);
1459
+ await rollbackFrameQuietly();
1278
1460
  throw error;
1279
1461
  }
1280
1462
  });
@@ -1297,7 +1479,7 @@ function createSqliteBackend(db, options = {}) {
1297
1479
  "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)."
1298
1480
  );
1299
1481
  }
1300
- chunkST3LPB2V_cjs.assertAdoptedDialect(
1482
+ chunkMUK4BU7K_cjs.assertAdoptedDialect(
1301
1483
  externalTx,
1302
1484
  sqliteCore.BaseSQLiteDatabase,
1303
1485
  "sqlite"
@@ -1309,6 +1491,9 @@ function createSqliteBackend(db, options = {}) {
1309
1491
  return Promise.resolve();
1310
1492
  }
1311
1493
  };
1494
+ if (serializedConnection !== void 0) {
1495
+ chunkXBYVV3MP_cjs.markSerializedTransactionResource(backend, serializedConnection);
1496
+ }
1312
1497
  return backend;
1313
1498
  }
1314
1499
  function createTransactionBackend(options) {
@@ -1329,5 +1514,6 @@ function createTransactionBackend(options) {
1329
1514
  }
1330
1515
 
1331
1516
  exports.createSqliteBackend = createSqliteBackend;
1332
- //# sourceMappingURL=chunk-OSZPLZIV.cjs.map
1333
- //# sourceMappingURL=chunk-OSZPLZIV.cjs.map
1517
+ exports.isLocalLibsqlClient = isLocalLibsqlClient;
1518
+ //# sourceMappingURL=chunk-YVWGEQJE.cjs.map
1519
+ //# sourceMappingURL=chunk-YVWGEQJE.cjs.map