@nicia-ai/typegraph 0.45.0 → 0.46.1

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 (384) 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 -42
  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 -38
  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 -43
  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 -39
  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-S3ZRKJHY.js → chunk-2LG2XB2M.js} +3 -3
  44. package/dist/{chunk-S3ZRKJHY.js.map → chunk-2LG2XB2M.js.map} +1 -1
  45. package/dist/{chunk-7PF2L3H6.cjs → chunk-2NA5DYLO.cjs} +4 -4
  46. package/dist/{chunk-7PF2L3H6.cjs.map → chunk-2NA5DYLO.cjs.map} +1 -1
  47. package/dist/chunk-2Z2Z3ZD6.js +58 -0
  48. package/dist/chunk-2Z2Z3ZD6.js.map +1 -0
  49. package/dist/{chunk-VVQM4CZD.cjs → chunk-3DHZCOT7.cjs} +20 -20
  50. package/dist/{chunk-VVQM4CZD.cjs.map → chunk-3DHZCOT7.cjs.map} +1 -1
  51. package/dist/{chunk-JXUTCSXX.cjs → chunk-4UGOKMI5.cjs} +250 -158
  52. package/dist/chunk-4UGOKMI5.cjs.map +1 -0
  53. package/dist/{chunk-RFRM3Q5K.js → chunk-5262ZMTR.js} +14 -5
  54. package/dist/chunk-5262ZMTR.js.map +1 -0
  55. package/dist/{chunk-QRNYDV5Z.js → chunk-5763DULU.js} +214 -69
  56. package/dist/chunk-5763DULU.js.map +1 -0
  57. package/dist/{chunk-BGYJW37L.js → chunk-5UVRGXD3.js} +277 -7
  58. package/dist/chunk-5UVRGXD3.js.map +1 -0
  59. package/dist/{chunk-QR24DJDF.cjs → chunk-62ZP23AW.cjs} +15 -15
  60. package/dist/{chunk-QR24DJDF.cjs.map → chunk-62ZP23AW.cjs.map} +1 -1
  61. package/dist/{chunk-ZI6VQSZA.cjs → chunk-65E3XWGF.cjs} +724 -577
  62. package/dist/chunk-65E3XWGF.cjs.map +1 -0
  63. package/dist/{chunk-S4KQ5LV4.js → chunk-775A4ZMN.js} +40 -6
  64. package/dist/chunk-775A4ZMN.js.map +1 -0
  65. package/dist/{chunk-J2ICGNHO.cjs → chunk-7BQXPCGN.cjs} +830 -169
  66. package/dist/chunk-7BQXPCGN.cjs.map +1 -0
  67. package/dist/{chunk-FJMPR3OH.cjs → chunk-7EO3TCQB.cjs} +33 -7
  68. package/dist/chunk-7EO3TCQB.cjs.map +1 -0
  69. package/dist/{chunk-DXEEHSGN.js → chunk-7VQXLT5O.js} +436 -43
  70. package/dist/chunk-7VQXLT5O.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-55ITBQJI.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-WUFASQUO.js → chunk-ASTI57H3.js} +3 -3
  80. package/dist/{chunk-WUFASQUO.js.map → chunk-ASTI57H3.js.map} +1 -1
  81. package/dist/{chunk-4QIKLIGG.js → chunk-BKCUOV7A.js} +15 -5
  82. package/dist/chunk-BKCUOV7A.js.map +1 -0
  83. package/dist/{chunk-JQXSZHF2.cjs → chunk-BSFJMMV3.cjs} +134 -7
  84. package/dist/chunk-BSFJMMV3.cjs.map +1 -0
  85. package/dist/{chunk-4GUTQPVO.js → chunk-C23WSN5E.js} +185 -24
  86. package/dist/chunk-C23WSN5E.js.map +1 -0
  87. package/dist/{chunk-QLUXRWKL.js → chunk-CBTIUB76.js} +3 -3
  88. package/dist/{chunk-QLUXRWKL.js.map → chunk-CBTIUB76.js.map} +1 -1
  89. package/dist/chunk-CMWHLBVN.cjs +2082 -0
  90. package/dist/chunk-CMWHLBVN.cjs.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-FL5UQRES.js → chunk-DCQVHAYQ.js} +5 -5
  94. package/dist/{chunk-FL5UQRES.js.map → chunk-DCQVHAYQ.js.map} +1 -1
  95. package/dist/chunk-DTVWX77L.cjs +3432 -0
  96. package/dist/chunk-DTVWX77L.cjs.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-GF3KXUTW.js +3393 -0
  104. package/dist/chunk-GF3KXUTW.js.map +1 -0
  105. package/dist/{chunk-VTN3C3CH.js → chunk-HFHTMECK.js} +7 -7
  106. package/dist/{chunk-VTN3C3CH.js.map → chunk-HFHTMECK.js.map} +1 -1
  107. package/dist/{chunk-FLEQ2HBK.js → chunk-I5MOXA4H.js} +20 -14
  108. package/dist/chunk-I5MOXA4H.js.map +1 -0
  109. package/dist/{chunk-4MB3AQAQ.js → chunk-J3WZ3FA2.js} +77 -3
  110. package/dist/chunk-J3WZ3FA2.js.map +1 -0
  111. package/dist/{chunk-UR7W5YQK.js → chunk-JBQQ7THH.js} +5 -3
  112. package/dist/chunk-JBQQ7THH.js.map +1 -0
  113. package/dist/{chunk-TKP5T34P.js → chunk-JXA2ZP2Q.js} +6 -16
  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-42PYUGLS.js → chunk-K5ELX2GT.js} +108 -8
  120. package/dist/chunk-K5ELX2GT.js.map +1 -0
  121. package/dist/{chunk-Q6EDCUXV.js → chunk-L65OU2U3.js} +556 -204
  122. package/dist/chunk-L65OU2U3.js.map +1 -0
  123. package/dist/{chunk-D54WH24V.cjs → chunk-LBJKZXDE.cjs} +115 -13
  124. package/dist/chunk-LBJKZXDE.cjs.map +1 -0
  125. package/dist/{chunk-FQ7ZPOTZ.js → chunk-LGHCOKTT.js} +637 -493
  126. package/dist/chunk-LGHCOKTT.js.map +1 -0
  127. package/dist/chunk-M3WP7RQZ.js +736 -0
  128. package/dist/chunk-M3WP7RQZ.js.map +1 -0
  129. package/dist/{chunk-4MEWSUVM.cjs → chunk-M4BDU5RX.cjs} +12 -12
  130. package/dist/chunk-M4BDU5RX.cjs.map +1 -0
  131. package/dist/chunk-MCLYU6BN.cjs +332 -0
  132. package/dist/chunk-MCLYU6BN.cjs.map +1 -0
  133. package/dist/{chunk-MIJKEVV7.js → chunk-MSY7FSX4.js} +37 -4
  134. package/dist/chunk-MSY7FSX4.js.map +1 -0
  135. package/dist/{chunk-H7VE3FL4.cjs → chunk-MUK4BU7K.cjs} +519 -125
  136. package/dist/chunk-MUK4BU7K.cjs.map +1 -0
  137. package/dist/{chunk-D56XG4EI.cjs → chunk-MXJDTH5B.cjs} +56 -45
  138. package/dist/chunk-MXJDTH5B.cjs.map +1 -0
  139. package/dist/{chunk-5EKPX6QU.js → chunk-MZLPX2R7.js} +8 -9
  140. package/dist/chunk-MZLPX2R7.js.map +1 -0
  141. package/dist/chunk-N66HCGCY.cjs +57 -0
  142. package/dist/chunk-N66HCGCY.cjs.map +1 -0
  143. package/dist/{chunk-CPEL3YIR.cjs → chunk-NFCVHQ5P.cjs} +55 -22
  144. package/dist/chunk-NFCVHQ5P.cjs.map +1 -0
  145. package/dist/{chunk-C4F7VJ5D.cjs → chunk-NI72YOJB.cjs} +84 -2
  146. package/dist/chunk-NI72YOJB.cjs.map +1 -0
  147. package/dist/{chunk-BNS75YNF.cjs → chunk-NK5Q7UNE.cjs} +10 -20
  148. package/dist/chunk-NK5Q7UNE.cjs.map +1 -0
  149. package/dist/{chunk-TKORQCG4.js → chunk-NLI2AVEF.js} +386 -862
  150. package/dist/chunk-NLI2AVEF.js.map +1 -0
  151. package/dist/{chunk-YMTXMPV6.js → chunk-NMWDXFPH.js} +4 -4
  152. package/dist/{chunk-YMTXMPV6.js.map → chunk-NMWDXFPH.js.map} +1 -1
  153. package/dist/{chunk-J7LXTUTP.cjs → chunk-PF6F5NLJ.cjs} +604 -1094
  154. package/dist/chunk-PF6F5NLJ.cjs.map +1 -0
  155. package/dist/{chunk-NAAMUYMS.cjs → chunk-PNN7RHVR.cjs} +58 -48
  156. package/dist/chunk-PNN7RHVR.cjs.map +1 -0
  157. package/dist/{chunk-YOALGKRE.cjs → chunk-PNTCATDE.cjs} +3528 -1763
  158. package/dist/chunk-PNTCATDE.cjs.map +1 -0
  159. package/dist/{chunk-6DCB664D.js → chunk-PQBQG7IM.js} +3 -3
  160. package/dist/{chunk-6DCB664D.js.map → chunk-PQBQG7IM.js.map} +1 -1
  161. package/dist/{chunk-UCQ3BFSY.cjs → chunk-PT7RIRIZ.cjs} +684 -332
  162. package/dist/chunk-PT7RIRIZ.cjs.map +1 -0
  163. package/dist/{chunk-ACSVZPK7.cjs → chunk-PWLJ77UV.cjs} +5 -3
  164. package/dist/chunk-PWLJ77UV.cjs.map +1 -0
  165. package/dist/chunk-Q3G6A4I3.cjs +755 -0
  166. package/dist/chunk-Q3G6A4I3.cjs.map +1 -0
  167. package/dist/{chunk-Z3WO6MND.cjs → chunk-RMQLSPA2.cjs} +297 -27
  168. package/dist/chunk-RMQLSPA2.cjs.map +1 -0
  169. package/dist/{chunk-SJDMVITW.cjs → chunk-RT5ZY4XA.cjs} +6 -5
  170. package/dist/chunk-RT5ZY4XA.cjs.map +1 -0
  171. package/dist/{chunk-ID4WXTKL.js → chunk-S6PW7VV5.js} +2382 -617
  172. package/dist/chunk-S6PW7VV5.js.map +1 -0
  173. package/dist/{chunk-4GUBTVPV.js → chunk-T4XNKYXB.js} +780 -126
  174. package/dist/chunk-T4XNKYXB.js.map +1 -0
  175. package/dist/{chunk-YDWLUT5V.cjs → chunk-TQR4KBY2.cjs} +323 -178
  176. package/dist/chunk-TQR4KBY2.cjs.map +1 -0
  177. package/dist/{chunk-OOA273IJ.cjs → chunk-U5SON7R2.cjs} +27 -27
  178. package/dist/{chunk-OOA273IJ.cjs.map → chunk-U5SON7R2.cjs.map} +1 -1
  179. package/dist/{chunk-IX64T5OL.cjs → chunk-U63GDNRC.cjs} +32 -26
  180. package/dist/chunk-U63GDNRC.cjs.map +1 -0
  181. package/dist/{chunk-WDBXJOU5.cjs → chunk-UDISNXDL.cjs} +56 -47
  182. package/dist/chunk-UDISNXDL.cjs.map +1 -0
  183. package/dist/{chunk-EFEOOCJ3.js → chunk-UV3SN74I.js} +5 -5
  184. package/dist/{chunk-EFEOOCJ3.js.map → chunk-UV3SN74I.js.map} +1 -1
  185. package/dist/{chunk-U5W4LKZV.cjs → chunk-VCRRKBLN.cjs} +9 -9
  186. package/dist/{chunk-U5W4LKZV.cjs.map → chunk-VCRRKBLN.cjs.map} +1 -1
  187. package/dist/{chunk-ISLPNELU.js → chunk-VGTJPTIC.js} +16 -5
  188. package/dist/chunk-VGTJPTIC.js.map +1 -0
  189. package/dist/chunk-VLT6PEWR.cjs +60 -0
  190. package/dist/chunk-VLT6PEWR.cjs.map +1 -0
  191. package/dist/chunk-VQH4VAWD.cjs +12 -0
  192. package/dist/{chunk-B3F2D3SP.cjs.map → chunk-VQH4VAWD.cjs.map} +1 -1
  193. package/dist/{chunk-SNXVDZAJ.js → chunk-W6OG3HDG.js} +5 -4
  194. package/dist/chunk-W6OG3HDG.js.map +1 -0
  195. package/dist/chunk-WDGA7IYB.js +207 -0
  196. package/dist/chunk-WDGA7IYB.js.map +1 -0
  197. package/dist/chunk-WQZLUGVR.js +2057 -0
  198. package/dist/chunk-WQZLUGVR.js.map +1 -0
  199. package/dist/{chunk-EKFUG4G7.cjs → chunk-XBYVV3MP.cjs} +60 -5
  200. package/dist/chunk-XBYVV3MP.cjs.map +1 -0
  201. package/dist/{chunk-5GAONX5G.cjs → chunk-XCAGZAKP.cjs} +7 -7
  202. package/dist/{chunk-5GAONX5G.cjs.map → chunk-XCAGZAKP.cjs.map} +1 -1
  203. package/dist/chunk-XL7SLCXS.js +309 -0
  204. package/dist/chunk-XL7SLCXS.js.map +1 -0
  205. package/dist/{chunk-SVJ5GEXW.cjs → chunk-XUO3KQFO.cjs} +2 -2
  206. package/dist/chunk-XUO3KQFO.cjs.map +1 -0
  207. package/dist/{chunk-F4NHQHEZ.cjs → chunk-YAAM3M2S.cjs} +10 -10
  208. package/dist/{chunk-F4NHQHEZ.cjs.map → chunk-YAAM3M2S.cjs.map} +1 -1
  209. package/dist/{chunk-RUQS6M7G.js → chunk-YBFHZUXX.js} +6 -6
  210. package/dist/chunk-YBFHZUXX.js.map +1 -0
  211. package/dist/{chunk-KMXWZLQX.cjs → chunk-YBQOHKHN.cjs} +99 -100
  212. package/dist/chunk-YBQOHKHN.cjs.map +1 -0
  213. package/dist/{chunk-PVUI6KGR.js → chunk-YDFDBE6D.js} +93 -6
  214. package/dist/chunk-YDFDBE6D.js.map +1 -0
  215. package/dist/{chunk-P7GTYOLB.cjs → chunk-YVWGEQJE.cjs} +297 -135
  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 -40
  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 -8
  223. package/dist/{ddl-BG4J805L.d.cts → ddl-BJcOp4WZ.d.cts} +3 -3
  224. package/dist/{ddl-CgiS9QLj.d.ts → ddl-BXfGHbPN.d.ts} +3 -3
  225. package/dist/graph-extension/index.cjs +26 -22
  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 -7
  229. package/dist/graph-merge/index.cjs +2459 -654
  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 -467
  234. package/dist/graph-merge/index.js.map +1 -1
  235. package/dist/{index-C3y_98iN.d.cts → index-BSHvKfok.d.ts} +221 -10
  236. package/dist/{index-BBxZCUdu.d.ts → index-DxaYCv8Y.d.cts} +221 -10
  237. package/dist/index.cjs +330 -268
  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 -49
  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 -51
  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 -25
  252. package/dist/interchange/index.js.map +1 -1
  253. package/dist/{manager-YoLEfcc1.d.ts → manager-CfZAimti.d.ts} +36 -5
  254. package/dist/{manager-KS7CGQQT.d.cts → manager-HGk6E_HW.d.cts} +36 -5
  255. package/dist/{materialize-indexes-Bhhyb1B3.d.ts → materialize-indexes-6A7dWGtb.d.cts} +10 -2
  256. package/dist/{materialize-indexes-OHRWypW6.d.cts → materialize-indexes-BMJP6Tms.d.ts} +10 -2
  257. package/dist/{postgres-DpkW3R5Y.d.cts → postgres-DFYWENdR.d.cts} +1961 -439
  258. package/dist/{postgres-DwqyIniy.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 -48
  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 -21
  273. package/dist/{searchable-DLWEfC4a.d.ts → searchable-9OQoPuRs.d.ts} +1 -2
  274. package/dist/{searchable-CIZL8Hyw.d.cts → searchable-CIje5XYD.d.cts} +1 -2
  275. package/dist/{sqlite-DY0WODUK.d.cts → sqlite-DerU5tc7.d.ts} +2029 -347
  276. package/dist/{sqlite-L-VIRzqA.d.ts → sqlite-DitnISa9.d.cts} +2029 -347
  277. package/dist/{store-view-A85FFRnk.d.cts → store-B0h6x7wo.d.cts} +1289 -767
  278. package/dist/{store-view-66p92IPi.d.ts → store-ClQ-MZQS.d.ts} +1289 -767
  279. package/dist/{temporal-BNbjXqer.d.cts → temporal-Bn-Fi8FJ.d.cts} +1 -1
  280. package/dist/{temporal-Bob6Nfbp.d.ts → temporal-BtM4UALv.d.ts} +1 -1
  281. package/dist/{types-DeORZhxn.d.cts → types-CoIx8HX5.d.cts} +1 -1
  282. package/dist/{types-Ch9a0Dx6.d.ts → types-HkveCCx0.d.cts} +726 -5
  283. package/dist/{types-Ch9a0Dx6.d.cts → types-HkveCCx0.d.ts} +726 -5
  284. package/dist/{types-ClCzT-dT.d.ts → types-KFfk-8Ah.d.ts} +1 -1
  285. package/dist/{where-DPw52ksb.d.cts → where--fk7_0kv.d.cts} +1 -1
  286. package/dist/{where-kWUZPvEA.d.ts → where-ws5hf-Ov.d.ts} +1 -1
  287. package/package.json +3 -3
  288. package/dist/chunk-2L54C2C2.js +0 -144
  289. package/dist/chunk-2L54C2C2.js.map +0 -1
  290. package/dist/chunk-35S6P5ZU.js +0 -27
  291. package/dist/chunk-35S6P5ZU.js.map +0 -1
  292. package/dist/chunk-42PYUGLS.js.map +0 -1
  293. package/dist/chunk-4GUBTVPV.js.map +0 -1
  294. package/dist/chunk-4GUTQPVO.js.map +0 -1
  295. package/dist/chunk-4MB3AQAQ.js.map +0 -1
  296. package/dist/chunk-4MEWSUVM.cjs.map +0 -1
  297. package/dist/chunk-4QIKLIGG.js.map +0 -1
  298. package/dist/chunk-4SZ6XPTG.cjs +0 -12
  299. package/dist/chunk-55ITBQJI.js.map +0 -1
  300. package/dist/chunk-5EKPX6QU.js.map +0 -1
  301. package/dist/chunk-6RYPD3NJ.cjs +0 -1282
  302. package/dist/chunk-6RYPD3NJ.cjs.map +0 -1
  303. package/dist/chunk-764JHTLT.cjs +0 -15
  304. package/dist/chunk-764JHTLT.cjs.map +0 -1
  305. package/dist/chunk-ACSVZPK7.cjs.map +0 -1
  306. package/dist/chunk-B3F2D3SP.cjs +0 -12
  307. package/dist/chunk-BGYJW37L.js.map +0 -1
  308. package/dist/chunk-BNS75YNF.cjs.map +0 -1
  309. package/dist/chunk-C4F7VJ5D.cjs.map +0 -1
  310. package/dist/chunk-CBKG6HEP.js +0 -1263
  311. package/dist/chunk-CBKG6HEP.js.map +0 -1
  312. package/dist/chunk-CPEL3YIR.cjs.map +0 -1
  313. package/dist/chunk-D54WH24V.cjs.map +0 -1
  314. package/dist/chunk-D56XG4EI.cjs.map +0 -1
  315. package/dist/chunk-D7PG5D5K.js.map +0 -1
  316. package/dist/chunk-DI74SMXS.cjs +0 -29
  317. package/dist/chunk-DI74SMXS.cjs.map +0 -1
  318. package/dist/chunk-DK2S42XB.js +0 -77
  319. package/dist/chunk-DK2S42XB.js.map +0 -1
  320. package/dist/chunk-DRACN6XG.js +0 -27
  321. package/dist/chunk-DRACN6XG.js.map +0 -1
  322. package/dist/chunk-DXEEHSGN.js.map +0 -1
  323. package/dist/chunk-EKFUG4G7.cjs.map +0 -1
  324. package/dist/chunk-EQ7JKLZO.cjs +0 -157
  325. package/dist/chunk-EQ7JKLZO.cjs.map +0 -1
  326. package/dist/chunk-FJMPR3OH.cjs.map +0 -1
  327. package/dist/chunk-FLEQ2HBK.js.map +0 -1
  328. package/dist/chunk-FQ7ZPOTZ.js.map +0 -1
  329. package/dist/chunk-G6Q5UM7U.js.map +0 -1
  330. package/dist/chunk-GYA4JRP5.js.map +0 -1
  331. package/dist/chunk-H7VE3FL4.cjs.map +0 -1
  332. package/dist/chunk-ID4WXTKL.js.map +0 -1
  333. package/dist/chunk-ISLPNELU.js.map +0 -1
  334. package/dist/chunk-ITE4IXAK.js +0 -25
  335. package/dist/chunk-ITE4IXAK.js.map +0 -1
  336. package/dist/chunk-IX64T5OL.cjs.map +0 -1
  337. package/dist/chunk-J2ICGNHO.cjs.map +0 -1
  338. package/dist/chunk-J7LXTUTP.cjs.map +0 -1
  339. package/dist/chunk-JQXSZHF2.cjs.map +0 -1
  340. package/dist/chunk-JXUTCSXX.cjs.map +0 -1
  341. package/dist/chunk-KCO5EFJU.js +0 -79
  342. package/dist/chunk-KCO5EFJU.js.map +0 -1
  343. package/dist/chunk-KKYELPZ2.cjs +0 -83
  344. package/dist/chunk-KKYELPZ2.cjs.map +0 -1
  345. package/dist/chunk-KMXWZLQX.cjs.map +0 -1
  346. package/dist/chunk-MIJKEVV7.js.map +0 -1
  347. package/dist/chunk-NAAMUYMS.cjs.map +0 -1
  348. package/dist/chunk-P7GTYOLB.cjs.map +0 -1
  349. package/dist/chunk-PVUI6KGR.js.map +0 -1
  350. package/dist/chunk-Q6EDCUXV.js.map +0 -1
  351. package/dist/chunk-QB6VMOJ2.cjs.map +0 -1
  352. package/dist/chunk-QC4MCOFV.cjs +0 -83
  353. package/dist/chunk-QC4MCOFV.cjs.map +0 -1
  354. package/dist/chunk-QMQLUA66.js +0 -12
  355. package/dist/chunk-QMQLUA66.js.map +0 -1
  356. package/dist/chunk-QRNYDV5Z.js.map +0 -1
  357. package/dist/chunk-RFRM3Q5K.js.map +0 -1
  358. package/dist/chunk-RUQS6M7G.js.map +0 -1
  359. package/dist/chunk-S4KQ5LV4.js.map +0 -1
  360. package/dist/chunk-SJDMVITW.cjs.map +0 -1
  361. package/dist/chunk-SNXVDZAJ.js.map +0 -1
  362. package/dist/chunk-SVJ5GEXW.cjs.map +0 -1
  363. package/dist/chunk-TDXIBCGY.cjs.map +0 -1
  364. package/dist/chunk-TKORQCG4.js.map +0 -1
  365. package/dist/chunk-TKP5T34P.js.map +0 -1
  366. package/dist/chunk-TRF4EBJT.cjs +0 -30
  367. package/dist/chunk-TRF4EBJT.cjs.map +0 -1
  368. package/dist/chunk-UCQ3BFSY.cjs.map +0 -1
  369. package/dist/chunk-UR7W5YQK.js.map +0 -1
  370. package/dist/chunk-V34A6R5V.js +0 -134
  371. package/dist/chunk-V34A6R5V.js.map +0 -1
  372. package/dist/chunk-WDAVPX46.js +0 -81
  373. package/dist/chunk-WDAVPX46.js.map +0 -1
  374. package/dist/chunk-WDBXJOU5.cjs.map +0 -1
  375. package/dist/chunk-YDWLUT5V.cjs.map +0 -1
  376. package/dist/chunk-YOALGKRE.cjs.map +0 -1
  377. package/dist/chunk-Z3WO6MND.cjs.map +0 -1
  378. package/dist/chunk-ZDH3DX3C.cjs +0 -30
  379. package/dist/chunk-ZDH3DX3C.cjs.map +0 -1
  380. package/dist/chunk-ZI6VQSZA.cjs.map +0 -1
  381. package/dist/chunk-ZTAJL4DT.cjs +0 -85
  382. package/dist/chunk-ZTAJL4DT.cjs.map +0 -1
  383. package/dist/define-graph-BGrJahvp.d.ts +0 -173
  384. package/dist/define-graph-alREY2wj.d.cts +0 -173
@@ -1,15 +1,14 @@
1
- import { createPostgresOperationStrategy, createCachedTableExistence, createContributionMaterializer, gateFulltextMethods, lockPostgresTrustedImportTables, assertTrustedImportDatabaseEmpty, suspendPostgresSecondaryIndexes, createPostgresTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, createCommonOperationBackend, vectorSlotFromParams, buildLiveNodeCandidates, mapVectorWriteError, mapHybridSearchRow, mapContributionMaterializationRow, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, tableExistsFromRow, assertAdoptedDialect, buildKindRemovalInsertValues, POSTGRES_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, POSTGRES_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT, EMBEDDING_UPSERT_PARAM_COUNT, gateFulltext, getOrCreateLru, commitSchemaVersionIfKindsEmpty, assertActiveSchemaVersion } from './chunk-DXEEHSGN.js';
2
- import { pgvectorStrategy, assertPgvectorEfSearch } from './chunk-ISLPNELU.js';
3
- import { createNodeRowMapper, POSTGRES_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-YMTXMPV6.js';
4
- import { tables, generatePostgresDDL, generatePgCreateTableSQL } from './chunk-BGYJW37L.js';
5
- import { toDrizzleSql, compileQueryWithDialect } from './chunk-EFEOOCJ3.js';
6
- import { chunk } from './chunk-35S6P5ZU.js';
7
- import { POSTGRES_MAX_BIND_PARAMETERS, normalizeGraphAnalyticsCapabilities, createBackendOverlay, INTERNAL_TEMPORARY_WRITES, POSTGRES_CAPABILITIES } from './chunk-55ITBQJI.js';
8
- import { isMissingTableError, isInsufficientResourcesError, isPostgresUniqueViolationError } from './chunk-V34A6R5V.js';
9
- import { tsvectorStrategy, assertVectorSearchLimit, buildFulltextCapabilities, buildVectorCapabilities } from './chunk-PVUI6KGR.js';
10
- import { sql, isSqlFragment, shouldForceCustomPlan, annIndexScanTypes } from './chunk-6DCB664D.js';
11
- import { requireDefined } from './chunk-QMQLUA66.js';
12
- import { ConfigurationError, CompilerInvariantError, TransactionClosedError } from './chunk-4MB3AQAQ.js';
1
+ import { contributionRebuildSupported, createPostgresOperationStrategy, createCachedTableExistence, createContributionMaterializer, gateFulltextMethods, lockPostgresTrustedImportTables, assertTrustedImportDatabaseEmpty, suspendPostgresSecondaryIndexes, createPostgresTrustedImportSession, restoreSecondaryIndexes, analyzeImportedTables, createCommonOperationBackend, vectorSlotFromParams, buildLiveNodeCandidates, mapVectorWriteError, mapHybridSearchRow, mapContributionMaterializationRow, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, tableExistsFromRow, assertAdoptedDialect, commitSchemaVersionIfKindsEmpty, buildKindRemovalInsertValues, POSTGRES_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, POSTGRES_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, vectorSlotFromDropIndexParams, vectorSlotFromCreateIndexParams, assertActiveSchemaVersion, FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT, EMBEDDING_UPSERT_PARAM_COUNT, gateFulltext, getOrCreateLru } from './chunk-7VQXLT5O.js';
2
+ import { pgvectorStrategy, assertPgvectorEfSearch } from './chunk-VGTJPTIC.js';
3
+ import { createNodeRowMapper, POSTGRES_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, nowIso, coerceNumericScore } from './chunk-NMWDXFPH.js';
4
+ import { tables, generatePostgresDDL, generatePgCreateTableSQL, createPostgresTables, postgresContributions } from './chunk-5UVRGXD3.js';
5
+ import { toDrizzleSql, compileQueryWithDialect } from './chunk-UV3SN74I.js';
6
+ import { isPostgresConcurrentDdlRaceError, chunk, isMissingTableError, isInsufficientResourcesError } from './chunk-JZUR7ZWE.js';
7
+ import { POSTGRES_MAX_BIND_PARAMETERS, normalizeGraphAnalyticsCapabilities, createBackendOverlay, markSerializedTransactionResource, INTERNAL_TEMPORARY_WRITES, POSTGRES_CAPABILITIES } from './chunk-AKLS3BYZ.js';
8
+ import { tsvectorStrategy, assertVectorSearchLimit, buildFulltextCapabilities, buildVectorCapabilities, resolveEfSearchOverride, vectorSearchFrontierTuning } from './chunk-YDFDBE6D.js';
9
+ import { sql, isSqlFragment, shouldForceCustomPlan, annIndexScanTypes } from './chunk-PQBQG7IM.js';
10
+ import { ConfigurationError, StaleVersionError, CompilerInvariantError, TransactionClosedError } from './chunk-J3WZ3FA2.js';
11
+ import { requireDefined } from './chunk-DYATYRY4.js';
13
12
  import { getTableName, sql as sql$1, eq, and, isNull, inArray } from 'drizzle-orm';
14
13
  import { PgTransaction } from 'drizzle-orm/pg-core';
15
14
 
@@ -28,8 +27,12 @@ function isPgliteClient(candidate) {
28
27
  return typeof candidate === "object" && hasFunctionProperty(candidate, "query") && hasFunctionProperty(candidate, "dumpDataDir");
29
28
  }
30
29
  var PGLITE_MAX_BIND_PARAMETERS = 32767;
30
+ function getPgliteClient(db) {
31
+ const client = db.$client;
32
+ return isPgliteClient(client) ? client : void 0;
33
+ }
31
34
  function isPgliteDatabase(db) {
32
- return isPgliteClient(db.$client);
35
+ return getPgliteClient(db) !== void 0;
33
36
  }
34
37
  function transactionSession(carrier) {
35
38
  return carrier.session ?? carrier._?.session;
@@ -341,6 +344,12 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
341
344
  )
342
345
  };
343
346
  }
347
+ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
348
+ "identityAssertions",
349
+ "recordedIdentityAssertions",
350
+ "identityClosure",
351
+ "identitySeparation"
352
+ ]);
344
353
  var toNodeRow = createNodeRowMapper(POSTGRES_ROW_MAPPER_CONFIG);
345
354
  var toEdgeRow = createEdgeRowMapper(POSTGRES_ROW_MAPPER_CONFIG);
346
355
  var toUniqueRow = createUniqueRowMapper(POSTGRES_ROW_MAPPER_CONFIG);
@@ -355,6 +364,7 @@ function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
355
364
  };
356
365
  }
357
366
  function createPostgresBackend(db, options = {}) {
367
+ const serializedClient = getSerializedPostgresClient(db);
358
368
  const tables2 = options.tables ?? tables;
359
369
  const fulltextStrategy = options.fulltext ?? tsvectorStrategy;
360
370
  const vectorStrategy = options.vector === false ? void 0 : options.vector ?? pgvectorStrategy;
@@ -377,12 +387,24 @@ function createPostgresBackend(db, options = {}) {
377
387
  PGLITE_MAX_BIND_PARAMETERS
378
388
  )
379
389
  } : {};
380
- const capabilities = normalizeGraphAnalyticsCapabilities({
390
+ const declaredCapabilities = normalizeGraphAnalyticsCapabilities({
381
391
  ...baseCapabilities,
382
392
  ...httpOnlyOverrides,
383
393
  ...options.capabilities,
384
394
  ...driverBindParameterOverrides
385
395
  });
396
+ const capabilities = {
397
+ ...declaredCapabilities,
398
+ contributions: {
399
+ supported: true,
400
+ probe: true,
401
+ rebuild: contributionRebuildSupported(
402
+ fulltextStrategy,
403
+ tables2.fulltextTableName,
404
+ declaredCapabilities.transactions
405
+ )
406
+ }
407
+ };
386
408
  const adapterOptions = {
387
409
  ...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
388
410
  ...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
@@ -396,6 +418,10 @@ function createPostgresBackend(db, options = {}) {
396
418
  recordedEdges: getTableName(tables2.recordedEdges),
397
419
  recordedClock: getTableName(tables2.recordedClock),
398
420
  revisionOrigins: getTableName(tables2.revisionOrigins),
421
+ identityAssertions: getTableName(tables2.identityAssertions),
422
+ recordedIdentityAssertions: getTableName(tables2.recordedIdentityAssertions),
423
+ identityClosure: getTableName(tables2.identityClosure),
424
+ identitySeparation: getTableName(tables2.identitySeparation),
399
425
  fulltext: tables2.fulltextTableName,
400
426
  uniques: getTableName(tables2.uniques)
401
427
  };
@@ -410,16 +436,20 @@ function createPostgresBackend(db, options = {}) {
410
436
  "postgres"
411
437
  )
412
438
  );
413
- const recordedAnalyzeTables = [
439
+ const guardedAnalyzeTables = [
414
440
  tableNames.recordedNodes,
415
441
  tableNames.recordedEdges,
416
- tableNames.recordedClock
442
+ tableNames.recordedClock,
443
+ tableNames.recordedIdentityAssertions,
444
+ tableNames.identityAssertions,
445
+ tableNames.identityClosure,
446
+ tableNames.identitySeparation
417
447
  ];
418
448
  const operationStrategy = createPostgresOperationStrategy(
419
449
  tables2,
420
450
  fulltextStrategy
421
451
  );
422
- const recordedTableExists = createCachedTableExistence(
452
+ const guardedTableExists = createCachedTableExistence(
423
453
  async (tableName) => {
424
454
  const rows = await executionAdapter.execute(
425
455
  operationStrategy.buildTableExists(tableName)
@@ -429,18 +459,32 @@ function createPostgresBackend(db, options = {}) {
429
459
  { cacheExisting: false }
430
460
  );
431
461
  const matTable = tables2.contributionMaterializations;
432
- async function ensureTableWithConcurrentCreateRetry(table) {
433
- const statement = sql$1.raw(generatePgCreateTableSQL(table));
462
+ async function executeConcurrentCreateDdl(ddl) {
463
+ const statement = sql$1.raw(ddl);
434
464
  try {
435
465
  await db.execute(statement);
436
466
  } catch (error) {
437
- if (!isPostgresUniqueViolationError(error)) throw error;
467
+ if (!isPostgresConcurrentDdlRaceError(error)) throw error;
438
468
  await db.execute(statement);
439
469
  }
440
470
  }
471
+ async function ensureTableWithConcurrentCreateRetry(table) {
472
+ await executeConcurrentCreateDdl(generatePgCreateTableSQL(table));
473
+ }
441
474
  async function ensureContributionMaterializationsTableImpl() {
442
475
  await ensureTableWithConcurrentCreateRetry(matTable);
443
476
  }
477
+ function identityContributionsFor(identityTableNames) {
478
+ const identityTables = createPostgresTables({
479
+ identityAssertions: identityTableNames.identityAssertions,
480
+ recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
481
+ identityClosure: identityTableNames.identityClosure,
482
+ identitySeparation: identityTableNames.identitySeparation
483
+ });
484
+ return postgresContributions(identityTables, fulltextStrategy).filter(
485
+ (contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
486
+ );
487
+ }
444
488
  async function getContributionMaterializationRow(identity) {
445
489
  const rows = await db.select().from(matTable).where(
446
490
  and(
@@ -506,14 +550,25 @@ function createPostgresBackend(db, options = {}) {
506
550
  fulltextStrategy,
507
551
  fulltextTableName: tables2.fulltextTableName,
508
552
  vectorStrategy,
553
+ // Contribution DDL is `CREATE ... IF NOT EXISTS` reached from every
554
+ // booting replica, so it carries the same concurrent-create retry the
555
+ // other create sites use. Without it the loser's 23505 is recorded as
556
+ // `lastError` on the marker row and reported as a failed materialization,
557
+ // when the table it wanted is in fact present.
509
558
  execDdl: async (statement) => {
510
- await db.execute(sql$1.raw(statement));
559
+ await executeConcurrentCreateDdl(statement);
511
560
  },
512
561
  ensureMarkerTable: ensureContributionMaterializationsTableImpl,
513
562
  getMarkers: getContributionMaterializationRows,
514
563
  recordMarker: recordContributionMaterializationRow,
515
564
  deleteMarker: deleteContributionMaterializationRow,
516
- tableExists: contributionTableExists
565
+ tableExists: contributionTableExists,
566
+ // Withheld rather than wired-and-throwing when the driver cannot hold
567
+ // a session: the rebuild must refuse with its own typed error naming
568
+ // the absent fence, matching `capabilities.contributions.rebuild`.
569
+ ...capabilities.transactions ? {
570
+ schemaWriteTransaction: (graphId, fn) => runSchemaWriteTransaction(graphId, (target) => fn(target))
571
+ } : {}
517
572
  });
518
573
  const operations = createPostgresOperationBackend({
519
574
  db,
@@ -633,12 +688,34 @@ function createPostgresBackend(db, options = {}) {
633
688
  async bootstrapTables() {
634
689
  const statements = generatePostgresDDL(tables2, fulltextStrategy);
635
690
  for (const statement of statements) {
636
- await db.execute(sql$1.raw(statement));
691
+ await executeConcurrentCreateDdl(statement);
637
692
  }
638
693
  },
639
694
  async ensureRevisionOriginsTable() {
640
695
  await ensureTableWithConcurrentCreateRetry(tables2.revisionOrigins);
641
696
  },
697
+ async ensureIdentityTables(identityTableNames, options2) {
698
+ const identityContributions = identityContributionsFor(identityTableNames);
699
+ const missing = [];
700
+ for (const contribution of identityContributions) {
701
+ if (!await contributionTableExists(contribution.tableName)) {
702
+ missing.push(contribution.logicalName);
703
+ }
704
+ }
705
+ if (missing.length === 0 || options2.provisionMissing) {
706
+ for (const contribution of identityContributions) {
707
+ for (const ddl of contribution.createDdl) {
708
+ await executeConcurrentCreateDdl(ddl);
709
+ }
710
+ }
711
+ }
712
+ return missing;
713
+ },
714
+ identityTableDdl(identityTableNames) {
715
+ return identityContributionsFor(identityTableNames).flatMap(
716
+ (contribution) => [...contribution.createDdl]
717
+ );
718
+ },
642
719
  // Every fulltext-touching method asserts the durable marker instead
643
720
  // of lazily emitting DDL. Steady state performs zero ensure; an
644
721
  // uninitialized database throws `StoreNotInitializedError` loudly
@@ -654,15 +731,11 @@ function createPostgresBackend(db, options = {}) {
654
731
  async ensureIndexMaterializationsTable() {
655
732
  await ensureTableWithConcurrentCreateRetry(tables2.indexMaterializations);
656
733
  const tableName = getTableName(tables2.indexMaterializations);
657
- await db.execute(
658
- sql$1.raw(
659
- `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "building_since" timestamptz;`
660
- )
734
+ await executeConcurrentCreateDdl(
735
+ `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "building_since" timestamptz;`
661
736
  );
662
- await db.execute(
663
- sql$1.raw(
664
- `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
665
- )
737
+ await executeConcurrentCreateDdl(
738
+ `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
666
739
  );
667
740
  },
668
741
  async claimIndexMaterialization(params) {
@@ -786,6 +859,16 @@ function createPostgresBackend(db, options = {}) {
786
859
  async repairContributions(graphId, vectorSlots) {
787
860
  return contributionMaterializer.repairContributions(graphId, vectorSlots);
788
861
  },
862
+ async probeContributions(graphId, vectorSlots) {
863
+ return contributionMaterializer.probeContributions(graphId, vectorSlots);
864
+ },
865
+ async rebuildContribution(graphId, scope, repopulate) {
866
+ return contributionMaterializer.rebuildContribution(
867
+ graphId,
868
+ scope,
869
+ repopulate
870
+ );
871
+ },
789
872
  // Vector counterparts of the runtime-contribution methods. Present
790
873
  // only when a vector strategy is wired (omitted under `vector: false`,
791
874
  // mirroring the embedding/search methods), so a no-vector backend
@@ -824,13 +907,13 @@ function createPostgresBackend(db, options = {}) {
824
907
  await db.execute(statement);
825
908
  }
826
909
  const tablePresence = await Promise.all(
827
- recordedAnalyzeTables.map(async (tableName) => ({
910
+ guardedAnalyzeTables.map(async (tableName) => ({
828
911
  tableName,
829
- exists: await recordedTableExists(tableName)
912
+ exists: await guardedTableExists(tableName)
830
913
  }))
831
914
  );
832
- const presentRecordedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
833
- for (const tableName of presentRecordedTables) {
915
+ const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
916
+ for (const tableName of presentGuardedTables) {
834
917
  await db.execute(
835
918
  toDrizzleSql(
836
919
  sql`ANALYZE (SKIP_LOCKED) ${sql.identifier(tableName)}`,
@@ -851,6 +934,12 @@ function createPostgresBackend(db, options = {}) {
851
934
  (target) => commitSchemaVersionIfKindsEmpty(target, params, probes)
852
935
  );
853
936
  },
937
+ async commitSchemaVersionWithPreflight(params, preflight) {
938
+ return runSchemaWriteTransaction(params.graphId, async (target) => {
939
+ await preflight(target);
940
+ return target.commitSchemaVersion(params);
941
+ });
942
+ },
854
943
  async setActiveVersion(params) {
855
944
  await runSchemaWriteTransaction(
856
945
  params.graphId,
@@ -909,8 +998,42 @@ function createPostgresBackend(db, options = {}) {
909
998
  async close() {
910
999
  }
911
1000
  };
1001
+ if (serializedClient !== void 0) {
1002
+ markSerializedTransactionResource(backend, serializedClient);
1003
+ }
912
1004
  return backend;
913
1005
  }
1006
+ function getSerializedPostgresClient(db) {
1007
+ const pgliteClient = getPgliteClient(db);
1008
+ if (pgliteClient !== void 0) return pgliteClient;
1009
+ const client = db.$client;
1010
+ if (typeof client === "function") {
1011
+ return isSingleConnectionCallablePgClient(client) ? client : void 0;
1012
+ }
1013
+ if (typeof client !== "object" || client === null) return void 0;
1014
+ const candidate = client;
1015
+ if (!hasFunctionProperty(candidate, "query")) return void 0;
1016
+ if (isSingleConnectionPgPool(candidate)) return client;
1017
+ return isBarePgClient(candidate) ? client : void 0;
1018
+ }
1019
+ function isSingleConnectionPgPool(candidate) {
1020
+ const options = candidate["options"];
1021
+ if (typeof options !== "object" || options === null) return false;
1022
+ return options["max"] === 1;
1023
+ }
1024
+ function isSingleConnectionCallablePgClient(client) {
1025
+ if (client === void 0 || client === null) return false;
1026
+ const options = client["options"];
1027
+ if (!isPostgresJsClient(client)) return false;
1028
+ if (typeof options !== "object" || options === null) return false;
1029
+ return options["max"] === 1;
1030
+ }
1031
+ function isBarePgClient(candidate) {
1032
+ if (candidate["options"] !== void 0 || candidate["totalCount"] !== void 0 || candidate["idleCount"] !== void 0 || candidate["waitingCount"] !== void 0) {
1033
+ return false;
1034
+ }
1035
+ return hasFunctionProperty(candidate, "connect") && hasFunctionProperty(candidate, "end") && hasFunctionProperty(candidate, "escapeIdentifier");
1036
+ }
914
1037
  function createIterativeScanProbe() {
915
1038
  let probe;
916
1039
  let warned = false;
@@ -969,31 +1092,24 @@ function createPostgresOperationBackend(options) {
969
1092
  async function execRun(query) {
970
1093
  await executionAdapter.execute(query);
971
1094
  }
972
- let efSearchUnsupportedWarned = false;
973
- function warnEfSearchUnsupported() {
974
- if (efSearchUnsupportedWarned) return;
975
- efSearchUnsupportedWarned = true;
976
- if (typeof console === "undefined" || typeof console.warn !== "function") {
977
- return;
978
- }
979
- console.warn(
980
- "[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."
981
- );
982
- }
983
1095
  function pgvectorIterativeScanSupported() {
984
1096
  return iterativeScanProbe.isSupported(execAll);
985
1097
  }
986
1098
  async function vectorSearchGucOverrides(params) {
987
1099
  const overrides = [];
988
- if (params.efSearch !== void 0) {
989
- if (capabilities.transactions) {
990
- overrides.push({
991
- name: "hnsw.ef_search",
992
- value: String(params.efSearch)
993
- });
994
- } else {
995
- warnEfSearchUnsupported();
996
- }
1100
+ const efSearchParameter = resolveEfSearchOverride({
1101
+ efSearch: params.efSearch,
1102
+ indexType: params.indexType,
1103
+ tuning: vectorSearchFrontierTuning(vectorStrategy),
1104
+ transactions: capabilities.transactions,
1105
+ dialect: "PostgreSQL",
1106
+ engine: vectorStrategy?.name ?? "this backend"
1107
+ });
1108
+ if (efSearchParameter !== void 0) {
1109
+ overrides.push({
1110
+ name: efSearchParameter,
1111
+ value: String(params.efSearch)
1112
+ });
997
1113
  }
998
1114
  if (params.indexType === "hnsw" && capabilities.transactions && await pgvectorIterativeScanSupported()) {
999
1115
  overrides.push({ name: "hnsw.iterative_scan", value: "strict_order" });
@@ -1245,10 +1361,36 @@ function createPostgresOperationBackend(options) {
1245
1361
  }
1246
1362
  } : {}
1247
1363
  };
1364
+ async function lockActiveSchemaVersion(graphId) {
1365
+ const active = await execGet(sql$1`
1366
+ SELECT ${schemaVersionsTable.version} AS version
1367
+ FROM ${schemaVersionsTable}
1368
+ WHERE ${schemaVersionsTable.graphId} = ${graphId}
1369
+ AND ${schemaVersionsTable.isActive} = TRUE
1370
+ FOR SHARE
1371
+ `);
1372
+ return active?.version;
1373
+ }
1248
1374
  const operationBackend = {
1249
1375
  ...commonBackend,
1250
1376
  ...executeRawMethod,
1251
1377
  ...vectorEmbeddingMethods,
1378
+ /**
1379
+ * Transaction-scoped contribution marker stamp. Present so the
1380
+ * destructive rebuild can commit its marker with the DDL that
1381
+ * produced it; without it the stamp would land outside the
1382
+ * transaction and could survive a rolled-back drop.
1383
+ *
1384
+ * States the row outright rather than reusing the top-level upsert,
1385
+ * whose `materialized_at` COALESCE preserves an earlier success so a
1386
+ * failed re-attempt cannot erase it. A completed rebuild replaced the
1387
+ * storage, so the recorded timestamp must be the rebuild's.
1388
+ */
1389
+ async recordContributionMaterialization(params) {
1390
+ await execRun(
1391
+ operationStrategy.buildInsertContributionMaterialization(params)
1392
+ );
1393
+ },
1252
1394
  async deleteSchemaVectorSlotContribution(slot) {
1253
1395
  if (vectorStrategy === void 0) return;
1254
1396
  for (const contribution of vectorStrategy.ownedTables(slot)) {
@@ -1278,18 +1420,21 @@ function createPostgresOperationBackend(options) {
1278
1420
  }
1279
1421
  );
1280
1422
  }
1281
- const active = await execGet(sql$1`
1282
- SELECT ${schemaVersionsTable.version} AS version
1283
- FROM ${schemaVersionsTable}
1284
- WHERE ${schemaVersionsTable.graphId} = ${params.graphId}
1285
- AND ${schemaVersionsTable.isActive} = TRUE
1286
- FOR SHARE
1287
- `);
1288
- assertActiveSchemaVersion(
1289
- params.graphId,
1290
- params.expectedVersion,
1291
- active?.version ?? 0
1292
- );
1423
+ const locked = await lockActiveSchemaVersion(params.graphId);
1424
+ if (locked !== void 0) {
1425
+ assertActiveSchemaVersion(
1426
+ params.graphId,
1427
+ params.expectedVersion,
1428
+ locked
1429
+ );
1430
+ return;
1431
+ }
1432
+ const settled = await commonBackend.getActiveSchema(params.graphId);
1433
+ throw new StaleVersionError({
1434
+ graphId: params.graphId,
1435
+ expected: params.expectedVersion,
1436
+ actual: settled?.version ?? 0
1437
+ });
1293
1438
  },
1294
1439
  // === Vector Index Operations ===
1295
1440
  async createVectorIndex(params) {
@@ -1440,5 +1585,5 @@ function createTransactionBackend(options) {
1440
1585
  }
1441
1586
 
1442
1587
  export { createPostgresBackend };
1443
- //# sourceMappingURL=chunk-QRNYDV5Z.js.map
1444
- //# sourceMappingURL=chunk-QRNYDV5Z.js.map
1588
+ //# sourceMappingURL=chunk-5763DULU.js.map
1589
+ //# sourceMappingURL=chunk-5763DULU.js.map