@nicia-ai/typegraph 0.37.0 → 0.38.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 (372) hide show
  1. package/README.md +12 -10
  2. package/dist/backend/drizzle/indexes.cjs +32 -0
  3. package/dist/backend/drizzle/indexes.cjs.map +1 -0
  4. package/dist/backend/drizzle/indexes.d.cts +43 -0
  5. package/dist/backend/drizzle/indexes.d.ts +43 -0
  6. package/dist/backend/drizzle/indexes.js +11 -0
  7. package/dist/backend/drizzle/indexes.js.map +1 -0
  8. package/dist/backend/index.cjs +161 -0
  9. package/dist/backend/index.cjs.map +1 -0
  10. package/dist/backend/index.d.cts +3 -0
  11. package/dist/backend/index.d.ts +3 -0
  12. package/dist/backend/index.js +8 -0
  13. package/dist/backend/index.js.map +1 -0
  14. package/dist/backend/postgres/index.cjs +32 -28
  15. package/dist/backend/postgres/index.d.cts +13 -12
  16. package/dist/backend/postgres/index.d.ts +13 -12
  17. package/dist/backend/postgres/index.js +19 -15
  18. package/dist/backend/postgres/pglite-store.cjs +67 -0
  19. package/dist/backend/postgres/pglite-store.cjs.map +1 -0
  20. package/dist/backend/postgres/pglite-store.d.cts +38 -0
  21. package/dist/backend/postgres/pglite-store.d.ts +38 -0
  22. package/dist/backend/postgres/pglite-store.js +65 -0
  23. package/dist/backend/postgres/pglite-store.js.map +1 -0
  24. package/dist/backend/postgres/pglite.cjs +25 -50
  25. package/dist/backend/postgres/pglite.cjs.map +1 -1
  26. package/dist/backend/postgres/pglite.d.cts +10 -9
  27. package/dist/backend/postgres/pglite.d.ts +10 -9
  28. package/dist/backend/postgres/pglite.js +20 -52
  29. package/dist/backend/postgres/pglite.js.map +1 -1
  30. package/dist/backend/sqlite/index.cjs +29 -25
  31. package/dist/backend/sqlite/index.d.cts +11 -11
  32. package/dist/backend/sqlite/index.d.ts +11 -11
  33. package/dist/backend/sqlite/index.js +17 -13
  34. package/dist/backend/sqlite/libsql.cjs +23 -19
  35. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  36. package/dist/backend/sqlite/libsql.d.cts +9 -10
  37. package/dist/backend/sqlite/libsql.d.ts +9 -10
  38. package/dist/backend/sqlite/libsql.js +19 -15
  39. package/dist/backend/sqlite/libsql.js.map +1 -1
  40. package/dist/backend/sqlite/local-store.cjs +72 -0
  41. package/dist/backend/sqlite/local-store.cjs.map +1 -0
  42. package/dist/backend/sqlite/local-store.d.cts +42 -0
  43. package/dist/backend/sqlite/local-store.d.ts +42 -0
  44. package/dist/backend/sqlite/local-store.js +67 -0
  45. package/dist/backend/sqlite/local-store.js.map +1 -0
  46. package/dist/backend/sqlite/local.cjs +28 -183
  47. package/dist/backend/sqlite/local.cjs.map +1 -1
  48. package/dist/backend/sqlite/local.d.cts +8 -81
  49. package/dist/backend/sqlite/local.d.ts +8 -81
  50. package/dist/backend/sqlite/local.js +20 -180
  51. package/dist/backend/sqlite/local.js.map +1 -1
  52. package/dist/chunk-2EBMPJBO.js +16 -0
  53. package/dist/chunk-2EBMPJBO.js.map +1 -0
  54. package/dist/{chunk-NBP2WTJW.cjs → chunk-2SL7OGPR.cjs} +2900 -1597
  55. package/dist/chunk-2SL7OGPR.cjs.map +1 -0
  56. package/dist/chunk-35S6P5ZU.js +27 -0
  57. package/dist/chunk-35S6P5ZU.js.map +1 -0
  58. package/dist/chunk-3LKL3S6X.js +50 -0
  59. package/dist/chunk-3LKL3S6X.js.map +1 -0
  60. package/dist/chunk-6G5CQ6JX.js +47 -0
  61. package/dist/chunk-6G5CQ6JX.js.map +1 -0
  62. package/dist/chunk-6XDBRDZE.js +312 -0
  63. package/dist/chunk-6XDBRDZE.js.map +1 -0
  64. package/dist/chunk-764JHTLT.cjs +15 -0
  65. package/dist/chunk-764JHTLT.cjs.map +1 -0
  66. package/dist/chunk-76HE7DJP.js +68 -0
  67. package/dist/chunk-76HE7DJP.js.map +1 -0
  68. package/dist/{chunk-VGDDG3XJ.cjs → chunk-7M3NACL3.cjs} +12 -12
  69. package/dist/{chunk-VGDDG3XJ.cjs.map → chunk-7M3NACL3.cjs.map} +1 -1
  70. package/dist/{chunk-NXQFATMF.cjs → chunk-7VLCN3JB.cjs} +153 -123
  71. package/dist/chunk-7VLCN3JB.cjs.map +1 -0
  72. package/dist/{chunk-552KNYQJ.js → chunk-A2FGSWMQ.js} +1907 -607
  73. package/dist/chunk-A2FGSWMQ.js.map +1 -0
  74. package/dist/chunk-AOL64O4Z.js +165 -0
  75. package/dist/chunk-AOL64O4Z.js.map +1 -0
  76. package/dist/{chunk-27SSDCEP.cjs → chunk-B63IFHXR.cjs} +53 -74
  77. package/dist/chunk-B63IFHXR.cjs.map +1 -0
  78. package/dist/{chunk-3XXGYU62.cjs → chunk-BKAKAVRW.cjs} +56 -53
  79. package/dist/chunk-BKAKAVRW.cjs.map +1 -0
  80. package/dist/{chunk-YTSN73ND.js → chunk-BQITNFQJ.js} +3 -3
  81. package/dist/{chunk-YTSN73ND.js.map → chunk-BQITNFQJ.js.map} +1 -1
  82. package/dist/{chunk-NUIG3BCV.cjs → chunk-CQC6VBAF.cjs} +93 -155
  83. package/dist/chunk-CQC6VBAF.cjs.map +1 -0
  84. package/dist/{chunk-6EEO3OVU.cjs → chunk-CWX77JB4.cjs} +22 -59
  85. package/dist/chunk-CWX77JB4.cjs.map +1 -0
  86. package/dist/{chunk-UGZUAYAR.js → chunk-D7PG5D5K.js} +4 -3
  87. package/dist/chunk-D7PG5D5K.js.map +1 -0
  88. package/dist/chunk-DDCIXXOO.js +9 -0
  89. package/dist/chunk-DDCIXXOO.js.map +1 -0
  90. package/dist/chunk-DDCYVIVV.cjs +44 -0
  91. package/dist/chunk-DDCYVIVV.cjs.map +1 -0
  92. package/dist/{chunk-XPCZADMT.cjs → chunk-DOVMTPKE.cjs} +89 -27
  93. package/dist/chunk-DOVMTPKE.cjs.map +1 -0
  94. package/dist/{chunk-5PNMDJ7J.js → chunk-DPNA466P.js} +14 -9
  95. package/dist/chunk-DPNA466P.js.map +1 -0
  96. package/dist/{chunk-BYPOGQWK.js → chunk-DRACN6XG.js} +6 -4
  97. package/dist/chunk-DRACN6XG.js.map +1 -0
  98. package/dist/chunk-E6TXEISH.cjs +175 -0
  99. package/dist/chunk-E6TXEISH.cjs.map +1 -0
  100. package/dist/{chunk-TKT2XHED.js → chunk-E6YZRKMM.js} +13 -12
  101. package/dist/chunk-E6YZRKMM.js.map +1 -0
  102. package/dist/{chunk-3C2RYI6L.cjs → chunk-EOJFGECD.cjs} +11 -11
  103. package/dist/chunk-EOJFGECD.cjs.map +1 -0
  104. package/dist/{chunk-XWV4JT34.js → chunk-ERZ4QPQX.js} +27 -22
  105. package/dist/chunk-ERZ4QPQX.js.map +1 -0
  106. package/dist/{chunk-DFVLCOP6.js → chunk-EZH7FNUS.js} +3 -3
  107. package/dist/{chunk-DFVLCOP6.js.map → chunk-EZH7FNUS.js.map} +1 -1
  108. package/dist/{chunk-WWFHO375.cjs → chunk-FJMPR3OH.cjs} +4 -3
  109. package/dist/chunk-FJMPR3OH.cjs.map +1 -0
  110. package/dist/chunk-FMNUSGZ4.cjs +12 -0
  111. package/dist/chunk-FMNUSGZ4.cjs.map +1 -0
  112. package/dist/{chunk-K3Q3LJY3.js → chunk-G32AO634.js} +201 -100
  113. package/dist/chunk-G32AO634.js.map +1 -0
  114. package/dist/{chunk-EXU3RASM.js → chunk-G3CSQLLT.js} +20 -474
  115. package/dist/chunk-G3CSQLLT.js.map +1 -0
  116. package/dist/chunk-GNPGGLAE.cjs +212 -0
  117. package/dist/chunk-GNPGGLAE.cjs.map +1 -0
  118. package/dist/{chunk-QARBLBXT.cjs → chunk-GUUWKPTK.cjs} +7 -7
  119. package/dist/{chunk-QARBLBXT.cjs.map → chunk-GUUWKPTK.cjs.map} +1 -1
  120. package/dist/chunk-GYA4JRP5.js +31 -0
  121. package/dist/chunk-GYA4JRP5.js.map +1 -0
  122. package/dist/chunk-I6FX7AAG.js +39 -0
  123. package/dist/chunk-I6FX7AAG.js.map +1 -0
  124. package/dist/chunk-IMQKXL4E.cjs +12 -0
  125. package/dist/{chunk-QSXTWU4U.cjs.map → chunk-IMQKXL4E.cjs.map} +1 -1
  126. package/dist/chunk-J6IJARLG.js +94 -0
  127. package/dist/chunk-J6IJARLG.js.map +1 -0
  128. package/dist/{chunk-W63OVYY4.js → chunk-K34OPSJK.js} +3 -3
  129. package/dist/{chunk-W63OVYY4.js.map → chunk-K34OPSJK.js.map} +1 -1
  130. package/dist/{chunk-TGOMW4MB.cjs → chunk-KCLZHYPU.cjs} +110 -109
  131. package/dist/chunk-KCLZHYPU.cjs.map +1 -0
  132. package/dist/{chunk-XGPUQ56G.js → chunk-KFLXWVUJ.js} +4 -38
  133. package/dist/chunk-KFLXWVUJ.js.map +1 -0
  134. package/dist/{chunk-3DS7Z4T4.cjs → chunk-LZ3TVJY4.cjs} +44 -43
  135. package/dist/chunk-LZ3TVJY4.cjs.map +1 -0
  136. package/dist/{chunk-UXLSNRYL.js → chunk-MTNEGGM2.js} +4 -4
  137. package/dist/chunk-MTNEGGM2.js.map +1 -0
  138. package/dist/{chunk-IP3CGGPA.cjs → chunk-N2V3HJFV.cjs} +92 -185
  139. package/dist/chunk-N2V3HJFV.cjs.map +1 -0
  140. package/dist/chunk-NAUA4PW5.cjs +28 -0
  141. package/dist/chunk-NAUA4PW5.cjs.map +1 -0
  142. package/dist/chunk-NMQ6C6TS.cjs +61 -0
  143. package/dist/chunk-NMQ6C6TS.cjs.map +1 -0
  144. package/dist/{chunk-2N6EOBTH.cjs → chunk-NPWACFQJ.cjs} +58 -53
  145. package/dist/chunk-NPWACFQJ.cjs.map +1 -0
  146. package/dist/{chunk-5KEQ74YU.cjs → chunk-NT6ILURI.cjs} +9 -86
  147. package/dist/chunk-NT6ILURI.cjs.map +1 -0
  148. package/dist/chunk-NU23DUSJ.cjs +192 -0
  149. package/dist/chunk-NU23DUSJ.cjs.map +1 -0
  150. package/dist/{chunk-WOJMKB3N.cjs → chunk-NWYCOFEZ.cjs} +1677 -308
  151. package/dist/chunk-NWYCOFEZ.cjs.map +1 -0
  152. package/dist/{chunk-3GH67G4Z.cjs → chunk-O5H62ZWJ.cjs} +4 -42
  153. package/dist/chunk-O5H62ZWJ.cjs.map +1 -0
  154. package/dist/{chunk-3SLPDKHQ.js → chunk-PH4IJ3V5.js} +5 -77
  155. package/dist/chunk-PH4IJ3V5.js.map +1 -0
  156. package/dist/chunk-PWXGB77L.cjs +56 -0
  157. package/dist/chunk-PWXGB77L.cjs.map +1 -0
  158. package/dist/chunk-PZHC5GCD.js +193 -0
  159. package/dist/chunk-PZHC5GCD.js.map +1 -0
  160. package/dist/chunk-QMQLUA66.js +12 -0
  161. package/dist/chunk-QMQLUA66.js.map +1 -0
  162. package/dist/{chunk-5WWVZMVX.js → chunk-QZ7A6HBM.js} +2 -2
  163. package/dist/{chunk-5WWVZMVX.js.map → chunk-QZ7A6HBM.js.map} +1 -1
  164. package/dist/{chunk-VKGKDOKR.js → chunk-RQPRCEIO.js} +1539 -206
  165. package/dist/chunk-RQPRCEIO.js.map +1 -0
  166. package/dist/chunk-RW24SAHI.cjs +74 -0
  167. package/dist/chunk-RW24SAHI.cjs.map +1 -0
  168. package/dist/{chunk-BVRDGYXQ.cjs → chunk-SAFZ6JTI.cjs} +14 -9
  169. package/dist/chunk-SAFZ6JTI.cjs.map +1 -0
  170. package/dist/{chunk-L7HQ2OSI.js → chunk-SCTZRFW5.js} +87 -166
  171. package/dist/chunk-SCTZRFW5.js.map +1 -0
  172. package/dist/{chunk-5KPNWT6X.js → chunk-SDHV2MWU.js} +24 -45
  173. package/dist/chunk-SDHV2MWU.js.map +1 -0
  174. package/dist/chunk-SVJ5GEXW.cjs +45 -0
  175. package/dist/chunk-SVJ5GEXW.cjs.map +1 -0
  176. package/dist/chunk-SVUKGWSN.cjs +102 -0
  177. package/dist/chunk-SVUKGWSN.cjs.map +1 -0
  178. package/dist/chunk-TAUGGLNQ.js +59 -0
  179. package/dist/chunk-TAUGGLNQ.js.map +1 -0
  180. package/dist/{chunk-J4IUSYFF.js → chunk-TE5ZA4VX.js} +69 -27
  181. package/dist/chunk-TE5ZA4VX.js.map +1 -0
  182. package/dist/{chunk-A42GCBGX.cjs → chunk-TRF4EBJT.cjs} +6 -4
  183. package/dist/chunk-TRF4EBJT.cjs.map +1 -0
  184. package/dist/{chunk-KQJ54OG5.js → chunk-U4JDJKPD.js} +19 -56
  185. package/dist/chunk-U4JDJKPD.js.map +1 -0
  186. package/dist/chunk-UH2USOMG.cjs +627 -0
  187. package/dist/chunk-UH2USOMG.cjs.map +1 -0
  188. package/dist/{chunk-RCVLFTCT.js → chunk-UPXDVI3T.js} +13 -12
  189. package/dist/chunk-UPXDVI3T.js.map +1 -0
  190. package/dist/{chunk-5VQM6VWP.cjs → chunk-UWG5GX6E.cjs} +2 -2
  191. package/dist/{chunk-5VQM6VWP.cjs.map → chunk-UWG5GX6E.cjs.map} +1 -1
  192. package/dist/{chunk-3RWZPJKV.js → chunk-VBH7ZXSZ.js} +21 -78
  193. package/dist/chunk-VBH7ZXSZ.js.map +1 -0
  194. package/dist/{chunk-K5UBVGJN.js → chunk-VDYA2HMS.js} +6 -6
  195. package/dist/{chunk-K5UBVGJN.js.map → chunk-VDYA2HMS.js.map} +1 -1
  196. package/dist/chunk-X4PVHAZ6.cjs +83 -0
  197. package/dist/chunk-X4PVHAZ6.cjs.map +1 -0
  198. package/dist/{chunk-UYQMBBWJ.js → chunk-X6CNEA32.js} +23 -20
  199. package/dist/chunk-X6CNEA32.js.map +1 -0
  200. package/dist/chunk-X6RDQ5NB.cjs +335 -0
  201. package/dist/chunk-X6RDQ5NB.cjs.map +1 -0
  202. package/dist/chunk-XD6X7O5R.js +184 -0
  203. package/dist/chunk-XD6X7O5R.js.map +1 -0
  204. package/dist/{chunk-DIQ3AV5W.cjs → chunk-XFY73JWD.cjs} +324 -224
  205. package/dist/chunk-XFY73JWD.cjs.map +1 -0
  206. package/dist/{chunk-DEFQM7JU.cjs → chunk-XRU7V7FF.cjs} +7 -7
  207. package/dist/{chunk-DEFQM7JU.cjs.map → chunk-XRU7V7FF.cjs.map} +1 -1
  208. package/dist/{chunk-TPF25IG6.js → chunk-XZA3Y4YH.js} +3 -3
  209. package/dist/{chunk-TPF25IG6.js.map → chunk-XZA3Y4YH.js.map} +1 -1
  210. package/dist/chunk-Y7M44XEK.js +462 -0
  211. package/dist/chunk-Y7M44XEK.js.map +1 -0
  212. package/dist/{chunk-RRSNR3TP.js → chunk-YIRLBUNN.js} +3 -3
  213. package/dist/{chunk-RRSNR3TP.js.map → chunk-YIRLBUNN.js.map} +1 -1
  214. package/dist/{chunk-IXGYRP2P.js → chunk-YJDSPA5E.js} +79 -49
  215. package/dist/chunk-YJDSPA5E.js.map +1 -0
  216. package/dist/{chunk-JBNOGRKW.cjs → chunk-YLINFV7Z.cjs} +157 -115
  217. package/dist/chunk-YLINFV7Z.cjs.map +1 -0
  218. package/dist/{chunk-QERAIDRJ.js → chunk-Z2PPIVOO.js} +82 -22
  219. package/dist/chunk-Z2PPIVOO.js.map +1 -0
  220. package/dist/chunk-Z5QHVL5U.cjs +12 -0
  221. package/dist/chunk-Z5QHVL5U.cjs.map +1 -0
  222. package/dist/chunk-ZDH3DX3C.cjs +30 -0
  223. package/dist/chunk-ZDH3DX3C.cjs.map +1 -0
  224. package/dist/chunk-ZE6NVENI.js +77 -0
  225. package/dist/chunk-ZE6NVENI.js.map +1 -0
  226. package/dist/chunk-ZHX4KEM7.cjs +49 -0
  227. package/dist/chunk-ZHX4KEM7.cjs.map +1 -0
  228. package/dist/chunk-ZKZAIX42.cjs +479 -0
  229. package/dist/chunk-ZKZAIX42.cjs.map +1 -0
  230. package/dist/{chunk-TEDRJXOG.cjs → chunk-ZY4GXIVN.cjs} +5 -5
  231. package/dist/{chunk-TEDRJXOG.cjs.map → chunk-ZY4GXIVN.cjs.map} +1 -1
  232. package/dist/core/index.cjs +117 -0
  233. package/dist/core/index.cjs.map +1 -0
  234. package/dist/core/index.d.cts +225 -0
  235. package/dist/core/index.d.ts +225 -0
  236. package/dist/core/index.js +12 -0
  237. package/dist/core/index.js.map +1 -0
  238. package/dist/{ddl-CS0KUVwB.d.ts → ddl-Dx3Z0_WC.d.ts} +3 -3
  239. package/dist/{ddl-BD-ZfKeX.d.cts → ddl-J6sDyABg.d.cts} +3 -3
  240. package/dist/define-graph-CzEvA_8F.d.cts +174 -0
  241. package/dist/define-graph-DRo9xpYN.d.ts +174 -0
  242. package/dist/{extension-types-BM2ACfYO.d.cts → extension-types-BLEVH4SG.d.cts} +1 -1
  243. package/dist/{extension-types-BM2ACfYO.d.ts → extension-types-BLEVH4SG.d.ts} +1 -1
  244. package/dist/graph-extension/index.cjs +21 -19
  245. package/dist/graph-extension/index.d.cts +4 -4
  246. package/dist/graph-extension/index.d.ts +4 -4
  247. package/dist/graph-extension/index.js +6 -4
  248. package/dist/graph-merge/index.cjs +265 -214
  249. package/dist/graph-merge/index.cjs.map +1 -1
  250. package/dist/graph-merge/index.d.cts +8 -89
  251. package/dist/graph-merge/index.d.ts +8 -89
  252. package/dist/graph-merge/index.js +141 -90
  253. package/dist/graph-merge/index.js.map +1 -1
  254. package/dist/{index-BeacbPoe.d.ts → index-BD_3TCgh.d.ts} +6 -4
  255. package/dist/{index-BPM59vsg.d.cts → index-BihFPsPu.d.cts} +6 -4
  256. package/dist/{fulltext-strategy-C27vXaeB.d.cts → index-Bq7vSPHy.d.ts} +3195 -2646
  257. package/dist/{fulltext-strategy-DebsMrqg.d.ts → index-CrFL_ENI.d.cts} +3195 -2646
  258. package/dist/index.cjs +326 -315
  259. package/dist/index.cjs.map +1 -1
  260. package/dist/index.d.cts +59 -240
  261. package/dist/index.d.ts +59 -240
  262. package/dist/index.js +46 -79
  263. package/dist/index.js.map +1 -1
  264. package/dist/indexes/index.cjs +26 -38
  265. package/dist/indexes/index.d.cts +6 -41
  266. package/dist/indexes/index.d.ts +6 -41
  267. package/dist/indexes/index.js +14 -10
  268. package/dist/interchange/index.cjs +48 -39
  269. package/dist/interchange/index.cjs.map +1 -1
  270. package/dist/interchange/index.d.cts +7 -8
  271. package/dist/interchange/index.d.ts +7 -8
  272. package/dist/interchange/index.js +23 -14
  273. package/dist/interchange/index.js.map +1 -1
  274. package/dist/local-options-CZ1BnIoF.d.cts +29 -0
  275. package/dist/local-options-CZ1BnIoF.d.ts +29 -0
  276. package/dist/{manager-D00_NXvT.d.ts → manager-CASfhmzV.d.ts} +4 -173
  277. package/dist/{manager-nU1vTJLy.d.cts → manager-nCEJiYBb.d.cts} +4 -173
  278. package/dist/{materialize-indexes-zK2J_flP.d.ts → materialize-indexes-D4iei4Kp.d.ts} +1 -1
  279. package/dist/{materialize-indexes-CuR3gAZb.d.cts → materialize-indexes-ExQ6OrAh.d.cts} +1 -1
  280. package/dist/{postgres-IaBA4RgE.d.ts → postgres-Cl1ZAN1G.d.ts} +1 -1
  281. package/dist/{postgres-YrYmPlaU.d.cts → postgres-DMgIKQU-.d.cts} +1 -1
  282. package/dist/postgres-execution-fKW0qRiN.d.cts +14 -0
  283. package/dist/postgres-execution-fKW0qRiN.d.ts +14 -0
  284. package/dist/profiler/index.cjs +9 -8
  285. package/dist/profiler/index.cjs.map +1 -1
  286. package/dist/profiler/index.d.cts +9 -17
  287. package/dist/profiler/index.d.ts +9 -17
  288. package/dist/profiler/index.js +8 -7
  289. package/dist/profiler/index.js.map +1 -1
  290. package/dist/provenance/index.cjs +61 -55
  291. package/dist/provenance/index.cjs.map +1 -1
  292. package/dist/provenance/index.d.cts +7 -8
  293. package/dist/provenance/index.d.ts +7 -8
  294. package/dist/provenance/index.js +34 -28
  295. package/dist/provenance/index.js.map +1 -1
  296. package/dist/schema/index.cjs +46 -37
  297. package/dist/schema/index.cjs.map +1 -1
  298. package/dist/schema/index.d.cts +8 -10
  299. package/dist/schema/index.d.ts +8 -10
  300. package/dist/schema/index.js +22 -13
  301. package/dist/schema/index.js.map +1 -1
  302. package/dist/{sqlite-BUOHPx7p.d.ts → sqlite-BDkW39aa.d.cts} +1 -1
  303. package/dist/{sqlite-Pp8O19WE.d.cts → sqlite-CYfhvESj.d.ts} +1 -1
  304. package/dist/sqlite-execution-DwbE2a9y.d.cts +32 -0
  305. package/dist/sqlite-execution-DwbE2a9y.d.ts +32 -0
  306. package/dist/{store-view-X96Rd00T.d.cts → store-view-BoHqdHjB.d.cts} +394 -1393
  307. package/dist/{store-view-ANL6mTph.d.ts → store-view-Ctq-3OHy.d.ts} +394 -1393
  308. package/dist/temporal-BC_NQV5Y.d.cts +281 -0
  309. package/dist/temporal-DqtOEo_B.d.ts +281 -0
  310. package/dist/{types-r-Zyq2Hz.d.cts → types-COq3-vMC.d.cts} +2 -2
  311. package/dist/{types-wsvuBgPK.d.ts → types-CUevi_D1.d.ts} +2 -2
  312. package/dist/{where-CJOpJj3a.d.ts → where-BdE_cYtx.d.ts} +5 -5
  313. package/dist/{where-K3uBP33l.d.cts → where-C92TXCzT.d.cts} +5 -5
  314. package/package.json +37 -6
  315. package/dist/chunk-27SSDCEP.cjs.map +0 -1
  316. package/dist/chunk-2N6EOBTH.cjs.map +0 -1
  317. package/dist/chunk-3C2RYI6L.cjs.map +0 -1
  318. package/dist/chunk-3DS7Z4T4.cjs.map +0 -1
  319. package/dist/chunk-3GH67G4Z.cjs.map +0 -1
  320. package/dist/chunk-3RWZPJKV.js.map +0 -1
  321. package/dist/chunk-3SLPDKHQ.js.map +0 -1
  322. package/dist/chunk-3XXGYU62.cjs.map +0 -1
  323. package/dist/chunk-44TA22QT.js +0 -1478
  324. package/dist/chunk-44TA22QT.js.map +0 -1
  325. package/dist/chunk-552KNYQJ.js.map +0 -1
  326. package/dist/chunk-5KEQ74YU.cjs.map +0 -1
  327. package/dist/chunk-5KPNWT6X.js.map +0 -1
  328. package/dist/chunk-5PNMDJ7J.js.map +0 -1
  329. package/dist/chunk-6EEO3OVU.cjs.map +0 -1
  330. package/dist/chunk-7YSP4V4R.cjs +0 -69
  331. package/dist/chunk-7YSP4V4R.cjs.map +0 -1
  332. package/dist/chunk-A42GCBGX.cjs.map +0 -1
  333. package/dist/chunk-BVRDGYXQ.cjs.map +0 -1
  334. package/dist/chunk-BYPOGQWK.js.map +0 -1
  335. package/dist/chunk-CUHM5CWJ.cjs +0 -12
  336. package/dist/chunk-CUHM5CWJ.cjs.map +0 -1
  337. package/dist/chunk-DIQ3AV5W.cjs.map +0 -1
  338. package/dist/chunk-EXU3RASM.js.map +0 -1
  339. package/dist/chunk-IP3CGGPA.cjs.map +0 -1
  340. package/dist/chunk-IPSVVTWT.cjs +0 -1540
  341. package/dist/chunk-IPSVVTWT.cjs.map +0 -1
  342. package/dist/chunk-IXGYRP2P.js.map +0 -1
  343. package/dist/chunk-J4IUSYFF.js.map +0 -1
  344. package/dist/chunk-JBNOGRKW.cjs.map +0 -1
  345. package/dist/chunk-K3Q3LJY3.js.map +0 -1
  346. package/dist/chunk-KQJ54OG5.js.map +0 -1
  347. package/dist/chunk-L7HQ2OSI.js.map +0 -1
  348. package/dist/chunk-M6VES7V6.js +0 -239
  349. package/dist/chunk-M6VES7V6.js.map +0 -1
  350. package/dist/chunk-NBP2WTJW.cjs.map +0 -1
  351. package/dist/chunk-NUIG3BCV.cjs.map +0 -1
  352. package/dist/chunk-NXQFATMF.cjs.map +0 -1
  353. package/dist/chunk-OHMP6N2J.js +0 -47
  354. package/dist/chunk-OHMP6N2J.js.map +0 -1
  355. package/dist/chunk-QERAIDRJ.js.map +0 -1
  356. package/dist/chunk-QSXTWU4U.cjs +0 -12
  357. package/dist/chunk-RCVLFTCT.js.map +0 -1
  358. package/dist/chunk-TGOMW4MB.cjs.map +0 -1
  359. package/dist/chunk-TKT2XHED.js.map +0 -1
  360. package/dist/chunk-UGZUAYAR.js.map +0 -1
  361. package/dist/chunk-UXLSNRYL.js.map +0 -1
  362. package/dist/chunk-UYQMBBWJ.js.map +0 -1
  363. package/dist/chunk-VKGKDOKR.js.map +0 -1
  364. package/dist/chunk-VL2V6PEN.cjs +0 -261
  365. package/dist/chunk-VL2V6PEN.cjs.map +0 -1
  366. package/dist/chunk-WOJMKB3N.cjs.map +0 -1
  367. package/dist/chunk-WWFHO375.cjs.map +0 -1
  368. package/dist/chunk-XGPUQ56G.js.map +0 -1
  369. package/dist/chunk-XGU7DZDA.cjs +0 -1095
  370. package/dist/chunk-XGU7DZDA.cjs.map +0 -1
  371. package/dist/chunk-XPCZADMT.cjs.map +0 -1
  372. package/dist/chunk-XWV4JT34.js.map +0 -1
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ var chunkZHX4KEM7_cjs = require('../../chunk-ZHX4KEM7.cjs');
4
+ require('../../chunk-7VLCN3JB.cjs');
5
+ var chunkXFY73JWD_cjs = require('../../chunk-XFY73JWD.cjs');
6
+ var chunk2SL7OGPR_cjs = require('../../chunk-2SL7OGPR.cjs');
7
+ require('../../chunk-TRF4EBJT.cjs');
8
+ require('../../chunk-B63IFHXR.cjs');
9
+ require('../../chunk-FMNUSGZ4.cjs');
10
+ require('../../chunk-EOJFGECD.cjs');
11
+ require('../../chunk-E6TXEISH.cjs');
12
+ require('../../chunk-DOVMTPKE.cjs');
13
+ require('../../chunk-KCLZHYPU.cjs');
14
+ require('../../chunk-NWYCOFEZ.cjs');
15
+ require('../../chunk-ZDH3DX3C.cjs');
16
+ var chunkGNPGGLAE_cjs = require('../../chunk-GNPGGLAE.cjs');
17
+ require('../../chunk-SVUKGWSN.cjs');
18
+ require('../../chunk-CQC6VBAF.cjs');
19
+ require('../../chunk-RW24SAHI.cjs');
20
+ require('../../chunk-X4PVHAZ6.cjs');
21
+ require('../../chunk-ACSVZPK7.cjs');
22
+ require('../../chunk-O5H62ZWJ.cjs');
23
+ require('../../chunk-NT6ILURI.cjs');
24
+ require('../../chunk-DDCYVIVV.cjs');
25
+ require('../../chunk-CWX77JB4.cjs');
26
+ require('../../chunk-GUUWKPTK.cjs');
27
+ require('../../chunk-7M3NACL3.cjs');
28
+ require('../../chunk-ZY4GXIVN.cjs');
29
+ require('../../chunk-NAUA4PW5.cjs');
30
+ require('../../chunk-UH2USOMG.cjs');
31
+ require('../../chunk-Z5QHVL5U.cjs');
32
+ require('../../chunk-ZKZAIX42.cjs');
33
+ require('../../chunk-X6RDQ5NB.cjs');
34
+ require('../../chunk-FJMPR3OH.cjs');
35
+ require('../../chunk-SJDMVITW.cjs');
36
+ require('../../chunk-764JHTLT.cjs');
37
+ require('../../chunk-HAHNRASW.cjs');
38
+ require('../../chunk-N2V3HJFV.cjs');
39
+ require('../../chunk-SVJ5GEXW.cjs');
40
+ require('../../chunk-NMQ6C6TS.cjs');
41
+ require('../../chunk-DI74SMXS.cjs');
42
+ require('../../chunk-XRU7V7FF.cjs');
43
+ require('../../chunk-SAFZ6JTI.cjs');
44
+ require('../../chunk-TDXIBCGY.cjs');
45
+
46
+ // src/backend/postgres/pglite-store.ts
47
+ async function createLocalPgliteStore(graph, options = {}) {
48
+ const tables = options.store?.schema === void 0 ? void 0 : chunkXFY73JWD_cjs.createPostgresTables(options.store.schema.tables);
49
+ const { backend } = await chunkZHX4KEM7_cjs.createLocalPgliteBackend({
50
+ ...options.dataDir === void 0 ? {} : { dataDir: options.dataDir },
51
+ ...options.vector === false ? { vector: false } : {},
52
+ ...tables === void 0 ? {} : { tables }
53
+ });
54
+ try {
55
+ const [store] = await chunk2SL7OGPR_cjs.createStoreWithSchema(graph, backend, {
56
+ ...options.store,
57
+ ...options.schemaManagement
58
+ });
59
+ return store;
60
+ } catch (error) {
61
+ return chunkGNPGGLAE_cjs.closeAfterFailure(backend, error);
62
+ }
63
+ }
64
+
65
+ exports.createLocalPgliteStore = createLocalPgliteStore;
66
+ //# sourceMappingURL=pglite-store.cjs.map
67
+ //# sourceMappingURL=pglite-store.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/backend/postgres/pglite-store.ts"],"names":["createPostgresTables","createLocalPgliteBackend","createStoreWithSchema","closeAfterFailure"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,eAAsB,sBAAA,CACpB,KAAA,EACA,OAAA,GAAmC,EAAC,EACwB;AAC5D,EAAA,MAAM,MAAA,GACJ,OAAA,CAAQ,KAAA,EAAO,MAAA,KAAW,MAAA,GACxB,SACAA,sCAAA,CAAqB,OAAA,CAAQ,KAAA,CAAM,MAAA,CAAO,MAAM,CAAA;AACpD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,MAAMC,0CAAA,CAAyB;AAAA,IACjD,GAAI,QAAQ,OAAA,KAAY,MAAA,GAAY,EAAC,GAAI,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACpE,GAAI,QAAQ,MAAA,KAAW,KAAA,GAAQ,EAAE,MAAA,EAAQ,KAAA,KAAmB,EAAC;AAAA,IAC7D,GAAI,MAAA,KAAW,MAAA,GAAY,EAAC,GAAI,EAAE,MAAA;AAAO,GAC1C,CAAA;AACD,EAAA,IAAI;AACF,IAAA,MAAM,CAAC,KAAK,CAAA,GAAI,MAAMC,uCAAA,CAAsB,OAAO,OAAA,EAAS;AAAA,MAC1D,GAAG,OAAA,CAAQ,KAAA;AAAA,MACX,GAAG,OAAA,CAAQ;AAAA,KACZ,CAAA;AACD,IAAA,OAAO,KAAA;AAAA,EACT,SAAS,KAAA,EAAO;AACd,IAAA,OAAOC,mCAAA,CAAkB,SAAS,KAAK,CAAA;AAAA,EACzC;AACF","file":"pglite-store.cjs","sourcesContent":["/**\n * Batteries-included local PostgreSQL Store backed by PGlite.\n *\n * This entrypoint owns the connection and intentionally exposes the portable\n * TypeGraph Store surface rather than the adapter-native Drizzle handle.\n */\nimport { type GraphDef } from \"../../core/define-graph\";\nimport { type SchemaManagerOptions } from \"../../schema/manager\";\nimport {\n createStoreWithSchema,\n type HistoryStore,\n type RecordedReadStore,\n type Store,\n} from \"../../store/store\";\nimport {\n type HistoryStoreOptions,\n type LiveStoreOptions,\n type RecordedReadStoreOptions,\n type StoreOptions,\n type UnboundLiveStoreOptions,\n} from \"../../store/types\";\nimport { createPostgresTables } from \"../drizzle/schema/postgres\";\nimport { closeAfterFailure } from \"../types\";\nimport { createLocalPgliteBackend } from \"./pglite\";\n\nexport type LocalPgliteStoreOptions<\n TStoreOptions extends StoreOptions = StoreOptions,\n> = Readonly<{\n /** PGlite data directory. Defaults to an in-memory database. */\n dataDir?: string;\n /** Whether to load pgvector. Defaults to true. */\n vector?: boolean;\n /** Store behavior, including hooks, history, and custom table names. */\n store?: TStoreOptions;\n /** Schema initialization and migration policy. */\n schemaManagement?: SchemaManagerOptions;\n}>;\n\n/** Creates, provisions, and returns a full typed local PGlite Store. */\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options?: LocalPgliteStoreOptions<UnboundLiveStoreOptions>,\n): Promise<Store<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions<HistoryStoreOptions> &\n Readonly<{ store: HistoryStoreOptions }>,\n): Promise<HistoryStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions<RecordedReadStoreOptions> &\n Readonly<{ store: RecordedReadStoreOptions }>,\n): Promise<RecordedReadStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions<LiveStoreOptions>,\n): Promise<Store<G> | RecordedReadStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions,\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>>;\nexport async function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions = {},\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>> {\n const tables =\n options.store?.schema === undefined ?\n undefined\n : createPostgresTables(options.store.schema.tables);\n const { backend } = await createLocalPgliteBackend({\n ...(options.dataDir === undefined ? {} : { dataDir: options.dataDir }),\n ...(options.vector === false ? { vector: false as const } : {}),\n ...(tables === undefined ? {} : { tables }),\n });\n try {\n const [store] = await createStoreWithSchema(graph, backend, {\n ...options.store,\n ...options.schemaManagement,\n });\n return store;\n } catch (error) {\n return closeAfterFailure(backend, error);\n }\n}\n"]}
@@ -0,0 +1,38 @@
1
+ import { G as GraphDef } from '../../define-graph-CzEvA_8F.cjs';
2
+ import { S as SchemaManagerOptions } from '../../manager-nCEJiYBb.cjs';
3
+ import { S as StoreOptions, U as UnboundLiveStoreOptions, a as Store, H as HistoryStoreOptions, b as HistoryStore, R as RecordedReadStoreOptions, c as RecordedReadStore, L as LiveStoreOptions } from '../../store-view-BoHqdHjB.cjs';
4
+ import '../../extension-types-BLEVH4SG.cjs';
5
+ import 'zod';
6
+ import '../../index-CrFL_ENI.cjs';
7
+ import '../../temporal-BC_NQV5Y.cjs';
8
+ import '../../materialize-indexes-ExQ6OrAh.cjs';
9
+
10
+ /**
11
+ * Batteries-included local PostgreSQL Store backed by PGlite.
12
+ *
13
+ * This entrypoint owns the connection and intentionally exposes the portable
14
+ * TypeGraph Store surface rather than the adapter-native Drizzle handle.
15
+ */
16
+
17
+ type LocalPgliteStoreOptions<TStoreOptions extends StoreOptions = StoreOptions> = Readonly<{
18
+ /** PGlite data directory. Defaults to an in-memory database. */
19
+ dataDir?: string;
20
+ /** Whether to load pgvector. Defaults to true. */
21
+ vector?: boolean;
22
+ /** Store behavior, including hooks, history, and custom table names. */
23
+ store?: TStoreOptions;
24
+ /** Schema initialization and migration policy. */
25
+ schemaManagement?: SchemaManagerOptions;
26
+ }>;
27
+ /** Creates, provisions, and returns a full typed local PGlite Store. */
28
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options?: LocalPgliteStoreOptions<UnboundLiveStoreOptions>): Promise<Store<G>>;
29
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions<HistoryStoreOptions> & Readonly<{
30
+ store: HistoryStoreOptions;
31
+ }>): Promise<HistoryStore<G>>;
32
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions<RecordedReadStoreOptions> & Readonly<{
33
+ store: RecordedReadStoreOptions;
34
+ }>): Promise<RecordedReadStore<G>>;
35
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions<LiveStoreOptions>): Promise<Store<G> | RecordedReadStore<G>>;
36
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>>;
37
+
38
+ export { type LocalPgliteStoreOptions, createLocalPgliteStore };
@@ -0,0 +1,38 @@
1
+ import { G as GraphDef } from '../../define-graph-DRo9xpYN.js';
2
+ import { S as SchemaManagerOptions } from '../../manager-CASfhmzV.js';
3
+ import { S as StoreOptions, U as UnboundLiveStoreOptions, a as Store, H as HistoryStoreOptions, b as HistoryStore, R as RecordedReadStoreOptions, c as RecordedReadStore, L as LiveStoreOptions } from '../../store-view-Ctq-3OHy.js';
4
+ import '../../extension-types-BLEVH4SG.js';
5
+ import 'zod';
6
+ import '../../index-Bq7vSPHy.js';
7
+ import '../../temporal-DqtOEo_B.js';
8
+ import '../../materialize-indexes-D4iei4Kp.js';
9
+
10
+ /**
11
+ * Batteries-included local PostgreSQL Store backed by PGlite.
12
+ *
13
+ * This entrypoint owns the connection and intentionally exposes the portable
14
+ * TypeGraph Store surface rather than the adapter-native Drizzle handle.
15
+ */
16
+
17
+ type LocalPgliteStoreOptions<TStoreOptions extends StoreOptions = StoreOptions> = Readonly<{
18
+ /** PGlite data directory. Defaults to an in-memory database. */
19
+ dataDir?: string;
20
+ /** Whether to load pgvector. Defaults to true. */
21
+ vector?: boolean;
22
+ /** Store behavior, including hooks, history, and custom table names. */
23
+ store?: TStoreOptions;
24
+ /** Schema initialization and migration policy. */
25
+ schemaManagement?: SchemaManagerOptions;
26
+ }>;
27
+ /** Creates, provisions, and returns a full typed local PGlite Store. */
28
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options?: LocalPgliteStoreOptions<UnboundLiveStoreOptions>): Promise<Store<G>>;
29
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions<HistoryStoreOptions> & Readonly<{
30
+ store: HistoryStoreOptions;
31
+ }>): Promise<HistoryStore<G>>;
32
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions<RecordedReadStoreOptions> & Readonly<{
33
+ store: RecordedReadStoreOptions;
34
+ }>): Promise<RecordedReadStore<G>>;
35
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions<LiveStoreOptions>): Promise<Store<G> | RecordedReadStore<G>>;
36
+ declare function createLocalPgliteStore<G extends GraphDef>(graph: G, options: LocalPgliteStoreOptions): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>>;
37
+
38
+ export { type LocalPgliteStoreOptions, createLocalPgliteStore };
@@ -0,0 +1,65 @@
1
+ import { createLocalPgliteBackend } from '../../chunk-6G5CQ6JX.js';
2
+ import '../../chunk-YJDSPA5E.js';
3
+ import { createPostgresTables } from '../../chunk-G32AO634.js';
4
+ import { createStoreWithSchema } from '../../chunk-A2FGSWMQ.js';
5
+ import '../../chunk-DRACN6XG.js';
6
+ import '../../chunk-SDHV2MWU.js';
7
+ import '../../chunk-EZH7FNUS.js';
8
+ import '../../chunk-MTNEGGM2.js';
9
+ import '../../chunk-AOL64O4Z.js';
10
+ import '../../chunk-Z2PPIVOO.js';
11
+ import '../../chunk-UPXDVI3T.js';
12
+ import '../../chunk-RQPRCEIO.js';
13
+ import '../../chunk-35S6P5ZU.js';
14
+ import { closeAfterFailure } from '../../chunk-PZHC5GCD.js';
15
+ import '../../chunk-J6IJARLG.js';
16
+ import '../../chunk-VBH7ZXSZ.js';
17
+ import '../../chunk-76HE7DJP.js';
18
+ import '../../chunk-ZE6NVENI.js';
19
+ import '../../chunk-UR7W5YQK.js';
20
+ import '../../chunk-KFLXWVUJ.js';
21
+ import '../../chunk-PH4IJ3V5.js';
22
+ import '../../chunk-I6FX7AAG.js';
23
+ import '../../chunk-U4JDJKPD.js';
24
+ import '../../chunk-BQITNFQJ.js';
25
+ import '../../chunk-VDYA2HMS.js';
26
+ import '../../chunk-K34OPSJK.js';
27
+ import '../../chunk-2EBMPJBO.js';
28
+ import '../../chunk-G3CSQLLT.js';
29
+ import '../../chunk-DDCIXXOO.js';
30
+ import '../../chunk-Y7M44XEK.js';
31
+ import '../../chunk-6XDBRDZE.js';
32
+ import '../../chunk-D7PG5D5K.js';
33
+ import '../../chunk-SNXVDZAJ.js';
34
+ import '../../chunk-QMQLUA66.js';
35
+ import '../../chunk-PC2UBAUB.js';
36
+ import '../../chunk-SCTZRFW5.js';
37
+ import '../../chunk-GYA4JRP5.js';
38
+ import '../../chunk-TAUGGLNQ.js';
39
+ import '../../chunk-ITE4IXAK.js';
40
+ import '../../chunk-XZA3Y4YH.js';
41
+ import '../../chunk-DPNA466P.js';
42
+ import '../../chunk-G6Q5UM7U.js';
43
+
44
+ // src/backend/postgres/pglite-store.ts
45
+ async function createLocalPgliteStore(graph, options = {}) {
46
+ const tables = options.store?.schema === void 0 ? void 0 : createPostgresTables(options.store.schema.tables);
47
+ const { backend } = await createLocalPgliteBackend({
48
+ ...options.dataDir === void 0 ? {} : { dataDir: options.dataDir },
49
+ ...options.vector === false ? { vector: false } : {},
50
+ ...tables === void 0 ? {} : { tables }
51
+ });
52
+ try {
53
+ const [store] = await createStoreWithSchema(graph, backend, {
54
+ ...options.store,
55
+ ...options.schemaManagement
56
+ });
57
+ return store;
58
+ } catch (error) {
59
+ return closeAfterFailure(backend, error);
60
+ }
61
+ }
62
+
63
+ export { createLocalPgliteStore };
64
+ //# sourceMappingURL=pglite-store.js.map
65
+ //# sourceMappingURL=pglite-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/backend/postgres/pglite-store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,eAAsB,sBAAA,CACpB,KAAA,EACA,OAAA,GAAmC,EAAC,EACwB;AAC5D,EAAA,MAAM,MAAA,GACJ,OAAA,CAAQ,KAAA,EAAO,MAAA,KAAW,MAAA,GACxB,SACA,oBAAA,CAAqB,OAAA,CAAQ,KAAA,CAAM,MAAA,CAAO,MAAM,CAAA;AACpD,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,MAAM,wBAAA,CAAyB;AAAA,IACjD,GAAI,QAAQ,OAAA,KAAY,MAAA,GAAY,EAAC,GAAI,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACpE,GAAI,QAAQ,MAAA,KAAW,KAAA,GAAQ,EAAE,MAAA,EAAQ,KAAA,KAAmB,EAAC;AAAA,IAC7D,GAAI,MAAA,KAAW,MAAA,GAAY,EAAC,GAAI,EAAE,MAAA;AAAO,GAC1C,CAAA;AACD,EAAA,IAAI;AACF,IAAA,MAAM,CAAC,KAAK,CAAA,GAAI,MAAM,qBAAA,CAAsB,OAAO,OAAA,EAAS;AAAA,MAC1D,GAAG,OAAA,CAAQ,KAAA;AAAA,MACX,GAAG,OAAA,CAAQ;AAAA,KACZ,CAAA;AACD,IAAA,OAAO,KAAA;AAAA,EACT,SAAS,KAAA,EAAO;AACd,IAAA,OAAO,iBAAA,CAAkB,SAAS,KAAK,CAAA;AAAA,EACzC;AACF","file":"pglite-store.js","sourcesContent":["/**\n * Batteries-included local PostgreSQL Store backed by PGlite.\n *\n * This entrypoint owns the connection and intentionally exposes the portable\n * TypeGraph Store surface rather than the adapter-native Drizzle handle.\n */\nimport { type GraphDef } from \"../../core/define-graph\";\nimport { type SchemaManagerOptions } from \"../../schema/manager\";\nimport {\n createStoreWithSchema,\n type HistoryStore,\n type RecordedReadStore,\n type Store,\n} from \"../../store/store\";\nimport {\n type HistoryStoreOptions,\n type LiveStoreOptions,\n type RecordedReadStoreOptions,\n type StoreOptions,\n type UnboundLiveStoreOptions,\n} from \"../../store/types\";\nimport { createPostgresTables } from \"../drizzle/schema/postgres\";\nimport { closeAfterFailure } from \"../types\";\nimport { createLocalPgliteBackend } from \"./pglite\";\n\nexport type LocalPgliteStoreOptions<\n TStoreOptions extends StoreOptions = StoreOptions,\n> = Readonly<{\n /** PGlite data directory. Defaults to an in-memory database. */\n dataDir?: string;\n /** Whether to load pgvector. Defaults to true. */\n vector?: boolean;\n /** Store behavior, including hooks, history, and custom table names. */\n store?: TStoreOptions;\n /** Schema initialization and migration policy. */\n schemaManagement?: SchemaManagerOptions;\n}>;\n\n/** Creates, provisions, and returns a full typed local PGlite Store. */\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options?: LocalPgliteStoreOptions<UnboundLiveStoreOptions>,\n): Promise<Store<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions<HistoryStoreOptions> &\n Readonly<{ store: HistoryStoreOptions }>,\n): Promise<HistoryStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions<RecordedReadStoreOptions> &\n Readonly<{ store: RecordedReadStoreOptions }>,\n): Promise<RecordedReadStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions<LiveStoreOptions>,\n): Promise<Store<G> | RecordedReadStore<G>>;\nexport function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions,\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>>;\nexport async function createLocalPgliteStore<G extends GraphDef>(\n graph: G,\n options: LocalPgliteStoreOptions = {},\n): Promise<Store<G> | HistoryStore<G> | RecordedReadStore<G>> {\n const tables =\n options.store?.schema === undefined ?\n undefined\n : createPostgresTables(options.store.schema.tables);\n const { backend } = await createLocalPgliteBackend({\n ...(options.dataDir === undefined ? {} : { dataDir: options.dataDir }),\n ...(options.vector === false ? { vector: false as const } : {}),\n ...(tables === undefined ? {} : { tables }),\n });\n try {\n const [store] = await createStoreWithSchema(graph, backend, {\n ...options.store,\n ...options.schemaManagement,\n });\n return store;\n } catch (error) {\n return closeAfterFailure(backend, error);\n }\n}\n"]}
@@ -1,58 +1,33 @@
1
1
  'use strict';
2
2
 
3
- var chunkNXQFATMF_cjs = require('../../chunk-NXQFATMF.cjs');
4
- var chunkDIQ3AV5W_cjs = require('../../chunk-DIQ3AV5W.cjs');
5
- require('../../chunk-27SSDCEP.cjs');
6
- require('../../chunk-CUHM5CWJ.cjs');
7
- require('../../chunk-3C2RYI6L.cjs');
8
- require('../../chunk-XPCZADMT.cjs');
9
- require('../../chunk-VL2V6PEN.cjs');
3
+ var chunkZHX4KEM7_cjs = require('../../chunk-ZHX4KEM7.cjs');
4
+ require('../../chunk-7VLCN3JB.cjs');
5
+ require('../../chunk-XFY73JWD.cjs');
6
+ require('../../chunk-B63IFHXR.cjs');
7
+ require('../../chunk-FMNUSGZ4.cjs');
8
+ require('../../chunk-EOJFGECD.cjs');
9
+ require('../../chunk-E6TXEISH.cjs');
10
+ require('../../chunk-DOVMTPKE.cjs');
11
+ require('../../chunk-ZDH3DX3C.cjs');
12
+ require('../../chunk-GNPGGLAE.cjs');
10
13
  require('../../chunk-ACSVZPK7.cjs');
11
- require('../../chunk-QARBLBXT.cjs');
12
- require('../../chunk-TEDRJXOG.cjs');
13
- require('../../chunk-XGU7DZDA.cjs');
14
- var chunkIPSVVTWT_cjs = require('../../chunk-IPSVVTWT.cjs');
15
- require('../../chunk-3GH67G4Z.cjs');
16
- require('../../chunk-7YSP4V4R.cjs');
17
- require('../../chunk-SJDMVITW.cjs');
18
- var chunkBVRDGYXQ_cjs = require('../../chunk-BVRDGYXQ.cjs');
14
+ require('../../chunk-O5H62ZWJ.cjs');
15
+ require('../../chunk-GUUWKPTK.cjs');
16
+ require('../../chunk-ZY4GXIVN.cjs');
17
+ require('../../chunk-NAUA4PW5.cjs');
18
+ require('../../chunk-UH2USOMG.cjs');
19
+ require('../../chunk-Z5QHVL5U.cjs');
20
+ require('../../chunk-ZKZAIX42.cjs');
21
+ require('../../chunk-X6RDQ5NB.cjs');
22
+ require('../../chunk-764JHTLT.cjs');
23
+ require('../../chunk-SAFZ6JTI.cjs');
19
24
  require('../../chunk-TDXIBCGY.cjs');
20
- var pglite = require('@electric-sql/pglite');
21
- var pglite$1 = require('drizzle-orm/pglite');
22
25
 
23
- async function loadDefaultPgvectorExtension() {
24
- try {
25
- const module_ = await import('@electric-sql/pglite-pgvector');
26
- return module_.vector;
27
- } catch (error) {
28
- throw new chunkBVRDGYXQ_cjs.ConfigurationError(
29
- "createLocalPgliteBackend needs the pgvector extension but `@electric-sql/pglite-pgvector` could not be loaded. Install it (`pnpm add @electric-sql/pglite-pgvector`), pass your own `vector` extension, or set `vector: false` to disable vector support.",
30
- { backend: "pglite", dependency: "@electric-sql/pglite-pgvector" },
31
- { cause: error }
32
- );
33
- }
34
- }
35
- async function createLocalPgliteBackend(options = {}) {
36
- const tables2 = options.tables ?? chunkDIQ3AV5W_cjs.tables;
37
- const vectorExtension = options.vector === false ? void 0 : options.vector ?? await loadDefaultPgvectorExtension();
38
- const vectorEnabled = vectorExtension !== void 0;
39
- const client = await pglite.PGlite.create({
40
- ...options.dataDir === void 0 ? {} : { dataDir: options.dataDir },
41
- ...vectorExtension === void 0 ? {} : { extensions: { vector: vectorExtension } }
42
- });
43
- const migrationSql = vectorEnabled ? chunkDIQ3AV5W_cjs.generatePostgresMigrationSQL(tables2) : chunkDIQ3AV5W_cjs.generatePostgresDDL(tables2).join("\n\n");
44
- await client.exec(migrationSql);
45
- const db = pglite$1.drizzle(client);
46
- const backend = chunkNXQFATMF_cjs.createPostgresBackend(db, {
47
- tables: tables2,
48
- ...vectorEnabled ? {} : { vector: false }
49
- });
50
- const managedBackend = chunkIPSVVTWT_cjs.wrapWithManagedClose(backend, async () => {
51
- await client.close();
52
- });
53
- return { backend: managedBackend, db, client };
54
- }
55
26
 
56
- exports.createLocalPgliteBackend = createLocalPgliteBackend;
27
+
28
+ Object.defineProperty(exports, "createLocalPgliteBackend", {
29
+ enumerable: true,
30
+ get: function () { return chunkZHX4KEM7_cjs.createLocalPgliteBackend; }
31
+ });
57
32
  //# sourceMappingURL=pglite.cjs.map
58
33
  //# sourceMappingURL=pglite.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/backend/postgres/pglite.ts"],"names":["ConfigurationError","tables","PGlite","generatePostgresMigrationSQL","generatePostgresDDL","drizzle","createPostgresBackend","wrapWithManagedClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2HA,eAAe,4BAAA,GAAmD;AAChE,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,MAAM,OAAO,+BAA+B,CAAA;AAC5D,IAAA,OAAO,OAAA,CAAQ,MAAA;AAAA,EACjB,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,IAAIA,oCAAA;AAAA,MACR,2PAAA;AAAA,MAIA,EAAE,OAAA,EAAS,QAAA,EAAU,UAAA,EAAY,+BAAA,EAAgC;AAAA,MACjE,EAAE,OAAO,KAAA;AAAM,KACjB;AAAA,EACF;AACF;AAoBA,eAAsB,wBAAA,CACpB,OAAA,GAAqC,EAAC,EACH;AACnC,EAAA,MAAMC,OAAAA,GAAS,QAAQ,MAAA,IAAUA,wBAAA;AAMjC,EAAA,MAAM,eAAA,GACJ,QAAQ,MAAA,KAAW,KAAA,GACjB,SACC,OAAA,CAAQ,MAAA,IAAW,MAAM,4BAAA,EAA6B;AAC3D,EAAA,MAAM,gBAAgB,eAAA,KAAoB,MAAA;AAO1C,EAAA,MAAM,MAAA,GAAS,MAAMC,aAAA,CAAO,MAAA,CAAO;AAAA,IACjC,GAAI,QAAQ,OAAA,KAAY,MAAA,GAAY,EAAC,GAAI,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACpE,GAAI,eAAA,KAAoB,MAAA,GACtB,EAAC,GACD,EAAE,UAAA,EAAY,EAAE,MAAA,EAAQ,eAAA,EAAgB;AAAE,GAC7C,CAAA;AAID,EAAA,MAAM,YAAA,GACJ,gBACEC,8CAAA,CAA6BF,OAAM,IACnCG,qCAAA,CAAoBH,OAAM,CAAA,CAAE,IAAA,CAAK,MAAM,CAAA;AAC3C,EAAA,MAAM,MAAA,CAAO,KAAK,YAAY,CAAA;AAE9B,EAAA,MAAM,EAAA,GAAKI,iBAAQ,MAAM,CAAA;AACzB,EAAA,MAAM,OAAA,GAAUC,wCAAsB,EAAA,EAAI;AAAA,IACxC,MAAA,EAAAL,OAAAA;AAAA,IACA,GAAI,aAAA,GAAgB,EAAC,GAAI,EAAE,QAAQ,KAAA;AAAM,GAC1C,CAAA;AACD,EAAA,MAAM,cAAA,GAAiBM,sCAAA,CAAqB,OAAA,EAAS,YAAY;AAC/D,IAAA,MAAM,OAAO,KAAA,EAAM;AAAA,EACrB,CAAC,CAAA;AAED,EAAA,OAAO,EAAE,OAAA,EAAS,cAAA,EAAgB,EAAA,EAAI,MAAA,EAAO;AAC/C","file":"pglite.cjs","sourcesContent":["/**\n * Local PGlite backend — Postgres-in-WASM, running in-process.\n *\n * [PGlite](https://pglite.dev/) is a full Postgres compiled to WebAssembly\n * that runs inside the Node/Bun/Deno/browser process with no server and no\n * native addon. This is the batteries-included Postgres analog of\n * `createLocalSqliteBackend`: it constructs a PGlite instance, loads the\n * pgvector extension, runs the schema DDL, and returns a ready\n * `{ backend, db }` pair whose `close()` disposes the engine.\n *\n * `@electric-sql/pglite` is an optional peer dependency. Vector support\n * additionally needs `@electric-sql/pglite-pgvector` (PGlite ≥ 0.5 ships\n * pgvector as a separate package). Install what you need:\n *\n * ```bash\n * pnpm add @electric-sql/pglite @electric-sql/pglite-pgvector\n * ```\n *\n * @example In-memory database (default, vector enabled)\n * ```typescript\n * import { createLocalPgliteBackend } from \"@nicia-ai/typegraph/postgres/pglite\";\n *\n * const { backend } = await createLocalPgliteBackend();\n * const store = createStore(graph, backend);\n * ```\n *\n * @example Persistent on-disk database\n * ```typescript\n * const { backend, db } = await createLocalPgliteBackend({ dataDir: \"./pgdata\" });\n * ```\n *\n * @example No vector support (skip the pgvector extension)\n * ```typescript\n * const { backend } = await createLocalPgliteBackend({ vector: false });\n * ```\n *\n * PGlite is single-connection and serial: there is no pooling, so concurrent\n * `store.transaction()` calls queue rather than run in parallel.\n */\nimport { type Extension, PGlite } from \"@electric-sql/pglite\";\nimport { drizzle, type PgliteDatabase } from \"drizzle-orm/pglite\";\n\nimport { ConfigurationError } from \"../../errors\";\nimport {\n generatePostgresDDL,\n generatePostgresMigrationSQL,\n} from \"../drizzle/ddl\";\nimport {\n createPostgresBackend,\n type PostgresTables,\n tables as defaultTables,\n} from \"../drizzle/postgres\";\nimport { type GraphBackend, wrapWithManagedClose } from \"../types\";\n\n// ============================================================\n// Types\n// ============================================================\n\n/**\n * Options for creating a local PGlite backend.\n */\nexport type LocalPgliteBackendOptions = Readonly<{\n /**\n * PGlite data directory. Omit for an in-memory database (the default).\n * Accepts any PGlite data-dir spec: a filesystem path (`\"./pgdata\"`),\n * `\"memory://\"`, or a browser/runtime-specific scheme such as\n * `\"idb://my-db\"`.\n */\n dataDir?: string;\n\n /**\n * Custom table definitions. Defaults to standard TypeGraph table names.\n */\n tables?: PostgresTables;\n\n /**\n * Controls the pgvector stack:\n *\n * - **omitted (default)** — load pgvector from `@electric-sql/pglite-pgvector`\n * and run `CREATE EXTENSION vector`, so embedding fields work out of the\n * box. Throws a {@link ConfigurationError} if the package isn't installed.\n * - **`false`** — skip the extension entirely; the backend advertises no\n * vector capability (mirroring a SQLite connection without sqlite-vec).\n * Use when a graph carries no embeddings, or to avoid the extension dep.\n * - **a PGlite `Extension`** — bring your own pgvector build or custom\n * extension packaging. Decouples this helper from a specific pgvector\n * package version.\n */\n vector?: false | Extension;\n}>;\n\n/**\n * Result of creating a local PGlite backend.\n */\nexport type LocalPgliteBackendResult = Readonly<{\n /**\n * The GraphBackend instance for use with createStore. Its `close()`\n * disposes the underlying PGlite engine.\n */\n backend: GraphBackend;\n\n /**\n * The underlying Drizzle database instance. Useful for direct SQL access.\n */\n db: PgliteDatabase;\n\n /**\n * The raw PGlite instance, for engine-specific operations such as\n * `dumpDataDir()` / `clone()` not surfaced through Drizzle.\n */\n client: PGlite;\n}>;\n\n// ============================================================\n// Vector extension loading\n// ============================================================\n\n/**\n * Dynamically loads the default pgvector extension from\n * `@electric-sql/pglite-pgvector`. Kept as a runtime import so the package\n * stays an optional peer dependency — callers using `vector: false` or\n * supplying their own extension never need it installed.\n */\nasync function loadDefaultPgvectorExtension(): Promise<Extension> {\n try {\n const module_ = await import(\"@electric-sql/pglite-pgvector\");\n return module_.vector;\n } catch (error) {\n throw new ConfigurationError(\n \"createLocalPgliteBackend needs the pgvector extension but \" +\n \"`@electric-sql/pglite-pgvector` could not be loaded. Install it \" +\n \"(`pnpm add @electric-sql/pglite-pgvector`), pass your own `vector` \" +\n \"extension, or set `vector: false` to disable vector support.\",\n { backend: \"pglite\", dependency: \"@electric-sql/pglite-pgvector\" },\n { cause: error },\n );\n }\n}\n\n// ============================================================\n// Factory Function\n// ============================================================\n\n/**\n * Creates a TypeGraph backend backed by an in-process PGlite database.\n *\n * Constructs the PGlite engine (loading pgvector unless disabled), executes\n * the schema DDL, and wires the standard Postgres backend. The returned\n * backend owns the engine: call `backend.close()` to dispose it.\n *\n * For production Postgres, or a PGlite instance you construct yourself,\n * use `createPostgresBackend` directly with your own Drizzle database — the\n * execution fast path detects PGlite and routes it correctly.\n *\n * @param options - Configuration options\n * @returns Backend, Drizzle database, and raw PGlite client\n */\nexport async function createLocalPgliteBackend(\n options: LocalPgliteBackendOptions = {},\n): Promise<LocalPgliteBackendResult> {\n const tables = options.tables ?? defaultTables;\n\n // pgvector lives in the WASM instance, so the extension must be passed at\n // construction — `CREATE EXTENSION vector` alone can't pull it in. An\n // explicitly supplied extension wins; `false` disables; otherwise load the\n // default package.\n const vectorExtension =\n options.vector === false ?\n undefined\n : (options.vector ?? (await loadDefaultPgvectorExtension()));\n const vectorEnabled = vectorExtension !== undefined;\n\n // Construct via the single options-object form (passing `dataDir` as a\n // field), not the positional `create(dataDir, options)` overload: with a\n // leading `undefined` dataDir, that overload silently drops `extensions`\n // (\"extension vector is not available\"). The options form loads them for\n // both the in-memory and on-disk cases.\n const client = await PGlite.create({\n ...(options.dataDir === undefined ? {} : { dataDir: options.dataDir }),\n ...(vectorExtension === undefined ?\n {}\n : { extensions: { vector: vectorExtension } }),\n });\n\n // `exec` runs a multi-statement batch (DDL + the pgvector `CREATE\n // EXTENSION` when enabled) in one round trip.\n const migrationSql =\n vectorEnabled ?\n generatePostgresMigrationSQL(tables)\n : generatePostgresDDL(tables).join(\"\\n\\n\");\n await client.exec(migrationSql);\n\n const db = drizzle(client);\n const backend = createPostgresBackend(db, {\n tables,\n ...(vectorEnabled ? {} : { vector: false }),\n });\n const managedBackend = wrapWithManagedClose(backend, async () => {\n await client.close();\n });\n\n return { backend: managedBackend, db, client };\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"pglite.cjs"}
@@ -1,12 +1,13 @@
1
1
  import { Extension, PGlite } from '@electric-sql/pglite';
2
2
  import { PgliteDatabase } from 'drizzle-orm/pglite';
3
- import { G as GraphBackend } from '../../fulltext-strategy-C27vXaeB.cjs';
4
- import { P as PostgresTables } from '../../postgres-YrYmPlaU.cjs';
5
- import 'drizzle-orm';
6
- import '../../extension-types-BM2ACfYO.cjs';
7
- import 'zod';
3
+ import { a as AnyPgTransaction } from '../../postgres-execution-fKW0qRiN.cjs';
4
+ export { A as AnyPgDatabase } from '../../postgres-execution-fKW0qRiN.cjs';
5
+ import { A as AdapterBackend } from '../../index-CrFL_ENI.cjs';
6
+ import { P as PostgresTables } from '../../postgres-DMgIKQU-.cjs';
8
7
  import 'drizzle-orm/pg-core';
9
- import 'drizzle-orm/sqlite-core';
8
+ import 'drizzle-orm/relations';
9
+ import '../../extension-types-BLEVH4SG.cjs';
10
+ import 'zod';
10
11
 
11
12
  /**
12
13
  * Local PGlite backend — Postgres-in-WASM, running in-process.
@@ -28,7 +29,7 @@ import 'drizzle-orm/sqlite-core';
28
29
  *
29
30
  * @example In-memory database (default, vector enabled)
30
31
  * ```typescript
31
- * import { createLocalPgliteBackend } from "@nicia-ai/typegraph/postgres/pglite";
32
+ * import { createLocalPgliteBackend } from "@nicia-ai/typegraph/adapters/drizzle/postgres/pglite";
32
33
  *
33
34
  * const { backend } = await createLocalPgliteBackend();
34
35
  * const store = createStore(graph, backend);
@@ -86,7 +87,7 @@ type LocalPgliteBackendResult = Readonly<{
86
87
  * The GraphBackend instance for use with createStore. Its `close()`
87
88
  * disposes the underlying PGlite engine.
88
89
  */
89
- backend: GraphBackend;
90
+ backend: AdapterBackend<AnyPgTransaction>;
90
91
  /**
91
92
  * The underlying Drizzle database instance. Useful for direct SQL access.
92
93
  */
@@ -113,4 +114,4 @@ type LocalPgliteBackendResult = Readonly<{
113
114
  */
114
115
  declare function createLocalPgliteBackend(options?: LocalPgliteBackendOptions): Promise<LocalPgliteBackendResult>;
115
116
 
116
- export { type LocalPgliteBackendOptions, type LocalPgliteBackendResult, createLocalPgliteBackend };
117
+ export { AnyPgTransaction, type LocalPgliteBackendOptions, type LocalPgliteBackendResult, createLocalPgliteBackend };
@@ -1,12 +1,13 @@
1
1
  import { Extension, PGlite } from '@electric-sql/pglite';
2
2
  import { PgliteDatabase } from 'drizzle-orm/pglite';
3
- import { G as GraphBackend } from '../../fulltext-strategy-DebsMrqg.js';
4
- import { P as PostgresTables } from '../../postgres-IaBA4RgE.js';
5
- import 'drizzle-orm';
6
- import '../../extension-types-BM2ACfYO.js';
7
- import 'zod';
3
+ import { a as AnyPgTransaction } from '../../postgres-execution-fKW0qRiN.js';
4
+ export { A as AnyPgDatabase } from '../../postgres-execution-fKW0qRiN.js';
5
+ import { A as AdapterBackend } from '../../index-Bq7vSPHy.js';
6
+ import { P as PostgresTables } from '../../postgres-Cl1ZAN1G.js';
8
7
  import 'drizzle-orm/pg-core';
9
- import 'drizzle-orm/sqlite-core';
8
+ import 'drizzle-orm/relations';
9
+ import '../../extension-types-BLEVH4SG.js';
10
+ import 'zod';
10
11
 
11
12
  /**
12
13
  * Local PGlite backend — Postgres-in-WASM, running in-process.
@@ -28,7 +29,7 @@ import 'drizzle-orm/sqlite-core';
28
29
  *
29
30
  * @example In-memory database (default, vector enabled)
30
31
  * ```typescript
31
- * import { createLocalPgliteBackend } from "@nicia-ai/typegraph/postgres/pglite";
32
+ * import { createLocalPgliteBackend } from "@nicia-ai/typegraph/adapters/drizzle/postgres/pglite";
32
33
  *
33
34
  * const { backend } = await createLocalPgliteBackend();
34
35
  * const store = createStore(graph, backend);
@@ -86,7 +87,7 @@ type LocalPgliteBackendResult = Readonly<{
86
87
  * The GraphBackend instance for use with createStore. Its `close()`
87
88
  * disposes the underlying PGlite engine.
88
89
  */
89
- backend: GraphBackend;
90
+ backend: AdapterBackend<AnyPgTransaction>;
90
91
  /**
91
92
  * The underlying Drizzle database instance. Useful for direct SQL access.
92
93
  */
@@ -113,4 +114,4 @@ type LocalPgliteBackendResult = Readonly<{
113
114
  */
114
115
  declare function createLocalPgliteBackend(options?: LocalPgliteBackendOptions): Promise<LocalPgliteBackendResult>;
115
116
 
116
- export { type LocalPgliteBackendOptions, type LocalPgliteBackendResult, createLocalPgliteBackend };
117
+ export { AnyPgTransaction, type LocalPgliteBackendOptions, type LocalPgliteBackendResult, createLocalPgliteBackend };
@@ -1,56 +1,24 @@
1
- import { createPostgresBackend } from '../../chunk-IXGYRP2P.js';
2
- import { tables, generatePostgresMigrationSQL, generatePostgresDDL } from '../../chunk-K3Q3LJY3.js';
3
- import '../../chunk-5KPNWT6X.js';
4
- import '../../chunk-DFVLCOP6.js';
5
- import '../../chunk-UXLSNRYL.js';
6
- import '../../chunk-QERAIDRJ.js';
7
- import '../../chunk-M6VES7V6.js';
1
+ export { createLocalPgliteBackend } from '../../chunk-6G5CQ6JX.js';
2
+ import '../../chunk-YJDSPA5E.js';
3
+ import '../../chunk-G32AO634.js';
4
+ import '../../chunk-SDHV2MWU.js';
5
+ import '../../chunk-EZH7FNUS.js';
6
+ import '../../chunk-MTNEGGM2.js';
7
+ import '../../chunk-AOL64O4Z.js';
8
+ import '../../chunk-Z2PPIVOO.js';
9
+ import '../../chunk-35S6P5ZU.js';
10
+ import '../../chunk-PZHC5GCD.js';
8
11
  import '../../chunk-UR7W5YQK.js';
9
- import '../../chunk-YTSN73ND.js';
10
- import '../../chunk-W63OVYY4.js';
11
- import '../../chunk-EXU3RASM.js';
12
- import { wrapWithManagedClose } from '../../chunk-44TA22QT.js';
13
- import '../../chunk-XGPUQ56G.js';
14
- import '../../chunk-OHMP6N2J.js';
15
- import '../../chunk-SNXVDZAJ.js';
16
- import { ConfigurationError } from '../../chunk-5PNMDJ7J.js';
12
+ import '../../chunk-KFLXWVUJ.js';
13
+ import '../../chunk-BQITNFQJ.js';
14
+ import '../../chunk-K34OPSJK.js';
15
+ import '../../chunk-2EBMPJBO.js';
16
+ import '../../chunk-G3CSQLLT.js';
17
+ import '../../chunk-DDCIXXOO.js';
18
+ import '../../chunk-Y7M44XEK.js';
19
+ import '../../chunk-6XDBRDZE.js';
20
+ import '../../chunk-QMQLUA66.js';
21
+ import '../../chunk-DPNA466P.js';
17
22
  import '../../chunk-G6Q5UM7U.js';
18
- import { PGlite } from '@electric-sql/pglite';
19
- import { drizzle } from 'drizzle-orm/pglite';
20
-
21
- async function loadDefaultPgvectorExtension() {
22
- try {
23
- const module_ = await import('@electric-sql/pglite-pgvector');
24
- return module_.vector;
25
- } catch (error) {
26
- throw new ConfigurationError(
27
- "createLocalPgliteBackend needs the pgvector extension but `@electric-sql/pglite-pgvector` could not be loaded. Install it (`pnpm add @electric-sql/pglite-pgvector`), pass your own `vector` extension, or set `vector: false` to disable vector support.",
28
- { backend: "pglite", dependency: "@electric-sql/pglite-pgvector" },
29
- { cause: error }
30
- );
31
- }
32
- }
33
- async function createLocalPgliteBackend(options = {}) {
34
- const tables2 = options.tables ?? tables;
35
- const vectorExtension = options.vector === false ? void 0 : options.vector ?? await loadDefaultPgvectorExtension();
36
- const vectorEnabled = vectorExtension !== void 0;
37
- const client = await PGlite.create({
38
- ...options.dataDir === void 0 ? {} : { dataDir: options.dataDir },
39
- ...vectorExtension === void 0 ? {} : { extensions: { vector: vectorExtension } }
40
- });
41
- const migrationSql = vectorEnabled ? generatePostgresMigrationSQL(tables2) : generatePostgresDDL(tables2).join("\n\n");
42
- await client.exec(migrationSql);
43
- const db = drizzle(client);
44
- const backend = createPostgresBackend(db, {
45
- tables: tables2,
46
- ...vectorEnabled ? {} : { vector: false }
47
- });
48
- const managedBackend = wrapWithManagedClose(backend, async () => {
49
- await client.close();
50
- });
51
- return { backend: managedBackend, db, client };
52
- }
53
-
54
- export { createLocalPgliteBackend };
55
23
  //# sourceMappingURL=pglite.js.map
56
24
  //# sourceMappingURL=pglite.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/backend/postgres/pglite.ts"],"names":["tables"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2HA,eAAe,4BAAA,GAAmD;AAChE,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,MAAM,OAAO,+BAA+B,CAAA;AAC5D,IAAA,OAAO,OAAA,CAAQ,MAAA;AAAA,EACjB,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,IAAI,kBAAA;AAAA,MACR,2PAAA;AAAA,MAIA,EAAE,OAAA,EAAS,QAAA,EAAU,UAAA,EAAY,+BAAA,EAAgC;AAAA,MACjE,EAAE,OAAO,KAAA;AAAM,KACjB;AAAA,EACF;AACF;AAoBA,eAAsB,wBAAA,CACpB,OAAA,GAAqC,EAAC,EACH;AACnC,EAAA,MAAMA,OAAAA,GAAS,QAAQ,MAAA,IAAU,MAAA;AAMjC,EAAA,MAAM,eAAA,GACJ,QAAQ,MAAA,KAAW,KAAA,GACjB,SACC,OAAA,CAAQ,MAAA,IAAW,MAAM,4BAAA,EAA6B;AAC3D,EAAA,MAAM,gBAAgB,eAAA,KAAoB,MAAA;AAO1C,EAAA,MAAM,MAAA,GAAS,MAAM,MAAA,CAAO,MAAA,CAAO;AAAA,IACjC,GAAI,QAAQ,OAAA,KAAY,MAAA,GAAY,EAAC,GAAI,EAAE,OAAA,EAAS,OAAA,CAAQ,OAAA,EAAQ;AAAA,IACpE,GAAI,eAAA,KAAoB,MAAA,GACtB,EAAC,GACD,EAAE,UAAA,EAAY,EAAE,MAAA,EAAQ,eAAA,EAAgB;AAAE,GAC7C,CAAA;AAID,EAAA,MAAM,YAAA,GACJ,gBACE,4BAAA,CAA6BA,OAAM,IACnC,mBAAA,CAAoBA,OAAM,CAAA,CAAE,IAAA,CAAK,MAAM,CAAA;AAC3C,EAAA,MAAM,MAAA,CAAO,KAAK,YAAY,CAAA;AAE9B,EAAA,MAAM,EAAA,GAAK,QAAQ,MAAM,CAAA;AACzB,EAAA,MAAM,OAAA,GAAU,sBAAsB,EAAA,EAAI;AAAA,IACxC,MAAA,EAAAA,OAAAA;AAAA,IACA,GAAI,aAAA,GAAgB,EAAC,GAAI,EAAE,QAAQ,KAAA;AAAM,GAC1C,CAAA;AACD,EAAA,MAAM,cAAA,GAAiB,oBAAA,CAAqB,OAAA,EAAS,YAAY;AAC/D,IAAA,MAAM,OAAO,KAAA,EAAM;AAAA,EACrB,CAAC,CAAA;AAED,EAAA,OAAO,EAAE,OAAA,EAAS,cAAA,EAAgB,EAAA,EAAI,MAAA,EAAO;AAC/C","file":"pglite.js","sourcesContent":["/**\n * Local PGlite backend — Postgres-in-WASM, running in-process.\n *\n * [PGlite](https://pglite.dev/) is a full Postgres compiled to WebAssembly\n * that runs inside the Node/Bun/Deno/browser process with no server and no\n * native addon. This is the batteries-included Postgres analog of\n * `createLocalSqliteBackend`: it constructs a PGlite instance, loads the\n * pgvector extension, runs the schema DDL, and returns a ready\n * `{ backend, db }` pair whose `close()` disposes the engine.\n *\n * `@electric-sql/pglite` is an optional peer dependency. Vector support\n * additionally needs `@electric-sql/pglite-pgvector` (PGlite ≥ 0.5 ships\n * pgvector as a separate package). Install what you need:\n *\n * ```bash\n * pnpm add @electric-sql/pglite @electric-sql/pglite-pgvector\n * ```\n *\n * @example In-memory database (default, vector enabled)\n * ```typescript\n * import { createLocalPgliteBackend } from \"@nicia-ai/typegraph/postgres/pglite\";\n *\n * const { backend } = await createLocalPgliteBackend();\n * const store = createStore(graph, backend);\n * ```\n *\n * @example Persistent on-disk database\n * ```typescript\n * const { backend, db } = await createLocalPgliteBackend({ dataDir: \"./pgdata\" });\n * ```\n *\n * @example No vector support (skip the pgvector extension)\n * ```typescript\n * const { backend } = await createLocalPgliteBackend({ vector: false });\n * ```\n *\n * PGlite is single-connection and serial: there is no pooling, so concurrent\n * `store.transaction()` calls queue rather than run in parallel.\n */\nimport { type Extension, PGlite } from \"@electric-sql/pglite\";\nimport { drizzle, type PgliteDatabase } from \"drizzle-orm/pglite\";\n\nimport { ConfigurationError } from \"../../errors\";\nimport {\n generatePostgresDDL,\n generatePostgresMigrationSQL,\n} from \"../drizzle/ddl\";\nimport {\n createPostgresBackend,\n type PostgresTables,\n tables as defaultTables,\n} from \"../drizzle/postgres\";\nimport { type GraphBackend, wrapWithManagedClose } from \"../types\";\n\n// ============================================================\n// Types\n// ============================================================\n\n/**\n * Options for creating a local PGlite backend.\n */\nexport type LocalPgliteBackendOptions = Readonly<{\n /**\n * PGlite data directory. Omit for an in-memory database (the default).\n * Accepts any PGlite data-dir spec: a filesystem path (`\"./pgdata\"`),\n * `\"memory://\"`, or a browser/runtime-specific scheme such as\n * `\"idb://my-db\"`.\n */\n dataDir?: string;\n\n /**\n * Custom table definitions. Defaults to standard TypeGraph table names.\n */\n tables?: PostgresTables;\n\n /**\n * Controls the pgvector stack:\n *\n * - **omitted (default)** — load pgvector from `@electric-sql/pglite-pgvector`\n * and run `CREATE EXTENSION vector`, so embedding fields work out of the\n * box. Throws a {@link ConfigurationError} if the package isn't installed.\n * - **`false`** — skip the extension entirely; the backend advertises no\n * vector capability (mirroring a SQLite connection without sqlite-vec).\n * Use when a graph carries no embeddings, or to avoid the extension dep.\n * - **a PGlite `Extension`** — bring your own pgvector build or custom\n * extension packaging. Decouples this helper from a specific pgvector\n * package version.\n */\n vector?: false | Extension;\n}>;\n\n/**\n * Result of creating a local PGlite backend.\n */\nexport type LocalPgliteBackendResult = Readonly<{\n /**\n * The GraphBackend instance for use with createStore. Its `close()`\n * disposes the underlying PGlite engine.\n */\n backend: GraphBackend;\n\n /**\n * The underlying Drizzle database instance. Useful for direct SQL access.\n */\n db: PgliteDatabase;\n\n /**\n * The raw PGlite instance, for engine-specific operations such as\n * `dumpDataDir()` / `clone()` not surfaced through Drizzle.\n */\n client: PGlite;\n}>;\n\n// ============================================================\n// Vector extension loading\n// ============================================================\n\n/**\n * Dynamically loads the default pgvector extension from\n * `@electric-sql/pglite-pgvector`. Kept as a runtime import so the package\n * stays an optional peer dependency — callers using `vector: false` or\n * supplying their own extension never need it installed.\n */\nasync function loadDefaultPgvectorExtension(): Promise<Extension> {\n try {\n const module_ = await import(\"@electric-sql/pglite-pgvector\");\n return module_.vector;\n } catch (error) {\n throw new ConfigurationError(\n \"createLocalPgliteBackend needs the pgvector extension but \" +\n \"`@electric-sql/pglite-pgvector` could not be loaded. Install it \" +\n \"(`pnpm add @electric-sql/pglite-pgvector`), pass your own `vector` \" +\n \"extension, or set `vector: false` to disable vector support.\",\n { backend: \"pglite\", dependency: \"@electric-sql/pglite-pgvector\" },\n { cause: error },\n );\n }\n}\n\n// ============================================================\n// Factory Function\n// ============================================================\n\n/**\n * Creates a TypeGraph backend backed by an in-process PGlite database.\n *\n * Constructs the PGlite engine (loading pgvector unless disabled), executes\n * the schema DDL, and wires the standard Postgres backend. The returned\n * backend owns the engine: call `backend.close()` to dispose it.\n *\n * For production Postgres, or a PGlite instance you construct yourself,\n * use `createPostgresBackend` directly with your own Drizzle database — the\n * execution fast path detects PGlite and routes it correctly.\n *\n * @param options - Configuration options\n * @returns Backend, Drizzle database, and raw PGlite client\n */\nexport async function createLocalPgliteBackend(\n options: LocalPgliteBackendOptions = {},\n): Promise<LocalPgliteBackendResult> {\n const tables = options.tables ?? defaultTables;\n\n // pgvector lives in the WASM instance, so the extension must be passed at\n // construction — `CREATE EXTENSION vector` alone can't pull it in. An\n // explicitly supplied extension wins; `false` disables; otherwise load the\n // default package.\n const vectorExtension =\n options.vector === false ?\n undefined\n : (options.vector ?? (await loadDefaultPgvectorExtension()));\n const vectorEnabled = vectorExtension !== undefined;\n\n // Construct via the single options-object form (passing `dataDir` as a\n // field), not the positional `create(dataDir, options)` overload: with a\n // leading `undefined` dataDir, that overload silently drops `extensions`\n // (\"extension vector is not available\"). The options form loads them for\n // both the in-memory and on-disk cases.\n const client = await PGlite.create({\n ...(options.dataDir === undefined ? {} : { dataDir: options.dataDir }),\n ...(vectorExtension === undefined ?\n {}\n : { extensions: { vector: vectorExtension } }),\n });\n\n // `exec` runs a multi-statement batch (DDL + the pgvector `CREATE\n // EXTENSION` when enabled) in one round trip.\n const migrationSql =\n vectorEnabled ?\n generatePostgresMigrationSQL(tables)\n : generatePostgresDDL(tables).join(\"\\n\\n\");\n await client.exec(migrationSql);\n\n const db = drizzle(client);\n const backend = createPostgresBackend(db, {\n tables,\n ...(vectorEnabled ? {} : { vector: false }),\n });\n const managedBackend = wrapWithManagedClose(backend, async () => {\n await client.close();\n });\n\n return { backend: managedBackend, db, client };\n}\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"pglite.js"}
@@ -1,70 +1,74 @@
1
1
  'use strict';
2
2
 
3
- var chunkJBNOGRKW_cjs = require('../../chunk-JBNOGRKW.cjs');
4
- var chunkDIQ3AV5W_cjs = require('../../chunk-DIQ3AV5W.cjs');
5
- var chunk3C2RYI6L_cjs = require('../../chunk-3C2RYI6L.cjs');
6
- require('../../chunk-XPCZADMT.cjs');
7
- require('../../chunk-VL2V6PEN.cjs');
3
+ var chunkYLINFV7Z_cjs = require('../../chunk-YLINFV7Z.cjs');
4
+ var chunkXFY73JWD_cjs = require('../../chunk-XFY73JWD.cjs');
5
+ var chunkEOJFGECD_cjs = require('../../chunk-EOJFGECD.cjs');
6
+ require('../../chunk-E6TXEISH.cjs');
7
+ require('../../chunk-DOVMTPKE.cjs');
8
+ require('../../chunk-ZDH3DX3C.cjs');
9
+ require('../../chunk-GNPGGLAE.cjs');
8
10
  require('../../chunk-ACSVZPK7.cjs');
9
- require('../../chunk-QARBLBXT.cjs');
10
- require('../../chunk-TEDRJXOG.cjs');
11
- require('../../chunk-XGU7DZDA.cjs');
12
- require('../../chunk-IPSVVTWT.cjs');
13
- require('../../chunk-3GH67G4Z.cjs');
14
- require('../../chunk-7YSP4V4R.cjs');
15
- require('../../chunk-SJDMVITW.cjs');
16
- require('../../chunk-BVRDGYXQ.cjs');
11
+ require('../../chunk-O5H62ZWJ.cjs');
12
+ require('../../chunk-GUUWKPTK.cjs');
13
+ require('../../chunk-ZY4GXIVN.cjs');
14
+ require('../../chunk-NAUA4PW5.cjs');
15
+ require('../../chunk-UH2USOMG.cjs');
16
+ require('../../chunk-Z5QHVL5U.cjs');
17
+ require('../../chunk-ZKZAIX42.cjs');
18
+ require('../../chunk-X6RDQ5NB.cjs');
19
+ require('../../chunk-764JHTLT.cjs');
20
+ require('../../chunk-SAFZ6JTI.cjs');
17
21
  require('../../chunk-TDXIBCGY.cjs');
18
22
 
19
23
 
20
24
 
21
25
  Object.defineProperty(exports, "createSqliteBackend", {
22
26
  enumerable: true,
23
- get: function () { return chunkJBNOGRKW_cjs.createSqliteBackend; }
27
+ get: function () { return chunkYLINFV7Z_cjs.createSqliteBackend; }
24
28
  });
25
29
  Object.defineProperty(exports, "generateSqliteDDL", {
26
30
  enumerable: true,
27
- get: function () { return chunkDIQ3AV5W_cjs.generateSqliteDDL; }
31
+ get: function () { return chunkXFY73JWD_cjs.generateSqliteDDL; }
28
32
  });
29
33
  Object.defineProperty(exports, "generateSqliteMigrationSQL", {
30
34
  enumerable: true,
31
- get: function () { return chunkDIQ3AV5W_cjs.generateSqliteMigrationSQL; }
35
+ get: function () { return chunkXFY73JWD_cjs.generateSqliteMigrationSQL; }
32
36
  });
33
37
  Object.defineProperty(exports, "createSqliteTables", {
34
38
  enumerable: true,
35
- get: function () { return chunk3C2RYI6L_cjs.createSqliteTables; }
39
+ get: function () { return chunkEOJFGECD_cjs.createSqliteTables; }
36
40
  });
37
41
  Object.defineProperty(exports, "edges", {
38
42
  enumerable: true,
39
- get: function () { return chunk3C2RYI6L_cjs.edges; }
43
+ get: function () { return chunkEOJFGECD_cjs.edges; }
40
44
  });
41
45
  Object.defineProperty(exports, "nodes", {
42
46
  enumerable: true,
43
- get: function () { return chunk3C2RYI6L_cjs.nodes; }
47
+ get: function () { return chunkEOJFGECD_cjs.nodes; }
44
48
  });
45
49
  Object.defineProperty(exports, "recordedClock", {
46
50
  enumerable: true,
47
- get: function () { return chunk3C2RYI6L_cjs.recordedClock; }
51
+ get: function () { return chunkEOJFGECD_cjs.recordedClock; }
48
52
  });
49
53
  Object.defineProperty(exports, "recordedEdges", {
50
54
  enumerable: true,
51
- get: function () { return chunk3C2RYI6L_cjs.recordedEdges; }
55
+ get: function () { return chunkEOJFGECD_cjs.recordedEdges; }
52
56
  });
53
57
  Object.defineProperty(exports, "recordedNodes", {
54
58
  enumerable: true,
55
- get: function () { return chunk3C2RYI6L_cjs.recordedNodes; }
59
+ get: function () { return chunkEOJFGECD_cjs.recordedNodes; }
56
60
  });
57
61
  Object.defineProperty(exports, "schemaVersions", {
58
62
  enumerable: true,
59
- get: function () { return chunk3C2RYI6L_cjs.schemaVersions; }
63
+ get: function () { return chunkEOJFGECD_cjs.schemaVersions; }
60
64
  });
61
65
  Object.defineProperty(exports, "tables", {
62
66
  enumerable: true,
63
- get: function () { return chunk3C2RYI6L_cjs.tables; }
67
+ get: function () { return chunkEOJFGECD_cjs.tables; }
64
68
  });
65
69
  Object.defineProperty(exports, "uniques", {
66
70
  enumerable: true,
67
- get: function () { return chunk3C2RYI6L_cjs.uniques; }
71
+ get: function () { return chunkEOJFGECD_cjs.uniques; }
68
72
  });
69
73
  //# sourceMappingURL=index.cjs.map
70
74
  //# sourceMappingURL=index.cjs.map