@nicia-ai/typegraph 0.46.2 → 0.48.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 (310) hide show
  1. package/README.md +20 -1
  2. package/dist/backend/drizzle/indexes.cjs +9 -9
  3. package/dist/backend/drizzle/indexes.d.cts +1 -1
  4. package/dist/backend/drizzle/indexes.d.ts +1 -1
  5. package/dist/backend/drizzle/indexes.js +5 -5
  6. package/dist/backend/index.cjs +58 -49
  7. package/dist/backend/index.d.cts +37 -55
  8. package/dist/backend/index.d.ts +37 -55
  9. package/dist/backend/index.js +11 -10
  10. package/dist/backend/postgres/index.cjs +27 -26
  11. package/dist/backend/postgres/index.d.cts +21 -7
  12. package/dist/backend/postgres/index.d.ts +21 -7
  13. package/dist/backend/postgres/index.js +14 -13
  14. package/dist/backend/postgres/pglite-store.cjs +34 -33
  15. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  16. package/dist/backend/postgres/pglite-store.d.cts +8 -8
  17. package/dist/backend/postgres/pglite-store.d.ts +8 -8
  18. package/dist/backend/postgres/pglite-store.js +30 -29
  19. package/dist/backend/postgres/pglite-store.js.map +1 -1
  20. package/dist/backend/postgres/pglite.cjs +16 -15
  21. package/dist/backend/postgres/pglite.d.cts +3 -3
  22. package/dist/backend/postgres/pglite.d.ts +3 -3
  23. package/dist/backend/postgres/pglite.js +15 -14
  24. package/dist/backend/sqlite/index.cjs +24 -23
  25. package/dist/backend/sqlite/index.d.cts +20 -7
  26. package/dist/backend/sqlite/index.d.ts +20 -7
  27. package/dist/backend/sqlite/index.js +12 -11
  28. package/dist/backend/sqlite/libsql.cjs +19 -18
  29. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  30. package/dist/backend/sqlite/libsql.d.cts +3 -3
  31. package/dist/backend/sqlite/libsql.d.ts +3 -3
  32. package/dist/backend/sqlite/libsql.js +14 -13
  33. package/dist/backend/sqlite/libsql.js.map +1 -1
  34. package/dist/backend/sqlite/local-store.cjs +35 -34
  35. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  36. package/dist/backend/sqlite/local-store.d.cts +8 -8
  37. package/dist/backend/sqlite/local-store.d.ts +8 -8
  38. package/dist/backend/sqlite/local-store.js +31 -30
  39. package/dist/backend/sqlite/local-store.js.map +1 -1
  40. package/dist/backend/sqlite/local.cjs +17 -16
  41. package/dist/backend/sqlite/local.d.cts +3 -3
  42. package/dist/backend/sqlite/local.d.ts +3 -3
  43. package/dist/backend/sqlite/local.js +15 -14
  44. package/dist/{chunk-TCT66A7N.cjs → chunk-26YKDNUD.cjs} +10 -10
  45. package/dist/{chunk-TCT66A7N.cjs.map → chunk-26YKDNUD.cjs.map} +1 -1
  46. package/dist/{chunk-E4OSGBCM.cjs → chunk-2HIYYMWY.cjs} +139 -136
  47. package/dist/chunk-2HIYYMWY.cjs.map +1 -0
  48. package/dist/chunk-2QGYQBS2.cjs +161 -0
  49. package/dist/chunk-2QGYQBS2.cjs.map +1 -0
  50. package/dist/{chunk-GWXXHOLU.js → chunk-2SYZXD54.js} +21 -18
  51. package/dist/chunk-2SYZXD54.js.map +1 -0
  52. package/dist/{chunk-KA4L2NZ3.js → chunk-2TYSSBU5.js} +14 -14
  53. package/dist/{chunk-KA4L2NZ3.js.map → chunk-2TYSSBU5.js.map} +1 -1
  54. package/dist/{chunk-QOJ2L2AD.js → chunk-3DMMGT6S.js} +3 -3
  55. package/dist/{chunk-QOJ2L2AD.js.map → chunk-3DMMGT6S.js.map} +1 -1
  56. package/dist/{chunk-F36KZDFX.cjs → chunk-3FPR224C.cjs} +91 -91
  57. package/dist/{chunk-F36KZDFX.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
  58. package/dist/{chunk-32UETY6S.cjs → chunk-3KOY4FH3.cjs} +207 -28
  59. package/dist/chunk-3KOY4FH3.cjs.map +1 -0
  60. package/dist/{chunk-QU7QLJA4.cjs → chunk-3U5ABFDW.cjs} +26 -26
  61. package/dist/{chunk-QU7QLJA4.cjs.map → chunk-3U5ABFDW.cjs.map} +1 -1
  62. package/dist/{chunk-RFDEYLIK.js → chunk-4WMMBDS5.js} +7 -7
  63. package/dist/chunk-4WMMBDS5.js.map +1 -0
  64. package/dist/{chunk-R7EWHKID.js → chunk-5K2BKEBD.js} +19 -145
  65. package/dist/chunk-5K2BKEBD.js.map +1 -0
  66. package/dist/chunk-5PRKMB24.cjs +124 -0
  67. package/dist/chunk-5PRKMB24.cjs.map +1 -0
  68. package/dist/chunk-6LN7FIVU.js +107 -0
  69. package/dist/chunk-6LN7FIVU.js.map +1 -0
  70. package/dist/{chunk-D6GCNNMK.cjs → chunk-6NGW27EO.cjs} +10 -10
  71. package/dist/{chunk-D6GCNNMK.cjs.map → chunk-6NGW27EO.cjs.map} +1 -1
  72. package/dist/{chunk-WHS2Y43J.js → chunk-6SWPJEYN.js} +5 -5
  73. package/dist/{chunk-WHS2Y43J.js.map → chunk-6SWPJEYN.js.map} +1 -1
  74. package/dist/{chunk-7TKNK32B.js → chunk-7SQSZN2J.js} +5 -5
  75. package/dist/{chunk-7TKNK32B.js.map → chunk-7SQSZN2J.js.map} +1 -1
  76. package/dist/{chunk-UTVQPZPN.cjs → chunk-7XUYFFR4.cjs} +20 -20
  77. package/dist/chunk-7XUYFFR4.cjs.map +1 -0
  78. package/dist/{chunk-KXSMF6PL.js → chunk-ACGSAMD3.js} +39 -34
  79. package/dist/chunk-ACGSAMD3.js.map +1 -0
  80. package/dist/{chunk-PYKF7UIL.cjs → chunk-AOSSQDVO.cjs} +13 -13
  81. package/dist/{chunk-PYKF7UIL.cjs.map → chunk-AOSSQDVO.cjs.map} +1 -1
  82. package/dist/{chunk-AT3MLMJV.js → chunk-AX6JGVTZ.js} +91 -20
  83. package/dist/chunk-AX6JGVTZ.js.map +1 -0
  84. package/dist/{chunk-WA64ZSCA.cjs → chunk-BFUOME67.cjs} +11 -11
  85. package/dist/{chunk-WA64ZSCA.cjs.map → chunk-BFUOME67.cjs.map} +1 -1
  86. package/dist/{chunk-YQ4JONWE.js → chunk-BRRP76WO.js} +401 -131
  87. package/dist/chunk-BRRP76WO.js.map +1 -0
  88. package/dist/{chunk-FCIZNUW5.js → chunk-CHAOFCHV.js} +3 -3
  89. package/dist/{chunk-FCIZNUW5.js.map → chunk-CHAOFCHV.js.map} +1 -1
  90. package/dist/chunk-CICO5GXD.cjs +12 -0
  91. package/dist/{chunk-73MWKDFK.cjs.map → chunk-CICO5GXD.cjs.map} +1 -1
  92. package/dist/{chunk-S3G5VLSW.js → chunk-CT3ZKTOF.js} +7 -6
  93. package/dist/chunk-CT3ZKTOF.js.map +1 -0
  94. package/dist/{chunk-SXWLLQ3D.js → chunk-D5R42W5D.js} +4 -4
  95. package/dist/{chunk-SXWLLQ3D.js.map → chunk-D5R42W5D.js.map} +1 -1
  96. package/dist/{chunk-BZZI7B43.cjs → chunk-DO7SAMEK.cjs} +47 -47
  97. package/dist/{chunk-BZZI7B43.cjs.map → chunk-DO7SAMEK.cjs.map} +1 -1
  98. package/dist/chunk-DZAICA5J.js +147 -0
  99. package/dist/chunk-DZAICA5J.js.map +1 -0
  100. package/dist/{chunk-2ZWM2RFH.cjs → chunk-EDN4Y4ZG.cjs} +9 -9
  101. package/dist/{chunk-2ZWM2RFH.cjs.map → chunk-EDN4Y4ZG.cjs.map} +1 -1
  102. package/dist/{chunk-A4R3H7RU.cjs → chunk-EZEEWCFJ.cjs} +264 -361
  103. package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
  104. package/dist/{chunk-BEB4OFZF.cjs → chunk-FA2AFWLP.cjs} +51 -59
  105. package/dist/chunk-FA2AFWLP.cjs.map +1 -0
  106. package/dist/{chunk-ZBVZ7HXD.cjs → chunk-FQPEMEWX.cjs} +12 -12
  107. package/dist/{chunk-ZBVZ7HXD.cjs.map → chunk-FQPEMEWX.cjs.map} +1 -1
  108. package/dist/{chunk-LNIWCQR4.js → chunk-GLHXM7C4.js} +3 -3
  109. package/dist/{chunk-LNIWCQR4.js.map → chunk-GLHXM7C4.js.map} +1 -1
  110. package/dist/{chunk-6BD6ZBKT.cjs → chunk-GYEG3ZLZ.cjs} +10 -10
  111. package/dist/{chunk-6BD6ZBKT.cjs.map → chunk-GYEG3ZLZ.cjs.map} +1 -1
  112. package/dist/{chunk-A7NMUYEL.cjs → chunk-HDL2ARHX.cjs} +27 -27
  113. package/dist/{chunk-A7NMUYEL.cjs.map → chunk-HDL2ARHX.cjs.map} +1 -1
  114. package/dist/{chunk-5ZJOB5YS.js → chunk-HEV35TGT.js} +4 -4
  115. package/dist/{chunk-5ZJOB5YS.js.map → chunk-HEV35TGT.js.map} +1 -1
  116. package/dist/{chunk-LHYSY6SE.js → chunk-I4GAZH5Z.js} +186 -9
  117. package/dist/chunk-I4GAZH5Z.js.map +1 -0
  118. package/dist/{chunk-BQM5P2NO.cjs → chunk-JB6T4GLL.cjs} +260 -223
  119. package/dist/chunk-JB6T4GLL.cjs.map +1 -0
  120. package/dist/{chunk-QPOQX2DI.cjs → chunk-JFRT7S3B.cjs} +1026 -369
  121. package/dist/chunk-JFRT7S3B.cjs.map +1 -0
  122. package/dist/{chunk-JCNTKRAK.js → chunk-JONXFAPO.js} +5 -5
  123. package/dist/{chunk-JCNTKRAK.js.map → chunk-JONXFAPO.js.map} +1 -1
  124. package/dist/{chunk-WEJHA7AD.js → chunk-KF6K7TGH.js} +109 -75
  125. package/dist/chunk-KF6K7TGH.js.map +1 -0
  126. package/dist/{chunk-EDJDDY6H.js → chunk-KKBDXCLQ.js} +4 -4
  127. package/dist/{chunk-EDJDDY6H.js.map → chunk-KKBDXCLQ.js.map} +1 -1
  128. package/dist/{chunk-ZHOAZD7Q.cjs → chunk-L3LQNR34.cjs} +161 -161
  129. package/dist/{chunk-ZHOAZD7Q.cjs.map → chunk-L3LQNR34.cjs.map} +1 -1
  130. package/dist/{chunk-AF3TWL5C.cjs → chunk-LRQKXRXO.cjs} +4 -4
  131. package/dist/{chunk-AF3TWL5C.cjs.map → chunk-LRQKXRXO.cjs.map} +1 -1
  132. package/dist/chunk-MKJ4KXL5.cjs +12 -0
  133. package/dist/{chunk-6LAXM4J2.cjs.map → chunk-MKJ4KXL5.cjs.map} +1 -1
  134. package/dist/{chunk-KCH7WQA5.cjs → chunk-MRDBBHIZ.cjs} +48 -2
  135. package/dist/chunk-MRDBBHIZ.cjs.map +1 -0
  136. package/dist/{chunk-FXNHZFZV.js → chunk-MYKHJI2J.js} +3 -3
  137. package/dist/{chunk-FXNHZFZV.js.map → chunk-MYKHJI2J.js.map} +1 -1
  138. package/dist/{chunk-Z43KWLZF.js → chunk-NACVVDWB.js} +213 -12
  139. package/dist/chunk-NACVVDWB.js.map +1 -0
  140. package/dist/{chunk-72WUT4GG.js → chunk-NVY5CJFP.js} +4 -4
  141. package/dist/{chunk-72WUT4GG.js.map → chunk-NVY5CJFP.js.map} +1 -1
  142. package/dist/{chunk-WYFB7BN3.js → chunk-OD4SSY2U.js} +166 -48
  143. package/dist/chunk-OD4SSY2U.js.map +1 -0
  144. package/dist/{chunk-ZIH42CRX.cjs → chunk-OI2GQ25X.cjs} +7 -7
  145. package/dist/{chunk-ZIH42CRX.cjs.map → chunk-OI2GQ25X.cjs.map} +1 -1
  146. package/dist/{chunk-AU3IJNNP.js → chunk-OMZ37BM2.js} +5 -5
  147. package/dist/{chunk-AU3IJNNP.js.map → chunk-OMZ37BM2.js.map} +1 -1
  148. package/dist/{chunk-C4DYN2SD.cjs → chunk-OORXGFL5.cjs} +48 -48
  149. package/dist/{chunk-C4DYN2SD.cjs.map → chunk-OORXGFL5.cjs.map} +1 -1
  150. package/dist/{chunk-HNYLMPQQ.cjs → chunk-OTUPEF2W.cjs} +149 -78
  151. package/dist/chunk-OTUPEF2W.cjs.map +1 -0
  152. package/dist/{chunk-BRN3RGD2.js → chunk-OVI7IXYX.js} +3 -3
  153. package/dist/{chunk-BRN3RGD2.js.map → chunk-OVI7IXYX.js.map} +1 -1
  154. package/dist/{chunk-WMKEGJG4.js → chunk-P6YLZTRE.js} +3 -3
  155. package/dist/{chunk-WMKEGJG4.js.map → chunk-P6YLZTRE.js.map} +1 -1
  156. package/dist/{chunk-C2ZP5YS6.cjs → chunk-PFBRJBUL.cjs} +278 -160
  157. package/dist/chunk-PFBRJBUL.cjs.map +1 -0
  158. package/dist/{chunk-EJSYWAEV.js → chunk-QTD6HX4O.js} +5 -5
  159. package/dist/{chunk-EJSYWAEV.js.map → chunk-QTD6HX4O.js.map} +1 -1
  160. package/dist/{chunk-JL5UEBWT.cjs → chunk-ROR5ZR6A.cjs} +45 -45
  161. package/dist/{chunk-JL5UEBWT.cjs.map → chunk-ROR5ZR6A.cjs.map} +1 -1
  162. package/dist/{chunk-EDHV4CBU.js → chunk-S5TERQVW.js} +37 -134
  163. package/dist/chunk-S5TERQVW.js.map +1 -0
  164. package/dist/{chunk-FSLTU57P.js → chunk-SDBBMD4N.js} +3 -3
  165. package/dist/{chunk-FSLTU57P.js.map → chunk-SDBBMD4N.js.map} +1 -1
  166. package/dist/{chunk-36LIJXWC.js → chunk-SHFBB23Q.js} +4 -4
  167. package/dist/{chunk-36LIJXWC.js.map → chunk-SHFBB23Q.js.map} +1 -1
  168. package/dist/chunk-SIT26LAZ.cjs +614 -0
  169. package/dist/chunk-SIT26LAZ.cjs.map +1 -0
  170. package/dist/{chunk-C6KE2HSQ.cjs → chunk-SR725PWF.cjs} +1662 -1392
  171. package/dist/chunk-SR725PWF.cjs.map +1 -0
  172. package/dist/{chunk-S7WIRFNS.cjs → chunk-TKZXMWQF.cjs} +13 -12
  173. package/dist/chunk-TKZXMWQF.cjs.map +1 -0
  174. package/dist/{chunk-5PDSCELM.cjs → chunk-TQHGE7UC.cjs} +29 -164
  175. package/dist/chunk-TQHGE7UC.cjs.map +1 -0
  176. package/dist/{chunk-XBHRKLZU.cjs → chunk-TUNPBZY3.cjs} +4 -4
  177. package/dist/{chunk-XBHRKLZU.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
  178. package/dist/{chunk-KOAI3KIV.cjs → chunk-TZEGUG6D.cjs} +4 -4
  179. package/dist/{chunk-KOAI3KIV.cjs.map → chunk-TZEGUG6D.cjs.map} +1 -1
  180. package/dist/chunk-UGHG7PGX.js +592 -0
  181. package/dist/chunk-UGHG7PGX.js.map +1 -0
  182. package/dist/{chunk-N3QTGPC7.cjs → chunk-UMGZDVOA.cjs} +303 -101
  183. package/dist/chunk-UMGZDVOA.cjs.map +1 -0
  184. package/dist/{chunk-RHDOAQCT.cjs → chunk-WCCATHMB.cjs} +140 -135
  185. package/dist/chunk-WCCATHMB.cjs.map +1 -0
  186. package/dist/{chunk-DYPRZ53S.cjs → chunk-WODMN3Q2.cjs} +27 -27
  187. package/dist/{chunk-DYPRZ53S.cjs.map → chunk-WODMN3Q2.cjs.map} +1 -1
  188. package/dist/{chunk-OZJCH7ZS.js → chunk-XVWOYKIK.js} +3 -3
  189. package/dist/{chunk-OZJCH7ZS.js.map → chunk-XVWOYKIK.js.map} +1 -1
  190. package/dist/{chunk-IHRDX7K6.js → chunk-YIURNGXI.js} +46 -56
  191. package/dist/chunk-YIURNGXI.js.map +1 -0
  192. package/dist/{chunk-GWUWRZXW.js → chunk-YVF2EM7B.js} +3 -3
  193. package/dist/{chunk-GWUWRZXW.js.map → chunk-YVF2EM7B.js.map} +1 -1
  194. package/dist/{chunk-EAMVXR5B.js → chunk-ZDKTPBGV.js} +4 -4
  195. package/dist/{chunk-EAMVXR5B.js.map → chunk-ZDKTPBGV.js.map} +1 -1
  196. package/dist/{chunk-A2LJG5GM.js → chunk-ZFMCDJGB.js} +803 -148
  197. package/dist/chunk-ZFMCDJGB.js.map +1 -0
  198. package/dist/{chunk-62ZXBMSD.js → chunk-ZLONH2UD.js} +46 -3
  199. package/dist/chunk-ZLONH2UD.js.map +1 -0
  200. package/dist/core/index.cjs +28 -27
  201. package/dist/core/index.d.cts +4 -4
  202. package/dist/core/index.d.ts +4 -4
  203. package/dist/core/index.js +8 -7
  204. package/dist/ddl-BL1NZLMY.d.cts +78 -0
  205. package/dist/ddl-D_oW-EVO.d.ts +78 -0
  206. package/dist/graph-extension/index.cjs +20 -20
  207. package/dist/graph-extension/index.d.cts +4 -4
  208. package/dist/graph-extension/index.d.ts +4 -4
  209. package/dist/graph-extension/index.js +4 -4
  210. package/dist/graph-merge/index.cjs +3418 -706
  211. package/dist/graph-merge/index.cjs.map +1 -1
  212. package/dist/graph-merge/index.d.cts +550 -58
  213. package/dist/graph-merge/index.d.ts +550 -58
  214. package/dist/graph-merge/index.js +3191 -497
  215. package/dist/graph-merge/index.js.map +1 -1
  216. package/dist/{index-Deyu8IXL.d.ts → index-COs_z6nV.d.cts} +47 -3
  217. package/dist/{index-DrRS51Ld.d.cts → index-D7d1u2gr.d.ts} +47 -3
  218. package/dist/index.cjs +233 -216
  219. package/dist/index.cjs.map +1 -1
  220. package/dist/index.d.cts +12 -12
  221. package/dist/index.d.ts +12 -12
  222. package/dist/index.js +35 -34
  223. package/dist/index.js.map +1 -1
  224. package/dist/indexes/index.cjs +13 -13
  225. package/dist/indexes/index.d.cts +4 -4
  226. package/dist/indexes/index.d.ts +4 -4
  227. package/dist/indexes/index.js +6 -6
  228. package/dist/interchange/index.cjs +53 -52
  229. package/dist/interchange/index.cjs.map +1 -1
  230. package/dist/interchange/index.d.cts +17 -13
  231. package/dist/interchange/index.d.ts +17 -13
  232. package/dist/interchange/index.js +17 -16
  233. package/dist/interchange/index.js.map +1 -1
  234. package/dist/{manager-ptr3JLRP.d.cts → manager-CYaff3n3.d.cts} +2 -2
  235. package/dist/{manager-DX983gJ0.d.ts → manager-D9eRT_ns.d.ts} +2 -2
  236. package/dist/{materialize-indexes-CpXoggWU.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
  237. package/dist/{materialize-indexes-BXz77YqO.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
  238. package/dist/{postgres-DwgEXSPI.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
  239. package/dist/{postgres-QdOMHTBz.d.ts → postgres-DMj39MEu.d.cts} +1 -1
  240. package/dist/profiler/index.d.cts +9 -9
  241. package/dist/profiler/index.d.ts +9 -9
  242. package/dist/provenance/index.cjs +46 -46
  243. package/dist/provenance/index.cjs.map +1 -1
  244. package/dist/provenance/index.d.cts +7 -7
  245. package/dist/provenance/index.d.ts +7 -7
  246. package/dist/provenance/index.js +13 -13
  247. package/dist/provenance/index.js.map +1 -1
  248. package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
  249. package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
  250. package/dist/schema/index.cjs +45 -44
  251. package/dist/schema/index.d.cts +6 -6
  252. package/dist/schema/index.d.ts +6 -6
  253. package/dist/schema/index.js +18 -17
  254. package/dist/{searchable-BOUuA83f.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
  255. package/dist/{searchable-BrUh0pdc.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
  256. package/dist/{sqlite-BfYcV61E.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
  257. package/dist/{sqlite-DK40XVR1.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
  258. package/dist/{store-FTqBpuJD.d.cts → store-JUVvtmR4.d.cts} +228 -92
  259. package/dist/{store-Bo1psfVZ.d.ts → store-UzrGvZOo.d.ts} +228 -92
  260. package/dist/{temporal-DPtn0HOu.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
  261. package/dist/{temporal-CXewwLTB.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
  262. package/dist/{types-Du78EvpN.d.ts → types-BqFZTQmV.d.cts} +60 -9
  263. package/dist/{types-Du78EvpN.d.cts → types-BqFZTQmV.d.ts} +60 -9
  264. package/dist/{types-CeT7xM4M.d.ts → types-Bx74kaTt.d.ts} +1 -1
  265. package/dist/{types-XR1nHERK.d.cts → types-CXAhpW-c.d.cts} +1 -1
  266. package/dist/{where-CJsp-YUf.d.cts → where-DI_Fqz-X.d.cts} +1 -1
  267. package/dist/{where-CMbFiWwp.d.ts → where-O-k2wgYm.d.ts} +1 -1
  268. package/package.json +1 -1
  269. package/dist/chunk-32UETY6S.cjs.map +0 -1
  270. package/dist/chunk-5PDSCELM.cjs.map +0 -1
  271. package/dist/chunk-62ZXBMSD.js.map +0 -1
  272. package/dist/chunk-6LAXM4J2.cjs +0 -12
  273. package/dist/chunk-73MWKDFK.cjs +0 -12
  274. package/dist/chunk-A2LJG5GM.js.map +0 -1
  275. package/dist/chunk-A4R3H7RU.cjs.map +0 -1
  276. package/dist/chunk-ANKOXPCC.cjs +0 -267
  277. package/dist/chunk-ANKOXPCC.cjs.map +0 -1
  278. package/dist/chunk-AT3MLMJV.js.map +0 -1
  279. package/dist/chunk-BEB4OFZF.cjs.map +0 -1
  280. package/dist/chunk-BQM5P2NO.cjs.map +0 -1
  281. package/dist/chunk-C2ZP5YS6.cjs.map +0 -1
  282. package/dist/chunk-C6KE2HSQ.cjs.map +0 -1
  283. package/dist/chunk-DSAWGCMP.js +0 -254
  284. package/dist/chunk-DSAWGCMP.js.map +0 -1
  285. package/dist/chunk-E4OSGBCM.cjs.map +0 -1
  286. package/dist/chunk-EDHV4CBU.js.map +0 -1
  287. package/dist/chunk-FA6Z7B5L.js +0 -244
  288. package/dist/chunk-FA6Z7B5L.js.map +0 -1
  289. package/dist/chunk-GVAMRRZR.cjs +0 -268
  290. package/dist/chunk-GVAMRRZR.cjs.map +0 -1
  291. package/dist/chunk-GWXXHOLU.js.map +0 -1
  292. package/dist/chunk-HNYLMPQQ.cjs.map +0 -1
  293. package/dist/chunk-IHRDX7K6.js.map +0 -1
  294. package/dist/chunk-KCH7WQA5.cjs.map +0 -1
  295. package/dist/chunk-KXSMF6PL.js.map +0 -1
  296. package/dist/chunk-LHYSY6SE.js.map +0 -1
  297. package/dist/chunk-N3QTGPC7.cjs.map +0 -1
  298. package/dist/chunk-QPOQX2DI.cjs.map +0 -1
  299. package/dist/chunk-R7EWHKID.js.map +0 -1
  300. package/dist/chunk-RFDEYLIK.js.map +0 -1
  301. package/dist/chunk-RHDOAQCT.cjs.map +0 -1
  302. package/dist/chunk-S3G5VLSW.js.map +0 -1
  303. package/dist/chunk-S7WIRFNS.cjs.map +0 -1
  304. package/dist/chunk-UTVQPZPN.cjs.map +0 -1
  305. package/dist/chunk-WEJHA7AD.js.map +0 -1
  306. package/dist/chunk-WYFB7BN3.js.map +0 -1
  307. package/dist/chunk-YQ4JONWE.js.map +0 -1
  308. package/dist/chunk-Z43KWLZF.js.map +0 -1
  309. package/dist/ddl-mE07h_EM.d.cts +0 -38
  310. package/dist/ddl-opIn8DfX.d.ts +0 -38
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkRHDOAQCT_cjs = require('./chunk-RHDOAQCT.cjs');
4
- var chunkJL5UEBWT_cjs = require('./chunk-JL5UEBWT.cjs');
5
- var chunkBEB4OFZF_cjs = require('./chunk-BEB4OFZF.cjs');
6
- var chunkA7NMUYEL_cjs = require('./chunk-A7NMUYEL.cjs');
7
- var chunkDYPRZ53S_cjs = require('./chunk-DYPRZ53S.cjs');
8
- var chunkGVAMRRZR_cjs = require('./chunk-GVAMRRZR.cjs');
9
- var chunkANKOXPCC_cjs = require('./chunk-ANKOXPCC.cjs');
10
- var chunkZHOAZD7Q_cjs = require('./chunk-ZHOAZD7Q.cjs');
11
- var chunk2ZWM2RFH_cjs = require('./chunk-2ZWM2RFH.cjs');
12
- var chunkKCH7WQA5_cjs = require('./chunk-KCH7WQA5.cjs');
3
+ var chunkWCCATHMB_cjs = require('./chunk-WCCATHMB.cjs');
4
+ var chunkROR5ZR6A_cjs = require('./chunk-ROR5ZR6A.cjs');
5
+ var chunkFA2AFWLP_cjs = require('./chunk-FA2AFWLP.cjs');
6
+ var chunkHDL2ARHX_cjs = require('./chunk-HDL2ARHX.cjs');
7
+ var chunkWODMN3Q2_cjs = require('./chunk-WODMN3Q2.cjs');
8
+ var chunkSIT26LAZ_cjs = require('./chunk-SIT26LAZ.cjs');
9
+ var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.cjs');
10
+ var chunkL3LQNR34_cjs = require('./chunk-L3LQNR34.cjs');
11
+ var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
12
+ var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
13
13
  var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
14
14
  var drizzleOrm = require('drizzle-orm');
15
15
  var pgCore = require('drizzle-orm/pg-core');
@@ -53,7 +53,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
53
53
  var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
54
54
  var nextStatementId = 0;
55
55
  function statementNameFor(sqlText, cacheMax) {
56
- return chunkRHDOAQCT_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
56
+ return chunkWCCATHMB_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
57
57
  const name = `tg_${nextStatementId}`;
58
58
  nextStatementId += 1;
59
59
  return name;
@@ -167,7 +167,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
167
167
  options.useTransactionClient ?? false
168
168
  );
169
169
  function compile(query) {
170
- return chunkDYPRZ53S_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
170
+ return chunkWODMN3Q2_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
171
171
  }
172
172
  function assertCompiledWithinBindParameterLimit(compiledQuery) {
173
173
  assertWithinBindParameterLimit(
@@ -182,7 +182,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
182
182
  assertCompiledWithinBindParameterLimit(compile(query));
183
183
  return executeDrizzleQuery(
184
184
  db,
185
- chunk2ZWM2RFH_cjs.isSqlFragment(query) ? chunkDYPRZ53S_cjs.toDrizzleSql(query, "postgres") : query
185
+ chunkEDN4Y4ZG_cjs.isSqlFragment(query) ? chunkWODMN3Q2_cjs.toDrizzleSql(query, "postgres") : query
186
186
  );
187
187
  }
188
188
  };
@@ -201,7 +201,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
201
201
  async execute(query) {
202
202
  const compiled = compile(query);
203
203
  assertCompiledWithinBindParameterLimit(compiled);
204
- if (chunk2ZWM2RFH_cjs.isSqlFragment(query) && chunk2ZWM2RFH_cjs.shouldForceCustomPlan(query)) {
204
+ if (chunkEDN4Y4ZG_cjs.isSqlFragment(query) && chunkEDN4Y4ZG_cjs.shouldForceCustomPlan(query)) {
205
205
  const result = await pgQueryClient.queryUnnamed(
206
206
  compiled.sql,
207
207
  compiled.params
@@ -224,7 +224,7 @@ function assertWithinBindParameterLimit(parameterCount, maxBindParameters) {
224
224
  if (maxBindParameters === void 0 || parameterCount <= maxBindParameters) {
225
225
  return;
226
226
  }
227
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
227
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
228
228
  `PostgreSQL statement uses ${parameterCount} bound parameters, exceeding this backend's limit of ${maxBindParameters}.`,
229
229
  {
230
230
  capability: "maxBindParameters",
@@ -245,7 +245,7 @@ function createStatementQueue() {
245
245
  let closed = false;
246
246
  return {
247
247
  enqueue(task) {
248
- if (closed) return Promise.reject(new chunkKCH7WQA5_cjs.TransactionClosedError());
248
+ if (closed) return Promise.reject(new chunkMRDBBHIZ_cjs.TransactionClosedError());
249
249
  const result = tail.then(() => task());
250
250
  tail = result.then(ignoreOutcome, ignoreOutcome);
251
251
  return result;
@@ -310,11 +310,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
310
310
  ),
311
311
  embeddingUpsertBatchSize: Math.max(
312
312
  1,
313
- Math.floor(maxBindParameters / chunkRHDOAQCT_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
313
+ Math.floor(maxBindParameters / chunkWCCATHMB_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
314
314
  ),
315
315
  findEdgesEndpointChunkSize: Math.max(
316
316
  1,
317
- maxBindParameters - chunkRHDOAQCT_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
317
+ maxBindParameters - chunkWCCATHMB_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
318
318
  ),
319
319
  fulltextDeleteChunkSize: Math.max(
320
320
  1,
@@ -352,24 +352,134 @@ var IDENTITY_TABLE_LOGICAL_NAMES = /* @__PURE__ */ new Set([
352
352
  "identityClosure",
353
353
  "identitySeparation"
354
354
  ]);
355
- var toNodeRow = chunkBEB4OFZF_cjs.createNodeRowMapper(chunkBEB4OFZF_cjs.POSTGRES_ROW_MAPPER_CONFIG);
356
- var toEdgeRow = chunkBEB4OFZF_cjs.createEdgeRowMapper(chunkBEB4OFZF_cjs.POSTGRES_ROW_MAPPER_CONFIG);
357
- var toUniqueRow = chunkBEB4OFZF_cjs.createUniqueRowMapper(chunkBEB4OFZF_cjs.POSTGRES_ROW_MAPPER_CONFIG);
358
- var toSchemaVersionRow = chunkBEB4OFZF_cjs.createSchemaVersionRowMapper(
359
- chunkBEB4OFZF_cjs.POSTGRES_ROW_MAPPER_CONFIG
355
+ var TRIGRAM_EXTENSION_DDL_LOCK_KEY = "typegraph:pg-trgm-ddl";
356
+ var TRIGRAM_EXTENSION_DDL = "CREATE EXTENSION IF NOT EXISTS pg_trgm;";
357
+ function parallelWorkerResetSql(tableName) {
358
+ return `ALTER TABLE "${tableName.replaceAll('"', '""')}" RESET (parallel_workers);`;
359
+ }
360
+ function parallelWorkerResetError(tableName, resetError) {
361
+ return new Error(
362
+ `PostgreSQL did not restore the durable parallel_workers setting on vector table ${JSON.stringify(tableName)}. Run ${parallelWorkerResetSql(tableName)} before retrying index materialization.`,
363
+ { cause: resetError }
364
+ );
365
+ }
366
+ function vectorSerialFallbackPreparationError(step, parallelBuildError, preparationError) {
367
+ const action = step === "drop-index" ? "drop the partial vector index" : "disable parallel workers for the serial retry";
368
+ return new AggregateError(
369
+ [preparationError],
370
+ `PostgreSQL could not ${action} after the parallel vector index build exhausted resources.`,
371
+ { cause: parallelBuildError }
372
+ );
373
+ }
374
+ function reportParallelWorkerResetFailure(tableName, resetError) {
375
+ try {
376
+ if (typeof console === "undefined" || typeof console.error !== "function") {
377
+ return;
378
+ }
379
+ const reported = console.error(
380
+ `[typegraph] The serial vector index rebuild failed and cleanup also failed. ${parallelWorkerResetError(tableName, resetError).message}`,
381
+ resetError
382
+ );
383
+ void Promise.resolve(reported).catch(() => {
384
+ });
385
+ } catch {
386
+ }
387
+ }
388
+ async function resetVectorParallelWorkers(execute, tableName) {
389
+ try {
390
+ await execute(
391
+ chunkEDN4Y4ZG_cjs.sql`ALTER TABLE ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)} RESET (parallel_workers)`
392
+ );
393
+ } catch (resetError) {
394
+ throw parallelWorkerResetError(tableName, resetError);
395
+ }
396
+ }
397
+ async function runVectorIndexBuildWithSerialFallback(execute, tableName, indexStatement, dropStatement) {
398
+ await resetVectorParallelWorkers(execute, tableName);
399
+ try {
400
+ await execute(indexStatement);
401
+ } catch (error) {
402
+ if (!chunkSIT26LAZ_cjs.isInsufficientResourcesError(error)) throw error;
403
+ if (dropStatement !== void 0) {
404
+ try {
405
+ await execute(dropStatement);
406
+ } catch (dropError) {
407
+ throw vectorSerialFallbackPreparationError(
408
+ "drop-index",
409
+ error,
410
+ dropError
411
+ );
412
+ }
413
+ }
414
+ await runSerialVectorIndexBuild(
415
+ execute,
416
+ tableName,
417
+ indexStatement,
418
+ error
419
+ );
420
+ }
421
+ }
422
+ async function runPostgresVectorIndexBuild(vectorStrategy, execute, tableName, indexStatement, dropStatement) {
423
+ if (vectorStrategy !== chunkROR5ZR6A_cjs.pgvectorStrategy) {
424
+ await execute(indexStatement);
425
+ return;
426
+ }
427
+ await runVectorIndexBuildWithSerialFallback(
428
+ execute,
429
+ tableName,
430
+ indexStatement,
431
+ dropStatement
432
+ );
433
+ }
434
+ async function runSerialVectorIndexBuild(execute, tableName, indexStatement, parallelBuildError) {
435
+ const table = chunkEDN4Y4ZG_cjs.sql.identifier(tableName);
436
+ try {
437
+ await execute(chunkEDN4Y4ZG_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`);
438
+ } catch (setError) {
439
+ if (parallelBuildError === void 0) throw setError;
440
+ throw vectorSerialFallbackPreparationError(
441
+ "disable-parallel-workers",
442
+ parallelBuildError,
443
+ setError
444
+ );
445
+ }
446
+ let buildFailure;
447
+ try {
448
+ await execute(indexStatement);
449
+ } catch (error) {
450
+ buildFailure = { error };
451
+ }
452
+ try {
453
+ await execute(chunkEDN4Y4ZG_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`);
454
+ } catch (resetError) {
455
+ if (buildFailure === void 0) {
456
+ throw parallelWorkerResetError(tableName, resetError);
457
+ }
458
+ reportParallelWorkerResetFailure(tableName, resetError);
459
+ }
460
+ if (buildFailure !== void 0) throw buildFailure.error;
461
+ }
462
+ var toNodeRow = chunkFA2AFWLP_cjs.createNodeRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
463
+ var toEdgeRow = chunkFA2AFWLP_cjs.createEdgeRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
464
+ var toUniqueRow = chunkFA2AFWLP_cjs.createUniqueRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
465
+ var toSchemaVersionRow = chunkFA2AFWLP_cjs.createSchemaVersionRowMapper(
466
+ chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG
360
467
  );
361
468
  function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
362
469
  return {
363
- ...chunkANKOXPCC_cjs.POSTGRES_CAPABILITIES,
364
- ...vectorStrategy === void 0 ? {} : { vector: chunkZHOAZD7Q_cjs.buildVectorCapabilities(vectorStrategy) },
365
- fulltext: chunkZHOAZD7Q_cjs.buildFulltextCapabilities(fulltextStrategy)
470
+ ...chunk5PRKMB24_cjs.POSTGRES_CAPABILITIES,
471
+ ...vectorStrategy === void 0 ? {} : { vector: chunkL3LQNR34_cjs.buildVectorCapabilities(vectorStrategy) },
472
+ fulltext: chunkL3LQNR34_cjs.buildFulltextCapabilities(fulltextStrategy)
366
473
  };
367
474
  }
368
475
  function createPostgresBackend(db, options = {}) {
369
- const serializedClient = getSerializedPostgresClient(db);
370
- const tables2 = options.tables ?? chunkA7NMUYEL_cjs.tables;
371
- const fulltextStrategy = options.fulltext ?? chunkZHOAZD7Q_cjs.tsvectorStrategy;
372
- const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkJL5UEBWT_cjs.pgvectorStrategy;
476
+ const resourceAudit = chunkSIT26LAZ_cjs.resolveDeclaredBackendResource(
477
+ getSerializedPostgresClient(db),
478
+ options.serializedResource
479
+ );
480
+ const tables2 = options.tables ?? chunkHDL2ARHX_cjs.tables;
481
+ const fulltextStrategy = options.fulltext ?? chunkL3LQNR34_cjs.tsvectorStrategy;
482
+ const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkROR5ZR6A_cjs.pgvectorStrategy;
373
483
  const iterativeScanProbe = createIterativeScanProbe();
374
484
  const baseCapabilities = buildPostgresCapabilities(
375
485
  fulltextStrategy,
@@ -382,14 +492,14 @@ function createPostgresBackend(db, options = {}) {
382
492
  supported: false
383
493
  }
384
494
  } : {};
385
- const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunkANKOXPCC_cjs.POSTGRES_MAX_BIND_PARAMETERS;
495
+ const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS;
386
496
  const driverBindParameterOverrides = isPgliteDatabase(db) ? {
387
497
  maxBindParameters: Math.min(
388
498
  configuredMaxBindParameters,
389
499
  PGLITE_MAX_BIND_PARAMETERS
390
500
  )
391
501
  } : {};
392
- const declaredCapabilities = chunkANKOXPCC_cjs.normalizeGraphAnalyticsCapabilities({
502
+ const declaredCapabilities = chunk5PRKMB24_cjs.normalizeGraphAnalyticsCapabilities({
393
503
  ...baseCapabilities,
394
504
  ...httpOnlyOverrides,
395
505
  ...options.capabilities,
@@ -400,7 +510,7 @@ function createPostgresBackend(db, options = {}) {
400
510
  contributions: {
401
511
  supported: true,
402
512
  probe: true,
403
- rebuild: chunkRHDOAQCT_cjs.contributionRebuildSupported(
513
+ rebuild: chunkWCCATHMB_cjs.contributionRebuildSupported(
404
514
  fulltextStrategy,
405
515
  tables2.fulltextTableName,
406
516
  declaredCapabilities.transactions
@@ -410,7 +520,7 @@ function createPostgresBackend(db, options = {}) {
410
520
  const adapterOptions = {
411
521
  ...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
412
522
  ...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
413
- maxBindParameters: capabilities.maxBindParameters ?? chunkANKOXPCC_cjs.POSTGRES_MAX_BIND_PARAMETERS
523
+ maxBindParameters: capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS
414
524
  };
415
525
  const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
416
526
  const tableNames = {
@@ -433,8 +543,8 @@ function createPostgresBackend(db, options = {}) {
433
543
  drizzleOrm.getTableName(tables2.uniques),
434
544
  tableNames.fulltext
435
545
  ].map(
436
- (name) => chunkDYPRZ53S_cjs.toDrizzleSql(
437
- chunk2ZWM2RFH_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunk2ZWM2RFH_cjs.sql.identifier(name)}`,
546
+ (name) => chunkWODMN3Q2_cjs.toDrizzleSql(
547
+ chunkEDN4Y4ZG_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkEDN4Y4ZG_cjs.sql.identifier(name)}`,
438
548
  "postgres"
439
549
  )
440
550
  );
@@ -447,11 +557,11 @@ function createPostgresBackend(db, options = {}) {
447
557
  tableNames.identityClosure,
448
558
  tableNames.identitySeparation
449
559
  ];
450
- const operationStrategy = chunkRHDOAQCT_cjs.createPostgresOperationStrategy(
560
+ const operationStrategy = chunkWCCATHMB_cjs.createPostgresOperationStrategy(
451
561
  tables2,
452
562
  fulltextStrategy
453
563
  );
454
- const guardedTableExists = chunkRHDOAQCT_cjs.createCachedTableExistence(
564
+ const guardedTableExists = chunkWCCATHMB_cjs.createCachedTableExistence(
455
565
  async (tableName) => {
456
566
  const rows = await executionAdapter.execute(
457
567
  operationStrategy.buildTableExists(tableName)
@@ -466,24 +576,24 @@ function createPostgresBackend(db, options = {}) {
466
576
  try {
467
577
  await db.execute(statement);
468
578
  } catch (error) {
469
- if (!chunkGVAMRRZR_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
579
+ if (!chunkSIT26LAZ_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
470
580
  await db.execute(statement);
471
581
  }
472
582
  }
473
583
  async function ensureTableWithConcurrentCreateRetry(table) {
474
- await executeConcurrentCreateDdl(chunkA7NMUYEL_cjs.generatePgCreateTableSQL(table));
584
+ await executeConcurrentCreateDdl(chunkHDL2ARHX_cjs.generatePgCreateTableSQL(table));
475
585
  }
476
586
  async function ensureContributionMaterializationsTableImpl() {
477
587
  await ensureTableWithConcurrentCreateRetry(matTable);
478
588
  }
479
589
  function identityContributionsFor(identityTableNames) {
480
- const identityTables = chunkA7NMUYEL_cjs.createPostgresTables({
590
+ const identityTables = chunkHDL2ARHX_cjs.createPostgresTables({
481
591
  identityAssertions: identityTableNames.identityAssertions,
482
592
  recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
483
593
  identityClosure: identityTableNames.identityClosure,
484
594
  identitySeparation: identityTableNames.identitySeparation
485
595
  });
486
- return chunkA7NMUYEL_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
596
+ return chunkHDL2ARHX_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
487
597
  (contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
488
598
  );
489
599
  }
@@ -498,25 +608,25 @@ function createPostgresBackend(db, options = {}) {
498
608
  );
499
609
  const row = rows[0];
500
610
  if (row === void 0) return void 0;
501
- return chunkRHDOAQCT_cjs.mapContributionMaterializationRow(
611
+ return chunkWCCATHMB_cjs.mapContributionMaterializationRow(
502
612
  row,
503
- chunkRHDOAQCT_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
613
+ chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
504
614
  );
505
615
  }
506
616
  async function getContributionMaterializationRows(graphId) {
507
617
  const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
508
618
  return rows.map(
509
- (row) => chunkRHDOAQCT_cjs.mapContributionMaterializationRow(
619
+ (row) => chunkWCCATHMB_cjs.mapContributionMaterializationRow(
510
620
  row,
511
- chunkRHDOAQCT_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
621
+ chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
512
622
  )
513
623
  );
514
624
  }
515
625
  async function recordContributionMaterializationRow(params) {
516
626
  await db.insert(matTable).values(
517
- chunkRHDOAQCT_cjs.buildContributionInsertValues(
627
+ chunkWCCATHMB_cjs.buildContributionInsertValues(
518
628
  params,
519
- chunkRHDOAQCT_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
629
+ chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
520
630
  )
521
631
  ).onConflictDoUpdate({
522
632
  target: [
@@ -525,7 +635,7 @@ function createPostgresBackend(db, options = {}) {
525
635
  matTable.owner,
526
636
  matTable.tableName
527
637
  ],
528
- set: chunkRHDOAQCT_cjs.buildContributionOnConflictSet(
638
+ set: chunkWCCATHMB_cjs.buildContributionOnConflictSet(
529
639
  matTable.materializedAt,
530
640
  params.materializedAt
531
641
  )
@@ -545,9 +655,9 @@ function createPostgresBackend(db, options = {}) {
545
655
  const rows = await executionAdapter.execute(
546
656
  operationStrategy.buildTableExists(tableName)
547
657
  );
548
- return chunkRHDOAQCT_cjs.tableExistsFromRow(rows[0]);
658
+ return chunkWCCATHMB_cjs.tableExistsFromRow(rows[0]);
549
659
  }
550
- const contributionMaterializer = chunkRHDOAQCT_cjs.createContributionMaterializer({
660
+ const contributionMaterializer = chunkWCCATHMB_cjs.createContributionMaterializer({
551
661
  dialect: "postgres",
552
662
  fulltextStrategy,
553
663
  fulltextTableName: tables2.fulltextTableName,
@@ -588,7 +698,7 @@ function createPostgresBackend(db, options = {}) {
588
698
  });
589
699
  function runSchemaWriteTransaction(graphId, fn) {
590
700
  if (!capabilities.transactions) {
591
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
701
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
592
702
  "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.",
593
703
  {
594
704
  backend: "postgres",
@@ -639,7 +749,7 @@ function createPostgresBackend(db, options = {}) {
639
749
  schemaVersionsTable: tables2.schemaVersions
640
750
  });
641
751
  return {
642
- backend: chunkRHDOAQCT_cjs.gateFulltext(
752
+ backend: chunkWCCATHMB_cjs.gateFulltext(
643
753
  backend2,
644
754
  contributionMaterializer.assertInitialized,
645
755
  contributionMaterializer.refuseUnavailableFulltext
@@ -663,33 +773,33 @@ function createPostgresBackend(db, options = {}) {
663
773
  );
664
774
  const executeCompiled = trustedExecutionAdapter.executeCompiled;
665
775
  if (executeCompiled === void 0) {
666
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
776
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
667
777
  "Trusted import could not bind raw execution to the PostgreSQL transaction.",
668
778
  { capability: "trustedImport", dialect: "postgres" }
669
779
  );
670
780
  }
671
- const trustedTx = chunkANKOXPCC_cjs.createBackendOverlay(tx, {
781
+ const trustedTx = chunkSIT26LAZ_cjs.deriveBackend(tx, {
672
782
  executeRaw(sqlText, params) {
673
783
  return executeCompiled({ params, sql: sqlText });
674
784
  }
675
785
  });
676
- await chunkRHDOAQCT_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
677
- await chunkRHDOAQCT_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
678
- const indexDefinitions = await chunkRHDOAQCT_cjs.suspendPostgresSecondaryIndexes(
786
+ await chunkWCCATHMB_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
787
+ await chunkWCCATHMB_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
788
+ const indexDefinitions = await chunkWCCATHMB_cjs.suspendPostgresSecondaryIndexes(
679
789
  trustedTx,
680
790
  tableNames
681
791
  );
682
792
  const result = await fn(
683
- chunkRHDOAQCT_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
793
+ chunkWCCATHMB_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
684
794
  );
685
- await chunkRHDOAQCT_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
686
- await chunkRHDOAQCT_cjs.analyzeImportedTables(trustedTx, tableNames);
795
+ await chunkWCCATHMB_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
796
+ await chunkWCCATHMB_cjs.analyzeImportedTables(trustedTx, tableNames);
687
797
  return result;
688
798
  });
689
799
  }
690
800
  } : {},
691
801
  async bootstrapTables() {
692
- const statements = chunkA7NMUYEL_cjs.generatePostgresDDL(tables2, fulltextStrategy);
802
+ const statements = chunkHDL2ARHX_cjs.generatePostgresDDL(tables2, fulltextStrategy);
693
803
  for (const statement of statements) {
694
804
  await executeConcurrentCreateDdl(statement);
695
805
  }
@@ -724,7 +834,7 @@ function createPostgresBackend(db, options = {}) {
724
834
  // uninitialized database throws `StoreNotInitializedError` loudly
725
835
  // rather than self-healing on a read/write path (#135). Shared
726
836
  // verbatim with the tx-scoped gate via `gateFulltextMethods`.
727
- ...chunkRHDOAQCT_cjs.gateFulltextMethods(
837
+ ...chunkWCCATHMB_cjs.gateFulltextMethods(
728
838
  operations,
729
839
  contributionMaterializer.assertInitialized,
730
840
  contributionMaterializer.refuseUnavailableFulltext
@@ -742,6 +852,18 @@ function createPostgresBackend(db, options = {}) {
742
852
  `ALTER TABLE "${tableName}" ADD COLUMN IF NOT EXISTS "claim_token" text;`
743
853
  );
744
854
  },
855
+ async ensureTrigramExtension() {
856
+ if (!capabilities.transactions) {
857
+ await executeConcurrentCreateDdl(TRIGRAM_EXTENSION_DDL);
858
+ return;
859
+ }
860
+ await db.transaction(async (tx) => {
861
+ await tx.execute(
862
+ drizzleOrm.sql`SELECT pg_advisory_xact_lock(hashtext(${TRIGRAM_EXTENSION_DDL_LOCK_KEY}), 0)`
863
+ );
864
+ await tx.execute(drizzleOrm.sql.raw(TRIGRAM_EXTENSION_DDL));
865
+ });
866
+ },
745
867
  async claimIndexMaterialization(params) {
746
868
  const t = tables2.indexMaterializations;
747
869
  const rows = await db.execute(drizzleOrm.sql`
@@ -780,26 +902,26 @@ function createPostgresBackend(db, options = {}) {
780
902
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
781
903
  const row = rows[0];
782
904
  if (row === void 0) return void 0;
783
- return chunkRHDOAQCT_cjs.mapMaterializationRow(row, chunkRHDOAQCT_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
905
+ return chunkWCCATHMB_cjs.mapMaterializationRow(row, chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
784
906
  },
785
907
  async getIndexMaterializations(statusKeys) {
786
908
  if (statusKeys.length === 0) return [];
787
909
  const t = tables2.indexMaterializations;
788
910
  const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
789
911
  return rows.map(
790
- (row) => chunkRHDOAQCT_cjs.mapMaterializationRow(row, chunkRHDOAQCT_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
912
+ (row) => chunkWCCATHMB_cjs.mapMaterializationRow(row, chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
791
913
  );
792
914
  },
793
915
  async recordIndexMaterialization(params) {
794
916
  const t = tables2.indexMaterializations;
795
917
  await db.insert(t).values(
796
- chunkRHDOAQCT_cjs.buildMaterializationInsertValues(
918
+ chunkWCCATHMB_cjs.buildMaterializationInsertValues(
797
919
  params,
798
- chunkRHDOAQCT_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
920
+ chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
799
921
  )
800
922
  ).onConflictDoUpdate({
801
923
  target: t.indexName,
802
- set: chunkRHDOAQCT_cjs.buildMaterializationOnConflictSet(params.materializedAt)
924
+ set: chunkWCCATHMB_cjs.buildMaterializationOnConflictSet(params.materializedAt)
803
925
  });
804
926
  },
805
927
  async ensureContributionMaterializationsTable() {
@@ -821,26 +943,26 @@ function createPostgresBackend(db, options = {}) {
821
943
  const t = tables2.kindRemovals;
822
944
  const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
823
945
  return rows.map(
824
- (row) => chunkRHDOAQCT_cjs.mapKindRemovalRow(row, chunkRHDOAQCT_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
946
+ (row) => chunkWCCATHMB_cjs.mapKindRemovalRow(row, chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
825
947
  );
826
948
  },
827
949
  async getAllKindRemovals(graphId) {
828
950
  const t = tables2.kindRemovals;
829
951
  const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
830
952
  return rows.map(
831
- (row) => chunkRHDOAQCT_cjs.mapKindRemovalRow(row, chunkRHDOAQCT_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
953
+ (row) => chunkWCCATHMB_cjs.mapKindRemovalRow(row, chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
832
954
  );
833
955
  },
834
956
  async recordKindRemoval(params) {
835
957
  const t = tables2.kindRemovals;
836
958
  await db.insert(t).values(
837
- chunkRHDOAQCT_cjs.buildKindRemovalInsertValues(
959
+ chunkWCCATHMB_cjs.buildKindRemovalInsertValues(
838
960
  params,
839
- chunkRHDOAQCT_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
961
+ chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
840
962
  )
841
963
  ).onConflictDoUpdate({
842
964
  target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
843
- set: chunkRHDOAQCT_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
965
+ set: chunkWCCATHMB_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
844
966
  });
845
967
  },
846
968
  async ensureReconciliationMarkersTable() {
@@ -919,8 +1041,8 @@ function createPostgresBackend(db, options = {}) {
919
1041
  const presentGuardedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
920
1042
  for (const tableName of presentGuardedTables) {
921
1043
  await db.execute(
922
- chunkDYPRZ53S_cjs.toDrizzleSql(
923
- chunk2ZWM2RFH_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunk2ZWM2RFH_cjs.sql.identifier(tableName)}`,
1044
+ chunkWODMN3Q2_cjs.toDrizzleSql(
1045
+ chunkEDN4Y4ZG_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkEDN4Y4ZG_cjs.sql.identifier(tableName)}`,
924
1046
  "postgres"
925
1047
  )
926
1048
  );
@@ -935,7 +1057,7 @@ function createPostgresBackend(db, options = {}) {
935
1057
  async commitSchemaVersionIfKindsEmpty(params, probes) {
936
1058
  return runSchemaWriteTransaction(
937
1059
  params.graphId,
938
- (target) => chunkRHDOAQCT_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
1060
+ (target) => chunkWCCATHMB_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
939
1061
  );
940
1062
  },
941
1063
  async commitSchemaVersionWithPreflight(params, preflight) {
@@ -957,9 +1079,9 @@ function createPostgresBackend(db, options = {}) {
957
1079
  return backend.transactionWithNative((tx) => fn(tx), options2);
958
1080
  },
959
1081
  async transactionWithNative(fn, options2) {
960
- const temporaryWrites = options2?.temporaryWrites === chunkANKOXPCC_cjs.INTERNAL_TEMPORARY_WRITES;
1082
+ const temporaryWrites = options2?.temporaryWrites === chunk5PRKMB24_cjs.INTERNAL_TEMPORARY_WRITES;
961
1083
  if (temporaryWrites && options2.accessMode !== "read_only") {
962
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1084
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
963
1085
  "Temporary-write transactions must be semantically read-only.",
964
1086
  { dialect: "postgres" }
965
1087
  );
@@ -983,7 +1105,7 @@ function createPostgresBackend(db, options = {}) {
983
1105
  },
984
1106
  adoptTransaction(externalTx) {
985
1107
  if (!capabilities.transactions) {
986
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1108
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
987
1109
  "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.",
988
1110
  {
989
1111
  backend: "postgres",
@@ -992,7 +1114,7 @@ function createPostgresBackend(db, options = {}) {
992
1114
  }
993
1115
  );
994
1116
  }
995
- chunkRHDOAQCT_cjs.assertAdoptedDialect(
1117
+ chunkWCCATHMB_cjs.assertAdoptedDialect(
996
1118
  externalTx,
997
1119
  pgCore.PgTransaction,
998
1120
  "postgres"
@@ -1002,9 +1124,7 @@ function createPostgresBackend(db, options = {}) {
1002
1124
  async close() {
1003
1125
  }
1004
1126
  };
1005
- if (serializedClient !== void 0) {
1006
- chunkANKOXPCC_cjs.markSerializedTransactionResource(backend, serializedClient);
1007
- }
1127
+ chunkSIT26LAZ_cjs.auditBackendResource(backend, resourceAudit);
1008
1128
  return backend;
1009
1129
  }
1010
1130
  function getSerializedPostgresClient(db) {
@@ -1023,14 +1143,24 @@ function getSerializedPostgresClient(db) {
1023
1143
  function isSingleConnectionPgPool(candidate) {
1024
1144
  const options = candidate["options"];
1025
1145
  if (typeof options !== "object" || options === null) return false;
1026
- return options["max"] === 1;
1146
+ return isSingleConnectionPgPoolCap(
1147
+ options["max"]
1148
+ );
1149
+ }
1150
+ function isSingleConnectionPgPoolCap(value) {
1151
+ return value === 1 || typeof value === "string" && Number(value) === 1;
1027
1152
  }
1028
1153
  function isSingleConnectionCallablePgClient(client) {
1029
1154
  if (client === void 0 || client === null) return false;
1030
1155
  const options = client["options"];
1031
1156
  if (!isPostgresJsClient(client)) return false;
1032
1157
  if (typeof options !== "object" || options === null) return false;
1033
- return options["max"] === 1;
1158
+ return isSingleConnectionPostgresJsCap(
1159
+ options["max"]
1160
+ );
1161
+ }
1162
+ function isSingleConnectionPostgresJsCap(value) {
1163
+ return value === 1 || typeof value === "string" && Number(value) === 1;
1034
1164
  }
1035
1165
  function isBarePgClient(candidate) {
1036
1166
  if (candidate["options"] !== void 0 || candidate["totalCount"] !== void 0 || candidate["idleCount"] !== void 0 || candidate["waitingCount"] !== void 0) {
@@ -1101,10 +1231,10 @@ function createPostgresOperationBackend(options) {
1101
1231
  }
1102
1232
  async function vectorSearchGucOverrides(params) {
1103
1233
  const overrides = [];
1104
- const efSearchParameter = chunkZHOAZD7Q_cjs.resolveEfSearchOverride({
1234
+ const efSearchParameter = chunkL3LQNR34_cjs.resolveEfSearchOverride({
1105
1235
  efSearch: params.efSearch,
1106
1236
  indexType: params.indexType,
1107
- tuning: chunkZHOAZD7Q_cjs.vectorSearchFrontierTuning(vectorStrategy),
1237
+ tuning: chunkL3LQNR34_cjs.vectorSearchFrontierTuning(vectorStrategy),
1108
1238
  transactions: capabilities.transactions,
1109
1239
  dialect: "PostgreSQL",
1110
1240
  engine: vectorStrategy?.name ?? "this backend"
@@ -1129,7 +1259,7 @@ function createPostgresOperationBackend(options) {
1129
1259
  async function runVectorSearchGucGroup(overrides, query) {
1130
1260
  const runExclusive = executionAdapter.runExclusive;
1131
1261
  if (runExclusive === void 0) {
1132
- throw new chunkKCH7WQA5_cjs.CompilerInvariantError(
1262
+ throw new chunkMRDBBHIZ_cjs.CompilerInvariantError(
1133
1263
  "A transaction-scoped Postgres backend must expose runExclusive; its execution adapter was not wrapped by createSerialExecutionAdapter."
1134
1264
  );
1135
1265
  }
@@ -1173,17 +1303,17 @@ function createPostgresOperationBackend(options) {
1173
1303
  });
1174
1304
  }
1175
1305
  const batchConfig = computePostgresBatchChunkSizes(
1176
- capabilities.maxBindParameters ?? chunkANKOXPCC_cjs.POSTGRES_MAX_BIND_PARAMETERS
1306
+ capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS
1177
1307
  );
1178
- const commonBackend = chunkRHDOAQCT_cjs.createCommonOperationBackend({
1308
+ const commonOperationMembers = chunkWCCATHMB_cjs.createCommonOperationBackend({
1179
1309
  batchConfig,
1180
1310
  execution: {
1181
1311
  execAll,
1182
1312
  execGet,
1183
1313
  execRun
1184
1314
  },
1185
- nowIso: chunkBEB4OFZF_cjs.nowIso,
1186
- maxBindParameters: capabilities.maxBindParameters ?? chunkANKOXPCC_cjs.POSTGRES_MAX_BIND_PARAMETERS,
1315
+ nowIso: chunkFA2AFWLP_cjs.nowIso,
1316
+ maxBindParameters: capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS,
1187
1317
  operationStrategy,
1188
1318
  rowMappers: {
1189
1319
  toEdgeRow,
@@ -1201,28 +1331,28 @@ function createPostgresOperationBackend(options) {
1201
1331
  };
1202
1332
  const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
1203
1333
  async upsertEmbedding(params) {
1204
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromParams(params);
1334
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
1205
1335
  await contributionMaterializer.assertVectorSlot(slot);
1206
- const statements = vectorStrategy.buildUpsert(slot, params, chunkBEB4OFZF_cjs.nowIso());
1336
+ const statements = vectorStrategy.buildUpsert(slot, params, chunkFA2AFWLP_cjs.nowIso());
1207
1337
  try {
1208
1338
  for (const statement of statements) {
1209
1339
  await execRun(statement);
1210
1340
  }
1211
1341
  } catch (error) {
1212
- throw chunkRHDOAQCT_cjs.mapVectorWriteError(error, params);
1342
+ throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
1213
1343
  }
1214
1344
  },
1215
1345
  async upsertEmbeddingBatch(params) {
1216
1346
  if (params.rows.length === 0) return;
1217
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromParams(params);
1347
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
1218
1348
  await contributionMaterializer.assertVectorSlot(slot);
1219
1349
  const rowsById = new Map(
1220
1350
  params.rows.map((row) => [row.nodeId, row])
1221
1351
  );
1222
1352
  const rows = [...rowsById.values()];
1223
- const timestamp = chunkBEB4OFZF_cjs.nowIso();
1353
+ const timestamp = chunkFA2AFWLP_cjs.nowIso();
1224
1354
  try {
1225
- for (const chunk2 of chunkGVAMRRZR_cjs.chunk(
1355
+ for (const chunk2 of chunkSIT26LAZ_cjs.chunk(
1226
1356
  rows,
1227
1357
  batchConfig.embeddingUpsertBatchSize
1228
1358
  )) {
@@ -1251,11 +1381,11 @@ function createPostgresOperationBackend(options) {
1251
1381
  }
1252
1382
  }
1253
1383
  } catch (error) {
1254
- throw chunkRHDOAQCT_cjs.mapVectorWriteError(error, params);
1384
+ throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
1255
1385
  }
1256
1386
  },
1257
1387
  async deleteEmbedding(params) {
1258
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromParams(params);
1388
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
1259
1389
  await contributionMaterializer.assertVectorSlot(slot);
1260
1390
  const statements = vectorStrategy.buildDelete(slot, params);
1261
1391
  for (const statement of statements) {
@@ -1264,9 +1394,9 @@ function createPostgresOperationBackend(options) {
1264
1394
  },
1265
1395
  async deleteEmbeddingBatch(params) {
1266
1396
  if (params.nodeIds.length === 0) return;
1267
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromParams(params);
1397
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
1268
1398
  await contributionMaterializer.assertVectorSlot(slot);
1269
- for (const nodeIds of chunkGVAMRRZR_cjs.chunk(
1399
+ for (const nodeIds of chunkSIT26LAZ_cjs.chunk(
1270
1400
  [...new Set(params.nodeIds)],
1271
1401
  batchConfig.embeddingUpsertBatchSize
1272
1402
  )) {
@@ -1278,19 +1408,19 @@ function createPostgresOperationBackend(options) {
1278
1408
  }
1279
1409
  },
1280
1410
  async vectorSearch(params) {
1281
- chunkZHOAZD7Q_cjs.assertVectorSearchLimit(params.limit);
1282
- chunkJL5UEBWT_cjs.assertPgvectorEfSearch(params.efSearch);
1283
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromParams(params);
1411
+ chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
1412
+ chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.efSearch);
1413
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
1284
1414
  const query = vectorStrategy.buildSearch(
1285
1415
  slot,
1286
1416
  params,
1287
1417
  // Store-compiled candidates (predicates + subclass + currency)
1288
1418
  // take precedence; the live-node default covers direct backend use.
1289
- params.candidates ?? chunkRHDOAQCT_cjs.buildLiveNodeCandidates(
1419
+ params.candidates ?? chunkWCCATHMB_cjs.buildLiveNodeCandidates(
1290
1420
  tableNames.nodes,
1291
1421
  params.graphId,
1292
1422
  params.nodeKind,
1293
- chunkBEB4OFZF_cjs.nowIso()
1423
+ chunkFA2AFWLP_cjs.nowIso()
1294
1424
  )
1295
1425
  );
1296
1426
  const gucOverrides = await vectorSearchGucOverrides(params);
@@ -1298,7 +1428,7 @@ function createPostgresOperationBackend(options) {
1298
1428
  try {
1299
1429
  rows = await runVectorSearch(gucOverrides, query);
1300
1430
  } catch (error) {
1301
- throw chunkRHDOAQCT_cjs.mapVectorWriteError(error, params);
1431
+ throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
1302
1432
  }
1303
1433
  return rows.map((row) => ({
1304
1434
  nodeId: row.node_id,
@@ -1310,10 +1440,10 @@ function createPostgresOperationBackend(options) {
1310
1440
  // multi-statement fallback by simply not exposing the member.
1311
1441
  ...capabilities.windowFunctions ? {
1312
1442
  async hybridSearch(params) {
1313
- chunkZHOAZD7Q_cjs.assertVectorSearchLimit(params.limit);
1314
- chunkZHOAZD7Q_cjs.assertVectorSearchLimit(params.vector.k);
1315
- chunkJL5UEBWT_cjs.assertPgvectorEfSearch(params.vector.efSearch);
1316
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromParams({
1443
+ chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
1444
+ chunkL3LQNR34_cjs.assertVectorSearchLimit(params.vector.k);
1445
+ chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.vector.efSearch);
1446
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromParams({
1317
1447
  graphId: params.graphId,
1318
1448
  nodeKind: params.nodeKind,
1319
1449
  fieldPath: params.vector.fieldPath,
@@ -1321,11 +1451,11 @@ function createPostgresOperationBackend(options) {
1321
1451
  metric: params.vector.metric,
1322
1452
  indexType: params.vector.indexType
1323
1453
  });
1324
- const candidates = params.candidates ?? chunkRHDOAQCT_cjs.buildLiveNodeCandidates(
1454
+ const candidates = params.candidates ?? chunkWCCATHMB_cjs.buildLiveNodeCandidates(
1325
1455
  tableNames.nodes,
1326
1456
  params.graphId,
1327
1457
  params.nodeKind,
1328
- chunkBEB4OFZF_cjs.nowIso()
1458
+ chunkFA2AFWLP_cjs.nowIso()
1329
1459
  );
1330
1460
  const vectorParams = {
1331
1461
  graphId: params.graphId,
@@ -1341,11 +1471,11 @@ function createPostgresOperationBackend(options) {
1341
1471
  const vectorSql = vectorStrategy.buildSearch(
1342
1472
  slot,
1343
1473
  vectorParams,
1344
- chunk2ZWM2RFH_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
1474
+ chunkEDN4Y4ZG_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
1345
1475
  );
1346
1476
  const statement = operationStrategy.buildHybridSearch(
1347
1477
  { ...params, candidates },
1348
- chunkDYPRZ53S_cjs.toDrizzleSql(vectorSql, "postgres"),
1478
+ chunkWODMN3Q2_cjs.toDrizzleSql(vectorSql, "postgres"),
1349
1479
  params.vector.metric === "cosine"
1350
1480
  );
1351
1481
  const gucOverrides = await vectorSearchGucOverrides({
@@ -1359,9 +1489,9 @@ function createPostgresOperationBackend(options) {
1359
1489
  statement
1360
1490
  );
1361
1491
  } catch (error) {
1362
- throw chunkRHDOAQCT_cjs.mapVectorWriteError(error, vectorParams);
1492
+ throw chunkWCCATHMB_cjs.mapVectorWriteError(error, vectorParams);
1363
1493
  }
1364
- return raw.map((row) => chunkRHDOAQCT_cjs.mapHybridSearchRow(row, toNodeRow));
1494
+ return raw.map((row) => chunkWCCATHMB_cjs.mapHybridSearchRow(row, toNodeRow));
1365
1495
  }
1366
1496
  } : {}
1367
1497
  };
@@ -1376,7 +1506,7 @@ function createPostgresOperationBackend(options) {
1376
1506
  return active?.version;
1377
1507
  }
1378
1508
  const operationBackend = {
1379
- ...commonBackend,
1509
+ ...commonOperationMembers,
1380
1510
  ...executeRawMethod,
1381
1511
  ...vectorEmbeddingMethods,
1382
1512
  /**
@@ -1416,7 +1546,7 @@ function createPostgresOperationBackend(options) {
1416
1546
  tableNames,
1417
1547
  async lockSchemaVersionForWrite(params) {
1418
1548
  if (!transactionScoped) {
1419
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1549
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1420
1550
  "The schema write fence requires an explicit PostgreSQL transaction.",
1421
1551
  {
1422
1552
  code: "SCHEMA_WRITE_FENCE_TRANSACTION_REQUIRED",
@@ -1426,15 +1556,17 @@ function createPostgresOperationBackend(options) {
1426
1556
  }
1427
1557
  const locked = await lockActiveSchemaVersion(params.graphId);
1428
1558
  if (locked !== void 0) {
1429
- chunkRHDOAQCT_cjs.assertActiveSchemaVersion(
1559
+ chunkWCCATHMB_cjs.assertActiveSchemaVersion(
1430
1560
  params.graphId,
1431
1561
  params.expectedVersion,
1432
1562
  locked
1433
1563
  );
1434
1564
  return;
1435
1565
  }
1436
- const settled = await commonBackend.getActiveSchema(params.graphId);
1437
- throw new chunkKCH7WQA5_cjs.StaleVersionError({
1566
+ const settled = await commonOperationMembers.getActiveSchema(
1567
+ params.graphId
1568
+ );
1569
+ throw new chunkMRDBBHIZ_cjs.StaleVersionError({
1438
1570
  graphId: params.graphId,
1439
1571
  expected: params.expectedVersion,
1440
1572
  actual: settled?.version ?? 0
@@ -1443,43 +1575,29 @@ function createPostgresOperationBackend(options) {
1443
1575
  // === Vector Index Operations ===
1444
1576
  async createVectorIndex(params) {
1445
1577
  if (vectorStrategy === void 0) return;
1446
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromCreateIndexParams(params);
1578
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromCreateIndexParams(params);
1447
1579
  await contributionMaterializer.ensureVectorSlot(slot);
1448
1580
  const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
1449
1581
  concurrent: params.concurrent === true
1450
1582
  });
1451
1583
  if (indexStatement !== void 0) {
1452
- try {
1453
- await execRun(indexStatement);
1454
- } catch (error) {
1455
- if (!chunkGVAMRRZR_cjs.isInsufficientResourcesError(error)) throw error;
1456
- const dropStatement = vectorStrategy.buildDropIndex?.(slot);
1457
- if (dropStatement !== void 0) {
1458
- await execRun(dropStatement);
1459
- }
1460
- const table = chunk2ZWM2RFH_cjs.sql.identifier(
1461
- vectorStrategy.tableName(
1462
- slot.graphId,
1463
- slot.nodeKind,
1464
- slot.fieldPath
1465
- )
1466
- );
1467
- await execRun(
1468
- chunk2ZWM2RFH_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`
1469
- );
1470
- try {
1471
- await execRun(indexStatement);
1472
- } finally {
1473
- await execRun(
1474
- chunk2ZWM2RFH_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`
1475
- );
1476
- }
1477
- }
1584
+ const strategyTableName = vectorStrategy.tableName(
1585
+ slot.graphId,
1586
+ slot.nodeKind,
1587
+ slot.fieldPath
1588
+ );
1589
+ await runPostgresVectorIndexBuild(
1590
+ vectorStrategy,
1591
+ execRun,
1592
+ strategyTableName,
1593
+ indexStatement,
1594
+ vectorStrategy.buildDropIndex?.(slot)
1595
+ );
1478
1596
  }
1479
1597
  },
1480
1598
  // === Fulltext Operations ===
1481
1599
  async upsertFulltext(params) {
1482
- const timestamp = chunkBEB4OFZF_cjs.nowIso();
1600
+ const timestamp = chunkFA2AFWLP_cjs.nowIso();
1483
1601
  const statements = operationStrategy.buildUpsertFulltext(
1484
1602
  params,
1485
1603
  timestamp
@@ -1496,8 +1614,8 @@ function createPostgresOperationBackend(options) {
1496
1614
  },
1497
1615
  async upsertFulltextBatch(params) {
1498
1616
  if (params.rows.length === 0) return;
1499
- const timestamp = chunkBEB4OFZF_cjs.nowIso();
1500
- for (const rows of chunkGVAMRRZR_cjs.chunk(
1617
+ const timestamp = chunkFA2AFWLP_cjs.nowIso();
1618
+ for (const rows of chunkSIT26LAZ_cjs.chunk(
1501
1619
  params.rows,
1502
1620
  batchConfig.fulltextUpsertBatchSize
1503
1621
  )) {
@@ -1512,7 +1630,7 @@ function createPostgresOperationBackend(options) {
1512
1630
  },
1513
1631
  async deleteFulltextBatch(params) {
1514
1632
  if (params.nodeIds.length === 0) return;
1515
- for (const nodeIds of chunkGVAMRRZR_cjs.chunk(
1633
+ for (const nodeIds of chunkSIT26LAZ_cjs.chunk(
1516
1634
  params.nodeIds,
1517
1635
  batchConfig.fulltextDeleteChunkSize
1518
1636
  )) {
@@ -1530,25 +1648,25 @@ function createPostgresOperationBackend(options) {
1530
1648
  const rows = await execAll(query);
1531
1649
  return rows.map((row, index) => ({
1532
1650
  nodeId: row.node_id,
1533
- score: chunkBEB4OFZF_cjs.coerceNumericScore(row.score),
1651
+ score: chunkFA2AFWLP_cjs.coerceNumericScore(row.score),
1534
1652
  rank: index + 1,
1535
1653
  ...row.snippet === null ? {} : { snippet: row.snippet }
1536
1654
  }));
1537
1655
  },
1538
1656
  async dropVectorIndex(params) {
1539
1657
  if (vectorStrategy === void 0) return;
1540
- const slot = chunkRHDOAQCT_cjs.vectorSlotFromDropIndexParams(params);
1658
+ const slot = chunkWCCATHMB_cjs.vectorSlotFromDropIndexParams(params);
1541
1659
  const dropStatement = vectorStrategy.buildDropIndex?.(slot);
1542
1660
  if (dropStatement === void 0) return;
1543
1661
  try {
1544
1662
  await execRun(dropStatement);
1545
1663
  } catch (error) {
1546
- if (!chunkGVAMRRZR_cjs.isMissingTableError(error)) throw error;
1664
+ if (!chunkSIT26LAZ_cjs.isMissingTableError(error)) throw error;
1547
1665
  }
1548
1666
  },
1549
1667
  // === Query Execution ===
1550
1668
  async execute(query) {
1551
- const annTypes = chunk2ZWM2RFH_cjs.isSqlFragment(query) ? chunk2ZWM2RFH_cjs.annIndexScanTypes(query) : void 0;
1669
+ const annTypes = chunkEDN4Y4ZG_cjs.isSqlFragment(query) ? chunkEDN4Y4ZG_cjs.annIndexScanTypes(query) : void 0;
1552
1670
  if (annTypes !== void 0 && vectorStrategy !== void 0) {
1553
1671
  const overrides = [];
1554
1672
  for (const indexType of annTypes) {
@@ -1589,5 +1707,5 @@ function createTransactionBackend(options) {
1589
1707
  }
1590
1708
 
1591
1709
  exports.createPostgresBackend = createPostgresBackend;
1592
- //# sourceMappingURL=chunk-C2ZP5YS6.cjs.map
1593
- //# sourceMappingURL=chunk-C2ZP5YS6.cjs.map
1710
+ //# sourceMappingURL=chunk-PFBRJBUL.cjs.map
1711
+ //# sourceMappingURL=chunk-PFBRJBUL.cjs.map