@nicia-ai/typegraph 0.46.0 → 0.46.2
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.
- package/dist/backend/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +49 -49
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +10 -10
- package/dist/backend/postgres/index.cjs +26 -26
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +13 -13
- package/dist/backend/postgres/pglite-store.cjs +33 -33
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +29 -29
- package/dist/backend/postgres/pglite.cjs +15 -15
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +14 -14
- package/dist/backend/sqlite/index.cjs +23 -23
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +11 -11
- package/dist/backend/sqlite/libsql.cjs +18 -18
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +13 -13
- package/dist/backend/sqlite/local-store.cjs +34 -34
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +30 -30
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +14 -14
- package/dist/{chunk-VCRRKBLN.cjs → chunk-2ZWM2RFH.cjs} +9 -9
- package/dist/{chunk-VCRRKBLN.cjs.map → chunk-2ZWM2RFH.cjs.map} +1 -1
- package/dist/{chunk-TTAITEPJ.cjs → chunk-32UETY6S.cjs} +26 -26
- package/dist/chunk-32UETY6S.cjs.map +1 -0
- package/dist/{chunk-JXA2ZP2Q.js → chunk-36LIJXWC.js} +4 -4
- package/dist/{chunk-JXA2ZP2Q.js.map → chunk-36LIJXWC.js.map} +1 -1
- package/dist/{chunk-Q7Q4WSLJ.cjs → chunk-5PDSCELM.cjs} +18 -14
- package/dist/chunk-5PDSCELM.cjs.map +1 -0
- package/dist/{chunk-775A4ZMN.js → chunk-5ZJOB5YS.js} +4 -4
- package/dist/{chunk-775A4ZMN.js.map → chunk-5ZJOB5YS.js.map} +1 -1
- package/dist/{chunk-J3WZ3FA2.js → chunk-62ZXBMSD.js} +24 -3
- package/dist/chunk-62ZXBMSD.js.map +1 -0
- package/dist/{chunk-7BQXPCGN.cjs → chunk-6BD6ZBKT.cjs} +10 -10
- package/dist/{chunk-7BQXPCGN.cjs.map → chunk-6BD6ZBKT.cjs.map} +1 -1
- package/dist/chunk-6LAXM4J2.cjs +12 -0
- package/dist/{chunk-VQH4VAWD.cjs.map → chunk-6LAXM4J2.cjs.map} +1 -1
- package/dist/{chunk-MSY7FSX4.js → chunk-72WUT4GG.js} +4 -4
- package/dist/{chunk-MSY7FSX4.js.map → chunk-72WUT4GG.js.map} +1 -1
- package/dist/chunk-73MWKDFK.cjs +12 -0
- package/dist/{chunk-A4OC4DVN.cjs.map → chunk-73MWKDFK.cjs.map} +1 -1
- package/dist/{chunk-BKCUOV7A.js → chunk-7TKNK32B.js} +5 -5
- package/dist/{chunk-BKCUOV7A.js.map → chunk-7TKNK32B.js.map} +1 -1
- package/dist/{chunk-JIVMTW7W.js → chunk-A2LJG5GM.js} +9 -9
- package/dist/{chunk-JIVMTW7W.js.map → chunk-A2LJG5GM.js.map} +1 -1
- package/dist/{chunk-XMQSEJCF.cjs → chunk-A4R3H7RU.cjs} +237 -237
- package/dist/{chunk-XMQSEJCF.cjs.map → chunk-A4R3H7RU.cjs.map} +1 -1
- package/dist/{chunk-RMQLSPA2.cjs → chunk-A7NMUYEL.cjs} +27 -27
- package/dist/{chunk-RMQLSPA2.cjs.map → chunk-A7NMUYEL.cjs.map} +1 -1
- package/dist/{chunk-U63GDNRC.cjs → chunk-AF3TWL5C.cjs} +4 -4
- package/dist/{chunk-U63GDNRC.cjs.map → chunk-AF3TWL5C.cjs.map} +1 -1
- package/dist/{chunk-XBYVV3MP.cjs → chunk-ANKOXPCC.cjs} +4 -4
- package/dist/chunk-ANKOXPCC.cjs.map +1 -0
- package/dist/{chunk-OH5E5KIO.js → chunk-AT3MLMJV.js} +10 -10
- package/dist/{chunk-OH5E5KIO.js.map → chunk-AT3MLMJV.js.map} +1 -1
- package/dist/{chunk-UV3SN74I.js → chunk-AU3IJNNP.js} +5 -5
- package/dist/{chunk-UV3SN74I.js.map → chunk-AU3IJNNP.js.map} +1 -1
- package/dist/{chunk-YAAM3M2S.cjs → chunk-BEB4OFZF.cjs} +10 -10
- package/dist/{chunk-YAAM3M2S.cjs.map → chunk-BEB4OFZF.cjs.map} +1 -1
- package/dist/{chunk-7GT72YHH.cjs → chunk-BQM5P2NO.cjs} +169 -167
- package/dist/chunk-BQM5P2NO.cjs.map +1 -0
- package/dist/{chunk-YWGVVALJ.js → chunk-BRN3RGD2.js} +3 -3
- package/dist/{chunk-YWGVVALJ.js.map → chunk-BRN3RGD2.js.map} +1 -1
- package/dist/{chunk-UDISNXDL.cjs → chunk-BZZI7B43.cjs} +47 -47
- package/dist/{chunk-UDISNXDL.cjs.map → chunk-BZZI7B43.cjs.map} +1 -1
- package/dist/{chunk-TQR4KBY2.cjs → chunk-C2ZP5YS6.cjs} +135 -133
- package/dist/chunk-C2ZP5YS6.cjs.map +1 -0
- package/dist/{chunk-PNN7RHVR.cjs → chunk-C4DYN2SD.cjs} +48 -48
- package/dist/{chunk-PNN7RHVR.cjs.map → chunk-C4DYN2SD.cjs.map} +1 -1
- package/dist/{chunk-XDF2UPEQ.cjs → chunk-C6KE2HSQ.cjs} +1364 -1311
- package/dist/chunk-C6KE2HSQ.cjs.map +1 -0
- package/dist/{chunk-LBJKZXDE.cjs → chunk-D6GCNNMK.cjs} +10 -10
- package/dist/{chunk-LBJKZXDE.cjs.map → chunk-D6GCNNMK.cjs.map} +1 -1
- package/dist/{chunk-JZUR7ZWE.js → chunk-DSAWGCMP.js} +3 -3
- package/dist/{chunk-JZUR7ZWE.js.map → chunk-DSAWGCMP.js.map} +1 -1
- package/dist/{chunk-U5SON7R2.cjs → chunk-DYPRZ53S.cjs} +27 -27
- package/dist/{chunk-U5SON7R2.cjs.map → chunk-DYPRZ53S.cjs.map} +1 -1
- package/dist/{chunk-YVWGEQJE.cjs → chunk-E4OSGBCM.cjs} +139 -133
- package/dist/chunk-E4OSGBCM.cjs.map +1 -0
- package/dist/{chunk-YDFDBE6D.js → chunk-EAMVXR5B.js} +4 -4
- package/dist/{chunk-YDFDBE6D.js.map → chunk-EAMVXR5B.js.map} +1 -1
- package/dist/{chunk-NQ6BRJBE.js → chunk-EDHV4CBU.js} +8 -8
- package/dist/{chunk-NQ6BRJBE.js.map → chunk-EDHV4CBU.js.map} +1 -1
- package/dist/{chunk-DCQVHAYQ.js → chunk-EDJDDY6H.js} +4 -4
- package/dist/{chunk-DCQVHAYQ.js.map → chunk-EDJDDY6H.js.map} +1 -1
- package/dist/{chunk-5262ZMTR.js → chunk-EJSYWAEV.js} +5 -5
- package/dist/{chunk-5262ZMTR.js.map → chunk-EJSYWAEV.js.map} +1 -1
- package/dist/{chunk-N3257XE6.cjs → chunk-F36KZDFX.cjs} +91 -91
- package/dist/{chunk-N3257XE6.cjs.map → chunk-F36KZDFX.cjs.map} +1 -1
- package/dist/{chunk-AKLS3BYZ.js → chunk-FA6Z7B5L.js} +3 -3
- package/dist/chunk-FA6Z7B5L.js.map +1 -0
- package/dist/{chunk-ASTI57H3.js → chunk-FCIZNUW5.js} +3 -3
- package/dist/{chunk-ASTI57H3.js.map → chunk-FCIZNUW5.js.map} +1 -1
- package/dist/{chunk-CBTIUB76.js → chunk-FSLTU57P.js} +3 -3
- package/dist/{chunk-CBTIUB76.js.map → chunk-FSLTU57P.js.map} +1 -1
- package/dist/{chunk-2LG2XB2M.js → chunk-FXNHZFZV.js} +3 -3
- package/dist/{chunk-2LG2XB2M.js.map → chunk-FXNHZFZV.js.map} +1 -1
- package/dist/{chunk-BSFJMMV3.cjs → chunk-GVAMRRZR.cjs} +4 -4
- package/dist/{chunk-BSFJMMV3.cjs.map → chunk-GVAMRRZR.cjs.map} +1 -1
- package/dist/{chunk-CNV4TXJG.js → chunk-GWUWRZXW.js} +3 -3
- package/dist/{chunk-CNV4TXJG.js.map → chunk-GWUWRZXW.js.map} +1 -1
- package/dist/{chunk-C23WSN5E.js → chunk-GWXXHOLU.js} +20 -14
- package/dist/chunk-GWXXHOLU.js.map +1 -0
- package/dist/{chunk-ONU3HIED.cjs → chunk-HNYLMPQQ.cjs} +68 -68
- package/dist/{chunk-ONU3HIED.cjs.map → chunk-HNYLMPQQ.cjs.map} +1 -1
- package/dist/{chunk-NMWDXFPH.js → chunk-IHRDX7K6.js} +4 -4
- package/dist/{chunk-NMWDXFPH.js.map → chunk-IHRDX7K6.js.map} +1 -1
- package/dist/{chunk-VGTJPTIC.js → chunk-JCNTKRAK.js} +5 -5
- package/dist/{chunk-VGTJPTIC.js.map → chunk-JCNTKRAK.js.map} +1 -1
- package/dist/{chunk-MXJDTH5B.cjs → chunk-JL5UEBWT.cjs} +45 -45
- package/dist/{chunk-MXJDTH5B.cjs.map → chunk-JL5UEBWT.cjs.map} +1 -1
- package/dist/{chunk-QLRESYPU.js → chunk-KA4L2NZ3.js} +14 -14
- package/dist/{chunk-QLRESYPU.js.map → chunk-KA4L2NZ3.js.map} +1 -1
- package/dist/{chunk-NI72YOJB.cjs → chunk-KCH7WQA5.cjs} +24 -2
- package/dist/chunk-KCH7WQA5.cjs.map +1 -0
- package/dist/{chunk-2NA5DYLO.cjs → chunk-KOAI3KIV.cjs} +4 -4
- package/dist/{chunk-2NA5DYLO.cjs.map → chunk-KOAI3KIV.cjs.map} +1 -1
- package/dist/{chunk-7VQXLT5O.js → chunk-KXSMF6PL.js} +101 -25
- package/dist/chunk-KXSMF6PL.js.map +1 -0
- package/dist/{chunk-WEVQJ5LH.js → chunk-LHYSY6SE.js} +6 -6
- package/dist/chunk-LHYSY6SE.js.map +1 -0
- package/dist/{chunk-WDGA7IYB.js → chunk-LNIWCQR4.js} +3 -3
- package/dist/{chunk-WDGA7IYB.js.map → chunk-LNIWCQR4.js.map} +1 -1
- package/dist/{chunk-XNSI2FJO.cjs → chunk-N3QTGPC7.cjs} +99 -99
- package/dist/{chunk-XNSI2FJO.cjs.map → chunk-N3QTGPC7.cjs.map} +1 -1
- package/dist/{chunk-K5ELX2GT.js → chunk-OZJCH7ZS.js} +3 -3
- package/dist/{chunk-K5ELX2GT.js.map → chunk-OZJCH7ZS.js.map} +1 -1
- package/dist/{chunk-62ZP23AW.cjs → chunk-PYKF7UIL.cjs} +13 -13
- package/dist/{chunk-62ZP23AW.cjs.map → chunk-PYKF7UIL.cjs.map} +1 -1
- package/dist/{chunk-PQBQG7IM.js → chunk-QOJ2L2AD.js} +3 -3
- package/dist/{chunk-PQBQG7IM.js.map → chunk-QOJ2L2AD.js.map} +1 -1
- package/dist/{chunk-XNLIZYRZ.cjs → chunk-QPOQX2DI.cjs} +235 -235
- package/dist/{chunk-XNLIZYRZ.cjs.map → chunk-QPOQX2DI.cjs.map} +1 -1
- package/dist/{chunk-NFCVHQ5P.cjs → chunk-QU7QLJA4.cjs} +26 -26
- package/dist/{chunk-NFCVHQ5P.cjs.map → chunk-QU7QLJA4.cjs.map} +1 -1
- package/dist/{chunk-DLNROMQ7.js → chunk-R7EWHKID.js} +7 -4
- package/dist/chunk-R7EWHKID.js.map +1 -0
- package/dist/{chunk-HFHTMECK.js → chunk-RFDEYLIK.js} +7 -7
- package/dist/{chunk-HFHTMECK.js.map → chunk-RFDEYLIK.js.map} +1 -1
- package/dist/{chunk-MUK4BU7K.cjs → chunk-RHDOAQCT.cjs} +200 -124
- package/dist/chunk-RHDOAQCT.cjs.map +1 -0
- package/dist/{chunk-YBFHZUXX.js → chunk-S3G5VLSW.js} +6 -6
- package/dist/{chunk-YBFHZUXX.js.map → chunk-S3G5VLSW.js.map} +1 -1
- package/dist/{chunk-M4BDU5RX.cjs → chunk-S7WIRFNS.cjs} +12 -12
- package/dist/{chunk-M4BDU5RX.cjs.map → chunk-S7WIRFNS.cjs.map} +1 -1
- package/dist/{chunk-T4XNKYXB.js → chunk-SXWLLQ3D.js} +4 -4
- package/dist/{chunk-T4XNKYXB.js.map → chunk-SXWLLQ3D.js.map} +1 -1
- package/dist/{chunk-NK5Q7UNE.cjs → chunk-TCT66A7N.cjs} +10 -10
- package/dist/{chunk-NK5Q7UNE.cjs.map → chunk-TCT66A7N.cjs.map} +1 -1
- package/dist/{chunk-3DHZCOT7.cjs → chunk-UTVQPZPN.cjs} +20 -20
- package/dist/{chunk-3DHZCOT7.cjs.map → chunk-UTVQPZPN.cjs.map} +1 -1
- package/dist/{chunk-CXBHOOIQ.cjs → chunk-WA64ZSCA.cjs} +11 -11
- package/dist/{chunk-CXBHOOIQ.cjs.map → chunk-WA64ZSCA.cjs.map} +1 -1
- package/dist/{chunk-QWX5YA3K.js → chunk-WEJHA7AD.js} +18 -16
- package/dist/chunk-WEJHA7AD.js.map +1 -0
- package/dist/{chunk-5UVRGXD3.js → chunk-WHS2Y43J.js} +5 -5
- package/dist/{chunk-5UVRGXD3.js.map → chunk-WHS2Y43J.js.map} +1 -1
- package/dist/{chunk-I5MOXA4H.js → chunk-WMKEGJG4.js} +3 -3
- package/dist/{chunk-I5MOXA4H.js.map → chunk-WMKEGJG4.js.map} +1 -1
- package/dist/{chunk-5763DULU.js → chunk-WYFB7BN3.js} +16 -14
- package/dist/chunk-WYFB7BN3.js.map +1 -0
- package/dist/{chunk-XQSCL77R.cjs → chunk-XBHRKLZU.cjs} +4 -4
- package/dist/{chunk-XQSCL77R.cjs.map → chunk-XBHRKLZU.cjs.map} +1 -1
- package/dist/{chunk-7Z5OR7KO.js → chunk-YQ4JONWE.js} +102 -49
- package/dist/chunk-YQ4JONWE.js.map +1 -0
- package/dist/{chunk-RJS7DECT.js → chunk-Z43KWLZF.js} +8 -8
- package/dist/{chunk-RJS7DECT.js.map → chunk-Z43KWLZF.js.map} +1 -1
- package/dist/{chunk-E4WNQBEF.cjs → chunk-ZBVZ7HXD.cjs} +12 -12
- package/dist/{chunk-E4WNQBEF.cjs.map → chunk-ZBVZ7HXD.cjs.map} +1 -1
- package/dist/{chunk-4UGOKMI5.cjs → chunk-ZHOAZD7Q.cjs} +161 -161
- package/dist/{chunk-4UGOKMI5.cjs.map → chunk-ZHOAZD7Q.cjs.map} +1 -1
- package/dist/{chunk-XCAGZAKP.cjs → chunk-ZIH42CRX.cjs} +7 -7
- package/dist/{chunk-XCAGZAKP.cjs.map → chunk-ZIH42CRX.cjs.map} +1 -1
- package/dist/core/index.cjs +27 -27
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +7 -7
- package/dist/{ddl-BJcOp4WZ.d.cts → ddl-mE07h_EM.d.cts} +3 -3
- package/dist/{ddl-BXfGHbPN.d.ts → ddl-opIn8DfX.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +20 -20
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +248 -248
- package/dist/graph-merge/index.d.cts +8 -8
- package/dist/graph-merge/index.d.ts +8 -8
- package/dist/graph-merge/index.js +24 -24
- package/dist/{index-DxaYCv8Y.d.cts → index-Deyu8IXL.d.ts} +20 -3
- package/dist/{index-BSHvKfok.d.ts → index-DrRS51Ld.d.cts} +20 -3
- package/dist/index.cjs +219 -215
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +34 -34
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +52 -52
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +16 -16
- package/dist/{manager-CfZAimti.d.ts → manager-DX983gJ0.d.ts} +2 -2
- package/dist/{manager-HGk6E_HW.d.cts → manager-ptr3JLRP.d.cts} +2 -2
- package/dist/{materialize-indexes-6A7dWGtb.d.cts → materialize-indexes-BXz77YqO.d.cts} +1 -1
- package/dist/{materialize-indexes-BMJP6Tms.d.ts → materialize-indexes-CpXoggWU.d.ts} +1 -1
- package/dist/{postgres-DFYWENdR.d.cts → postgres-DwgEXSPI.d.cts} +1 -1
- package/dist/{postgres-e7a9TdvR.d.ts → postgres-QdOMHTBz.d.ts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +42 -42
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -9
- package/dist/schema/index.cjs +44 -44
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +17 -17
- package/dist/{searchable-9OQoPuRs.d.ts → searchable-BOUuA83f.d.ts} +1 -1
- package/dist/{searchable-CIje5XYD.d.cts → searchable-BrUh0pdc.d.cts} +1 -1
- package/dist/{sqlite-DerU5tc7.d.ts → sqlite-BfYcV61E.d.cts} +1 -1
- package/dist/{sqlite-DitnISa9.d.cts → sqlite-DK40XVR1.d.ts} +1 -1
- package/dist/{store-DawaWWjJ.d.ts → store-Bo1psfVZ.d.ts} +27 -8
- package/dist/{store-RwTJx8LX.d.cts → store-FTqBpuJD.d.cts} +27 -8
- package/dist/{temporal-Bn-Fi8FJ.d.cts → temporal-CXewwLTB.d.cts} +1 -1
- package/dist/{temporal-BtM4UALv.d.ts → temporal-DPtn0HOu.d.ts} +1 -1
- package/dist/{types-KFfk-8Ah.d.ts → types-CeT7xM4M.d.ts} +1 -1
- package/dist/{types-HkveCCx0.d.cts → types-Du78EvpN.d.cts} +7 -6
- package/dist/{types-HkveCCx0.d.ts → types-Du78EvpN.d.ts} +7 -6
- package/dist/{types-CoIx8HX5.d.cts → types-XR1nHERK.d.cts} +1 -1
- package/dist/{where--fk7_0kv.d.cts → where-CJsp-YUf.d.cts} +1 -1
- package/dist/{where-ws5hf-Ov.d.ts → where-CMbFiWwp.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-5763DULU.js.map +0 -1
- package/dist/chunk-7GT72YHH.cjs.map +0 -1
- package/dist/chunk-7VQXLT5O.js.map +0 -1
- package/dist/chunk-7Z5OR7KO.js.map +0 -1
- package/dist/chunk-A4OC4DVN.cjs +0 -12
- package/dist/chunk-AKLS3BYZ.js.map +0 -1
- package/dist/chunk-C23WSN5E.js.map +0 -1
- package/dist/chunk-DLNROMQ7.js.map +0 -1
- package/dist/chunk-J3WZ3FA2.js.map +0 -1
- package/dist/chunk-MUK4BU7K.cjs.map +0 -1
- package/dist/chunk-NI72YOJB.cjs.map +0 -1
- package/dist/chunk-Q7Q4WSLJ.cjs.map +0 -1
- package/dist/chunk-QWX5YA3K.js.map +0 -1
- package/dist/chunk-TQR4KBY2.cjs.map +0 -1
- package/dist/chunk-TTAITEPJ.cjs.map +0 -1
- package/dist/chunk-VQH4VAWD.cjs +0 -12
- package/dist/chunk-WEVQJ5LH.js.map +0 -1
- package/dist/chunk-XBYVV3MP.cjs.map +0 -1
- package/dist/chunk-XDF2UPEQ.cjs.map +0 -1
- package/dist/chunk-YVWGEQJE.cjs.map +0 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
var
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
9
|
-
require('../../chunk-
|
|
10
|
-
var
|
|
11
|
-
require('../../chunk-
|
|
12
|
-
require('../../chunk-
|
|
13
|
-
require('../../chunk-
|
|
14
|
-
require('../../chunk-
|
|
15
|
-
require('../../chunk-
|
|
16
|
-
require('../../chunk-
|
|
17
|
-
require('../../chunk-
|
|
3
|
+
var chunkUTVQPZPN_cjs = require('../../chunk-UTVQPZPN.cjs');
|
|
4
|
+
require('../../chunk-E4OSGBCM.cjs');
|
|
5
|
+
require('../../chunk-RHDOAQCT.cjs');
|
|
6
|
+
var chunkC6KE2HSQ_cjs = require('../../chunk-C6KE2HSQ.cjs');
|
|
7
|
+
require('../../chunk-C4DYN2SD.cjs');
|
|
8
|
+
require('../../chunk-73MWKDFK.cjs');
|
|
9
|
+
require('../../chunk-BEB4OFZF.cjs');
|
|
10
|
+
var chunkA7NMUYEL_cjs = require('../../chunk-A7NMUYEL.cjs');
|
|
11
|
+
require('../../chunk-DYPRZ53S.cjs');
|
|
12
|
+
require('../../chunk-BQM5P2NO.cjs');
|
|
13
|
+
require('../../chunk-32UETY6S.cjs');
|
|
14
|
+
require('../../chunk-F36KZDFX.cjs');
|
|
15
|
+
require('../../chunk-TCT66A7N.cjs');
|
|
16
|
+
require('../../chunk-QPOQX2DI.cjs');
|
|
17
|
+
require('../../chunk-A4R3H7RU.cjs');
|
|
18
18
|
require('../../chunk-PWLJ77UV.cjs');
|
|
19
|
-
require('../../chunk-
|
|
20
|
-
require('../../chunk-
|
|
21
|
-
var
|
|
22
|
-
require('../../chunk-
|
|
23
|
-
require('../../chunk-
|
|
24
|
-
require('../../chunk-
|
|
25
|
-
require('../../chunk-
|
|
26
|
-
require('../../chunk-
|
|
27
|
-
require('../../chunk-
|
|
19
|
+
require('../../chunk-GVAMRRZR.cjs');
|
|
20
|
+
require('../../chunk-QU7QLJA4.cjs');
|
|
21
|
+
var chunkANKOXPCC_cjs = require('../../chunk-ANKOXPCC.cjs');
|
|
22
|
+
require('../../chunk-WA64ZSCA.cjs');
|
|
23
|
+
require('../../chunk-ZBVZ7HXD.cjs');
|
|
24
|
+
require('../../chunk-5PDSCELM.cjs');
|
|
25
|
+
require('../../chunk-PYKF7UIL.cjs');
|
|
26
|
+
require('../../chunk-ZIH42CRX.cjs');
|
|
27
|
+
require('../../chunk-AF3TWL5C.cjs');
|
|
28
28
|
require('../../chunk-ZY4GXIVN.cjs');
|
|
29
29
|
require('../../chunk-NAUA4PW5.cjs');
|
|
30
|
-
require('../../chunk-
|
|
31
|
-
require('../../chunk-
|
|
30
|
+
require('../../chunk-ZHOAZD7Q.cjs');
|
|
31
|
+
require('../../chunk-2ZWM2RFH.cjs');
|
|
32
32
|
require('../../chunk-7EO3TCQB.cjs');
|
|
33
33
|
require('../../chunk-RT5ZY4XA.cjs');
|
|
34
34
|
require('../../chunk-HAHNRASW.cjs');
|
|
35
|
-
require('../../chunk-
|
|
35
|
+
require('../../chunk-6BD6ZBKT.cjs');
|
|
36
36
|
require('../../chunk-XUO3KQFO.cjs');
|
|
37
|
-
require('../../chunk-
|
|
38
|
-
require('../../chunk-
|
|
37
|
+
require('../../chunk-D6GCNNMK.cjs');
|
|
38
|
+
require('../../chunk-KCH7WQA5.cjs');
|
|
39
39
|
require('../../chunk-A7J2YDDI.cjs');
|
|
40
40
|
require('../../chunk-N66HCGCY.cjs');
|
|
41
41
|
|
|
@@ -46,15 +46,15 @@ function withoutSchemaOverride(schemaManagement) {
|
|
|
46
46
|
return rest;
|
|
47
47
|
}
|
|
48
48
|
async function createLocalSqliteStore(graph, options = {}) {
|
|
49
|
-
const tables = options.store?.schema === void 0 ? void 0 :
|
|
50
|
-
const { backend } =
|
|
49
|
+
const tables = options.store?.schema === void 0 ? void 0 : chunkA7NMUYEL_cjs.createSqliteTables(options.store.schema.tables);
|
|
50
|
+
const { backend } = chunkUTVQPZPN_cjs.createLocalSqliteBackend({
|
|
51
51
|
...options.path === void 0 ? {} : { path: options.path },
|
|
52
52
|
...options.pragmas === void 0 ? {} : { pragmas: options.pragmas },
|
|
53
53
|
...options.capabilities === void 0 ? {} : { capabilities: options.capabilities },
|
|
54
54
|
...tables === void 0 ? {} : { tables }
|
|
55
55
|
});
|
|
56
56
|
try {
|
|
57
|
-
const [store] = await
|
|
57
|
+
const [store] = await chunkC6KE2HSQ_cjs.createStoreWithSchema(graph, backend, {
|
|
58
58
|
...options.store,
|
|
59
59
|
// The type already excludes `schema` here; the runtime strip guards
|
|
60
60
|
// untyped callers, so the provisioned schema (or the default tables)
|
|
@@ -63,13 +63,13 @@ async function createLocalSqliteStore(graph, options = {}) {
|
|
|
63
63
|
});
|
|
64
64
|
return store;
|
|
65
65
|
} catch (error) {
|
|
66
|
-
return
|
|
66
|
+
return chunkANKOXPCC_cjs.closeAfterFailure(backend, error);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
Object.defineProperty(exports, "DEFAULT_LOCAL_SQLITE_PRAGMAS", {
|
|
71
71
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkUTVQPZPN_cjs.DEFAULT_LOCAL_SQLITE_PRAGMAS; }
|
|
73
73
|
});
|
|
74
74
|
exports.createLocalSqliteStore = createLocalSqliteStore;
|
|
75
75
|
//# sourceMappingURL=local-store.cjs.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { B as BackendCapabilities, d as GraphDef } from '../../types-
|
|
2
|
-
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-
|
|
3
|
-
import { S as SchemaManagerOptions } from '../../manager-
|
|
4
|
-
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-
|
|
5
|
-
export { I as IdentityAssertion, d as IdentityAssertionId, e as IdentityAssertionResult, f as IdentityFacade, g as IdentityNode, h as IdentityNodeRefInput, i as IdentityPair, j as IdentityReadFacade, k as IdentityRelation, l as IdentityWriteSummary } from '../../store-
|
|
1
|
+
import { B as BackendCapabilities, d as GraphDef } from '../../types-Du78EvpN.cjs';
|
|
2
|
+
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Du78EvpN.cjs';
|
|
3
|
+
import { S as SchemaManagerOptions } from '../../manager-ptr3JLRP.cjs';
|
|
4
|
+
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-FTqBpuJD.cjs';
|
|
5
|
+
export { I as IdentityAssertion, d as IdentityAssertionId, e as IdentityAssertionResult, f as IdentityFacade, g as IdentityNode, h as IdentityNodeRefInput, i as IdentityPair, j as IdentityReadFacade, k as IdentityRelation, l as IdentityWriteSummary } from '../../store-FTqBpuJD.cjs';
|
|
6
6
|
import { L as LocalSqlitePragmaOptions } from '../../local-options-CZ1BnIoF.cjs';
|
|
7
7
|
export { D as DEFAULT_LOCAL_SQLITE_PRAGMAS, a as LocalSqliteJournalMode, b as LocalSqliteSynchronousMode } from '../../local-options-CZ1BnIoF.cjs';
|
|
8
8
|
import 'zod';
|
|
9
|
-
import '../../materialize-indexes-
|
|
10
|
-
import '../../temporal-
|
|
11
|
-
import '../../searchable-
|
|
9
|
+
import '../../materialize-indexes-BXz77YqO.cjs';
|
|
10
|
+
import '../../temporal-CXewwLTB.cjs';
|
|
11
|
+
import '../../searchable-BrUh0pdc.cjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Batteries-included local SQLite Store for strict TypeScript consumers.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { B as BackendCapabilities, d as GraphDef } from '../../types-
|
|
2
|
-
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-
|
|
3
|
-
import { S as SchemaManagerOptions } from '../../manager-
|
|
4
|
-
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-
|
|
5
|
-
export { I as IdentityAssertion, d as IdentityAssertionId, e as IdentityAssertionResult, f as IdentityFacade, g as IdentityNode, h as IdentityNodeRefInput, i as IdentityPair, j as IdentityReadFacade, k as IdentityRelation, l as IdentityWriteSummary } from '../../store-
|
|
1
|
+
import { B as BackendCapabilities, d as GraphDef } from '../../types-Du78EvpN.js';
|
|
2
|
+
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Du78EvpN.js';
|
|
3
|
+
import { S as SchemaManagerOptions } from '../../manager-DX983gJ0.js';
|
|
4
|
+
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-Bo1psfVZ.js';
|
|
5
|
+
export { I as IdentityAssertion, d as IdentityAssertionId, e as IdentityAssertionResult, f as IdentityFacade, g as IdentityNode, h as IdentityNodeRefInput, i as IdentityPair, j as IdentityReadFacade, k as IdentityRelation, l as IdentityWriteSummary } from '../../store-Bo1psfVZ.js';
|
|
6
6
|
import { L as LocalSqlitePragmaOptions } from '../../local-options-CZ1BnIoF.js';
|
|
7
7
|
export { D as DEFAULT_LOCAL_SQLITE_PRAGMAS, a as LocalSqliteJournalMode, b as LocalSqliteSynchronousMode } from '../../local-options-CZ1BnIoF.js';
|
|
8
8
|
import 'zod';
|
|
9
|
-
import '../../materialize-indexes-
|
|
10
|
-
import '../../temporal-
|
|
11
|
-
import '../../searchable-
|
|
9
|
+
import '../../materialize-indexes-CpXoggWU.js';
|
|
10
|
+
import '../../temporal-DPtn0HOu.js';
|
|
11
|
+
import '../../searchable-BOUuA83f.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Batteries-included local SQLite Store for strict TypeScript consumers.
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { createLocalSqliteBackend } from '../../chunk-
|
|
2
|
-
export { DEFAULT_LOCAL_SQLITE_PRAGMAS } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import { createStoreWithSchema } from '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
9
|
-
import { createSqliteTables } from '../../chunk-
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import '../../chunk-
|
|
14
|
-
import '../../chunk-
|
|
15
|
-
import '../../chunk-
|
|
16
|
-
import '../../chunk-
|
|
1
|
+
import { createLocalSqliteBackend } from '../../chunk-RFDEYLIK.js';
|
|
2
|
+
export { DEFAULT_LOCAL_SQLITE_PRAGMAS } from '../../chunk-RFDEYLIK.js';
|
|
3
|
+
import '../../chunk-GWXXHOLU.js';
|
|
4
|
+
import '../../chunk-KXSMF6PL.js';
|
|
5
|
+
import { createStoreWithSchema } from '../../chunk-YQ4JONWE.js';
|
|
6
|
+
import '../../chunk-7TKNK32B.js';
|
|
7
|
+
import '../../chunk-BRN3RGD2.js';
|
|
8
|
+
import '../../chunk-IHRDX7K6.js';
|
|
9
|
+
import { createSqliteTables } from '../../chunk-WHS2Y43J.js';
|
|
10
|
+
import '../../chunk-AU3IJNNP.js';
|
|
11
|
+
import '../../chunk-WEJHA7AD.js';
|
|
12
|
+
import '../../chunk-LHYSY6SE.js';
|
|
13
|
+
import '../../chunk-KA4L2NZ3.js';
|
|
14
|
+
import '../../chunk-36LIJXWC.js';
|
|
15
|
+
import '../../chunk-A2LJG5GM.js';
|
|
16
|
+
import '../../chunk-EDHV4CBU.js';
|
|
17
17
|
import '../../chunk-JBQQ7THH.js';
|
|
18
|
-
import '../../chunk-
|
|
19
|
-
import '../../chunk-
|
|
20
|
-
import { closeAfterFailure } from '../../chunk-
|
|
21
|
-
import '../../chunk-
|
|
22
|
-
import '../../chunk-
|
|
23
|
-
import '../../chunk-
|
|
24
|
-
import '../../chunk-
|
|
25
|
-
import '../../chunk-
|
|
26
|
-
import '../../chunk-
|
|
18
|
+
import '../../chunk-DSAWGCMP.js';
|
|
19
|
+
import '../../chunk-72WUT4GG.js';
|
|
20
|
+
import { closeAfterFailure } from '../../chunk-FA6Z7B5L.js';
|
|
21
|
+
import '../../chunk-5ZJOB5YS.js';
|
|
22
|
+
import '../../chunk-LNIWCQR4.js';
|
|
23
|
+
import '../../chunk-R7EWHKID.js';
|
|
24
|
+
import '../../chunk-EDJDDY6H.js';
|
|
25
|
+
import '../../chunk-FSLTU57P.js';
|
|
26
|
+
import '../../chunk-WMKEGJG4.js';
|
|
27
27
|
import '../../chunk-K34OPSJK.js';
|
|
28
28
|
import '../../chunk-2EBMPJBO.js';
|
|
29
|
-
import '../../chunk-
|
|
30
|
-
import '../../chunk-
|
|
29
|
+
import '../../chunk-EAMVXR5B.js';
|
|
30
|
+
import '../../chunk-QOJ2L2AD.js';
|
|
31
31
|
import '../../chunk-AMKPPFUO.js';
|
|
32
32
|
import '../../chunk-W6OG3HDG.js';
|
|
33
33
|
import '../../chunk-PC2UBAUB.js';
|
|
34
|
-
import '../../chunk-
|
|
34
|
+
import '../../chunk-SXWLLQ3D.js';
|
|
35
35
|
import '../../chunk-JXXDZTMN.js';
|
|
36
|
-
import '../../chunk-
|
|
37
|
-
import '../../chunk-
|
|
36
|
+
import '../../chunk-OZJCH7ZS.js';
|
|
37
|
+
import '../../chunk-62ZXBMSD.js';
|
|
38
38
|
import '../../chunk-FWJKWH6U.js';
|
|
39
39
|
import '../../chunk-DYATYRY4.js';
|
|
40
40
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
9
|
-
require('../../chunk-
|
|
10
|
-
require('../../chunk-
|
|
3
|
+
var chunkUTVQPZPN_cjs = require('../../chunk-UTVQPZPN.cjs');
|
|
4
|
+
require('../../chunk-E4OSGBCM.cjs');
|
|
5
|
+
require('../../chunk-RHDOAQCT.cjs');
|
|
6
|
+
require('../../chunk-C4DYN2SD.cjs');
|
|
7
|
+
require('../../chunk-73MWKDFK.cjs');
|
|
8
|
+
require('../../chunk-BEB4OFZF.cjs');
|
|
9
|
+
require('../../chunk-A7NMUYEL.cjs');
|
|
10
|
+
require('../../chunk-DYPRZ53S.cjs');
|
|
11
11
|
require('../../chunk-PWLJ77UV.cjs');
|
|
12
|
-
require('../../chunk-
|
|
13
|
-
require('../../chunk-
|
|
14
|
-
require('../../chunk-
|
|
12
|
+
require('../../chunk-GVAMRRZR.cjs');
|
|
13
|
+
require('../../chunk-ANKOXPCC.cjs');
|
|
14
|
+
require('../../chunk-ZIH42CRX.cjs');
|
|
15
15
|
require('../../chunk-ZY4GXIVN.cjs');
|
|
16
16
|
require('../../chunk-NAUA4PW5.cjs');
|
|
17
|
-
require('../../chunk-
|
|
18
|
-
require('../../chunk-
|
|
19
|
-
require('../../chunk-
|
|
17
|
+
require('../../chunk-ZHOAZD7Q.cjs');
|
|
18
|
+
require('../../chunk-2ZWM2RFH.cjs');
|
|
19
|
+
require('../../chunk-KCH7WQA5.cjs');
|
|
20
20
|
require('../../chunk-A7J2YDDI.cjs');
|
|
21
21
|
require('../../chunk-N66HCGCY.cjs');
|
|
22
22
|
|
|
@@ -24,11 +24,11 @@ require('../../chunk-N66HCGCY.cjs');
|
|
|
24
24
|
|
|
25
25
|
Object.defineProperty(exports, "DEFAULT_LOCAL_SQLITE_PRAGMAS", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkUTVQPZPN_cjs.DEFAULT_LOCAL_SQLITE_PRAGMAS; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "createLocalSqliteBackend", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkUTVQPZPN_cjs.createLocalSqliteBackend; }
|
|
32
32
|
});
|
|
33
33
|
//# sourceMappingURL=local.cjs.map
|
|
34
34
|
//# sourceMappingURL=local.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
2
|
-
import { B as BackendCapabilities, A as AdapterBackend } from '../../types-
|
|
3
|
-
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-
|
|
2
|
+
import { B as BackendCapabilities, A as AdapterBackend } from '../../types-Du78EvpN.cjs';
|
|
3
|
+
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Du78EvpN.cjs';
|
|
4
4
|
import { A as AnySqliteDatabase } from '../../sqlite-execution-DwbE2a9y.cjs';
|
|
5
|
-
import { S as SqliteTables } from '../../sqlite-
|
|
5
|
+
import { S as SqliteTables } from '../../sqlite-BfYcV61E.cjs';
|
|
6
6
|
import { L as LocalSqlitePragmaOptions } from '../../local-options-CZ1BnIoF.cjs';
|
|
7
7
|
export { D as DEFAULT_LOCAL_SQLITE_PRAGMAS, a as LocalSqliteJournalMode, b as LocalSqliteSynchronousMode } from '../../local-options-CZ1BnIoF.cjs';
|
|
8
8
|
import 'zod';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
2
|
-
import { B as BackendCapabilities, A as AdapterBackend } from '../../types-
|
|
3
|
-
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-
|
|
2
|
+
import { B as BackendCapabilities, A as AdapterBackend } from '../../types-Du78EvpN.js';
|
|
3
|
+
export { C as ContributionDiagnostic, a as ContributionDiagnosticState, b as ContributionRepairEntry, c as ContributionRepairResult, G as GraphIdentityConfig } from '../../types-Du78EvpN.js';
|
|
4
4
|
import { A as AnySqliteDatabase } from '../../sqlite-execution-DwbE2a9y.js';
|
|
5
|
-
import { S as SqliteTables } from '../../sqlite-
|
|
5
|
+
import { S as SqliteTables } from '../../sqlite-DK40XVR1.js';
|
|
6
6
|
import { L as LocalSqlitePragmaOptions } from '../../local-options-CZ1BnIoF.js';
|
|
7
7
|
export { D as DEFAULT_LOCAL_SQLITE_PRAGMAS, a as LocalSqliteJournalMode, b as LocalSqliteSynchronousMode } from '../../local-options-CZ1BnIoF.js';
|
|
8
8
|
import 'zod';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { DEFAULT_LOCAL_SQLITE_PRAGMAS, createLocalSqliteBackend } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
1
|
+
export { DEFAULT_LOCAL_SQLITE_PRAGMAS, createLocalSqliteBackend } from '../../chunk-RFDEYLIK.js';
|
|
2
|
+
import '../../chunk-GWXXHOLU.js';
|
|
3
|
+
import '../../chunk-KXSMF6PL.js';
|
|
4
|
+
import '../../chunk-7TKNK32B.js';
|
|
5
|
+
import '../../chunk-BRN3RGD2.js';
|
|
6
|
+
import '../../chunk-IHRDX7K6.js';
|
|
7
|
+
import '../../chunk-WHS2Y43J.js';
|
|
8
|
+
import '../../chunk-AU3IJNNP.js';
|
|
9
9
|
import '../../chunk-JBQQ7THH.js';
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
10
|
+
import '../../chunk-DSAWGCMP.js';
|
|
11
|
+
import '../../chunk-FA6Z7B5L.js';
|
|
12
|
+
import '../../chunk-FSLTU57P.js';
|
|
13
13
|
import '../../chunk-K34OPSJK.js';
|
|
14
14
|
import '../../chunk-2EBMPJBO.js';
|
|
15
|
-
import '../../chunk-
|
|
16
|
-
import '../../chunk-
|
|
17
|
-
import '../../chunk-
|
|
15
|
+
import '../../chunk-EAMVXR5B.js';
|
|
16
|
+
import '../../chunk-QOJ2L2AD.js';
|
|
17
|
+
import '../../chunk-62ZXBMSD.js';
|
|
18
18
|
import '../../chunk-FWJKWH6U.js';
|
|
19
19
|
import '../../chunk-DYATYRY4.js';
|
|
20
20
|
//# sourceMappingURL=local.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKCH7WQA5_cjs = require('./chunk-KCH7WQA5.cjs');
|
|
4
4
|
|
|
5
5
|
// src/utils/global-symbol.ts
|
|
6
6
|
function typeGraphGlobalSymbol(name) {
|
|
@@ -133,7 +133,7 @@ function createFragment(chunks, intentSources = []) {
|
|
|
133
133
|
}
|
|
134
134
|
function getChunks(fragment) {
|
|
135
135
|
if (!isSqlFragment(fragment)) {
|
|
136
|
-
throw new
|
|
136
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
137
137
|
"Expected a SQL fragment created by TypeGraph's sql helper"
|
|
138
138
|
);
|
|
139
139
|
}
|
|
@@ -146,7 +146,7 @@ function isSqlPlaceholder(value) {
|
|
|
146
146
|
return typeof value === "object" && value !== null && SQL_PLACEHOLDER_BRAND in value && value[SQL_PLACEHOLDER_BRAND] === true && "name" in value && typeof value.name === "string";
|
|
147
147
|
}
|
|
148
148
|
function throwUnsupportedSqlChunk(chunk) {
|
|
149
|
-
throw new
|
|
149
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError("Unsupported SQL fragment chunk", { chunk });
|
|
150
150
|
}
|
|
151
151
|
function textNode(value) {
|
|
152
152
|
return Object.freeze({ kind: "text", value });
|
|
@@ -213,7 +213,7 @@ function quotedIdentifier(identifier) {
|
|
|
213
213
|
function resolvedPlaceholder(placeholder, bindings, dialect) {
|
|
214
214
|
if (bindings === void 0) return placeholder;
|
|
215
215
|
if (!Object.hasOwn(bindings, placeholder.name)) {
|
|
216
|
-
throw new
|
|
216
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
217
217
|
`Missing binding for parameter "${placeholder.name}"`,
|
|
218
218
|
{ parameterName: placeholder.name }
|
|
219
219
|
);
|
|
@@ -265,7 +265,7 @@ function inlineLiteral(value, dialect) {
|
|
|
265
265
|
if (typeof value === "string") return inlineSqlStringLiteral(value, dialect);
|
|
266
266
|
if (typeof value === "number") {
|
|
267
267
|
if (!Number.isFinite(value)) {
|
|
268
|
-
throw new
|
|
268
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError("Cannot inline a non-finite SQL number", {
|
|
269
269
|
value
|
|
270
270
|
});
|
|
271
271
|
}
|
|
@@ -278,7 +278,7 @@ function inlineLiteral(value, dialect) {
|
|
|
278
278
|
if (value instanceof Date) {
|
|
279
279
|
return inlineSqlStringLiteral(value.toISOString(), dialect);
|
|
280
280
|
}
|
|
281
|
-
throw new
|
|
281
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError("Cannot inline this SQL parameter value", {
|
|
282
282
|
value
|
|
283
283
|
});
|
|
284
284
|
}
|
|
@@ -299,7 +299,7 @@ function renderSqlInline(fragment, dialect) {
|
|
|
299
299
|
break;
|
|
300
300
|
}
|
|
301
301
|
case "placeholder": {
|
|
302
|
-
throw new
|
|
302
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
303
303
|
`Cannot inline unresolved SQL placeholder "${node.value.name}"`,
|
|
304
304
|
{ parameterName: node.value.name }
|
|
305
305
|
);
|
|
@@ -341,5 +341,5 @@ exports.shouldForceCustomPlan = shouldForceCustomPlan;
|
|
|
341
341
|
exports.sql = sql;
|
|
342
342
|
exports.throwUnsupportedSqlChunk = throwUnsupportedSqlChunk;
|
|
343
343
|
exports.typeGraphGlobalSymbol = typeGraphGlobalSymbol;
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-2ZWM2RFH.cjs.map
|
|
345
|
+
//# sourceMappingURL=chunk-2ZWM2RFH.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/global-symbol.ts","../src/query/dialect/profile.ts","../src/query/sql-intent.ts","../src/query/sql-fragment.ts","../src/query/dialect/like-escape.ts"],"names":["ConfigurationError"],"mappings":";;;;;AAYO,SAAS,sBACd,IAAA,EACS;AACT,EAAA,uBAAO,MAAA,CAAO,GAAA,CAAI,CAAA,oBAAA,EAAuB,IAAI,CAAA,CAAE,CAAA;AACjD;;;ACRA,IAAM,oBAAA,GAAuB;AAAA,EAC3B,QAAA,EAAU;AAAA,IACR,SAAA,EAAW,CAAC,KAAA,KAAmB,KAAA;AAAA,IAC/B,oBAAA,EAAsB,CAAC,KAAA,KAAoB,KAAA,GAAQ,MAAA,GAAS,OAAA;AAAA,IAC5D,WAAA,EAAa,CAAC,KAAA,KAAkB,CAAA,CAAA,EAAI,KAAK,CAAA;AAAA,GAC3C;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,SAAA,EAAW,CAAC,KAAA,KACV,OAAO,UAAU,SAAA,GACf,KAAA,GAAQ,IACN,CAAA,GACF,KAAA;AAAA,IACJ,oBAAA,EAAsB,CAAC,KAAA,KAAoB,KAAA,GAAQ,GAAA,GAAM,GAAA;AAAA,IACzD,aAA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EAAA,OAAO,KAAA,CAAM,KAAK,EAAE,CAAA;AACtB;;;ACvWO,IAAM,qBAAA,GAAwB;AAQ9B,IAAM,gBAAA,GAAgC,GAAA,CAAA,WAAA","file":"chunk-VCRRKBLN.cjs","sourcesContent":["type TypeGraphGlobalSymbolName =\n | \"sql-fragment\"\n | \"sql-placeholder\"\n | \"sql-intent-registry\"\n | \"internal-temporary-writes-v1\"\n | \"external-recorded-read-source-v1\"\n | \"sql-schema-v1\"\n | \"store-runtime-v1\"\n | \"typegraph-recorded-read-source-v1\"\n | \"transaction-runtime-v1\";\n\n/** Returns a process-wide symbol shared across ESM/CJS package instances. */\nexport function typeGraphGlobalSymbol<TSymbol extends symbol>(\n name: TypeGraphGlobalSymbolName,\n): TSymbol {\n return Symbol.for(`@nicia-ai/typegraph/${name}`) as TSymbol;\n}\n","import { type SqlDialect } from \"./types\";\n\nexport type SqlDialectProfile = Readonly<{\n bindValue: (value: unknown) => unknown;\n booleanLiteralString: (value: boolean) => string;\n placeholder: (index: number) => string;\n}>;\n\nconst SQL_DIALECT_PROFILES = {\n postgres: {\n bindValue: (value: unknown) => value,\n booleanLiteralString: (value: boolean) => (value ? \"TRUE\" : \"FALSE\"),\n placeholder: (index: number) => `$${index}`,\n },\n sqlite: {\n bindValue: (value: unknown) =>\n typeof value === \"boolean\" ?\n value ? 1\n : 0\n : value,\n booleanLiteralString: (value: boolean) => (value ? \"1\" : \"0\"),\n placeholder: () => \"?\",\n },\n} satisfies Record<SqlDialect, SqlDialectProfile>;\n\nconst SQL_STRING_LITERAL_RENDERERS = {\n postgres: (value: string) => {\n if (value.includes(\"\\\\\")) {\n return `E'${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"'\", \"''\")}'`;\n }\n return `'${value.replaceAll(\"'\", \"''\")}'`;\n },\n sqlite: (value: string) => `'${value.replaceAll(\"'\", \"''\")}'`,\n} satisfies Record<SqlDialect, (value: string) => string>;\n\n/** Returns the primitive rendering and binding rules for a SQL dialect. */\nexport function getSqlDialectProfile(dialect: SqlDialect): SqlDialectProfile {\n return SQL_DIALECT_PROFILES[dialect];\n}\n\n/** Maps a JavaScript value to the representation expected by a SQL driver. */\nexport function bindSqlValue(value: unknown, dialect: SqlDialect): unknown {\n if (value instanceof Date) return value.toISOString();\n return getSqlDialectProfile(dialect).bindValue(value);\n}\n\n/**\n * Packs a scalar list into the single JSON-text value that a list-valued `IN`\n * parameter binds to. Every element is bound exactly as the literal form would\n * bind it, so `field.in([...])` and `field.in(param(...))` agree row for row.\n */\nexport function packSqlListValue(\n values: readonly unknown[],\n dialect: SqlDialect,\n): string {\n return JSON.stringify(values.map((value) => bindSqlValue(value, dialect)));\n}\n\n/** Renders one SQL string literal using the dialect's escaping rules. */\nexport function inlineSqlStringLiteral(\n value: string,\n dialect: SqlDialect,\n): string {\n return SQL_STRING_LITERAL_RENDERERS[dialect](value);\n}\n","import { typeGraphGlobalSymbol } from \"../utils/global-symbol\";\nimport { type SqlFragment } from \"./sql-fragment\";\n\ndeclare const SqlIntentBrand: unique symbol;\n\nexport type SqlIntent = \"rows\" | \"statement\" | \"temporary-statement\";\n\nexport type IntentSql<I extends SqlIntent> = SqlFragment &\n Readonly<{ [SqlIntentBrand]: I }>;\n\nexport type CompiledRowsSql = IntentSql<\"rows\">;\nexport type CompiledSelectSql = CompiledRowsSql;\nexport type CompiledStatementSql = IntentSql<\"statement\">;\nexport type CompiledTemporaryStatementSql = IntentSql<\"temporary-statement\">;\n\nexport function asCompiledRowsSql(query: SqlFragment): CompiledRowsSql {\n return query as CompiledRowsSql;\n}\n\nexport function asCompiledSelectSql(query: SqlFragment): CompiledSelectSql {\n return asCompiledRowsSql(query);\n}\n\nexport function asCompiledStatementSql(\n query: SqlFragment,\n): CompiledStatementSql {\n return query as CompiledStatementSql;\n}\n\n/**\n * Marks an internal statement that may write only connection-local temporary\n * state. This is intentionally separate from the public raw-statement intent:\n * history-enabled stores block arbitrary raw writes but iterative graph\n * operations still need to manage ephemeral working tables.\n */\nexport function asCompiledTemporaryStatementSql(\n query: SqlFragment,\n): CompiledTemporaryStatementSql {\n return query as CompiledTemporaryStatementSql;\n}\n\n/**\n * Statements whose good plan depends on the bound parameter values —\n * e.g. an id-array membership filter where the array cardinality varies\n * per call. PostgreSQL's prepared-statement machinery switches to a\n * generic (parameter-blind) plan after five executions, which for these\n * statements is catastrophically wrong (measured 21ms -> 310ms on the\n * subgraph edge fetch). Marked statements are executed unnamed so every\n * call is planned against the actual parameters; the re-parse cost is\n * ~1ms, the generic-plan cliff it avoids is 10-300ms.\n */\ntype SqlIntentRegistry = Readonly<{\n annIndexScanQueries: WeakMap<SqlFragment, readonly string[]>;\n forceCustomPlanQueries: WeakSet<SqlFragment>;\n}>;\n\nconst SQL_INTENT_REGISTRY: unique symbol = typeGraphGlobalSymbol(\n \"sql-intent-registry\",\n);\nconst globalWithSqlIntentRegistry = globalThis as typeof globalThis &\n Readonly<{\n [SQL_INTENT_REGISTRY]?: SqlIntentRegistry;\n }>;\nconst sqlIntentRegistry =\n globalWithSqlIntentRegistry[SQL_INTENT_REGISTRY] ??\n (() => {\n const registry: SqlIntentRegistry = {\n annIndexScanQueries: new WeakMap(),\n forceCustomPlanQueries: new WeakSet(),\n };\n Object.defineProperty(globalWithSqlIntentRegistry, SQL_INTENT_REGISTRY, {\n configurable: false,\n enumerable: false,\n value: registry,\n writable: false,\n });\n return registry;\n })();\n\nexport function markForceCustomPlan(query: SqlFragment): void {\n sqlIntentRegistry.forceCustomPlanQueries.add(query);\n}\n\nexport function shouldForceCustomPlan(query: SqlFragment): boolean {\n return sqlIntentRegistry.forceCustomPlanQueries.has(query);\n}\n\n/**\n * Statements whose plan includes an engine ANN index scan (the inline\n * `.similarTo(..., { approximate: true })` branch). The PostgreSQL\n * backend wraps their execution with the same pgvector GUC overrides\n * the search facade applies (`hnsw.iterative_scan = strict_order` /\n * `ivfflat.iterative_scan = relaxed_order` on pgvector >= 0.8), so a\n * filtered approximate query keeps scanning past the default ef_search\n * frontier instead of starving. Carries the slot index types so the\n * backend knows which GUCs apply. Backends without GUC semantics\n * ignore the brand.\n */\nexport function markAnnIndexScan(\n query: SqlFragment,\n indexTypes: readonly string[],\n): void {\n sqlIntentRegistry.annIndexScanQueries.set(query, indexTypes);\n}\n\nexport function annIndexScanTypes(\n query: SqlFragment,\n): readonly string[] | undefined {\n return sqlIntentRegistry.annIndexScanQueries.get(query);\n}\n\n/** @internal Copies execution semantics when immutable fragments are composed. */\nexport function copySqlIntents(\n target: SqlFragment,\n sources: readonly SqlFragment[],\n): void {\n if (sources.some((source) => shouldForceCustomPlan(source))) {\n markForceCustomPlan(target);\n }\n\n const indexTypes = new Set<string>();\n for (const source of sources) {\n for (const indexType of annIndexScanTypes(source) ?? []) {\n indexTypes.add(indexType);\n }\n }\n if (indexTypes.size > 0) markAnnIndexScan(target, [...indexTypes]);\n}\n\n/**\n * Whether a compiled statement can be run as raw text (`executeRaw`) without\n * losing execution semantics. Both brands above ride on the SQL *object* and\n * are honored only by `backend.execute`: the force-custom-plan flag makes\n * PostgreSQL re-plan against the actual parameters (opposed to reusing a\n * cached statement), and the ANN-scan brand drives the pgvector iterative-scan\n * GUC wrapper. A statement carrying either must not be flattened to text and\n * cached — callers fall back to `backend.execute`. Keeping this predicate\n * beside the brands means a future brand updates one place, not every caller.\n */\nexport function isRawExecutable(query: SqlFragment): boolean {\n return (\n !shouldForceCustomPlan(query) && annIndexScanTypes(query) === undefined\n );\n}\n","import { ConfigurationError } from \"../errors\";\nimport { typeGraphGlobalSymbol } from \"../utils/global-symbol\";\nimport {\n bindSqlValue,\n getSqlDialectProfile,\n inlineSqlStringLiteral,\n} from \"./dialect/profile\";\nimport { type SqlDialect } from \"./dialect/types\";\nimport { copySqlIntents } from \"./sql-intent\";\n\n/** Nominal identity shared by every package entrypoint. */\nconst SQL_FRAGMENT_BRAND: unique symbol = typeGraphGlobalSymbol(\"sql-fragment\");\nconst SQL_PLACEHOLDER_BRAND: unique symbol =\n typeGraphGlobalSymbol(\"sql-placeholder\");\n\nexport type SqlTextChunk = Readonly<{\n kind: \"text\";\n value: string;\n}>;\n\nexport type SqlParameterChunk = Readonly<{\n kind: \"parameter\";\n value: unknown;\n}>;\n\nexport type SqlIdentifierChunk = Readonly<{\n kind: \"identifier\";\n value: string;\n}>;\n\nexport type SqlPlaceholderChunk = Readonly<{\n kind: \"placeholder\";\n value: Placeholder;\n}>;\n\n/** One immutable unit in a database-independent SQL fragment. */\nexport type SqlChunk =\n SqlTextChunk | SqlParameterChunk | SqlIdentifierChunk | SqlPlaceholderChunk;\n\n/**\n * An immutable, database-independent SQL expression.\n *\n * Fragments contain syntax and bound values as separate nodes. A database\n * adapter renders the same fragment with its native placeholder convention at\n * the final execution boundary.\n */\nexport type SqlFragment = Readonly<{\n [SQL_FRAGMENT_BRAND]: true;\n append: (fragment: SqlFragment) => SqlFragment;\n chunks: readonly SqlChunk[];\n}>;\n\n/** A named value resolved when a prepared statement is executed. */\nexport class Placeholder {\n readonly [SQL_PLACEHOLDER_BRAND] = true as const;\n readonly name: string;\n\n constructor(name: string) {\n this.name = name;\n Object.freeze(this);\n }\n}\n\nclass SqlFragmentValue implements SqlFragment {\n readonly [SQL_FRAGMENT_BRAND] = true as const;\n\n readonly chunks: readonly SqlChunk[];\n\n constructor(chunks: readonly SqlChunk[]) {\n this.chunks = Object.freeze([...chunks]);\n Object.freeze(this);\n }\n\n append(fragment: SqlFragment): SqlFragment {\n return createFragment(\n [...this.chunks, ...getChunks(fragment)],\n [this, fragment],\n );\n }\n}\n\nfunction createFragment(\n chunks: readonly SqlChunk[],\n intentSources: readonly SqlFragment[] = [],\n): SqlFragment {\n const fragment = new SqlFragmentValue(chunks);\n copySqlIntents(fragment, intentSources);\n return fragment;\n}\n\nfunction getChunks(fragment: SqlFragment): readonly SqlChunk[] {\n if (!isSqlFragment(fragment)) {\n throw new ConfigurationError(\n \"Expected a SQL fragment created by TypeGraph's sql helper\",\n );\n }\n return fragment.chunks;\n}\n\n/** Returns whether a value is a TypeGraph-owned SQL fragment. */\nexport function isSqlFragment(value: unknown): value is SqlFragment {\n return (\n typeof value === \"object\" &&\n value !== null &&\n SQL_FRAGMENT_BRAND in value &&\n value[SQL_FRAGMENT_BRAND] === true &&\n \"chunks\" in value &&\n Array.isArray(value.chunks) &&\n \"append\" in value &&\n typeof value.append === \"function\"\n );\n}\n\n/** Returns whether a value is a TypeGraph named SQL placeholder. */\nexport function isSqlPlaceholder(value: unknown): value is Placeholder {\n return (\n typeof value === \"object\" &&\n value !== null &&\n SQL_PLACEHOLDER_BRAND in value &&\n value[SQL_PLACEHOLDER_BRAND] === true &&\n \"name\" in value &&\n typeof value.name === \"string\"\n );\n}\n\n/** @internal Enforces exhaustive handling at every fragment boundary. */\nexport function throwUnsupportedSqlChunk(chunk: never): never {\n throw new ConfigurationError(\"Unsupported SQL fragment chunk\", { chunk });\n}\n\nfunction textNode(value: string): SqlTextChunk {\n return Object.freeze({ kind: \"text\", value });\n}\n\nfunction parameterNode(value: unknown): SqlParameterChunk {\n return Object.freeze({ kind: \"parameter\", value });\n}\n\nfunction identifierNode(value: string): SqlIdentifierChunk {\n return Object.freeze({ kind: \"identifier\", value });\n}\n\nfunction placeholderNode(value: Placeholder): SqlPlaceholderChunk {\n return Object.freeze({ kind: \"placeholder\", value });\n}\n\nfunction templateSql(\n strings: TemplateStringsArray,\n ...values: readonly unknown[]\n): SqlFragment {\n const chunks: SqlChunk[] = [];\n const intentSources: SqlFragment[] = [];\n\n for (const [index, text] of strings.entries()) {\n if (text.length > 0) chunks.push(textNode(text));\n\n if (index >= values.length) continue;\n const value = values[index];\n if (isSqlFragment(value)) {\n chunks.push(...getChunks(value));\n intentSources.push(value);\n } else if (isSqlPlaceholder(value)) {\n chunks.push(placeholderNode(value));\n } else {\n chunks.push(parameterNode(value));\n }\n }\n\n return createFragment(chunks, intentSources);\n}\n\nfunction rawSql(value: string): SqlFragment {\n return createFragment(value.length === 0 ? [] : [textNode(value)]);\n}\n\nfunction identifierSql(value: string): SqlFragment {\n return createFragment([identifierNode(value)]);\n}\n\nfunction joinSql(\n fragments: readonly SqlFragment[],\n separator: SqlFragment = EMPTY_SQL,\n): SqlFragment {\n const chunks: SqlChunk[] = [];\n const intentSources: SqlFragment[] = [separator];\n\n for (const [index, fragment] of fragments.entries()) {\n if (index > 0) chunks.push(...getChunks(separator));\n chunks.push(...getChunks(fragment));\n intentSources.push(fragment);\n }\n\n return createFragment(chunks, intentSources);\n}\n\nfunction placeholderSql(name: string): SqlFragment {\n return createFragment([placeholderNode(new Placeholder(name))]);\n}\n\nconst EMPTY_SQL = createFragment([]);\n\n/** TypeGraph's database-independent SQL template and composition helpers. */\nexport type SqlTag = Readonly<{\n empty: () => SqlFragment;\n identifier: (value: string) => SqlFragment;\n join: (\n fragments: readonly SqlFragment[],\n separator?: SqlFragment,\n ) => SqlFragment;\n placeholder: (name: string) => SqlFragment;\n raw: (value: string) => SqlFragment;\n}> &\n ((\n strings: TemplateStringsArray,\n ...values: readonly unknown[]\n ) => SqlFragment);\n\n/** TypeGraph's database-independent SQL template and composition helpers. */\nexport const sql: SqlTag = Object.assign(templateSql, {\n empty: function empty(): SqlFragment {\n return EMPTY_SQL;\n },\n identifier: identifierSql,\n join: joinSql,\n placeholder: placeholderSql,\n raw: rawSql,\n});\n\n/** A rendered statement and its ordered bound parameters. */\nexport type RenderedSql = Readonly<{\n sql: string;\n params: readonly unknown[];\n}>;\n\nfunction quotedIdentifier(identifier: string): string {\n return `\"${identifier.replaceAll('\"', '\"\"')}\"`;\n}\n\nfunction resolvedPlaceholder(\n placeholder: Placeholder,\n bindings: Readonly<Record<string, unknown>> | undefined,\n dialect: SqlDialect,\n): unknown {\n if (bindings === undefined) return placeholder;\n\n if (!Object.hasOwn(bindings, placeholder.name)) {\n throw new ConfigurationError(\n `Missing binding for parameter \"${placeholder.name}\"`,\n { parameterName: placeholder.name },\n );\n }\n return bindSqlValue(bindings[placeholder.name], dialect);\n}\n\n/**\n * Renders a fragment for a database adapter.\n *\n * Named placeholders remain in `params` when `bindings` is omitted, allowing\n * a prepared template to resolve them later. Passing `bindings` resolves every\n * placeholder eagerly.\n */\nexport function renderSql(\n fragment: SqlFragment,\n dialect: SqlDialect,\n bindings?: Readonly<Record<string, unknown>>,\n): RenderedSql {\n const parts: string[] = [];\n const params: unknown[] = [];\n const profile = getSqlDialectProfile(dialect);\n\n for (const node of getChunks(fragment)) {\n switch (node.kind) {\n case \"text\": {\n parts.push(node.value);\n break;\n }\n case \"identifier\": {\n parts.push(quotedIdentifier(node.value));\n break;\n }\n case \"parameter\": {\n params.push(bindSqlValue(node.value, dialect));\n parts.push(profile.placeholder(params.length));\n break;\n }\n case \"placeholder\": {\n params.push(resolvedPlaceholder(node.value, bindings, dialect));\n parts.push(profile.placeholder(params.length));\n break;\n }\n default: {\n throwUnsupportedSqlChunk(node);\n }\n }\n }\n\n return Object.freeze({\n sql: parts.join(\"\"),\n params: Object.freeze(params),\n });\n}\n\n/** Renders a fragment using SQLite's `?` placeholders. */\nexport function renderSqlite(\n fragment: SqlFragment,\n bindings?: Readonly<Record<string, unknown>>,\n): RenderedSql {\n return renderSql(fragment, \"sqlite\", bindings);\n}\n\n/** Renders a fragment using PostgreSQL's numbered placeholders. */\nexport function renderPostgres(\n fragment: SqlFragment,\n bindings?: Readonly<Record<string, unknown>>,\n): RenderedSql {\n return renderSql(fragment, \"postgres\", bindings);\n}\n\nfunction inlineLiteral(value: unknown, dialect: SqlDialect): string {\n if (value === undefined || value === null) return \"NULL\";\n if (typeof value === \"string\") return inlineSqlStringLiteral(value, dialect);\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) {\n throw new ConfigurationError(\"Cannot inline a non-finite SQL number\", {\n value,\n });\n }\n return String(value);\n }\n if (typeof value === \"bigint\") return String(value);\n if (typeof value === \"boolean\") {\n return getSqlDialectProfile(dialect).booleanLiteralString(value);\n }\n if (value instanceof Date) {\n return inlineSqlStringLiteral(value.toISOString(), dialect);\n }\n\n throw new ConfigurationError(\"Cannot inline this SQL parameter value\", {\n value,\n });\n}\n\n/**\n * Renders a fragment with safe scalar literals instead of bound parameters.\n *\n * This is intentionally limited to DDL paths whose drivers cannot bind values.\n * Application queries should always use {@link renderSql}.\n */\nexport function renderSqlInline(\n fragment: SqlFragment,\n dialect: SqlDialect,\n): string {\n const parts: string[] = [];\n\n for (const node of getChunks(fragment)) {\n switch (node.kind) {\n case \"text\": {\n parts.push(node.value);\n break;\n }\n case \"identifier\": {\n parts.push(quotedIdentifier(node.value));\n break;\n }\n case \"parameter\": {\n parts.push(inlineLiteral(node.value, dialect));\n break;\n }\n case \"placeholder\": {\n throw new ConfigurationError(\n `Cannot inline unresolved SQL placeholder \"${node.value.name}\"`,\n { parameterName: node.value.name },\n );\n }\n default: {\n throwUnsupportedSqlChunk(node);\n }\n }\n }\n\n return parts.join(\"\");\n}\n","/**\n * Shared LIKE-escape clause for the query compiler.\n *\n * The compiler builds `contains` / `startsWith` / `endsWith` patterns by\n * escaping the literal `%`, `_`, and `\\` in user input with a backslash (see\n * the pattern builders in `compiler/predicates.ts`). For that escaping to take\n * effect the emitted `LIKE` / `ILIKE` must declare backslash as its escape\n * character. PostgreSQL's default LIKE escape is already backslash, so this\n * clause is a no-op there; SQLite has *no* default escape character, so without\n * it an escaped `\\%` matches a literal backslash followed by any character —\n * silently diverging from Postgres. Emitting it on every compiled predicate\n * makes the two backends match by construction.\n */\nimport { sql, type SqlFragment } from \"../sql-fragment\";\n\n/**\n * The backslash escape character used by the JS pattern builder\n * (`compileStringPattern` in `compiler/predicates.ts`) to prefix the literal\n * `%`, `_`, and `\\` in user input. It must match the character declared by\n * {@link likeEscapeClause}: the builder prefixes wildcards with this character,\n * and the clause tells SQL to treat it as the escape. Both are backslash.\n */\nexport const LIKE_ESCAPE_CHARACTER = \"\\\\\";\n\n/**\n * `ESCAPE '\\'` clause appended to every compiled `LIKE` / `ILIKE` predicate,\n * declaring {@link LIKE_ESCAPE_CHARACTER} as the escape character. The single\n * backslash inside the quotes is a literal in both PostgreSQL (with\n * `standard_conforming_strings`, the default) and SQLite.\n */\nexport const likeEscapeClause: SqlFragment = sql`ESCAPE '\\\\'`;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/global-symbol.ts","../src/query/dialect/profile.ts","../src/query/sql-intent.ts","../src/query/sql-fragment.ts","../src/query/dialect/like-escape.ts"],"names":["ConfigurationError"],"mappings":";;;;;AAYO,SAAS,sBACd,IAAA,EACS;AACT,EAAA,uBAAO,MAAA,CAAO,GAAA,CAAI,CAAA,oBAAA,EAAuB,IAAI,CAAA,CAAE,CAAA;AACjD;;;ACRA,IAAM,oBAAA,GAAuB;AAAA,EAC3B,QAAA,EAAU;AAAA,IACR,SAAA,EAAW,CAAC,KAAA,KAAmB,KAAA;AAAA,IAC/B,oBAAA,EAAsB,CAAC,KAAA,KAAoB,KAAA,GAAQ,MAAA,GAAS,OAAA;AAAA,IAC5D,WAAA,EAAa,CAAC,KAAA,KAAkB,CAAA,CAAA,EAAI,KAAK,CAAA;AAAA,GAC3C;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,SAAA,EAAW,CAAC,KAAA,KACV,OAAO,UAAU,SAAA,GACf,KAAA,GAAQ,IACN,CAAA,GACF,KAAA;AAAA,IACJ,oBAAA,EAAsB,CAAC,KAAA,KAAoB,KAAA,GAAQ,GAAA,GAAM,GAAA;AAAA,IACzD,aAAa,MAAM;AAAA;AAEvB,CAAA;AAEA,IAAM,4BAAA,GAA+B;AAAA,EACnC,QAAA,EAAU,CAAC,KAAA,KAAkB;AAC3B,IAAA,IAAI,KAAA,CAAM,QAAA,CAAS,IAAI,CAAA,EAAG;AACxB,MAAA,OAAO,CAAA,EAAA,EAAK,MAAM,UAAA,CAAW,IAAA,EAAM,MAAM,CAAA,CAAE,UAAA,CAAW,GAAA,EAAK,IAAI,CAAC,CAAA,CAAA,CAAA;AAAA,IAClE;AACA,IAAA,OAAO,CAAA,CAAA,EAAI,KAAA,CAAM,UAAA,CAAW,GAAA,EAAK,IAAI,C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UACA,OAAA,EACQ;AACR,EAAA,MAAM,QAAkB,EAAC;AAEzB,EAAA,KAAA,MAAW,IAAA,IAAQ,SAAA,CAAU,QAAQ,CAAA,EAAG;AACtC,IAAA,QAAQ,KAAK,IAAA;AAAM,MACjB,KAAK,MAAA,EAAQ;AACX,QAAA,KAAA,CAAM,IAAA,CAAK,KAAK,KAAK,CAAA;AACrB,QAAA;AAAA,MACF;AAAA,MACA,KAAK,YAAA,EAAc;AACjB,QAAA,KAAA,CAAM,IAAA,CAAK,gBAAA,CAAiB,IAAA,CAAK,KAAK,CAAC,CAAA;AACvC,QAAA;AAAA,MACF;AAAA,MACA,KAAK,WAAA,EAAa;AAChB,QAAA,KAAA,CAAM,IAAA,CAAK,aAAA,CAAc,IAAA,CAAK,KAAA,EAAO,OAAO,CAAC,CAAA;AAC7C,QAAA;AAAA,MACF;AAAA,MACA,KAAK,aAAA,EAAe;AAClB,QAAA,MAAM,IAAIA,oCAAA;AAAA,UACR,CAAA,0CAAA,EAA6C,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA,CAAA,CAAA;AAAA,UAC5D,EAAE,aAAA,EAAe,IAAA,CAAK,KAAA,CAAM,IAAA;AAAK,SACnC;AAAA,MACF;AAAA,MACA,SAAS;AACP,QAAA,wBAAA,CAAyB,IAAI,CAAA;AAAA,MAC/B;AAAA;AACF,EACF;AAEA,EAAA,OAAO,KAAA,CAAM,KAAK,EAAE,CAAA;AACtB;;;ACvWO,IAAM,qBAAA,GAAwB;AAQ9B,IAAM,gBAAA,GAAgC,GAAA,CAAA,WAAA","file":"chunk-2ZWM2RFH.cjs","sourcesContent":["type TypeGraphGlobalSymbolName =\n | \"sql-fragment\"\n | \"sql-placeholder\"\n | \"sql-intent-registry\"\n | \"internal-temporary-writes-v1\"\n | \"external-recorded-read-source-v1\"\n | \"sql-schema-v1\"\n | \"store-runtime-v1\"\n | \"typegraph-recorded-read-source-v1\"\n | \"transaction-runtime-v1\";\n\n/** Returns a process-wide symbol shared across ESM/CJS package instances. */\nexport function typeGraphGlobalSymbol<TSymbol extends symbol>(\n name: TypeGraphGlobalSymbolName,\n): TSymbol {\n return Symbol.for(`@nicia-ai/typegraph/${name}`) as TSymbol;\n}\n","import { type SqlDialect } from \"./types\";\n\nexport type SqlDialectProfile = Readonly<{\n bindValue: (value: unknown) => unknown;\n booleanLiteralString: (value: boolean) => string;\n placeholder: (index: number) => string;\n}>;\n\nconst SQL_DIALECT_PROFILES = {\n postgres: {\n bindValue: (value: unknown) => value,\n booleanLiteralString: (value: boolean) => (value ? \"TRUE\" : \"FALSE\"),\n placeholder: (index: number) => `$${index}`,\n },\n sqlite: {\n bindValue: (value: unknown) =>\n typeof value === \"boolean\" ?\n value ? 1\n : 0\n : value,\n booleanLiteralString: (value: boolean) => (value ? \"1\" : \"0\"),\n placeholder: () => \"?\",\n },\n} satisfies Record<SqlDialect, SqlDialectProfile>;\n\nconst SQL_STRING_LITERAL_RENDERERS = {\n postgres: (value: string) => {\n if (value.includes(\"\\\\\")) {\n return `E'${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"'\", \"''\")}'`;\n }\n return `'${value.replaceAll(\"'\", \"''\")}'`;\n },\n sqlite: (value: string) => `'${value.replaceAll(\"'\", \"''\")}'`,\n} satisfies Record<SqlDialect, (value: string) => string>;\n\n/** Returns the primitive rendering and binding rules for a SQL dialect. */\nexport function getSqlDialectProfile(dialect: SqlDialect): SqlDialectProfile {\n return SQL_DIALECT_PROFILES[dialect];\n}\n\n/** Maps a JavaScript value to the representation expected by a SQL driver. */\nexport function bindSqlValue(value: unknown, dialect: SqlDialect): unknown {\n if (value instanceof Date) return value.toISOString();\n return getSqlDialectProfile(dialect).bindValue(value);\n}\n\n/**\n * Packs a scalar list into the single JSON-text value that a list-valued `IN`\n * parameter binds to. Every element is bound exactly as the literal form would\n * bind it, so `field.in([...])` and `field.in(param(...))` agree row for row.\n */\nexport function packSqlListValue(\n values: readonly unknown[],\n dialect: SqlDialect,\n): string {\n return JSON.stringify(values.map((value) => bindSqlValue(value, dialect)));\n}\n\n/** Renders one SQL string literal using the dialect's escaping rules. */\nexport function inlineSqlStringLiteral(\n value: string,\n dialect: SqlDialect,\n): string {\n return SQL_STRING_LITERAL_RENDERERS[dialect](value);\n}\n","import { typeGraphGlobalSymbol } from \"../utils/global-symbol\";\nimport { type SqlFragment } from \"./sql-fragment\";\n\ndeclare const SqlIntentBrand: unique symbol;\n\nexport type SqlIntent = \"rows\" | \"statement\" | \"temporary-statement\";\n\nexport type IntentSql<I extends SqlIntent> = SqlFragment &\n Readonly<{ [SqlIntentBrand]: I }>;\n\nexport type CompiledRowsSql = IntentSql<\"rows\">;\nexport type CompiledSelectSql = CompiledRowsSql;\nexport type CompiledStatementSql = IntentSql<\"statement\">;\nexport type CompiledTemporaryStatementSql = IntentSql<\"temporary-statement\">;\n\nexport function asCompiledRowsSql(query: SqlFragment): CompiledRowsSql {\n return query as CompiledRowsSql;\n}\n\nexport function asCompiledSelectSql(query: SqlFragment): CompiledSelectSql {\n return asCompiledRowsSql(query);\n}\n\nexport function asCompiledStatementSql(\n query: SqlFragment,\n): CompiledStatementSql {\n return query as CompiledStatementSql;\n}\n\n/**\n * Marks an internal statement that may write only connection-local temporary\n * state. This is intentionally separate from the public raw-statement intent:\n * history-enabled stores block arbitrary raw writes but iterative graph\n * operations still need to manage ephemeral working tables.\n */\nexport function asCompiledTemporaryStatementSql(\n query: SqlFragment,\n): CompiledTemporaryStatementSql {\n return query as CompiledTemporaryStatementSql;\n}\n\n/**\n * Statements whose good plan depends on the bound parameter values —\n * e.g. an id-array membership filter where the array cardinality varies\n * per call. PostgreSQL's prepared-statement machinery switches to a\n * generic (parameter-blind) plan after five executions, which for these\n * statements is catastrophically wrong (measured 21ms -> 310ms on the\n * subgraph edge fetch). Marked statements are executed unnamed so every\n * call is planned against the actual parameters; the re-parse cost is\n * ~1ms, the generic-plan cliff it avoids is 10-300ms.\n */\ntype SqlIntentRegistry = Readonly<{\n annIndexScanQueries: WeakMap<SqlFragment, readonly string[]>;\n forceCustomPlanQueries: WeakSet<SqlFragment>;\n}>;\n\nconst SQL_INTENT_REGISTRY: unique symbol = typeGraphGlobalSymbol(\n \"sql-intent-registry\",\n);\nconst globalWithSqlIntentRegistry = globalThis as typeof globalThis &\n Readonly<{\n [SQL_INTENT_REGISTRY]?: SqlIntentRegistry;\n }>;\nconst sqlIntentRegistry =\n globalWithSqlIntentRegistry[SQL_INTENT_REGISTRY] ??\n (() => {\n const registry: SqlIntentRegistry = {\n annIndexScanQueries: new WeakMap(),\n forceCustomPlanQueries: new WeakSet(),\n };\n Object.defineProperty(globalWithSqlIntentRegistry, SQL_INTENT_REGISTRY, {\n configurable: false,\n enumerable: false,\n value: registry,\n writable: false,\n });\n return registry;\n })();\n\nexport function markForceCustomPlan(query: SqlFragment): void {\n sqlIntentRegistry.forceCustomPlanQueries.add(query);\n}\n\nexport function shouldForceCustomPlan(query: SqlFragment): boolean {\n return sqlIntentRegistry.forceCustomPlanQueries.has(query);\n}\n\n/**\n * Statements whose plan includes an engine ANN index scan (the inline\n * `.similarTo(..., { approximate: true })` branch). The PostgreSQL\n * backend wraps their execution with the same pgvector GUC overrides\n * the search facade applies (`hnsw.iterative_scan = strict_order` /\n * `ivfflat.iterative_scan = relaxed_order` on pgvector >= 0.8), so a\n * filtered approximate query keeps scanning past the default ef_search\n * frontier instead of starving. Carries the slot index types so the\n * backend knows which GUCs apply. Backends without GUC semantics\n * ignore the brand.\n */\nexport function markAnnIndexScan(\n query: SqlFragment,\n indexTypes: readonly string[],\n): void {\n sqlIntentRegistry.annIndexScanQueries.set(query, indexTypes);\n}\n\nexport function annIndexScanTypes(\n query: SqlFragment,\n): readonly string[] | undefined {\n return sqlIntentRegistry.annIndexScanQueries.get(query);\n}\n\n/** @internal Copies execution semantics when immutable fragments are composed. */\nexport function copySqlIntents(\n target: SqlFragment,\n sources: readonly SqlFragment[],\n): void {\n if (sources.some((source) => shouldForceCustomPlan(source))) {\n markForceCustomPlan(target);\n }\n\n const indexTypes = new Set<string>();\n for (const source of sources) {\n for (const indexType of annIndexScanTypes(source) ?? []) {\n indexTypes.add(indexType);\n }\n }\n if (indexTypes.size > 0) markAnnIndexScan(target, [...indexTypes]);\n}\n\n/**\n * Whether a compiled statement can be run as raw text (`executeRaw`) without\n * losing execution semantics. Both brands above ride on the SQL *object* and\n * are honored only by `backend.execute`: the force-custom-plan flag makes\n * PostgreSQL re-plan against the actual parameters (opposed to reusing a\n * cached statement), and the ANN-scan brand drives the pgvector iterative-scan\n * GUC wrapper. A statement carrying either must not be flattened to text and\n * cached — callers fall back to `backend.execute`. Keeping this predicate\n * beside the brands means a future brand updates one place, not every caller.\n */\nexport function isRawExecutable(query: SqlFragment): boolean {\n return (\n !shouldForceCustomPlan(query) && annIndexScanTypes(query) === undefined\n );\n}\n","import { ConfigurationError } from \"../errors\";\nimport { typeGraphGlobalSymbol } from \"../utils/global-symbol\";\nimport {\n bindSqlValue,\n getSqlDialectProfile,\n inlineSqlStringLiteral,\n} from \"./dialect/profile\";\nimport { type SqlDialect } from \"./dialect/types\";\nimport { copySqlIntents } from \"./sql-intent\";\n\n/** Nominal identity shared by every package entrypoint. */\nconst SQL_FRAGMENT_BRAND: unique symbol = typeGraphGlobalSymbol(\"sql-fragment\");\nconst SQL_PLACEHOLDER_BRAND: unique symbol =\n typeGraphGlobalSymbol(\"sql-placeholder\");\n\nexport type SqlTextChunk = Readonly<{\n kind: \"text\";\n value: string;\n}>;\n\nexport type SqlParameterChunk = Readonly<{\n kind: \"parameter\";\n value: unknown;\n}>;\n\nexport type SqlIdentifierChunk = Readonly<{\n kind: \"identifier\";\n value: string;\n}>;\n\nexport type SqlPlaceholderChunk = Readonly<{\n kind: \"placeholder\";\n value: Placeholder;\n}>;\n\n/** One immutable unit in a database-independent SQL fragment. */\nexport type SqlChunk =\n SqlTextChunk | SqlParameterChunk | SqlIdentifierChunk | SqlPlaceholderChunk;\n\n/**\n * An immutable, database-independent SQL expression.\n *\n * Fragments contain syntax and bound values as separate nodes. A database\n * adapter renders the same fragment with its native placeholder convention at\n * the final execution boundary.\n */\nexport type SqlFragment = Readonly<{\n [SQL_FRAGMENT_BRAND]: true;\n append: (fragment: SqlFragment) => SqlFragment;\n chunks: readonly SqlChunk[];\n}>;\n\n/** A named value resolved when a prepared statement is executed. */\nexport class Placeholder {\n readonly [SQL_PLACEHOLDER_BRAND] = true as const;\n readonly name: string;\n\n constructor(name: string) {\n this.name = name;\n Object.freeze(this);\n }\n}\n\nclass SqlFragmentValue implements SqlFragment {\n readonly [SQL_FRAGMENT_BRAND] = true as const;\n\n readonly chunks: readonly SqlChunk[];\n\n constructor(chunks: readonly SqlChunk[]) {\n this.chunks = Object.freeze([...chunks]);\n Object.freeze(this);\n }\n\n append(fragment: SqlFragment): SqlFragment {\n return createFragment(\n [...this.chunks, ...getChunks(fragment)],\n [this, fragment],\n );\n }\n}\n\nfunction createFragment(\n chunks: readonly SqlChunk[],\n intentSources: readonly SqlFragment[] = [],\n): SqlFragment {\n const fragment = new SqlFragmentValue(chunks);\n copySqlIntents(fragment, intentSources);\n return fragment;\n}\n\nfunction getChunks(fragment: SqlFragment): readonly SqlChunk[] {\n if (!isSqlFragment(fragment)) {\n throw new ConfigurationError(\n \"Expected a SQL fragment created by TypeGraph's sql helper\",\n );\n }\n return fragment.chunks;\n}\n\n/** Returns whether a value is a TypeGraph-owned SQL fragment. */\nexport function isSqlFragment(value: unknown): value is SqlFragment {\n return (\n typeof value === \"object\" &&\n value !== null &&\n SQL_FRAGMENT_BRAND in value &&\n value[SQL_FRAGMENT_BRAND] === true &&\n \"chunks\" in value &&\n Array.isArray(value.chunks) &&\n \"append\" in value &&\n typeof value.append === \"function\"\n );\n}\n\n/** Returns whether a value is a TypeGraph named SQL placeholder. */\nexport function isSqlPlaceholder(value: unknown): value is Placeholder {\n return (\n typeof value === \"object\" &&\n value !== null &&\n SQL_PLACEHOLDER_BRAND in value &&\n value[SQL_PLACEHOLDER_BRAND] === true &&\n \"name\" in value &&\n typeof value.name === \"string\"\n );\n}\n\n/** @internal Enforces exhaustive handling at every fragment boundary. */\nexport function throwUnsupportedSqlChunk(chunk: never): never {\n throw new ConfigurationError(\"Unsupported SQL fragment chunk\", { chunk });\n}\n\nfunction textNode(value: string): SqlTextChunk {\n return Object.freeze({ kind: \"text\", value });\n}\n\nfunction parameterNode(value: unknown): SqlParameterChunk {\n return Object.freeze({ kind: \"parameter\", value });\n}\n\nfunction identifierNode(value: string): SqlIdentifierChunk {\n return Object.freeze({ kind: \"identifier\", value });\n}\n\nfunction placeholderNode(value: Placeholder): SqlPlaceholderChunk {\n return Object.freeze({ kind: \"placeholder\", value });\n}\n\nfunction templateSql(\n strings: TemplateStringsArray,\n ...values: readonly unknown[]\n): SqlFragment {\n const chunks: SqlChunk[] = [];\n const intentSources: SqlFragment[] = [];\n\n for (const [index, text] of strings.entries()) {\n if (text.length > 0) chunks.push(textNode(text));\n\n if (index >= values.length) continue;\n const value = values[index];\n if (isSqlFragment(value)) {\n chunks.push(...getChunks(value));\n intentSources.push(value);\n } else if (isSqlPlaceholder(value)) {\n chunks.push(placeholderNode(value));\n } else {\n chunks.push(parameterNode(value));\n }\n }\n\n return createFragment(chunks, intentSources);\n}\n\nfunction rawSql(value: string): SqlFragment {\n return createFragment(value.length === 0 ? [] : [textNode(value)]);\n}\n\nfunction identifierSql(value: string): SqlFragment {\n return createFragment([identifierNode(value)]);\n}\n\nfunction joinSql(\n fragments: readonly SqlFragment[],\n separator: SqlFragment = EMPTY_SQL,\n): SqlFragment {\n const chunks: SqlChunk[] = [];\n const intentSources: SqlFragment[] = [separator];\n\n for (const [index, fragment] of fragments.entries()) {\n if (index > 0) chunks.push(...getChunks(separator));\n chunks.push(...getChunks(fragment));\n intentSources.push(fragment);\n }\n\n return createFragment(chunks, intentSources);\n}\n\nfunction placeholderSql(name: string): SqlFragment {\n return createFragment([placeholderNode(new Placeholder(name))]);\n}\n\nconst EMPTY_SQL = createFragment([]);\n\n/** TypeGraph's database-independent SQL template and composition helpers. */\nexport type SqlTag = Readonly<{\n empty: () => SqlFragment;\n identifier: (value: string) => SqlFragment;\n join: (\n fragments: readonly SqlFragment[],\n separator?: SqlFragment,\n ) => SqlFragment;\n placeholder: (name: string) => SqlFragment;\n raw: (value: string) => SqlFragment;\n}> &\n ((\n strings: TemplateStringsArray,\n ...values: readonly unknown[]\n ) => SqlFragment);\n\n/** TypeGraph's database-independent SQL template and composition helpers. */\nexport const sql: SqlTag = Object.assign(templateSql, {\n empty: function empty(): SqlFragment {\n return EMPTY_SQL;\n },\n identifier: identifierSql,\n join: joinSql,\n placeholder: placeholderSql,\n raw: rawSql,\n});\n\n/** A rendered statement and its ordered bound parameters. */\nexport type RenderedSql = Readonly<{\n sql: string;\n params: readonly unknown[];\n}>;\n\nfunction quotedIdentifier(identifier: string): string {\n return `\"${identifier.replaceAll('\"', '\"\"')}\"`;\n}\n\nfunction resolvedPlaceholder(\n placeholder: Placeholder,\n bindings: Readonly<Record<string, unknown>> | undefined,\n dialect: SqlDialect,\n): unknown {\n if (bindings === undefined) return placeholder;\n\n if (!Object.hasOwn(bindings, placeholder.name)) {\n throw new ConfigurationError(\n `Missing binding for parameter \"${placeholder.name}\"`,\n { parameterName: placeholder.name },\n );\n }\n return bindSqlValue(bindings[placeholder.name], dialect);\n}\n\n/**\n * Renders a fragment for a database adapter.\n *\n * Named placeholders remain in `params` when `bindings` is omitted, allowing\n * a prepared template to resolve them later. Passing `bindings` resolves every\n * placeholder eagerly.\n */\nexport function renderSql(\n fragment: SqlFragment,\n dialect: SqlDialect,\n bindings?: Readonly<Record<string, unknown>>,\n): RenderedSql {\n const parts: string[] = [];\n const params: unknown[] = [];\n const profile = getSqlDialectProfile(dialect);\n\n for (const node of getChunks(fragment)) {\n switch (node.kind) {\n case \"text\": {\n parts.push(node.value);\n break;\n }\n case \"identifier\": {\n parts.push(quotedIdentifier(node.value));\n break;\n }\n case \"parameter\": {\n params.push(bindSqlValue(node.value, dialect));\n parts.push(profile.placeholder(params.length));\n break;\n }\n case \"placeholder\": {\n params.push(resolvedPlaceholder(node.value, bindings, dialect));\n parts.push(profile.placeholder(params.length));\n break;\n }\n default: {\n throwUnsupportedSqlChunk(node);\n }\n }\n }\n\n return Object.freeze({\n sql: parts.join(\"\"),\n params: Object.freeze(params),\n });\n}\n\n/** Renders a fragment using SQLite's `?` placeholders. */\nexport function renderSqlite(\n fragment: SqlFragment,\n bindings?: Readonly<Record<string, unknown>>,\n): RenderedSql {\n return renderSql(fragment, \"sqlite\", bindings);\n}\n\n/** Renders a fragment using PostgreSQL's numbered placeholders. */\nexport function renderPostgres(\n fragment: SqlFragment,\n bindings?: Readonly<Record<string, unknown>>,\n): RenderedSql {\n return renderSql(fragment, \"postgres\", bindings);\n}\n\nfunction inlineLiteral(value: unknown, dialect: SqlDialect): string {\n if (value === undefined || value === null) return \"NULL\";\n if (typeof value === \"string\") return inlineSqlStringLiteral(value, dialect);\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) {\n throw new ConfigurationError(\"Cannot inline a non-finite SQL number\", {\n value,\n });\n }\n return String(value);\n }\n if (typeof value === \"bigint\") return String(value);\n if (typeof value === \"boolean\") {\n return getSqlDialectProfile(dialect).booleanLiteralString(value);\n }\n if (value instanceof Date) {\n return inlineSqlStringLiteral(value.toISOString(), dialect);\n }\n\n throw new ConfigurationError(\"Cannot inline this SQL parameter value\", {\n value,\n });\n}\n\n/**\n * Renders a fragment with safe scalar literals instead of bound parameters.\n *\n * This is intentionally limited to DDL paths whose drivers cannot bind values.\n * Application queries should always use {@link renderSql}.\n */\nexport function renderSqlInline(\n fragment: SqlFragment,\n dialect: SqlDialect,\n): string {\n const parts: string[] = [];\n\n for (const node of getChunks(fragment)) {\n switch (node.kind) {\n case \"text\": {\n parts.push(node.value);\n break;\n }\n case \"identifier\": {\n parts.push(quotedIdentifier(node.value));\n break;\n }\n case \"parameter\": {\n parts.push(inlineLiteral(node.value, dialect));\n break;\n }\n case \"placeholder\": {\n throw new ConfigurationError(\n `Cannot inline unresolved SQL placeholder \"${node.value.name}\"`,\n { parameterName: node.value.name },\n );\n }\n default: {\n throwUnsupportedSqlChunk(node);\n }\n }\n }\n\n return parts.join(\"\");\n}\n","/**\n * Shared LIKE-escape clause for the query compiler.\n *\n * The compiler builds `contains` / `startsWith` / `endsWith` patterns by\n * escaping the literal `%`, `_`, and `\\` in user input with a backslash (see\n * the pattern builders in `compiler/predicates.ts`). For that escaping to take\n * effect the emitted `LIKE` / `ILIKE` must declare backslash as its escape\n * character. PostgreSQL's default LIKE escape is already backslash, so this\n * clause is a no-op there; SQLite has *no* default escape character, so without\n * it an escaped `\\%` matches a literal backslash followed by any character —\n * silently diverging from Postgres. Emitting it on every compiled predicate\n * makes the two backends match by construction.\n */\nimport { sql, type SqlFragment } from \"../sql-fragment\";\n\n/**\n * The backslash escape character used by the JS pattern builder\n * (`compileStringPattern` in `compiler/predicates.ts`) to prefix the literal\n * `%`, `_`, and `\\` in user input. It must match the character declared by\n * {@link likeEscapeClause}: the builder prefixes wildcards with this character,\n * and the clause tells SQL to treat it as the escape. Both are backslash.\n */\nexport const LIKE_ESCAPE_CHARACTER = \"\\\\\";\n\n/**\n * `ESCAPE '\\'` clause appended to every compiled `LIKE` / `ILIKE` predicate,\n * declaring {@link LIKE_ESCAPE_CHARACTER} as the escape character. The single\n * backslash inside the quotes is a literal in both PostgreSQL (with\n * `standard_conforming_strings`, the default) and SQLite.\n */\nexport const likeEscapeClause: SqlFragment = sql`ESCAPE '\\\\'`;\n"]}
|