@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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/sql-errors.ts","../src/utils/array.ts"],"names":["ConfigurationError"],"mappings":";;;;;AAuBA,IAAM,4BAAA,GAA+B,eAAA;AACrC,IAAM,yBAAA,GAA4B,cAAA;AAClC,IAAM,0BAAA,GAA6B,aAAA;AAiBnC,IAAM,0BAAA,GAA6B,sBAAA;AACnC,IAAM,mCAAA,GAAsC,GAAA;AAC5C,IAAM,0BAAA,GAA6B,eAAA;AACnC,IAAM,mCAAA,GACJ,oDAAA;AASF,IAAM,6BAAA,GAAgC,OAAA;AACtC,IAAM,8BAAA,GAAiC,OAAA;AAevC,IAAM,uCAAA,GAA0C;AAAA,EAC9C,8BAAA;AAAA,EACA;AACF,CAAA;AAcA,IAAM,4BAAA,GAA+B,OAAA;AACrC,IAAM,wCAAA,GAA2C,4BAAA;AAQjD,IAAM,+CAAA,GAAkD;AAAA,EACtD,OAAA;AAAA,EACA;AACF,CAAA;AAUA,IAAM,sCAAA,GAAyC,CAAC,OAAA,EAAS,OAAO,CAAA;AAuBzD,UAAU,WAAW,KAAA,EAAgD;AAC1E,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAa;AAC9B,EAAA,IAAI,OAAA,GAAmB,KAAA;AACvB,EAAA,OAAO,OAAA,KAAY,UAAa,OAAA,KAAY,IAAA,IAAQ,CAAC,IAAA,CAAK,GAAA,CAAI,OAAO,CAAA,EAAG;AACtE,IAAA,IAAA,CAAK,IAAI,OAAO,CAAA;AAChB,IAAA,MAAM,OAAA;AACN,IAAA,OAAA,GACE,gBAA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IAAI,CAAA;AACf,IAAA,MAAA,CAAO,GAAA,CAAI,KAAK,KAAK,CAAA;AAAA,EACvB;AACA,EAAA,OAAO,MAAA;AACT","file":"chunk-BSFJMMV3.cjs","sourcesContent":["/**\n * Cross-dialect detection of \"this relation does not exist yet\" errors.\n *\n * Shared so the schema bootstrap (`loadActiveSchemaWithBootstrap`) and\n * the durable contribution-materialization gate (#135) agree on what a\n * missing-table failure looks like, and — critically — so neither one\n * swallows a genuine system fault (connection/permission/driver error)\n * as a benign \"not bootstrapped yet\".\n *\n * Detection walks the error's `cause` chain because Drizzle (>= the\n * `DrizzleQueryError` era, drizzle-orm ≥ 0.36) wraps every failure from a\n * query-builder call (`db.select()`, `db.insert()`, …): the wrapper's\n * `.message` becomes the failed query text and the real driver error —\n * which carries both the missing-relation text and the SQLSTATE — is\n * preserved on `.cause`. node-postgres / postgres-js nest the pg error\n * one link deep; better-sqlite3 throws it unwrapped; raw `client.query()`\n * fast paths surface it directly. Walking the chain makes the check\n * wrapper- and driver-agnostic instead of only matching the outermost\n * `.message`, which on Postgres is just the SQL string.\n */\n\nimport { ConfigurationError } from \"../errors\";\n\nconst SQLITE_MISSING_TABLE_PATTERN = \"no such table\";\nconst SQLITE_GENERIC_ERROR_CODE = \"SQLITE_ERROR\";\nconst SQLITE_NOT_AUTHORIZED_CODE = \"SQLITE_AUTH\";\n\n/**\n * SQLite's EXTENDED result code for \"this read transaction cannot become a\n * write transaction\": the connection began a DEFERRED transaction, took a read\n * snapshot, and another connection has committed since. SQLite refuses the\n * upgrade because honoring it would let the writer act on a stale view; the\n * only recovery is `ROLLBACK` and a fresh transaction (SQLite's own rule — the\n * failure is not retryable in place).\n *\n * It is the one code that names the DEFERRED frame itself. A transaction opened\n * `BEGIN IMMEDIATE` holds the writer slot from the start and can never produce\n * it, and plain `SQLITE_BUSY` says something else entirely (\"another writer\n * holds the slot right now\"), so this code alone can be attributed to how the\n * transaction was begun. The numeric spelling is accepted for libSQL, which\n * surfaces only `rawCode`/`extendedCode` over a remote connection.\n */\nconst SQLITE_STALE_SNAPSHOT_CODE = \"SQLITE_BUSY_SNAPSHOT\";\nconst SQLITE_STALE_SNAPSHOT_EXTENDED_CODE = 517;\nconst DRIZZLE_QUERY_ERROR_PREFIX = \"Failed query:\";\nconst POSTGRES_UNDEFINED_RELATION_PATTERN =\n /\\b(?:relation|table)\\s+\"[^\"]+\"\\s+does not exist\\b/i;\n\n/**\n * SQLSTATE for PostgreSQL `undefined_table`. Preferred over the\n * human-readable message: it is locale-independent (the \"... does not\n * exist\" text is translated under a non-English `lc_messages`) and is\n * preserved on the underlying driver error even when Drizzle overwrites\n * `.message` with the query text.\n */\nconst POSTGRES_UNDEFINED_TABLE_CODE = \"42P01\";\nconst POSTGRES_UNIQUE_VIOLATION_CODE = \"23505\";\n\n/**\n * SQLSTATEs a racing IDEMPOTENT DDL statement loses with — the ones that mean\n * \"another session is committing the very thing this statement asks for\", not\n * \"this statement is wrong\".\n *\n * PostgreSQL's `IF NOT EXISTS` is not a concurrency primitive: the existence\n * check cannot see another session's uncommitted catalog rows, so the loser\n * waits for the winner and is then handed the conflict the winner's commit\n * produced — `unique_violation` (23505) from `pg_type`/`pg_class` for a racing\n * CREATE, `duplicate_column` (42701) for a racing `ALTER TABLE ... ADD COLUMN\n * IF NOT EXISTS`. Retrying once after that wait observes the committed object\n * and succeeds; a failure the retry cannot clear stays loud.\n */\nconst POSTGRES_CONCURRENT_DDL_RACE_SQL_STATES = [\n POSTGRES_UNIQUE_VIOLATION_CODE,\n \"42701\",\n] as const;\n\n/**\n * The one concurrent-DDL race PostgreSQL reports with no SQLSTATE of its own:\n * `heap_update` losing a catalog row to a concurrent updater raises\n * `elog(ERROR, \"tuple concurrently updated\")`, which carries the catch-all\n * `internal_error` (XX000).\n *\n * XX000 alone is far too broad to retry on — it covers genuine server faults —\n * so this shape is identified by SQLSTATE AND message together. Matching the\n * message is sound here specifically because `elog` emits it through\n * `errmsg_internal`, which is NOT run through gettext: unlike an `ereport`\n * message, it reads identically under every `lc_messages`.\n */\nconst POSTGRES_INTERNAL_ERROR_CODE = \"XX000\";\nconst POSTGRES_CONCURRENT_TUPLE_UPDATE_MESSAGE = \"tuple concurrently updated\";\n\n/**\n * PostgreSQL failures that mean a temporary table cannot be created here:\n * `read_only_sql_transaction` (a replica or otherwise read-only execution\n * context) and `insufficient_privilege` (a role without the database `TEMP`\n * privilege).\n */\nconst POSTGRES_TEMPORARY_TABLE_UNAVAILABLE_SQL_STATES = [\n \"25006\",\n \"42501\",\n] as const;\n\n/**\n * PostgreSQL failures that mean the read-write transaction hosting temporary\n * tables cannot even start. A standby rejects the read-write access mode in\n * the `BEGIN` itself with `feature_not_supported` (\"cannot set transaction\n * read-write mode during recovery\"), so the failure never reaches a\n * `CREATE TEMP TABLE`; a session pinned read-only by a proxy or by\n * `default_transaction_read_only` reports `read_only_sql_transaction`.\n */\nconst POSTGRES_READ_WRITE_REFUSED_SQL_STATES = [\"0A000\", \"25006\"] as const;\n\nexport type PostgresTemporaryTableUnavailableSqlState =\n (typeof POSTGRES_TEMPORARY_TABLE_UNAVAILABLE_SQL_STATES)[number];\n\nexport type PostgresReadWriteRefusedSqlState =\n (typeof POSTGRES_READ_WRITE_REFUSED_SQL_STATES)[number];\n\n/**\n * Yields an error and each error reachable by following `.cause`,\n * outermost first. `seen` guards the pathological cyclic-cause case so a\n * self-referential chain can't spin forever.\n *\n * The walk intentionally follows `.cause` through *non-`Error`* links, not just\n * `Error` instances: postgres-js surfaces its driver error as a plain object\n * (message + SQLSTATE `code`) on a Drizzle wrapper's `.cause`, so stopping at\n * the first non-`Error` link would miss it (see the postgres-js test). A plain\n * object is classified by its locale-independent SQLSTATE alone\n * ({@link isPostgresUndefinedTable}); the looser SQLite message substring is\n * consulted only for `Error` instances and raw strings\n * ({@link missingTableMessage}), so an unrelated object in a cause chain that\n * merely mentions one of those phrases is not mistaken for a missing table.\n */\nexport function* errorChain(error: unknown): Generator<unknown, void, void> {\n const seen = new Set<unknown>();\n let current: unknown = error;\n while (current !== undefined && current !== null && !seen.has(current)) {\n seen.add(current);\n yield current;\n current =\n canReadProperty(current) ? Reflect.get(current, \"cause\") : undefined;\n }\n}\n\nfunction canReadProperty(value: unknown): value is object {\n return (\n (typeof value === \"object\" && value !== null) || typeof value === \"function\"\n );\n}\n\n/**\n * Whether a single chain link is a PostgreSQL `undefined_table` failure,\n * identified by its SQLSTATE rather than a message substring.\n */\nfunction isPostgresUndefinedTable(link: unknown): boolean {\n return (\n canReadProperty(link) &&\n Reflect.get(link, \"code\") === POSTGRES_UNDEFINED_TABLE_CODE\n );\n}\n\nfunction messageProperty(link: unknown): string | undefined {\n if (typeof link === \"string\") return link;\n if (link instanceof Error) return link.message;\n const message =\n canReadProperty(link) ?\n (Reflect.get(link, \"message\") as unknown)\n : undefined;\n return typeof message === \"string\" ? message : undefined;\n}\n\nfunction errorMessage(link: unknown): string {\n return messageProperty(link) ?? String(link);\n}\n\n/**\n * The message a SQLite missing-table substring match may be tested against — but\n * only for `Error` instances and raw `string` links, never an arbitrary plain\n * object.\n *\n * Generic \"does not exist\" is deliberately not substring-matched: PostgreSQL uses\n * that phrase for undefined columns, functions, types, and relations. PostgreSQL\n * missing tables are classified by SQLSTATE 42P01 when available, or by the\n * narrower driver-message shape `relation/table \"...\" does not exist` when a\n * bring-your-own driver omits SQLSTATE. SQLite does not expose a portable\n * SQLSTATE here, so the narrow \"no such table\" engine message is still accepted.\n */\nfunction missingTableMessage(link: unknown): string | undefined {\n return typeof link === \"string\" || link instanceof Error ?\n messageProperty(link)\n : undefined;\n}\n\nfunction sqliteErrorCode(link: unknown): unknown {\n if (!canReadProperty(link)) return undefined;\n return Reflect.get(link, \"code\");\n}\n\n/**\n * Cloudflare D1 / Durable Objects may surface a missing-table failure as the\n * generic SQLite code with no detail. Accept the bare marker, but do not\n * substring-match detailed `SQLITE_ERROR: ...` failures: those include syntax\n * errors and bind-limit faults that must stay loud.\n */\nfunction isBareSqliteErrorMarker(link: unknown): boolean {\n const message = messageProperty(link);\n if (message === SQLITE_GENERIC_ERROR_CODE) return true;\n if (sqliteErrorCode(link) !== SQLITE_GENERIC_ERROR_CODE) return false;\n return (\n message === undefined ||\n message === SQLITE_GENERIC_ERROR_CODE ||\n message.includes(SQLITE_MISSING_TABLE_PATTERN)\n );\n}\n\nfunction isPostgresUndefinedRelationMessage(link: unknown): boolean {\n const message = errorMessage(link);\n if (message.startsWith(DRIZZLE_QUERY_ERROR_PREFIX)) return false;\n return POSTGRES_UNDEFINED_RELATION_PATTERN.test(message);\n}\n\n/**\n * Whether any link in the cause chain is a PostgreSQL \"insufficient\n * resources\" failure (SQLSTATE class 53: disk_full, out_of_memory,\n * configuration_limit_exceeded, ...). Parallel index builds surface\n * shared-memory exhaustion this way (53100 from dsm_impl_posix on hosts\n * with a small /dev/shm); callers retry such work with parallelism\n * disabled. Identified by the locale-independent 5-character SQLSTATE\n * prefix only — never by message text.\n */\nexport function isInsufficientResourcesError(error: unknown): boolean {\n for (const link of errorChain(error)) {\n if (!canReadProperty(link)) continue;\n const code: unknown = Reflect.get(link, \"code\");\n if (typeof code === \"string\" && code.length === 5 && code.startsWith(\"53\"))\n return true;\n }\n return false;\n}\n\nexport function isMissingTableError(error: unknown): boolean {\n // SQLSTATE 42P01 is locale-independent and structural, so it is honored on\n // *every* link — including a plain driver-error object reached only by walking\n // through a non-`Error` `.cause` (postgres-js).\n //\n // The SQLite message substring is honored only while every prior link in the\n // chain was an `Error` (or the top-level string) — the reach of the\n // pre-broadening walk, which stopped at the first non-`Error` `.cause`.\n let everyPriorLinkWasError = true;\n for (const link of errorChain(error)) {\n if (isPostgresUndefinedTable(link)) return true;\n if (isPostgresUndefinedRelationMessage(link)) return true;\n if (isBareSqliteErrorMarker(link)) return true;\n if (everyPriorLinkWasError) {\n const message = missingTableMessage(link);\n if (message?.includes(SQLITE_MISSING_TABLE_PATTERN) === true) {\n return true;\n }\n }\n if (!(link instanceof Error)) everyPriorLinkWasError = false;\n }\n return false;\n}\n\n/** Whether one chain link is the un-coded `tuple concurrently updated` race. */\nfunction isPostgresConcurrentTupleUpdate(link: unknown): boolean {\n if (!canReadProperty(link)) return false;\n if (Reflect.get(link, \"code\") !== POSTGRES_INTERNAL_ERROR_CODE) return false;\n return (\n messageProperty(link)?.includes(\n POSTGRES_CONCURRENT_TUPLE_UPDATE_MESSAGE,\n ) === true\n );\n}\n\n/**\n * Whether PostgreSQL refused an IDEMPOTENT DDL statement because another\n * session was concurrently committing the same catalog change — the single\n * owner of \"this DDL lost a race and is worth one retry\".\n *\n * Every idempotent-DDL site in the codebase classifies through this one\n * function: the Postgres backend's `executeConcurrentCreateDdl` (bootstrap\n * tables, contribution materialization, identity relations, the index\n * materialization table and its additive columns) and the identity\n * schema-transition retry. A second copy of the predicate would drift the\n * moment one site learned about a new race SQLSTATE — as `ALTER TABLE ... ADD\n * COLUMN IF NOT EXISTS` (42701) did (#445).\n *\n * Callers MUST use it only around DDL that is a no-op when the object already\n * exists. On any other statement 23505/42701 are real defects, and retrying\n * them would hide a duplicate write.\n */\nexport function isPostgresConcurrentDdlRaceError(error: unknown): boolean {\n for (const link of errorChain(error)) {\n if (!canReadProperty(link)) continue;\n if (\n isSqlStateIn(\n Reflect.get(link, \"code\"),\n POSTGRES_CONCURRENT_DDL_RACE_SQL_STATES,\n )\n ) {\n return true;\n }\n if (isPostgresConcurrentTupleUpdate(link)) return true;\n }\n return false;\n}\n\n/**\n * The PostgreSQL error fields naming the violated constraint and its relation.\n * Both spellings are read because the drivers disagree: node-postgres and\n * PGlite expose the protocol fields as `constraint` / `table`, while\n * postgres-js exposes them as `constraint_name` / `table_name`. Reading only\n * one spelling would silently classify nothing on the other driver.\n */\nconst POSTGRES_CONSTRAINT_FIELDS = [\"constraint\", \"constraint_name\"] as const;\nconst POSTGRES_RELATION_FIELDS = [\"table\", \"table_name\"] as const;\n\n/**\n * SQLite's EXTENDED result code for a primary-key duplicate, in both spellings a\n * driver reports it: the symbolic name (better-sqlite3 `code`, and the\n * `SqliteError` the libSQL client nests on its own error's `.cause`) and the\n * numeric value (libSQL `rawCode` / `extendedCode`, the only form a remote\n * connection surfaces).\n *\n * The extended code — not the base `SQLITE_CONSTRAINT` — is what makes the\n * classification possible at all: SQLite distinguishes a PRIMARY KEY duplicate\n * (1555) from any other unique-index duplicate (`SQLITE_CONSTRAINT_UNIQUE`,\n * 2067) in the code itself, so nothing has to read the message, which names the\n * columns rather than the constraint.\n */\nconst SQLITE_PRIMARY_KEY_VIOLATION_CODE = \"SQLITE_CONSTRAINT_PRIMARYKEY\";\nconst SQLITE_PRIMARY_KEY_VIOLATION_EXTENDED_CODE = 1555;\nconst SQLITE_EXTENDED_CODE_FIELDS = [\"rawCode\", \"extendedCode\"] as const;\n\n/**\n * A relation plus the names its PRIMARY KEY constraint can carry — how far a\n * duplicate-key classification is allowed to reach on an engine that reports the\n * violated constraint by name. See {@link isDuplicatePrimaryKeyError}.\n */\nexport type PrimaryKeyRelation = Readonly<{\n table: string;\n constraintNames: readonly string[];\n}>;\n\nfunction firstStringField(\n link: object,\n fields: readonly string[],\n): string | undefined {\n for (const field of fields) {\n const value: unknown = Reflect.get(link, field);\n if (typeof value === \"string\") return value;\n }\n return undefined;\n}\n\n/**\n * Whether PostgreSQL reported this link as a duplicate of `relation`'s PRIMARY\n * KEY: SQLSTATE, relation, and constraint name must all agree on the SAME link\n * (the driver error), so a 23505 raised by an unrelated statement deeper in the\n * chain cannot be attributed to this relation.\n */\nfunction isPostgresPrimaryKeyViolation(\n link: object,\n relation: PrimaryKeyRelation,\n): boolean {\n if (Reflect.get(link, \"code\") !== POSTGRES_UNIQUE_VIOLATION_CODE)\n return false;\n if (firstStringField(link, POSTGRES_RELATION_FIELDS) !== relation.table) {\n return false;\n }\n const constraint = firstStringField(link, POSTGRES_CONSTRAINT_FIELDS);\n return (\n constraint !== undefined && relation.constraintNames.includes(constraint)\n );\n}\n\n/**\n * Whether SQLite reported this link as a PRIMARY KEY duplicate. The relation is\n * not checked because SQLite does not report one — see\n * {@link isDuplicatePrimaryKeyError} for why the call site supplies that scope.\n */\nfunction isSqlitePrimaryKeyViolation(link: object): boolean {\n if (Reflect.get(link, \"code\") === SQLITE_PRIMARY_KEY_VIOLATION_CODE) {\n return true;\n }\n for (const field of SQLITE_EXTENDED_CODE_FIELDS) {\n const value: unknown = Reflect.get(link, field);\n if (\n typeof value === \"number\" &&\n value === SQLITE_PRIMARY_KEY_VIOLATION_EXTENDED_CODE\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Whether the engine refused a statement because it duplicated a PRIMARY KEY —\n * on PostgreSQL, `relation`'s specifically.\n *\n * Classification is structural: SQLSTATE and SQLite extended result codes, plus\n * the PostgreSQL protocol's own constraint and relation fields. Never message\n * text, which is translated under a non-English `lc_messages`, is overwritten\n * with the query string by Drizzle's wrapper, and on SQLite names the key's\n * COLUMNS rather than the constraint. The `.cause` chain is walked because every\n * driver here nests the real error under at least one wrapper.\n *\n * Narrowing to the primary key is the whole point. A `unique: true` index\n * declaration materializes a UNIQUE INDEX on the same relation, and violating\n * THAT is a declared-uniqueness failure about the row's VALUES, not a duplicate\n * identity. PostgreSQL reports it under the index's own name and SQLite under a\n * different extended code, so it never matches here and keeps surfacing as it\n * did before.\n *\n * `relation` scopes the PostgreSQL arm, which is the one that can see a\n * constraint name. SQLite reports no relation at all, so its scope comes from\n * the CALL SITE instead: callers must invoke this only for a statement that\n * writes exactly one relation — the node or edge insert — where a primary-key\n * duplicate can only be that relation's. Applying it to a multi-relation\n * statement would attribute the wrong table's collision.\n */\nexport function isDuplicatePrimaryKeyError(\n error: unknown,\n relation: PrimaryKeyRelation,\n): boolean {\n for (const link of errorChain(error)) {\n if (!canReadProperty(link)) continue;\n if (isPostgresPrimaryKeyViolation(link, relation)) return true;\n if (isSqlitePrimaryKeyViolation(link)) return true;\n }\n return false;\n}\n\nfunction isSqlStateIn<SqlState extends string>(\n code: unknown,\n states: readonly SqlState[],\n): code is SqlState {\n const known: readonly string[] = states;\n return typeof code === \"string\" && known.includes(code);\n}\n\n/**\n * The first SQLSTATE in the error's cause chain that belongs to `states`. The\n * walk handles both direct driver errors and wrappers such as\n * DrizzleQueryError, which keeps the SQLSTATE-bearing error on `.cause`.\n */\nfunction matchSqlState<SqlState extends string>(\n error: unknown,\n states: readonly SqlState[],\n): SqlState | undefined {\n for (const link of errorChain(error)) {\n if (!canReadProperty(link)) continue;\n const code: unknown = Reflect.get(link, \"code\");\n if (isSqlStateIn(code, states)) return code;\n }\n return undefined;\n}\n\n/**\n * Returns the PostgreSQL SQLSTATE that prevented temporary-table creation.\n *\n * Callers must use this only at a `CREATE TEMP TABLE` execution seam: 42501\n * is otherwise a generic permission failure, and translating it elsewhere\n * would hide a different authorization problem.\n */\nexport function postgresTemporaryTableUnavailableSqlState(\n error: unknown,\n): PostgresTemporaryTableUnavailableSqlState | undefined {\n return matchSqlState(error, POSTGRES_TEMPORARY_TABLE_UNAVAILABLE_SQL_STATES);\n}\n\n/**\n * Returns the PostgreSQL SQLSTATE with which the server refused to open a\n * read-write transaction.\n *\n * Callers must use this only for a failure raised while opening such a\n * transaction — 0A000 is otherwise a generic \"unsupported feature\" report\n * that any statement can raise.\n */\nexport function postgresReadWriteRefusedSqlState(\n error: unknown,\n): PostgresReadWriteRefusedSqlState | undefined {\n return matchSqlState(error, POSTGRES_READ_WRITE_REFUSED_SQL_STATES);\n}\n\n/**\n * Whether SQLite rejected a statement through its authorizer. Cloudflare D1\n * and Durable Objects surface this as `not authorized: SQLITE_AUTH`, usually on\n * a Drizzle wrapper's `.cause`; native drivers may instead expose\n * `code: \"SQLITE_AUTH\"`. Both shapes are structural enough to distinguish from\n * an unrelated permission or connection failure.\n */\nexport function isSqliteNotAuthorizedError(error: unknown): boolean {\n for (const link of errorChain(error)) {\n if (sqliteErrorCode(link) === SQLITE_NOT_AUTHORIZED_CODE) return true;\n const message = messageProperty(link);\n if (\n message?.includes(SQLITE_NOT_AUTHORIZED_CODE) === true &&\n message.toLowerCase().includes(\"not authorized\")\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Whether SQLite refused a write because the enclosing DEFERRED transaction's\n * read snapshot went stale before it could take the writer slot\n * ({@link SQLITE_STALE_SNAPSHOT_CODE}).\n *\n * Classified structurally — the extended result code in either spelling a\n * driver reports it (better-sqlite3's symbolic `code`, libSQL's numeric\n * `rawCode`/`extendedCode`) — and never by message: SQLite renders this as the\n * bare, indistinguishable \"database is locked\".\n */\nexport function isSqliteStaleSnapshotError(error: unknown): boolean {\n for (const link of errorChain(error)) {\n if (sqliteErrorCode(link) === SQLITE_STALE_SNAPSHOT_CODE) return true;\n if (!canReadProperty(link)) continue;\n for (const field of SQLITE_EXTENDED_CODE_FIELDS) {\n if (Reflect.get(link, field) === SQLITE_STALE_SNAPSHOT_EXTENDED_CODE) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction historyMissingRecordedRelationsError(\n details: Record<string, unknown>,\n cause: unknown,\n): ConfigurationError {\n return new ConfigurationError(\n \"history: true requires the recorded-time relations to exist, but a recorded relation is missing.\",\n details,\n {\n cause,\n suggestion:\n \"Create the recorded-time relations (typegraph_recorded_nodes, typegraph_recorded_edges, typegraph_recorded_clock) — e.g. re-run the generated migration SQL — on this database before enabling history capture.\",\n },\n );\n}\n\n/**\n * Converts missing recorded-relation failures into the actionable precondition\n * error used by construction-time history checks. Capture paths use this after\n * the live write has already succeeded inside the same transaction; recorded\n * read paths use it when query/schema swapping reaches a recorded table that\n * has not been materialized yet.\n */\nexport async function withRecordedRelationsPrecondition<T>(\n promise: Promise<T>,\n details: Record<string, unknown>,\n): Promise<T> {\n try {\n return await promise;\n } catch (error) {\n if (!isMissingTableError(error)) throw error;\n throw historyMissingRecordedRelationsError(\n { ...details, code: \"RECORDED_RELATIONS_MISSING\" },\n error,\n );\n }\n}\n\n/**\n * Engine \"vector dimension mismatch\" message shapes. pgvector:\n * `expected 384 dimensions, not 512`; libSQL / sqlite-vec surface a similar\n * `expected N … got/not M`. The first capture is the dimension the *stored*\n * column expects; the optional second is the dimension that was *attempted*.\n */\nconst DIMENSION_MISMATCH_PATTERN =\n /expected (\\d+) dimensions(?:[,\\s]+(?:not|got|but got|but)\\s*(\\d+))?/i;\n\n/**\n * Parses an engine vector-dimension-mismatch error into `{ expected, actual }`\n * by walking the `.cause` chain (drivers wrap the real error). `expected` is\n * the stored column's dimension; `actual` (when the message includes it) is the\n * attempted vector's dimension. Returns `undefined` for unrelated errors.\n */\nexport function parseDimensionMismatch(\n error: unknown,\n): { expected: number; actual: number | undefined } | undefined {\n for (const link of errorChain(error)) {\n const message = errorMessage(link);\n const match = DIMENSION_MISMATCH_PATTERN.exec(message);\n if (match) {\n return {\n expected: Number(match[1]),\n actual: match[2] === undefined ? undefined : Number(match[2]),\n };\n }\n }\n return undefined;\n}\n","/**\n * Splits `items` into consecutive chunks of at most `size` elements.\n *\n * An empty input yields no chunks (`[]`), and an input that already fits in a\n * single chunk is returned without copying. Callers rely on the empty-input\n * behavior to skip work entirely rather than issue a statement with an empty\n * `IN ()` list.\n */\nexport function chunk<T>(\n items: readonly T[],\n size: number,\n): readonly (readonly T[])[] {\n // A non-positive, non-finite, or fractional size would make the slice loop\n // fail to advance correctly; fail loud rather than spin or emit empty chunks.\n // All current callers derive size from a positive integer bind-parameter\n // budget, so this only guards against a future regression.\n if (!Number.isSafeInteger(size) || size < 1) {\n throw new RangeError(`chunk size must be a positive integer, got: ${size}`);\n }\n if (items.length === 0) return [];\n if (items.length <= size) return [items];\n const chunks: T[][] = [];\n for (let start = 0; start < items.length; start += size) {\n chunks.push(items.slice(start, start + size));\n }\n return chunks;\n}\n\n/**\n * Groups items by a caller-supplied key while preserving input order within\n * each group.\n */\nexport function groupBy<T, K>(\n items: Iterable<T>,\n keyFor: (item: T) => K,\n): Map<K, T[]> {\n const groups = new Map<K, T[]>();\n for (const item of items) {\n const key = keyFor(item);\n const group = groups.get(key) ?? [];\n group.push(item);\n groups.set(key, group);\n }\n return groups;\n}\n"]}
@@ -1,14 +1,13 @@
1
- import { createSqliteOperationStrategy, createContributionMaterializer, gateFulltextMethods, assertTrustedImportDatabaseEmpty, suspendSqliteSecondaryIndexes, createSqliteTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, mapContributionMaterializationRow, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, tableExistsFromRow, assertAdoptedDialect, buildKindRemovalInsertValues, SQLITE_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, SQLITE_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, createCommonOperationBackend, vectorSlotFromParams, buildLiveNodeCandidates, mapVectorWriteError, mapHybridSearchRow, gateFulltext, FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT, EMBEDDING_UPSERT_PARAM_COUNT, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, assertActiveSchemaVersion, getOrCreateLru, commitSchemaVersionIfKindsEmpty } from './chunk-SQRD2CYF.js';
2
- import { createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-PHXITZE4.js';
3
- import { tables2, generateSqliteCreateTableSQL, generateSqliteDDL } from './chunk-7G32LIQM.js';
4
- import { toDrizzleSql, compileQueryWithDialect } from './chunk-GWEDD3DH.js';
5
- import { chunk } from './chunk-35S6P5ZU.js';
6
- import { normalizeGraphAnalyticsCapabilities, INTERNAL_TEMPORARY_WRITES, SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS, MODERN_SQLITE_MAX_BIND_PARAMETERS, DURABLE_OBJECT_MAX_BIND_PARAMETERS, D1_MAX_BIND_PARAMETERS } from './chunk-FMMIX6N4.js';
7
- import { isSqliteNotAuthorizedError, isMissingTableError } from './chunk-B75XRV3O.js';
8
- import { fts5Strategy, buildVectorCapabilities, buildFulltextCapabilities, assertVectorSearchLimit } from './chunk-K3BUWSFR.js';
9
- import { sql as sql$1, isSqlFragment } from './chunk-6DCB664D.js';
10
- import { requireDefined } from './chunk-QMQLUA66.js';
11
- import { ConfigurationError, BackendDisposedError } from './chunk-4MB3AQAQ.js';
1
+ import { contributionRebuildSupported, createSqliteOperationStrategy, createContributionMaterializer, gateFulltextMethods, assertTrustedImportDatabaseEmpty, suspendSqliteSecondaryIndexes, createSqliteTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, mapContributionMaterializationRow, SQLITE_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, tableExistsFromRow, assertAdoptedDialect, buildKindRemovalInsertValues, SQLITE_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, SQLITE_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, createCommonOperationBackend, vectorSlotFromParams, buildLiveNodeCandidates, mapVectorWriteError, mapHybridSearchRow, gateFulltext, FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT, EMBEDDING_UPSERT_PARAM_COUNT, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, assertActiveSchemaVersion, getOrCreateLru, commitSchemaVersionIfKindsEmpty } from './chunk-7VQXLT5O.js';
2
+ import { createNodeRowMapper, SQLITE_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-NMWDXFPH.js';
3
+ import { tables2, generateSqliteCreateTableSQL, generateSqliteDDL, createSqliteTables, sqliteContributions } from './chunk-5UVRGXD3.js';
4
+ import { toDrizzleSql, compileQueryWithDialect } from './chunk-UV3SN74I.js';
5
+ import { isSqliteNotAuthorizedError, isMissingTableError, chunk } from './chunk-JZUR7ZWE.js';
6
+ import { normalizeGraphAnalyticsCapabilities, markSerializedTransactionResource, INTERNAL_TEMPORARY_WRITES, SQLITE_CAPABILITIES, SQLITE_MAX_BIND_PARAMETERS, MODERN_SQLITE_MAX_BIND_PARAMETERS, DURABLE_OBJECT_MAX_BIND_PARAMETERS, D1_MAX_BIND_PARAMETERS } from './chunk-AKLS3BYZ.js';
7
+ import { fts5Strategy, buildVectorCapabilities, buildFulltextCapabilities, assertVectorSearchLimit, resolveEfSearchOverride, vectorSearchFrontierTuning } from './chunk-YDFDBE6D.js';
8
+ import { sql as sql$1, isSqlFragment } from './chunk-PQBQG7IM.js';
9
+ import { ConfigurationError, BackendDisposedError } from './chunk-J3WZ3FA2.js';
10
+ import { requireDefined } from './chunk-DYATYRY4.js';
12
11
  import { getTableName, sql, eq, and, isNull, inArray } from 'drizzle-orm';
13
12
  import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
14
13
 
@@ -120,11 +119,30 @@ function detectMaxBindParameters(sqliteClient, hardMaxBindParameters) {
120
119
  return SQLITE_MAX_BIND_PARAMETERS;
121
120
  }
122
121
  }
122
+ function preparingClient(client) {
123
+ if (typeof client !== "object" || client === null) return void 0;
124
+ const candidate = client;
125
+ return typeof candidate["prepare"] === "function" ? candidate : void 0;
126
+ }
127
+ function hasMethods(client, methods) {
128
+ return methods.every((method) => typeof client[method] === "function");
129
+ }
130
+ function isBetterSqlite3Client(client) {
131
+ const candidate = preparingClient(client);
132
+ return candidate !== void 0 && hasMethods(candidate, ["pragma"]);
133
+ }
134
+ function isBunSqliteClient(client) {
135
+ const candidate = preparingClient(client);
136
+ return candidate !== void 0 && hasMethods(candidate, ["query", "run", "exec", "serialize"]) && typeof candidate["filename"] === "string";
137
+ }
138
+ function isSqlJsClient(client) {
139
+ const candidate = preparingClient(client);
140
+ return candidate !== void 0 && hasMethods(candidate, ["exec", "run", "export", "getRowsModified"]);
141
+ }
123
142
  function resolveSqliteClient(db) {
124
143
  const sqliteClient = db.$client;
125
- if (typeof sqliteClient !== "object" || sqliteClient === null) return;
126
- const candidate = sqliteClient;
127
- if (typeof candidate["prepare"] !== "function") return;
144
+ if (preparingClient(sqliteClient) === void 0) return;
145
+ if (isSqlJsClient(sqliteClient)) return;
128
146
  return sqliteClient;
129
147
  }
130
148
  function getOrCreatePreparedStatement(cache, sqliteClient, sqlText, cacheMax) {
@@ -268,8 +286,15 @@ var GET_EDGES_FIXED_PARAM_COUNT = 1;
268
286
  var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
269
287
  var FULLTEXT_UPSERT_PARAM_COUNT = 6;
270
288
  var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
289
+ var UNIQUE_DELETE_FIXED_PARAM_COUNT = 2;
271
290
  var UNIQUE_INSERT_PARAM_COUNT = 6;
272
291
  var SQLITE_ANALYZE_ROW_LIMIT = 1e3;
292
+ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
293
+ "identityAssertions",
294
+ "recordedIdentityAssertions",
295
+ "identityClosure",
296
+ "identitySeparation"
297
+ ]);
273
298
  function computeSqliteBatchChunkSizes(maxBindParameters) {
274
299
  return {
275
300
  checkUniqueBatchChunkSize: Math.max(
@@ -308,6 +333,10 @@ function computeSqliteBatchChunkSizes(maxBindParameters) {
308
333
  1,
309
334
  Math.floor(maxBindParameters / NODE_INSERT_PARAM_COUNT)
310
335
  ),
336
+ uniqueDeleteChunkSize: Math.max(
337
+ 1,
338
+ maxBindParameters - UNIQUE_DELETE_FIXED_PARAM_COUNT
339
+ ),
311
340
  uniqueInsertBatchSize: Math.max(
312
341
  1,
313
342
  Math.floor(maxBindParameters / UNIQUE_INSERT_PARAM_COUNT)
@@ -479,6 +508,7 @@ function createSqliteOperationBackend(options) {
479
508
  execRun
480
509
  },
481
510
  nowIso,
511
+ maxBindParameters: capabilities.maxBindParameters ?? SQLITE_MAX_BIND_PARAMETERS,
482
512
  operationStrategy,
483
513
  rowMappers: {
484
514
  toEdgeRow,
@@ -559,8 +589,31 @@ function createSqliteOperationBackend(options) {
559
589
  await execRun(statement);
560
590
  }
561
591
  },
592
+ async deleteEmbeddingBatch(params) {
593
+ if (params.nodeIds.length === 0) return;
594
+ const slot = vectorSlotFromParams(params);
595
+ await contributionMaterializer.assertVectorSlot(slot);
596
+ for (const nodeIds of chunk(
597
+ [...new Set(params.nodeIds)],
598
+ batchConfig.embeddingUpsertBatchSize
599
+ )) {
600
+ const statements = vectorStrategy.buildDeleteBatch(slot, {
601
+ ...params,
602
+ nodeIds
603
+ });
604
+ for (const statement of statements) await execRun(statement);
605
+ }
606
+ },
562
607
  async vectorSearch(params) {
563
608
  assertVectorSearchLimit(params.limit);
609
+ resolveEfSearchOverride({
610
+ efSearch: params.efSearch,
611
+ indexType: params.indexType,
612
+ tuning: vectorSearchFrontierTuning(vectorStrategy),
613
+ transactions: capabilities.transactions,
614
+ dialect: "SQLite",
615
+ engine: vectorStrategy.name
616
+ });
564
617
  const slot = vectorSlotFromParams(params);
565
618
  const query = vectorStrategy.buildSearch(
566
619
  slot,
@@ -592,6 +645,14 @@ function createSqliteOperationBackend(options) {
592
645
  async hybridSearch(params) {
593
646
  assertVectorSearchLimit(params.limit);
594
647
  assertVectorSearchLimit(params.vector.k);
648
+ resolveEfSearchOverride({
649
+ efSearch: params.vector.efSearch,
650
+ indexType: params.vector.indexType,
651
+ tuning: vectorSearchFrontierTuning(vectorStrategy),
652
+ transactions: capabilities.transactions,
653
+ dialect: "SQLite",
654
+ engine: vectorStrategy.name
655
+ });
595
656
  const slot = vectorSlotFromParams({
596
657
  graphId: params.graphId,
597
658
  nodeKind: params.nodeKind,
@@ -641,6 +702,22 @@ function createSqliteOperationBackend(options) {
641
702
  ...commonBackend,
642
703
  ...executeRawMethod,
643
704
  ...vectorEmbeddingMethods,
705
+ /**
706
+ * Transaction-scoped contribution marker stamp. Present so the
707
+ * destructive rebuild can commit its marker with the DDL that
708
+ * produced it; without it the stamp would land outside the
709
+ * transaction and could survive a rolled-back drop.
710
+ *
711
+ * States the row outright rather than reusing the top-level upsert,
712
+ * whose `materialized_at` COALESCE preserves an earlier success so a
713
+ * failed re-attempt cannot erase it. A completed rebuild replaced the
714
+ * storage, so the recorded timestamp must be the rebuild's.
715
+ */
716
+ async recordContributionMaterialization(params) {
717
+ await execRun(
718
+ operationStrategy.buildInsertContributionMaterialization(params)
719
+ );
720
+ },
644
721
  async deleteSchemaVectorSlotContribution(slot) {
645
722
  if (vectorStrategy === void 0) return;
646
723
  for (const contribution of vectorStrategy.ownedTables(slot)) {
@@ -768,7 +845,22 @@ function createSqliteOperationBackend(options) {
768
845
  };
769
846
  return operationBackend;
770
847
  }
848
+ function isLocalLibsqlClient(client) {
849
+ if (typeof client !== "object" || client === null) return false;
850
+ const candidate = client;
851
+ return candidate["protocol"] === "file" && typeof candidate["execute"] === "function" && typeof candidate["batch"] === "function" && typeof candidate["executeMultiple"] === "function";
852
+ }
853
+ function getSerializedSqliteConnection(db) {
854
+ const client = db.$client;
855
+ if (isBetterSqlite3Client(client) || isBunSqliteClient(client) || isSqlJsClient(client)) {
856
+ return client;
857
+ }
858
+ const storageClient = getDurableObjectStorageClient(db);
859
+ if (storageClient !== void 0) return storageClient;
860
+ return isLocalLibsqlClient(client) ? client : void 0;
861
+ }
771
862
  function createSqliteBackend(db, options = {}) {
863
+ const serializedConnection = getSerializedSqliteConnection(db);
772
864
  const tables2$1 = options.tables ?? tables2;
773
865
  const fulltextStrategy = options.fulltext ?? fts5Strategy;
774
866
  const profileHints = options.executionProfile ?? {};
@@ -776,7 +868,7 @@ function createSqliteBackend(db, options = {}) {
776
868
  const { isSync, transactionMode } = executionAdapter.profile;
777
869
  const vectorStrategy = options.vector;
778
870
  const capabilityOverrides = options.capabilities ?? {};
779
- const capabilities = normalizeGraphAnalyticsCapabilities({
871
+ const declaredCapabilities = normalizeGraphAnalyticsCapabilities({
780
872
  ...buildSqliteCapabilities({
781
873
  fulltextStrategy,
782
874
  vectorStrategy,
@@ -793,6 +885,18 @@ function createSqliteBackend(db, options = {}) {
793
885
  capabilityOverrides.graphAnalytics
794
886
  )
795
887
  });
888
+ const capabilities = {
889
+ ...declaredCapabilities,
890
+ contributions: {
891
+ supported: true,
892
+ probe: true,
893
+ rebuild: contributionRebuildSupported(
894
+ fulltextStrategy,
895
+ tables2$1.fulltextTableName,
896
+ declaredCapabilities.transactions
897
+ )
898
+ }
899
+ };
796
900
  const tableNames = {
797
901
  nodes: getTableName(tables2$1.nodes),
798
902
  edges: getTableName(tables2$1.edges),
@@ -800,6 +904,10 @@ function createSqliteBackend(db, options = {}) {
800
904
  recordedEdges: getTableName(tables2$1.recordedEdges),
801
905
  recordedClock: getTableName(tables2$1.recordedClock),
802
906
  revisionOrigins: getTableName(tables2$1.revisionOrigins),
907
+ identityAssertions: getTableName(tables2$1.identityAssertions),
908
+ recordedIdentityAssertions: getTableName(tables2$1.recordedIdentityAssertions),
909
+ identityClosure: getTableName(tables2$1.identityClosure),
910
+ identitySeparation: getTableName(tables2$1.identitySeparation),
803
911
  fulltext: tables2$1.fulltextTableName,
804
912
  uniques: getTableName(tables2$1.uniques)
805
913
  };
@@ -809,10 +917,14 @@ function createSqliteBackend(db, options = {}) {
809
917
  tableNames.uniques,
810
918
  tableNames.fulltext
811
919
  ];
812
- const recordedAnalyzeTables = [
920
+ const guardedAnalyzeTables = [
813
921
  tableNames.recordedNodes,
814
922
  tableNames.recordedEdges,
815
- tableNames.recordedClock
923
+ tableNames.recordedClock,
924
+ tableNames.recordedIdentityAssertions,
925
+ tableNames.identityAssertions,
926
+ tableNames.identityClosure,
927
+ tableNames.identitySeparation
816
928
  ];
817
929
  const operationStrategy = createSqliteOperationStrategy(
818
930
  tables2$1,
@@ -883,6 +995,17 @@ function createSqliteBackend(db, options = {}) {
883
995
  );
884
996
  return tableExistsFromRow(rows[0]);
885
997
  }
998
+ function identityContributionsFor(identityTableNames) {
999
+ const identityTables = createSqliteTables({
1000
+ identityAssertions: identityTableNames.identityAssertions,
1001
+ recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
1002
+ identityClosure: identityTableNames.identityClosure,
1003
+ identitySeparation: identityTableNames.identitySeparation
1004
+ });
1005
+ return sqliteContributions(identityTables, fulltextStrategy).filter(
1006
+ (contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
1007
+ );
1008
+ }
886
1009
  const contributionMaterializer = createContributionMaterializer({
887
1010
  dialect: "sqlite",
888
1011
  fulltextStrategy,
@@ -895,7 +1018,15 @@ function createSqliteBackend(db, options = {}) {
895
1018
  getMarkers: getContributionMaterializationRows,
896
1019
  recordMarker: recordContributionMaterializationRow,
897
1020
  deleteMarker: deleteContributionMaterializationRow,
898
- tableExists: contributionTableExists
1021
+ tableExists: contributionTableExists,
1022
+ // Withheld rather than wired-and-throwing when transactions are
1023
+ // disabled: the rebuild must refuse with its own typed error naming
1024
+ // the absent fence, matching `capabilities.contributions.rebuild`.
1025
+ // The graph id the materializer passes is unused — this backend's
1026
+ // schema lock is per connection, not per graph.
1027
+ ...capabilities.transactions ? {
1028
+ schemaWriteTransaction: (_graphId, fn) => runSchemaWriteTransaction((target) => fn(target))
1029
+ } : {}
899
1030
  });
900
1031
  const operations = createSqliteOperationBackend({
901
1032
  capabilities,
@@ -929,6 +1060,16 @@ function createSqliteBackend(db, options = {}) {
929
1060
  }
930
1061
  await compiledRun(executionAdapter.compile(query));
931
1062
  }
1063
+ async function rollbackFrameQuietly() {
1064
+ try {
1065
+ await runFrameStatement(sql`ROLLBACK`);
1066
+ } catch (rollbackError) {
1067
+ console.warn(
1068
+ "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.",
1069
+ rollbackError
1070
+ );
1071
+ }
1072
+ }
932
1073
  function runSchemaWriteTransaction(fn) {
933
1074
  if (transactionMode === "none") {
934
1075
  throwSqliteTransactionsDisabled(
@@ -954,7 +1095,7 @@ function createSqliteBackend(db, options = {}) {
954
1095
  await runFrameStatement(sql`COMMIT`);
955
1096
  return result;
956
1097
  } catch (error) {
957
- await runFrameStatement(sql`ROLLBACK`);
1098
+ await rollbackFrameQuietly();
958
1099
  throw error;
959
1100
  }
960
1101
  });
@@ -1042,6 +1183,28 @@ function createSqliteBackend(db, options = {}) {
1042
1183
  sql.raw(generateSqliteCreateTableSQL(tables2$1.revisionOrigins))
1043
1184
  );
1044
1185
  },
1186
+ async ensureIdentityTables(identityTableNames, options2) {
1187
+ const identityContributions = identityContributionsFor(identityTableNames);
1188
+ const missing = [];
1189
+ for (const contribution of identityContributions) {
1190
+ if (!await contributionTableExists(contribution.tableName)) {
1191
+ missing.push(contribution.logicalName);
1192
+ }
1193
+ }
1194
+ if (missing.length === 0 || options2.provisionMissing) {
1195
+ for (const contribution of identityContributions) {
1196
+ for (const ddl of contribution.createDdl) {
1197
+ await db.run(sql.raw(ddl));
1198
+ }
1199
+ }
1200
+ }
1201
+ return missing;
1202
+ },
1203
+ identityTableDdl(identityTableNames) {
1204
+ return identityContributionsFor(identityTableNames).flatMap(
1205
+ (contribution) => [...contribution.createDdl]
1206
+ );
1207
+ },
1045
1208
  // Every fulltext-touching method asserts the durable marker instead
1046
1209
  // of lazily emitting DDL. Steady state performs zero ensure; an
1047
1210
  // uninitialized database throws `StoreNotInitializedError` rather
@@ -1146,6 +1309,19 @@ function createSqliteBackend(db, options = {}) {
1146
1309
  async verifyContributions(graphId, vectorSlots) {
1147
1310
  return contributionMaterializer.verifyContributions(graphId, vectorSlots);
1148
1311
  },
1312
+ async repairContributions(graphId, vectorSlots) {
1313
+ return contributionMaterializer.repairContributions(graphId, vectorSlots);
1314
+ },
1315
+ async probeContributions(graphId, vectorSlots) {
1316
+ return contributionMaterializer.probeContributions(graphId, vectorSlots);
1317
+ },
1318
+ async rebuildContribution(graphId, scope, repopulate) {
1319
+ return contributionMaterializer.rebuildContribution(
1320
+ graphId,
1321
+ scope,
1322
+ repopulate
1323
+ );
1324
+ },
1149
1325
  // Vector counterparts of the runtime-contribution methods. Present
1150
1326
  // only when a vector strategy is wired (omitted on a plain SQLite
1151
1327
  // connection with no vector extension), mirroring the embedding/
@@ -1198,7 +1374,7 @@ function createSqliteBackend(db, options = {}) {
1198
1374
  )
1199
1375
  );
1200
1376
  }
1201
- for (const tableName of recordedAnalyzeTables) {
1377
+ for (const tableName of guardedAnalyzeTables) {
1202
1378
  try {
1203
1379
  await db.run(
1204
1380
  toDrizzleSql(
@@ -1221,6 +1397,12 @@ function createSqliteBackend(db, options = {}) {
1221
1397
  (target) => commitSchemaVersionIfKindsEmpty(target, params, probes)
1222
1398
  );
1223
1399
  },
1400
+ async commitSchemaVersionWithPreflight(params, preflight) {
1401
+ return runSchemaWriteTransaction(async (target) => {
1402
+ await preflight(target);
1403
+ return target.commitSchemaVersion(params);
1404
+ });
1405
+ },
1224
1406
  async setActiveVersion(params) {
1225
1407
  await runSchemaWriteTransaction(
1226
1408
  (target) => target.setActiveVersion(params)
@@ -1272,7 +1454,7 @@ function createSqliteBackend(db, options = {}) {
1272
1454
  await runFrameStatement(sql`COMMIT`);
1273
1455
  return result;
1274
1456
  } catch (error) {
1275
- await runFrameStatement(sql`ROLLBACK`);
1457
+ await rollbackFrameQuietly();
1276
1458
  throw error;
1277
1459
  }
1278
1460
  });
@@ -1307,6 +1489,9 @@ function createSqliteBackend(db, options = {}) {
1307
1489
  return Promise.resolve();
1308
1490
  }
1309
1491
  };
1492
+ if (serializedConnection !== void 0) {
1493
+ markSerializedTransactionResource(backend, serializedConnection);
1494
+ }
1310
1495
  return backend;
1311
1496
  }
1312
1497
  function createTransactionBackend(options) {
@@ -1326,6 +1511,6 @@ function createTransactionBackend(options) {
1326
1511
  });
1327
1512
  }
1328
1513
 
1329
- export { createSqliteBackend };
1330
- //# sourceMappingURL=chunk-63KCKSSH.js.map
1331
- //# sourceMappingURL=chunk-63KCKSSH.js.map
1514
+ export { createSqliteBackend, isLocalLibsqlClient };
1515
+ //# sourceMappingURL=chunk-C23WSN5E.js.map
1516
+ //# sourceMappingURL=chunk-C23WSN5E.js.map