@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,17 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkST3LPB2V_cjs = require('./chunk-ST3LPB2V.cjs');
4
- var chunkMCHP7RHZ_cjs = require('./chunk-MCHP7RHZ.cjs');
5
- var chunkHJH3RMXG_cjs = require('./chunk-HJH3RMXG.cjs');
6
- var chunk6JZUSDY2_cjs = require('./chunk-6JZUSDY2.cjs');
7
- var chunkNN3QSOVS_cjs = require('./chunk-NN3QSOVS.cjs');
8
- var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
9
- var chunk3PRKZW6D_cjs = require('./chunk-3PRKZW6D.cjs');
10
- var chunkWBUFJ7BS_cjs = require('./chunk-WBUFJ7BS.cjs');
11
- var chunkOVUUTCPJ_cjs = require('./chunk-OVUUTCPJ.cjs');
12
- var chunkU5W4LKZV_cjs = require('./chunk-U5W4LKZV.cjs');
13
- var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
14
- var chunkC4F7VJ5D_cjs = require('./chunk-C4F7VJ5D.cjs');
3
+ var chunkMUK4BU7K_cjs = require('./chunk-MUK4BU7K.cjs');
4
+ var chunkMXJDTH5B_cjs = require('./chunk-MXJDTH5B.cjs');
5
+ var chunkYAAM3M2S_cjs = require('./chunk-YAAM3M2S.cjs');
6
+ var chunkRMQLSPA2_cjs = require('./chunk-RMQLSPA2.cjs');
7
+ var chunkU5SON7R2_cjs = require('./chunk-U5SON7R2.cjs');
8
+ var chunkBSFJMMV3_cjs = require('./chunk-BSFJMMV3.cjs');
9
+ var chunkXBYVV3MP_cjs = require('./chunk-XBYVV3MP.cjs');
10
+ var chunk4UGOKMI5_cjs = require('./chunk-4UGOKMI5.cjs');
11
+ var chunkVCRRKBLN_cjs = require('./chunk-VCRRKBLN.cjs');
12
+ var chunkNI72YOJB_cjs = require('./chunk-NI72YOJB.cjs');
13
+ var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
15
14
  var drizzleOrm = require('drizzle-orm');
16
15
  var pgCore = require('drizzle-orm/pg-core');
17
16
 
@@ -30,8 +29,12 @@ function isPgliteClient(candidate) {
30
29
  return typeof candidate === "object" && hasFunctionProperty(candidate, "query") && hasFunctionProperty(candidate, "dumpDataDir");
31
30
  }
32
31
  var PGLITE_MAX_BIND_PARAMETERS = 32767;
32
+ function getPgliteClient(db) {
33
+ const client = db.$client;
34
+ return isPgliteClient(client) ? client : void 0;
35
+ }
33
36
  function isPgliteDatabase(db) {
34
- return isPgliteClient(db.$client);
37
+ return getPgliteClient(db) !== void 0;
35
38
  }
36
39
  function transactionSession(carrier) {
37
40
  return carrier.session ?? carrier._?.session;
@@ -50,7 +53,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
50
53
  var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
51
54
  var nextStatementId = 0;
52
55
  function statementNameFor(sqlText, cacheMax) {
53
- return chunkST3LPB2V_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
56
+ return chunkMUK4BU7K_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
54
57
  const name = `tg_${nextStatementId}`;
55
58
  nextStatementId += 1;
56
59
  return name;
@@ -164,7 +167,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
164
167
  options.useTransactionClient ?? false
165
168
  );
166
169
  function compile(query) {
167
- return chunkNN3QSOVS_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
170
+ return chunkU5SON7R2_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
168
171
  }
169
172
  function assertCompiledWithinBindParameterLimit(compiledQuery) {
170
173
  assertWithinBindParameterLimit(
@@ -179,7 +182,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
179
182
  assertCompiledWithinBindParameterLimit(compile(query));
180
183
  return executeDrizzleQuery(
181
184
  db,
182
- chunkU5W4LKZV_cjs.isSqlFragment(query) ? chunkNN3QSOVS_cjs.toDrizzleSql(query, "postgres") : query
185
+ chunkVCRRKBLN_cjs.isSqlFragment(query) ? chunkU5SON7R2_cjs.toDrizzleSql(query, "postgres") : query
183
186
  );
184
187
  }
185
188
  };
@@ -198,7 +201,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
198
201
  async execute(query) {
199
202
  const compiled = compile(query);
200
203
  assertCompiledWithinBindParameterLimit(compiled);
201
- if (chunkU5W4LKZV_cjs.isSqlFragment(query) && chunkU5W4LKZV_cjs.shouldForceCustomPlan(query)) {
204
+ if (chunkVCRRKBLN_cjs.isSqlFragment(query) && chunkVCRRKBLN_cjs.shouldForceCustomPlan(query)) {
202
205
  const result = await pgQueryClient.queryUnnamed(
203
206
  compiled.sql,
204
207
  compiled.params
@@ -221,7 +224,7 @@ function assertWithinBindParameterLimit(parameterCount, maxBindParameters) {
221
224
  if (maxBindParameters === void 0 || parameterCount <= maxBindParameters) {
222
225
  return;
223
226
  }
224
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
227
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
225
228
  `PostgreSQL statement uses ${parameterCount} bound parameters, exceeding this backend's limit of ${maxBindParameters}.`,
226
229
  {
227
230
  capability: "maxBindParameters",
@@ -242,7 +245,7 @@ function createStatementQueue() {
242
245
  let closed = false;
243
246
  return {
244
247
  enqueue(task) {
245
- if (closed) return Promise.reject(new chunkC4F7VJ5D_cjs.TransactionClosedError());
248
+ if (closed) return Promise.reject(new chunkNI72YOJB_cjs.TransactionClosedError());
246
249
  const result = tail.then(() => task());
247
250
  tail = result.then(ignoreOutcome, ignoreOutcome);
248
251
  return result;
@@ -293,6 +296,7 @@ var GET_EDGES_FIXED_PARAM_COUNT = 1;
293
296
  var FULLTEXT_UPSERT_PARAM_COUNT = 6;
294
297
  var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
295
298
  var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
299
+ var UNIQUE_DELETE_FIXED_PARAM_COUNT = 2;
296
300
  var UNIQUE_INSERT_PARAM_COUNT = 6;
297
301
  function computePostgresBatchChunkSizes(maxBindParameters) {
298
302
  return {
@@ -306,11 +310,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
306
310
  ),
307
311
  embeddingUpsertBatchSize: Math.max(
308
312
  1,
309
- Math.floor(maxBindParameters / chunkST3LPB2V_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
313
+ Math.floor(maxBindParameters / chunkMUK4BU7K_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
310
314
  ),
311
315
  findEdgesEndpointChunkSize: Math.max(
312
316
  1,
313
- maxBindParameters - chunkST3LPB2V_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
317
+ maxBindParameters - chunkMUK4BU7K_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
314
318
  ),
315
319
  fulltextDeleteChunkSize: Math.max(
316
320
  1,
@@ -332,29 +336,40 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
332
336
  1,
333
337
  Math.floor(maxBindParameters / NODE_INSERT_PARAM_COUNT)
334
338
  ),
339
+ uniqueDeleteChunkSize: Math.max(
340
+ 1,
341
+ maxBindParameters - UNIQUE_DELETE_FIXED_PARAM_COUNT
342
+ ),
335
343
  uniqueInsertBatchSize: Math.max(
336
344
  1,
337
345
  Math.floor(maxBindParameters / UNIQUE_INSERT_PARAM_COUNT)
338
346
  )
339
347
  };
340
348
  }
341
- var toNodeRow = chunkHJH3RMXG_cjs.createNodeRowMapper(chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG);
342
- var toEdgeRow = chunkHJH3RMXG_cjs.createEdgeRowMapper(chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG);
343
- var toUniqueRow = chunkHJH3RMXG_cjs.createUniqueRowMapper(chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG);
344
- var toSchemaVersionRow = chunkHJH3RMXG_cjs.createSchemaVersionRowMapper(
345
- chunkHJH3RMXG_cjs.POSTGRES_ROW_MAPPER_CONFIG
349
+ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
350
+ "identityAssertions",
351
+ "recordedIdentityAssertions",
352
+ "identityClosure",
353
+ "identitySeparation"
354
+ ]);
355
+ var toNodeRow = chunkYAAM3M2S_cjs.createNodeRowMapper(chunkYAAM3M2S_cjs.POSTGRES_ROW_MAPPER_CONFIG);
356
+ var toEdgeRow = chunkYAAM3M2S_cjs.createEdgeRowMapper(chunkYAAM3M2S_cjs.POSTGRES_ROW_MAPPER_CONFIG);
357
+ var toUniqueRow = chunkYAAM3M2S_cjs.createUniqueRowMapper(chunkYAAM3M2S_cjs.POSTGRES_ROW_MAPPER_CONFIG);
358
+ var toSchemaVersionRow = chunkYAAM3M2S_cjs.createSchemaVersionRowMapper(
359
+ chunkYAAM3M2S_cjs.POSTGRES_ROW_MAPPER_CONFIG
346
360
  );
347
361
  function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
348
362
  return {
349
- ...chunk3PRKZW6D_cjs.POSTGRES_CAPABILITIES,
350
- ...vectorStrategy === void 0 ? {} : { vector: chunkOVUUTCPJ_cjs.buildVectorCapabilities(vectorStrategy) },
351
- fulltext: chunkOVUUTCPJ_cjs.buildFulltextCapabilities(fulltextStrategy)
363
+ ...chunkXBYVV3MP_cjs.POSTGRES_CAPABILITIES,
364
+ ...vectorStrategy === void 0 ? {} : { vector: chunk4UGOKMI5_cjs.buildVectorCapabilities(vectorStrategy) },
365
+ fulltext: chunk4UGOKMI5_cjs.buildFulltextCapabilities(fulltextStrategy)
352
366
  };
353
367
  }
354
368
  function createPostgresBackend(db, options = {}) {
355
- const tables2 = options.tables ?? chunk6JZUSDY2_cjs.tables;
356
- const fulltextStrategy = options.fulltext ?? chunkOVUUTCPJ_cjs.tsvectorStrategy;
357
- const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkMCHP7RHZ_cjs.pgvectorStrategy;
369
+ const serializedClient = getSerializedPostgresClient(db);
370
+ const tables2 = options.tables ?? chunkRMQLSPA2_cjs.tables;
371
+ const fulltextStrategy = options.fulltext ?? chunk4UGOKMI5_cjs.tsvectorStrategy;
372
+ const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkMXJDTH5B_cjs.pgvectorStrategy;
358
373
  const iterativeScanProbe = createIterativeScanProbe();
359
374
  const baseCapabilities = buildPostgresCapabilities(
360
375
  fulltextStrategy,
@@ -367,23 +382,35 @@ function createPostgresBackend(db, options = {}) {
367
382
  supported: false
368
383
  }
369
384
  } : {};
370
- const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunk3PRKZW6D_cjs.POSTGRES_MAX_BIND_PARAMETERS;
385
+ const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunkXBYVV3MP_cjs.POSTGRES_MAX_BIND_PARAMETERS;
371
386
  const driverBindParameterOverrides = isPgliteDatabase(db) ? {
372
387
  maxBindParameters: Math.min(
373
388
  configuredMaxBindParameters,
374
389
  PGLITE_MAX_BIND_PARAMETERS
375
390
  )
376
391
  } : {};
377
- const capabilities = chunk3PRKZW6D_cjs.normalizeGraphAnalyticsCapabilities({
392
+ const declaredCapabilities = chunkXBYVV3MP_cjs.normalizeGraphAnalyticsCapabilities({
378
393
  ...baseCapabilities,
379
394
  ...httpOnlyOverrides,
380
395
  ...options.capabilities,
381
396
  ...driverBindParameterOverrides
382
397
  });
398
+ const capabilities = {
399
+ ...declaredCapabilities,
400
+ contributions: {
401
+ supported: true,
402
+ probe: true,
403
+ rebuild: chunkMUK4BU7K_cjs.contributionRebuildSupported(
404
+ fulltextStrategy,
405
+ tables2.fulltextTableName,
406
+ declaredCapabilities.transactions
407
+ )
408
+ }
409
+ };
383
410
  const adapterOptions = {
384
411
  ...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
385
412
  ...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
386
- maxBindParameters: capabilities.maxBindParameters ?? chunk3PRKZW6D_cjs.POSTGRES_MAX_BIND_PARAMETERS
413
+ maxBindParameters: capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.POSTGRES_MAX_BIND_PARAMETERS
387
414
  };
388
415
  const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
389
416
  const tableNames = {
@@ -393,6 +420,10 @@ function createPostgresBackend(db, options = {}) {
393
420
  recordedEdges: drizzleOrm.getTableName(tables2.recordedEdges),
394
421
  recordedClock: drizzleOrm.getTableName(tables2.recordedClock),
395
422
  revisionOrigins: drizzleOrm.getTableName(tables2.revisionOrigins),
423
+ identityAssertions: drizzleOrm.getTableName(tables2.identityAssertions),
424
+ recordedIdentityAssertions: drizzleOrm.getTableName(tables2.recordedIdentityAssertions),
425
+ identityClosure: drizzleOrm.getTableName(tables2.identityClosure),
426
+ identitySeparation: drizzleOrm.getTableName(tables2.identitySeparation),
396
427
  fulltext: tables2.fulltextTableName,
397
428
  uniques: drizzleOrm.getTableName(tables2.uniques)
398
429
  };
@@ -402,21 +433,25 @@ function createPostgresBackend(db, options = {}) {
402
433
  drizzleOrm.getTableName(tables2.uniques),
403
434
  tableNames.fulltext
404
435
  ].map(
405
- (name) => chunkNN3QSOVS_cjs.toDrizzleSql(
406
- chunkU5W4LKZV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkU5W4LKZV_cjs.sql.identifier(name)}`,
436
+ (name) => chunkU5SON7R2_cjs.toDrizzleSql(
437
+ chunkVCRRKBLN_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkVCRRKBLN_cjs.sql.identifier(name)}`,
407
438
  "postgres"
408
439
  )
409
440
  );
410
- const recordedAnalyzeTables = [
441
+ const guardedAnalyzeTables = [
411
442
  tableNames.recordedNodes,
412
443
  tableNames.recordedEdges,
413
- tableNames.recordedClock
444
+ tableNames.recordedClock,
445
+ tableNames.recordedIdentityAssertions,
446
+ tableNames.identityAssertions,
447
+ tableNames.identityClosure,
448
+ tableNames.identitySeparation
414
449
  ];
415
- const operationStrategy = chunkST3LPB2V_cjs.createPostgresOperationStrategy(
450
+ const operationStrategy = chunkMUK4BU7K_cjs.createPostgresOperationStrategy(
416
451
  tables2,
417
452
  fulltextStrategy
418
453
  );
419
- const recordedTableExists = chunkST3LPB2V_cjs.createCachedTableExistence(
454
+ const guardedTableExists = chunkMUK4BU7K_cjs.createCachedTableExistence(
420
455
  async (tableName) => {
421
456
  const rows = await executionAdapter.execute(
422
457
  operationStrategy.buildTableExists(tableName)
@@ -426,8 +461,31 @@ function createPostgresBackend(db, options = {}) {
426
461
  { cacheExisting: false }
427
462
  );
428
463
  const matTable = tables2.contributionMaterializations;
464
+ async function executeConcurrentCreateDdl(ddl) {
465
+ const statement = drizzleOrm.sql.raw(ddl);
466
+ try {
467
+ await db.execute(statement);
468
+ } catch (error) {
469
+ if (!chunkBSFJMMV3_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
470
+ await db.execute(statement);
471
+ }
472
+ }
473
+ async function ensureTableWithConcurrentCreateRetry(table) {
474
+ await executeConcurrentCreateDdl(chunkRMQLSPA2_cjs.generatePgCreateTableSQL(table));
475
+ }
429
476
  async function ensureContributionMaterializationsTableImpl() {
430
- await db.execute(drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(matTable)));
477
+ await ensureTableWithConcurrentCreateRetry(matTable);
478
+ }
479
+ function identityContributionsFor(identityTableNames) {
480
+ const identityTables = chunkRMQLSPA2_cjs.createPostgresTables({
481
+ identityAssertions: identityTableNames.identityAssertions,
482
+ recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
483
+ identityClosure: identityTableNames.identityClosure,
484
+ identitySeparation: identityTableNames.identitySeparation
485
+ });
486
+ return chunkRMQLSPA2_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
487
+ (contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
488
+ );
431
489
  }
432
490
  async function getContributionMaterializationRow(identity) {
433
491
  const rows = await db.select().from(matTable).where(
@@ -440,25 +498,25 @@ function createPostgresBackend(db, options = {}) {
440
498
  );
441
499
  const row = rows[0];
442
500
  if (row === void 0) return void 0;
443
- return chunkST3LPB2V_cjs.mapContributionMaterializationRow(
501
+ return chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
444
502
  row,
445
- chunkST3LPB2V_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
503
+ chunkMUK4BU7K_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
446
504
  );
447
505
  }
448
506
  async function getContributionMaterializationRows(graphId) {
449
507
  const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
450
508
  return rows.map(
451
- (row) => chunkST3LPB2V_cjs.mapContributionMaterializationRow(
509
+ (row) => chunkMUK4BU7K_cjs.mapContributionMaterializationRow(
452
510
  row,
453
- chunkST3LPB2V_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
511
+ chunkMUK4BU7K_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
454
512
  )
455
513
  );
456
514
  }
457
515
  async function recordContributionMaterializationRow(params) {
458
516
  await db.insert(matTable).values(
459
- chunkST3LPB2V_cjs.buildContributionInsertValues(
517
+ chunkMUK4BU7K_cjs.buildContributionInsertValues(
460
518
  params,
461
- chunkST3LPB2V_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
519
+ chunkMUK4BU7K_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
462
520
  )
463
521
  ).onConflictDoUpdate({
464
522
  target: [
@@ -467,7 +525,7 @@ function createPostgresBackend(db, options = {}) {
467
525
  matTable.owner,
468
526
  matTable.tableName
469
527
  ],
470
- set: chunkST3LPB2V_cjs.buildContributionOnConflictSet(
528
+ set: chunkMUK4BU7K_cjs.buildContributionOnConflictSet(
471
529
  matTable.materializedAt,
472
530
  params.materializedAt
473
531
  )
@@ -487,21 +545,32 @@ function createPostgresBackend(db, options = {}) {
487
545
  const rows = await executionAdapter.execute(
488
546
  operationStrategy.buildTableExists(tableName)
489
547
  );
490
- return chunkST3LPB2V_cjs.tableExistsFromRow(rows[0]);
548
+ return chunkMUK4BU7K_cjs.tableExistsFromRow(rows[0]);
491
549
  }
492
- const contributionMaterializer = chunkST3LPB2V_cjs.createContributionMaterializer({
550
+ const contributionMaterializer = chunkMUK4BU7K_cjs.createContributionMaterializer({
493
551
  dialect: "postgres",
494
552
  fulltextStrategy,
495
553
  fulltextTableName: tables2.fulltextTableName,
496
554
  vectorStrategy,
555
+ // Contribution DDL is `CREATE ... IF NOT EXISTS` reached from every
556
+ // booting replica, so it carries the same concurrent-create retry the
557
+ // other create sites use. Without it the loser's 23505 is recorded as
558
+ // `lastError` on the marker row and reported as a failed materialization,
559
+ // when the table it wanted is in fact present.
497
560
  execDdl: async (statement) => {
498
- await db.execute(drizzleOrm.sql.raw(statement));
561
+ await executeConcurrentCreateDdl(statement);
499
562
  },
500
563
  ensureMarkerTable: ensureContributionMaterializationsTableImpl,
501
564
  getMarkers: getContributionMaterializationRows,
502
565
  recordMarker: recordContributionMaterializationRow,
503
566
  deleteMarker: deleteContributionMaterializationRow,
504
- tableExists: contributionTableExists
567
+ tableExists: contributionTableExists,
568
+ // Withheld rather than wired-and-throwing when the driver cannot hold
569
+ // a session: the rebuild must refuse with its own typed error naming
570
+ // the absent fence, matching `capabilities.contributions.rebuild`.
571
+ ...capabilities.transactions ? {
572
+ schemaWriteTransaction: (graphId, fn) => runSchemaWriteTransaction(graphId, (target) => fn(target))
573
+ } : {}
505
574
  });
506
575
  const operations = createPostgresOperationBackend({
507
576
  db,
@@ -519,7 +588,7 @@ function createPostgresBackend(db, options = {}) {
519
588
  });
520
589
  function runSchemaWriteTransaction(graphId, fn) {
521
590
  if (!capabilities.transactions) {
522
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
591
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
523
592
  "Schema writes and removal cleanup require atomic transactions, but this Postgres backend does not provide them. The drizzle-orm/neon-http driver communicates over HTTP and cannot hold a session across statements; use drizzle-orm/neon-serverless (websocket) for transactional writes.",
524
593
  {
525
594
  backend: "postgres",
@@ -570,7 +639,7 @@ function createPostgresBackend(db, options = {}) {
570
639
  schemaVersionsTable: tables2.schemaVersions
571
640
  });
572
641
  return {
573
- backend: chunkST3LPB2V_cjs.gateFulltext(
642
+ backend: chunkMUK4BU7K_cjs.gateFulltext(
574
643
  backend2,
575
644
  contributionMaterializer.assertInitialized
576
645
  ),
@@ -583,7 +652,7 @@ function createPostgresBackend(db, options = {}) {
583
652
  async trustedImport(fn, options_) {
584
653
  return backend.transactionWithNative(async (tx, rawSql) => {
585
654
  if (options_?.schemaWrite !== void 0) {
586
- await chunk764JHTLT_cjs.requireDefined(tx.lockSchemaVersionForWrite)({
655
+ await chunkN66HCGCY_cjs.requireDefined(tx.lockSchemaVersionForWrite)({
587
656
  ...options_.schemaWrite
588
657
  });
589
658
  }
@@ -593,40 +662,60 @@ function createPostgresBackend(db, options = {}) {
593
662
  );
594
663
  const executeCompiled = trustedExecutionAdapter.executeCompiled;
595
664
  if (executeCompiled === void 0) {
596
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
665
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
597
666
  "Trusted import could not bind raw execution to the PostgreSQL transaction.",
598
667
  { capability: "trustedImport", dialect: "postgres" }
599
668
  );
600
669
  }
601
- const trustedTx = chunk3PRKZW6D_cjs.createBackendOverlay(tx, {
670
+ const trustedTx = chunkXBYVV3MP_cjs.createBackendOverlay(tx, {
602
671
  executeRaw(sqlText, params) {
603
672
  return executeCompiled({ params, sql: sqlText });
604
673
  }
605
674
  });
606
- await chunkST3LPB2V_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
607
- await chunkST3LPB2V_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
608
- const indexDefinitions = await chunkST3LPB2V_cjs.suspendPostgresSecondaryIndexes(
675
+ await chunkMUK4BU7K_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
676
+ await chunkMUK4BU7K_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
677
+ const indexDefinitions = await chunkMUK4BU7K_cjs.suspendPostgresSecondaryIndexes(
609
678
  trustedTx,
610
679
  tableNames
611
680
  );
612
681
  const result = await fn(
613
- chunkST3LPB2V_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
682
+ chunkMUK4BU7K_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
614
683
  );
615
- await chunkST3LPB2V_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
616
- await chunkST3LPB2V_cjs.analyzeImportedTables(trustedTx, tableNames);
684
+ await chunkMUK4BU7K_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
685
+ await chunkMUK4BU7K_cjs.analyzeImportedTables(trustedTx, tableNames);
617
686
  return result;
618
687
  });
619
688
  }
620
689
  } : {},
621
690
  async bootstrapTables() {
622
- const statements = chunk6JZUSDY2_cjs.generatePostgresDDL(tables2, fulltextStrategy);
691
+ const statements = chunkRMQLSPA2_cjs.generatePostgresDDL(tables2, fulltextStrategy);
623
692
  for (const statement of statements) {
624
- await db.execute(drizzleOrm.sql.raw(statement));
693
+ await executeConcurrentCreateDdl(statement);
625
694
  }
626
695
  },
627
696
  async ensureRevisionOriginsTable() {
628
- await db.execute(
629
- drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.revisionOrigins))
697
+ await ensureTableWithConcurrentCreateRetry(tables2.revisionOrigins);
698
+ },
699
+ async ensureIdentityTables(identityTableNames, options2) {
700
+ const identityContributions = identityContributionsFor(identityTableNames);
701
+ const missing = [];
702
+ for (const contribution of identityContributions) {
703
+ if (!await contributionTableExists(contribution.tableName)) {
704
+ missing.push(contribution.logicalName);
705
+ }
706
+ }
707
+ if (missing.length === 0 || options2.provisionMissing) {
708
+ for (const contribution of identityContributions) {
709
+ for (const ddl of contribution.createDdl) {
710
+ await executeConcurrentCreateDdl(ddl);
711
+ }
712
+ }
713
+ }
714
+ return missing;
715
+ },
716
+ identityTableDdl(identityTableNames) {
717
+ return identityContributionsFor(identityTableNames).flatMap(
718
+ (contribution) => [...contribution.createDdl]
630
719
  );
631
720
  },
632
721
  // Every fulltext-touching method asserts the durable marker instead
@@ -634,7 +723,7 @@ function createPostgresBackend(db, options = {}) {
634
723
  // uninitialized database throws `StoreNotInitializedError` loudly
635
724
  // rather than self-healing on a read/write path (#135). Shared
636
725
  // verbatim with the tx-scoped gate via `gateFulltextMethods`.
637
- ...chunkST3LPB2V_cjs.gateFulltextMethods(
726
+ ...chunkMUK4BU7K_cjs.gateFulltextMethods(
638
727
  operations,
639
728
  contributionMaterializer.assertInitialized
640
729
  ),
@@ -642,19 +731,13 @@ function createPostgresBackend(db, options = {}) {
642
731
  await db.execute(drizzleOrm.sql.raw(ddl));
643
732
  },
644
733
  async ensureIndexMaterializationsTable() {
645
- await db.execute(
646
- drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.indexMaterializations))
647
- );
734
+ await ensureTableWithConcurrentCreateRetry(tables2.indexMaterializations);
648
735
  const tableName = drizzleOrm.getTableName(tables2.indexMaterializations);
649
- await db.execute(
650
- drizzleOrm.sql.raw(
651
- `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "building_since" timestamptz;`
652
- )
736
+ await executeConcurrentCreateDdl(
737
+ `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "building_since" timestamptz;`
653
738
  );
654
- await db.execute(
655
- drizzleOrm.sql.raw(
656
- `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
657
- )
739
+ await executeConcurrentCreateDdl(
740
+ `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
658
741
  );
659
742
  },
660
743
  async claimIndexMaterialization(params) {
@@ -695,26 +778,26 @@ function createPostgresBackend(db, options = {}) {
695
778
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
696
779
  const row = rows[0];
697
780
  if (row === void 0) return void 0;
698
- return chunkST3LPB2V_cjs.mapMaterializationRow(row, chunkST3LPB2V_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
781
+ return chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
699
782
  },
700
783
  async getIndexMaterializations(statusKeys) {
701
784
  if (statusKeys.length === 0) return [];
702
785
  const t = tables2.indexMaterializations;
703
786
  const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
704
787
  return rows.map(
705
- (row) => chunkST3LPB2V_cjs.mapMaterializationRow(row, chunkST3LPB2V_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
788
+ (row) => chunkMUK4BU7K_cjs.mapMaterializationRow(row, chunkMUK4BU7K_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
706
789
  );
707
790
  },
708
791
  async recordIndexMaterialization(params) {
709
792
  const t = tables2.indexMaterializations;
710
793
  await db.insert(t).values(
711
- chunkST3LPB2V_cjs.buildMaterializationInsertValues(
794
+ chunkMUK4BU7K_cjs.buildMaterializationInsertValues(
712
795
  params,
713
- chunkST3LPB2V_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
796
+ chunkMUK4BU7K_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
714
797
  )
715
798
  ).onConflictDoUpdate({
716
799
  target: t.indexName,
717
- set: chunkST3LPB2V_cjs.buildMaterializationOnConflictSet(params.materializedAt)
800
+ set: chunkMUK4BU7K_cjs.buildMaterializationOnConflictSet(params.materializedAt)
718
801
  });
719
802
  },
720
803
  async ensureContributionMaterializationsTable() {
@@ -730,38 +813,36 @@ function createPostgresBackend(db, options = {}) {
730
813
  await contributionMaterializer.assertInitialized(graphId);
731
814
  },
732
815
  async ensureKindRemovalsTable() {
733
- await db.execute(drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.kindRemovals)));
816
+ await ensureTableWithConcurrentCreateRetry(tables2.kindRemovals);
734
817
  },
735
818
  async getPendingKindRemovals(graphId) {
736
819
  const t = tables2.kindRemovals;
737
820
  const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
738
821
  return rows.map(
739
- (row) => chunkST3LPB2V_cjs.mapKindRemovalRow(row, chunkST3LPB2V_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
822
+ (row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
740
823
  );
741
824
  },
742
825
  async getAllKindRemovals(graphId) {
743
826
  const t = tables2.kindRemovals;
744
827
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
745
828
  return rows.map(
746
- (row) => chunkST3LPB2V_cjs.mapKindRemovalRow(row, chunkST3LPB2V_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
829
+ (row) => chunkMUK4BU7K_cjs.mapKindRemovalRow(row, chunkMUK4BU7K_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
747
830
  );
748
831
  },
749
832
  async recordKindRemoval(params) {
750
833
  const t = tables2.kindRemovals;
751
834
  await db.insert(t).values(
752
- chunkST3LPB2V_cjs.buildKindRemovalInsertValues(
835
+ chunkMUK4BU7K_cjs.buildKindRemovalInsertValues(
753
836
  params,
754
- chunkST3LPB2V_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
837
+ chunkMUK4BU7K_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
755
838
  )
756
839
  ).onConflictDoUpdate({
757
840
  target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
758
- set: chunkST3LPB2V_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
841
+ set: chunkMUK4BU7K_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
759
842
  });
760
843
  },
761
844
  async ensureReconciliationMarkersTable() {
762
- await db.execute(
763
- drizzleOrm.sql.raw(chunk6JZUSDY2_cjs.generatePgCreateTableSQL(tables2.reconciliationMarkers))
764
- );
845
+ await ensureTableWithConcurrentCreateRetry(tables2.reconciliationMarkers);
765
846
  },
766
847
  async ensureRuntimeContributions(graphId) {
767
848
  await contributionMaterializer.ensureRuntimeContributions(graphId);
@@ -777,6 +858,19 @@ function createPostgresBackend(db, options = {}) {
777
858
  async verifyContributions(graphId, vectorSlots) {
778
859
  return contributionMaterializer.verifyContributions(graphId, vectorSlots);
779
860
  },
861
+ async repairContributions(graphId, vectorSlots) {
862
+ return contributionMaterializer.repairContributions(graphId, vectorSlots);
863
+ },
864
+ async probeContributions(graphId, vectorSlots) {
865
+ return contributionMaterializer.probeContributions(graphId, vectorSlots);
866
+ },
867
+ async rebuildContribution(graphId, scope, repopulate) {
868
+ return contributionMaterializer.rebuildContribution(
869
+ graphId,
870
+ scope,
871
+ repopulate
872
+ );
873
+ },
780
874
  // Vector counterparts of the runtime-contribution methods. Present
781
875
  // only when a vector strategy is wired (omitted under `vector: false`,
782
876
  // mirroring the embedding/search methods), so a no-vector backend
@@ -815,16 +909,16 @@ function createPostgresBackend(db, options = {}) {
815
909
  await db.execute(statement);
816
910
  }
817
911
  const tablePresence = await Promise.all(
818
- recordedAnalyzeTables.map(async (tableName) => ({
912
+ guardedAnalyzeTables.map(async (tableName) => ({
819
913
  tableName,
820
- exists: await recordedTableExists(tableName)
914
+ exists: await guardedTableExists(tableName)
821
915
  }))
822
916
  );
823
- const presentRecordedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
824
- for (const tableName of presentRecordedTables) {
917
+ const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
918
+ for (const tableName of presentGuardedTables) {
825
919
  await db.execute(
826
- chunkNN3QSOVS_cjs.toDrizzleSql(
827
- chunkU5W4LKZV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkU5W4LKZV_cjs.sql.identifier(tableName)}`,
920
+ chunkU5SON7R2_cjs.toDrizzleSql(
921
+ chunkVCRRKBLN_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkVCRRKBLN_cjs.sql.identifier(tableName)}`,
828
922
  "postgres"
829
923
  )
830
924
  );
@@ -839,9 +933,15 @@ function createPostgresBackend(db, options = {}) {
839
933
  async commitSchemaVersionIfKindsEmpty(params, probes) {
840
934
  return runSchemaWriteTransaction(
841
935
  params.graphId,
842
- (target) => chunkST3LPB2V_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
936
+ (target) => chunkMUK4BU7K_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
843
937
  );
844
938
  },
939
+ async commitSchemaVersionWithPreflight(params, preflight) {
940
+ return runSchemaWriteTransaction(params.graphId, async (target) => {
941
+ await preflight(target);
942
+ return target.commitSchemaVersion(params);
943
+ });
944
+ },
845
945
  async setActiveVersion(params) {
846
946
  await runSchemaWriteTransaction(
847
947
  params.graphId,
@@ -855,9 +955,9 @@ function createPostgresBackend(db, options = {}) {
855
955
  return backend.transactionWithNative((tx) => fn(tx), options2);
856
956
  },
857
957
  async transactionWithNative(fn, options2) {
858
- const temporaryWrites = options2?.temporaryWrites === chunk3PRKZW6D_cjs.INTERNAL_TEMPORARY_WRITES;
958
+ const temporaryWrites = options2?.temporaryWrites === chunkXBYVV3MP_cjs.INTERNAL_TEMPORARY_WRITES;
859
959
  if (temporaryWrites && options2.accessMode !== "read_only") {
860
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
960
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
861
961
  "Temporary-write transactions must be semantically read-only.",
862
962
  { dialect: "postgres" }
863
963
  );
@@ -867,7 +967,7 @@ function createPostgresBackend(db, options = {}) {
867
967
  isolationLevel: options2.isolationLevel.replace("_", " ")
868
968
  },
869
969
  ...options2.accessMode === void 0 && !temporaryWrites ? {} : {
870
- accessMode: temporaryWrites ? "read write" : chunk764JHTLT_cjs.requireDefined(options2.accessMode).replace("_", " ")
970
+ accessMode: temporaryWrites ? "read write" : chunkN66HCGCY_cjs.requireDefined(options2.accessMode).replace("_", " ")
871
971
  }
872
972
  } : void 0;
873
973
  return db.transaction(async (tx) => {
@@ -881,7 +981,7 @@ function createPostgresBackend(db, options = {}) {
881
981
  },
882
982
  adoptTransaction(externalTx) {
883
983
  if (!capabilities.transactions) {
884
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
984
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
885
985
  "Cross-store atomicity is unavailable on this Postgres backend: its driver does not support transactions (drizzle-orm/neon-http, Cloudflare D1). Adopting an external transaction here would let the caller's relational write commit with no way to roll back the graph write. Use a node-postgres or neon-serverless (Pool/WebSocket) connection for cross-store transactions.",
886
986
  {
887
987
  backend: "postgres",
@@ -890,7 +990,7 @@ function createPostgresBackend(db, options = {}) {
890
990
  }
891
991
  );
892
992
  }
893
- chunkST3LPB2V_cjs.assertAdoptedDialect(
993
+ chunkMUK4BU7K_cjs.assertAdoptedDialect(
894
994
  externalTx,
895
995
  pgCore.PgTransaction,
896
996
  "postgres"
@@ -900,8 +1000,42 @@ function createPostgresBackend(db, options = {}) {
900
1000
  async close() {
901
1001
  }
902
1002
  };
1003
+ if (serializedClient !== void 0) {
1004
+ chunkXBYVV3MP_cjs.markSerializedTransactionResource(backend, serializedClient);
1005
+ }
903
1006
  return backend;
904
1007
  }
1008
+ function getSerializedPostgresClient(db) {
1009
+ const pgliteClient = getPgliteClient(db);
1010
+ if (pgliteClient !== void 0) return pgliteClient;
1011
+ const client = db.$client;
1012
+ if (typeof client === "function") {
1013
+ return isSingleConnectionCallablePgClient(client) ? client : void 0;
1014
+ }
1015
+ if (typeof client !== "object" || client === null) return void 0;
1016
+ const candidate = client;
1017
+ if (!hasFunctionProperty(candidate, "query")) return void 0;
1018
+ if (isSingleConnectionPgPool(candidate)) return client;
1019
+ return isBarePgClient(candidate) ? client : void 0;
1020
+ }
1021
+ function isSingleConnectionPgPool(candidate) {
1022
+ const options = candidate["options"];
1023
+ if (typeof options !== "object" || options === null) return false;
1024
+ return options["max"] === 1;
1025
+ }
1026
+ function isSingleConnectionCallablePgClient(client) {
1027
+ if (client === void 0 || client === null) return false;
1028
+ const options = client["options"];
1029
+ if (!isPostgresJsClient(client)) return false;
1030
+ if (typeof options !== "object" || options === null) return false;
1031
+ return options["max"] === 1;
1032
+ }
1033
+ function isBarePgClient(candidate) {
1034
+ if (candidate["options"] !== void 0 || candidate["totalCount"] !== void 0 || candidate["idleCount"] !== void 0 || candidate["waitingCount"] !== void 0) {
1035
+ return false;
1036
+ }
1037
+ return hasFunctionProperty(candidate, "connect") && hasFunctionProperty(candidate, "end") && hasFunctionProperty(candidate, "escapeIdentifier");
1038
+ }
905
1039
  function createIterativeScanProbe() {
906
1040
  let probe;
907
1041
  let warned = false;
@@ -960,31 +1094,24 @@ function createPostgresOperationBackend(options) {
960
1094
  async function execRun(query) {
961
1095
  await executionAdapter.execute(query);
962
1096
  }
963
- let efSearchUnsupportedWarned = false;
964
- function warnEfSearchUnsupported() {
965
- if (efSearchUnsupportedWarned) return;
966
- efSearchUnsupportedWarned = true;
967
- if (typeof console === "undefined" || typeof console.warn !== "function") {
968
- return;
969
- }
970
- console.warn(
971
- "[typegraph] efSearch (hnsw.ef_search override) was ignored: this Postgres backend has transactions disabled (e.g. drizzle-orm/neon-http), and SET LOCAL needs a transaction to scope the override. Use a transactional driver (node-postgres / neon-serverless / postgres-js) to apply efSearch."
972
- );
973
- }
974
1097
  function pgvectorIterativeScanSupported() {
975
1098
  return iterativeScanProbe.isSupported(execAll);
976
1099
  }
977
1100
  async function vectorSearchGucOverrides(params) {
978
1101
  const overrides = [];
979
- if (params.efSearch !== void 0) {
980
- if (capabilities.transactions) {
981
- overrides.push({
982
- name: "hnsw.ef_search",
983
- value: String(params.efSearch)
984
- });
985
- } else {
986
- warnEfSearchUnsupported();
987
- }
1102
+ const efSearchParameter = chunk4UGOKMI5_cjs.resolveEfSearchOverride({
1103
+ efSearch: params.efSearch,
1104
+ indexType: params.indexType,
1105
+ tuning: chunk4UGOKMI5_cjs.vectorSearchFrontierTuning(vectorStrategy),
1106
+ transactions: capabilities.transactions,
1107
+ dialect: "PostgreSQL",
1108
+ engine: vectorStrategy?.name ?? "this backend"
1109
+ });
1110
+ if (efSearchParameter !== void 0) {
1111
+ overrides.push({
1112
+ name: efSearchParameter,
1113
+ value: String(params.efSearch)
1114
+ });
988
1115
  }
989
1116
  if (params.indexType === "hnsw" && capabilities.transactions && await pgvectorIterativeScanSupported()) {
990
1117
  overrides.push({ name: "hnsw.iterative_scan", value: "strict_order" });
@@ -1000,7 +1127,7 @@ function createPostgresOperationBackend(options) {
1000
1127
  async function runVectorSearchGucGroup(overrides, query) {
1001
1128
  const runExclusive = executionAdapter.runExclusive;
1002
1129
  if (runExclusive === void 0) {
1003
- throw new chunkC4F7VJ5D_cjs.CompilerInvariantError(
1130
+ throw new chunkNI72YOJB_cjs.CompilerInvariantError(
1004
1131
  "A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
1005
1132
  );
1006
1133
  }
@@ -1044,16 +1171,17 @@ function createPostgresOperationBackend(options) {
1044
1171
  });
1045
1172
  }
1046
1173
  const batchConfig = computePostgresBatchChunkSizes(
1047
- capabilities.maxBindParameters ?? chunk3PRKZW6D_cjs.POSTGRES_MAX_BIND_PARAMETERS
1174
+ capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.POSTGRES_MAX_BIND_PARAMETERS
1048
1175
  );
1049
- const commonBackend = chunkST3LPB2V_cjs.createCommonOperationBackend({
1176
+ const commonBackend = chunkMUK4BU7K_cjs.createCommonOperationBackend({
1050
1177
  batchConfig,
1051
1178
  execution: {
1052
1179
  execAll,
1053
1180
  execGet,
1054
1181
  execRun
1055
1182
  },
1056
- nowIso: chunkHJH3RMXG_cjs.nowIso,
1183
+ nowIso: chunkYAAM3M2S_cjs.nowIso,
1184
+ maxBindParameters: capabilities.maxBindParameters ?? chunkXBYVV3MP_cjs.POSTGRES_MAX_BIND_PARAMETERS,
1057
1185
  operationStrategy,
1058
1186
  rowMappers: {
1059
1187
  toEdgeRow,
@@ -1071,28 +1199,28 @@ function createPostgresOperationBackend(options) {
1071
1199
  };
1072
1200
  const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
1073
1201
  async upsertEmbedding(params) {
1074
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
1202
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
1075
1203
  await contributionMaterializer.assertVectorSlot(slot);
1076
- const statements = vectorStrategy.buildUpsert(slot, params, chunkHJH3RMXG_cjs.nowIso());
1204
+ const statements = vectorStrategy.buildUpsert(slot, params, chunkYAAM3M2S_cjs.nowIso());
1077
1205
  try {
1078
1206
  for (const statement of statements) {
1079
1207
  await execRun(statement);
1080
1208
  }
1081
1209
  } catch (error) {
1082
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
1210
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
1083
1211
  }
1084
1212
  },
1085
1213
  async upsertEmbeddingBatch(params) {
1086
1214
  if (params.rows.length === 0) return;
1087
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
1215
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
1088
1216
  await contributionMaterializer.assertVectorSlot(slot);
1089
1217
  const rowsById = new Map(
1090
1218
  params.rows.map((row) => [row.nodeId, row])
1091
1219
  );
1092
1220
  const rows = [...rowsById.values()];
1093
- const timestamp = chunkHJH3RMXG_cjs.nowIso();
1221
+ const timestamp = chunkYAAM3M2S_cjs.nowIso();
1094
1222
  try {
1095
- for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
1223
+ for (const chunk2 of chunkBSFJMMV3_cjs.chunk(
1096
1224
  rows,
1097
1225
  batchConfig.embeddingUpsertBatchSize
1098
1226
  )) {
@@ -1121,31 +1249,46 @@ function createPostgresOperationBackend(options) {
1121
1249
  }
1122
1250
  }
1123
1251
  } catch (error) {
1124
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
1252
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
1125
1253
  }
1126
1254
  },
1127
1255
  async deleteEmbedding(params) {
1128
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
1256
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
1129
1257
  await contributionMaterializer.assertVectorSlot(slot);
1130
1258
  const statements = vectorStrategy.buildDelete(slot, params);
1131
1259
  for (const statement of statements) {
1132
1260
  await execRun(statement);
1133
1261
  }
1134
1262
  },
1263
+ async deleteEmbeddingBatch(params) {
1264
+ if (params.nodeIds.length === 0) return;
1265
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
1266
+ await contributionMaterializer.assertVectorSlot(slot);
1267
+ for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
1268
+ [...new Set(params.nodeIds)],
1269
+ batchConfig.embeddingUpsertBatchSize
1270
+ )) {
1271
+ const statements = vectorStrategy.buildDeleteBatch(slot, {
1272
+ ...params,
1273
+ nodeIds
1274
+ });
1275
+ for (const statement of statements) await execRun(statement);
1276
+ }
1277
+ },
1135
1278
  async vectorSearch(params) {
1136
- chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.limit);
1137
- chunkMCHP7RHZ_cjs.assertPgvectorEfSearch(params.efSearch);
1138
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams(params);
1279
+ chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.limit);
1280
+ chunkMXJDTH5B_cjs.assertPgvectorEfSearch(params.efSearch);
1281
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams(params);
1139
1282
  const query = vectorStrategy.buildSearch(
1140
1283
  slot,
1141
1284
  params,
1142
1285
  // Store-compiled candidates (predicates + subclass + currency)
1143
1286
  // take precedence; the live-node default covers direct backend use.
1144
- params.candidates ?? chunkST3LPB2V_cjs.buildLiveNodeCandidates(
1287
+ params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
1145
1288
  tableNames.nodes,
1146
1289
  params.graphId,
1147
1290
  params.nodeKind,
1148
- chunkHJH3RMXG_cjs.nowIso()
1291
+ chunkYAAM3M2S_cjs.nowIso()
1149
1292
  )
1150
1293
  );
1151
1294
  const gucOverrides = await vectorSearchGucOverrides(params);
@@ -1153,7 +1296,7 @@ function createPostgresOperationBackend(options) {
1153
1296
  try {
1154
1297
  rows = await runVectorSearch(gucOverrides, query);
1155
1298
  } catch (error) {
1156
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, params);
1299
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, params);
1157
1300
  }
1158
1301
  return rows.map((row) => ({
1159
1302
  nodeId: row.node_id,
@@ -1165,10 +1308,10 @@ function createPostgresOperationBackend(options) {
1165
1308
  // multi-statement fallback by simply not exposing the member.
1166
1309
  ...capabilities.windowFunctions ? {
1167
1310
  async hybridSearch(params) {
1168
- chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.limit);
1169
- chunkOVUUTCPJ_cjs.assertVectorSearchLimit(params.vector.k);
1170
- chunkMCHP7RHZ_cjs.assertPgvectorEfSearch(params.vector.efSearch);
1171
- const slot = chunkST3LPB2V_cjs.vectorSlotFromParams({
1311
+ chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.limit);
1312
+ chunk4UGOKMI5_cjs.assertVectorSearchLimit(params.vector.k);
1313
+ chunkMXJDTH5B_cjs.assertPgvectorEfSearch(params.vector.efSearch);
1314
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromParams({
1172
1315
  graphId: params.graphId,
1173
1316
  nodeKind: params.nodeKind,
1174
1317
  fieldPath: params.vector.fieldPath,
@@ -1176,11 +1319,11 @@ function createPostgresOperationBackend(options) {
1176
1319
  metric: params.vector.metric,
1177
1320
  indexType: params.vector.indexType
1178
1321
  });
1179
- const candidates = params.candidates ?? chunkST3LPB2V_cjs.buildLiveNodeCandidates(
1322
+ const candidates = params.candidates ?? chunkMUK4BU7K_cjs.buildLiveNodeCandidates(
1180
1323
  tableNames.nodes,
1181
1324
  params.graphId,
1182
1325
  params.nodeKind,
1183
- chunkHJH3RMXG_cjs.nowIso()
1326
+ chunkYAAM3M2S_cjs.nowIso()
1184
1327
  );
1185
1328
  const vectorParams = {
1186
1329
  graphId: params.graphId,
@@ -1196,11 +1339,11 @@ function createPostgresOperationBackend(options) {
1196
1339
  const vectorSql = vectorStrategy.buildSearch(
1197
1340
  slot,
1198
1341
  vectorParams,
1199
- chunkU5W4LKZV_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
1342
+ chunkVCRRKBLN_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
1200
1343
  );
1201
1344
  const statement = operationStrategy.buildHybridSearch(
1202
1345
  { ...params, candidates },
1203
- chunkNN3QSOVS_cjs.toDrizzleSql(vectorSql, "postgres"),
1346
+ chunkU5SON7R2_cjs.toDrizzleSql(vectorSql, "postgres"),
1204
1347
  params.vector.metric === "cosine"
1205
1348
  );
1206
1349
  const gucOverrides = await vectorSearchGucOverrides({
@@ -1214,16 +1357,42 @@ function createPostgresOperationBackend(options) {
1214
1357
  statement
1215
1358
  );
1216
1359
  } catch (error) {
1217
- throw chunkST3LPB2V_cjs.mapVectorWriteError(error, vectorParams);
1360
+ throw chunkMUK4BU7K_cjs.mapVectorWriteError(error, vectorParams);
1218
1361
  }
1219
- return raw.map((row) => chunkST3LPB2V_cjs.mapHybridSearchRow(row, toNodeRow));
1362
+ return raw.map((row) => chunkMUK4BU7K_cjs.mapHybridSearchRow(row, toNodeRow));
1220
1363
  }
1221
1364
  } : {}
1222
1365
  };
1366
+ async function lockActiveSchemaVersion(graphId) {
1367
+ const active = await execGet(drizzleOrm.sql`
1368
+ SELECT ${schemaVersionsTable.version} AS version
1369
+ FROM ${schemaVersionsTable}
1370
+ WHERE ${schemaVersionsTable.graphId} = ${graphId}
1371
+ AND ${schemaVersionsTable.isActive} = TRUE
1372
+ FOR SHARE
1373
+ `);
1374
+ return active?.version;
1375
+ }
1223
1376
  const operationBackend = {
1224
1377
  ...commonBackend,
1225
1378
  ...executeRawMethod,
1226
1379
  ...vectorEmbeddingMethods,
1380
+ /**
1381
+ * Transaction-scoped contribution marker stamp. Present so the
1382
+ * destructive rebuild can commit its marker with the DDL that
1383
+ * produced it; without it the stamp would land outside the
1384
+ * transaction and could survive a rolled-back drop.
1385
+ *
1386
+ * States the row outright rather than reusing the top-level upsert,
1387
+ * whose `materialized_at` COALESCE preserves an earlier success so a
1388
+ * failed re-attempt cannot erase it. A completed rebuild replaced the
1389
+ * storage, so the recorded timestamp must be the rebuild's.
1390
+ */
1391
+ async recordContributionMaterialization(params) {
1392
+ await execRun(
1393
+ operationStrategy.buildInsertContributionMaterialization(params)
1394
+ );
1395
+ },
1227
1396
  async deleteSchemaVectorSlotContribution(slot) {
1228
1397
  if (vectorStrategy === void 0) return;
1229
1398
  for (const contribution of vectorStrategy.ownedTables(slot)) {
@@ -1245,7 +1414,7 @@ function createPostgresOperationBackend(options) {
1245
1414
  tableNames,
1246
1415
  async lockSchemaVersionForWrite(params) {
1247
1416
  if (!transactionScoped) {
1248
- throw new chunkC4F7VJ5D_cjs.ConfigurationError(
1417
+ throw new chunkNI72YOJB_cjs.ConfigurationError(
1249
1418
  "The schema write fence requires an explicit PostgreSQL transaction.",
1250
1419
  {
1251
1420
  code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
@@ -1253,23 +1422,26 @@ function createPostgresOperationBackend(options) {
1253
1422
  }
1254
1423
  );
1255
1424
  }
1256
- const active = await execGet(drizzleOrm.sql`
1257
- SELECT ${schemaVersionsTable.version} AS version
1258
- FROM ${schemaVersionsTable}
1259
- WHERE ${schemaVersionsTable.graphId} = ${params.graphId}
1260
- AND ${schemaVersionsTable.isActive} = TRUE
1261
- FOR SHARE
1262
- `);
1263
- chunkST3LPB2V_cjs.assertActiveSchemaVersion(
1264
- params.graphId,
1265
- params.expectedVersion,
1266
- active?.version ?? 0
1267
- );
1425
+ const locked = await lockActiveSchemaVersion(params.graphId);
1426
+ if (locked !== void 0) {
1427
+ chunkMUK4BU7K_cjs.assertActiveSchemaVersion(
1428
+ params.graphId,
1429
+ params.expectedVersion,
1430
+ locked
1431
+ );
1432
+ return;
1433
+ }
1434
+ const settled = await commonBackend.getActiveSchema(params.graphId);
1435
+ throw new chunkNI72YOJB_cjs.StaleVersionError({
1436
+ graphId: params.graphId,
1437
+ expected: params.expectedVersion,
1438
+ actual: settled?.version ?? 0
1439
+ });
1268
1440
  },
1269
1441
  // === Vector Index Operations ===
1270
1442
  async createVectorIndex(params) {
1271
1443
  if (vectorStrategy === void 0) return;
1272
- const slot = chunkST3LPB2V_cjs.vectorSlotFromCreateIndexParams(params);
1444
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromCreateIndexParams(params);
1273
1445
  await contributionMaterializer.ensureVectorSlot(slot);
1274
1446
  const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
1275
1447
  concurrent: params.concurrent === true
@@ -1278,12 +1450,12 @@ function createPostgresOperationBackend(options) {
1278
1450
  try {
1279
1451
  await execRun(indexStatement);
1280
1452
  } catch (error) {
1281
- if (!chunkWBUFJ7BS_cjs.isInsufficientResourcesError(error)) throw error;
1453
+ if (!chunkBSFJMMV3_cjs.isInsufficientResourcesError(error)) throw error;
1282
1454
  const dropStatement = vectorStrategy.buildDropIndex?.(slot);
1283
1455
  if (dropStatement !== void 0) {
1284
1456
  await execRun(dropStatement);
1285
1457
  }
1286
- const table = chunkU5W4LKZV_cjs.sql.identifier(
1458
+ const table = chunkVCRRKBLN_cjs.sql.identifier(
1287
1459
  vectorStrategy.tableName(
1288
1460
  slot.graphId,
1289
1461
  slot.nodeKind,
@@ -1291,13 +1463,13 @@ function createPostgresOperationBackend(options) {
1291
1463
  )
1292
1464
  );
1293
1465
  await execRun(
1294
- chunkU5W4LKZV_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`
1466
+ chunkVCRRKBLN_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`
1295
1467
  );
1296
1468
  try {
1297
1469
  await execRun(indexStatement);
1298
1470
  } finally {
1299
1471
  await execRun(
1300
- chunkU5W4LKZV_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`
1472
+ chunkVCRRKBLN_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`
1301
1473
  );
1302
1474
  }
1303
1475
  }
@@ -1305,7 +1477,7 @@ function createPostgresOperationBackend(options) {
1305
1477
  },
1306
1478
  // === Fulltext Operations ===
1307
1479
  async upsertFulltext(params) {
1308
- const timestamp = chunkHJH3RMXG_cjs.nowIso();
1480
+ const timestamp = chunkYAAM3M2S_cjs.nowIso();
1309
1481
  const statements = operationStrategy.buildUpsertFulltext(
1310
1482
  params,
1311
1483
  timestamp
@@ -1322,8 +1494,8 @@ function createPostgresOperationBackend(options) {
1322
1494
  },
1323
1495
  async upsertFulltextBatch(params) {
1324
1496
  if (params.rows.length === 0) return;
1325
- const timestamp = chunkHJH3RMXG_cjs.nowIso();
1326
- for (const rows of chunkZDH3DX3C_cjs.chunk(
1497
+ const timestamp = chunkYAAM3M2S_cjs.nowIso();
1498
+ for (const rows of chunkBSFJMMV3_cjs.chunk(
1327
1499
  params.rows,
1328
1500
  batchConfig.fulltextUpsertBatchSize
1329
1501
  )) {
@@ -1338,7 +1510,7 @@ function createPostgresOperationBackend(options) {
1338
1510
  },
1339
1511
  async deleteFulltextBatch(params) {
1340
1512
  if (params.nodeIds.length === 0) return;
1341
- for (const nodeIds of chunkZDH3DX3C_cjs.chunk(
1513
+ for (const nodeIds of chunkBSFJMMV3_cjs.chunk(
1342
1514
  params.nodeIds,
1343
1515
  batchConfig.fulltextDeleteChunkSize
1344
1516
  )) {
@@ -1356,25 +1528,25 @@ function createPostgresOperationBackend(options) {
1356
1528
  const rows = await execAll(query);
1357
1529
  return rows.map((row, index) => ({
1358
1530
  nodeId: row.node_id,
1359
- score: chunkHJH3RMXG_cjs.coerceNumericScore(row.score),
1531
+ score: chunkYAAM3M2S_cjs.coerceNumericScore(row.score),
1360
1532
  rank: index + 1,
1361
1533
  ...row.snippet === null ? {} : { snippet: row.snippet }
1362
1534
  }));
1363
1535
  },
1364
1536
  async dropVectorIndex(params) {
1365
1537
  if (vectorStrategy === void 0) return;
1366
- const slot = chunkST3LPB2V_cjs.vectorSlotFromDropIndexParams(params);
1538
+ const slot = chunkMUK4BU7K_cjs.vectorSlotFromDropIndexParams(params);
1367
1539
  const dropStatement = vectorStrategy.buildDropIndex?.(slot);
1368
1540
  if (dropStatement === void 0) return;
1369
1541
  try {
1370
1542
  await execRun(dropStatement);
1371
1543
  } catch (error) {
1372
- if (!chunkWBUFJ7BS_cjs.isMissingTableError(error)) throw error;
1544
+ if (!chunkBSFJMMV3_cjs.isMissingTableError(error)) throw error;
1373
1545
  }
1374
1546
  },
1375
1547
  // === Query Execution ===
1376
1548
  async execute(query) {
1377
- const annTypes = chunkU5W4LKZV_cjs.isSqlFragment(query) ? chunkU5W4LKZV_cjs.annIndexScanTypes(query) : void 0;
1549
+ const annTypes = chunkVCRRKBLN_cjs.isSqlFragment(query) ? chunkVCRRKBLN_cjs.annIndexScanTypes(query) : void 0;
1378
1550
  if (annTypes !== void 0 && vectorStrategy !== void 0) {
1379
1551
  const overrides = [];
1380
1552
  for (const indexType of annTypes) {
@@ -1415,5 +1587,5 @@ function createTransactionBackend(options) {
1415
1587
  }
1416
1588
 
1417
1589
  exports.createPostgresBackend = createPostgresBackend;
1418
- //# sourceMappingURL=chunk-PDGEXGS6.cjs.map
1419
- //# sourceMappingURL=chunk-PDGEXGS6.cjs.map
1590
+ //# sourceMappingURL=chunk-TQR4KBY2.cjs.map
1591
+ //# sourceMappingURL=chunk-TQR4KBY2.cjs.map