@nicia-ai/typegraph 0.39.0 → 0.41.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.
- package/dist/backend/drizzle/indexes.cjs +8 -10
- package/dist/backend/drizzle/indexes.d.cts +2 -2
- package/dist/backend/drizzle/indexes.d.ts +2 -2
- package/dist/backend/drizzle/indexes.js +4 -6
- package/dist/backend/index.cjs +60 -39
- package/dist/backend/index.d.cts +60 -1
- package/dist/backend/index.d.ts +60 -1
- package/dist/backend/index.js +12 -3
- package/dist/backend/postgres/index.cjs +24 -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 +11 -13
- package/dist/backend/postgres/pglite-store.cjs +25 -26
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +6 -5
- package/dist/backend/postgres/pglite-store.d.ts +6 -5
- package/dist/backend/postgres/pglite-store.js +21 -22
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +13 -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 +12 -14
- package/dist/backend/sqlite/index.cjs +25 -27
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +9 -11
- package/dist/backend/sqlite/libsql.cjs +15 -17
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +14 -16
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +26 -27
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- package/dist/backend/sqlite/local-store.d.cts +6 -5
- package/dist/backend/sqlite/local-store.d.ts +6 -5
- package/dist/backend/sqlite/local-store.js +22 -23
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +14 -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 +12 -14
- package/dist/{chunk-U4JDJKPD.js → chunk-2I3DNNBU.js} +4 -4
- package/dist/{chunk-U4JDJKPD.js.map → chunk-2I3DNNBU.js.map} +1 -1
- package/dist/{chunk-NPWACFQJ.cjs → chunk-2J5NMMVR.cjs} +43 -43
- package/dist/{chunk-NPWACFQJ.cjs.map → chunk-2J5NMMVR.cjs.map} +1 -1
- package/dist/{chunk-3YFDFOYB.cjs → chunk-2X73QTIC.cjs} +12 -13
- package/dist/chunk-2X73QTIC.cjs.map +1 -0
- package/dist/chunk-3SHAUJRB.js +79 -0
- package/dist/chunk-3SHAUJRB.js.map +1 -0
- package/dist/{chunk-3SK4SVTW.js → chunk-53BSOG3O.js} +8 -7
- package/dist/chunk-53BSOG3O.js.map +1 -0
- package/dist/chunk-5J4VNCUD.js +856 -0
- package/dist/chunk-5J4VNCUD.js.map +1 -0
- package/dist/chunk-5YBDB7UG.cjs +12 -0
- package/dist/{chunk-FMNUSGZ4.cjs.map → chunk-5YBDB7UG.cjs.map} +1 -1
- package/dist/{chunk-6XDBRDZE.js → chunk-6N7QBIWN.js} +7 -3
- package/dist/chunk-6N7QBIWN.js.map +1 -0
- package/dist/{chunk-EZH7FNUS.js → chunk-6QP4QXBR.js} +3 -3
- package/dist/{chunk-EZH7FNUS.js.map → chunk-6QP4QXBR.js.map} +1 -1
- package/dist/{chunk-E6TXEISH.cjs → chunk-7UTUKH4E.cjs} +4 -4
- package/dist/{chunk-E6TXEISH.cjs.map → chunk-7UTUKH4E.cjs.map} +1 -1
- package/dist/chunk-7WLEQIHA.cjs +605 -0
- package/dist/chunk-7WLEQIHA.cjs.map +1 -0
- package/dist/{chunk-BQITNFQJ.js → chunk-AQVDAKXH.js} +3 -3
- package/dist/{chunk-BQITNFQJ.js.map → chunk-AQVDAKXH.js.map} +1 -1
- package/dist/{chunk-X6CNEA32.js → chunk-BUZWMDNL.js} +5 -5
- package/dist/{chunk-X6CNEA32.js.map → chunk-BUZWMDNL.js.map} +1 -1
- package/dist/{chunk-7M3NACL3.cjs → chunk-CKFBZ4LV.cjs} +4 -4
- package/dist/{chunk-7M3NACL3.cjs.map → chunk-CKFBZ4LV.cjs.map} +1 -1
- package/dist/{chunk-IFRPHG7O.js → chunk-EFZ4S22A.js} +10 -9
- package/dist/chunk-EFZ4S22A.js.map +1 -0
- package/dist/chunk-ELA3V6UN.js +601 -0
- package/dist/chunk-ELA3V6UN.js.map +1 -0
- package/dist/chunk-HAQVISUF.cjs +1098 -0
- package/dist/chunk-HAQVISUF.cjs.map +1 -0
- package/dist/{chunk-BKAKAVRW.cjs → chunk-HQRZEYYB.cjs} +44 -44
- package/dist/{chunk-BKAKAVRW.cjs.map → chunk-HQRZEYYB.cjs.map} +1 -1
- package/dist/{chunk-KAFXPB2L.js → chunk-I5CRUPKO.js} +9 -10
- package/dist/{chunk-KAFXPB2L.js.map → chunk-I5CRUPKO.js.map} +1 -1
- package/dist/{chunk-IFDXG2YJ.js → chunk-JHK6NPFV.js} +217 -305
- package/dist/chunk-JHK6NPFV.js.map +1 -0
- package/dist/{chunk-VXAFOF6Z.cjs → chunk-JP5EICR6.cjs} +12 -7
- package/dist/chunk-JP5EICR6.cjs.map +1 -0
- package/dist/chunk-JZYMOHHM.cjs +226 -0
- package/dist/chunk-JZYMOHHM.cjs.map +1 -0
- package/dist/{chunk-ERZ4QPQX.js → chunk-K6CD6W5J.js} +5 -5
- package/dist/{chunk-ERZ4QPQX.js.map → chunk-K6CD6W5J.js.map} +1 -1
- package/dist/{chunk-JD2YC62H.cjs → chunk-KHNKYSGP.cjs} +34 -34
- package/dist/{chunk-JD2YC62H.cjs.map → chunk-KHNKYSGP.cjs.map} +1 -1
- package/dist/{chunk-CWX77JB4.cjs → chunk-KLR77R5A.cjs} +13 -13
- package/dist/{chunk-CWX77JB4.cjs.map → chunk-KLR77R5A.cjs.map} +1 -1
- package/dist/chunk-KOI7UEI5.js +81 -0
- package/dist/chunk-KOI7UEI5.js.map +1 -0
- package/dist/{chunk-AOL64O4Z.js → chunk-L3DDZUZP.js} +3 -3
- package/dist/{chunk-AOL64O4Z.js.map → chunk-L3DDZUZP.js.map} +1 -1
- package/dist/{chunk-PZHC5GCD.js → chunk-L5ET7FYQ.js} +3 -3
- package/dist/{chunk-PZHC5GCD.js.map → chunk-L5ET7FYQ.js.map} +1 -1
- package/dist/{chunk-B63IFHXR.cjs → chunk-LFFVD5ZR.cjs} +41 -41
- package/dist/{chunk-B63IFHXR.cjs.map → chunk-LFFVD5ZR.cjs.map} +1 -1
- package/dist/chunk-LL5D5T5W.cjs +157 -0
- package/dist/chunk-LL5D5T5W.cjs.map +1 -0
- package/dist/{chunk-GUUWKPTK.cjs → chunk-LLE25NRD.cjs} +7 -7
- package/dist/{chunk-GUUWKPTK.cjs.map → chunk-LLE25NRD.cjs.map} +1 -1
- package/dist/chunk-LLHMAHG4.cjs +886 -0
- package/dist/chunk-LLHMAHG4.cjs.map +1 -0
- package/dist/{chunk-6SRLCSAV.cjs → chunk-LOKG3KQV.cjs} +962 -875
- package/dist/chunk-LOKG3KQV.cjs.map +1 -0
- package/dist/{chunk-KIZSHRUI.cjs → chunk-M2RPZS7J.cjs} +10 -10
- package/dist/{chunk-KIZSHRUI.cjs.map → chunk-M2RPZS7J.cjs.map} +1 -1
- package/dist/chunk-MNURF4RF.cjs +85 -0
- package/dist/chunk-MNURF4RF.cjs.map +1 -0
- package/dist/{chunk-CBK2IVI2.js → chunk-MQBF3XGY.js} +119 -32
- package/dist/chunk-MQBF3XGY.js.map +1 -0
- package/dist/chunk-QCKD3RCI.cjs +83 -0
- package/dist/chunk-QCKD3RCI.cjs.map +1 -0
- package/dist/chunk-QOHTVDHU.js +144 -0
- package/dist/chunk-QOHTVDHU.js.map +1 -0
- package/dist/{chunk-HTQOBY75.cjs → chunk-QXKVUJLI.cjs} +110 -109
- package/dist/chunk-QXKVUJLI.cjs.map +1 -0
- package/dist/{chunk-GNPGGLAE.cjs → chunk-QYDUCWD2.cjs} +4 -4
- package/dist/{chunk-GNPGGLAE.cjs.map → chunk-QYDUCWD2.cjs.map} +1 -1
- package/dist/{chunk-DOKUXLFH.js → chunk-QZYGZVUI.js} +34 -34
- package/dist/chunk-QZYGZVUI.js.map +1 -0
- package/dist/{chunk-GKQU44SQ.cjs → chunk-SAMJLDGG.cjs} +103 -103
- package/dist/{chunk-GKQU44SQ.cjs.map → chunk-SAMJLDGG.cjs.map} +1 -1
- package/dist/{chunk-DOVMTPKE.cjs → chunk-SE422RES.cjs} +27 -27
- package/dist/{chunk-DOVMTPKE.cjs.map → chunk-SE422RES.cjs.map} +1 -1
- package/dist/{chunk-5ELKD2FQ.cjs → chunk-UCHW2MGP.cjs} +330 -431
- package/dist/chunk-UCHW2MGP.cjs.map +1 -0
- package/dist/{chunk-Y6UA55YS.cjs → chunk-UDS5DZNY.cjs} +495 -1095
- package/dist/chunk-UDS5DZNY.cjs.map +1 -0
- package/dist/{chunk-SU7VQOJ3.js → chunk-V3S74J44.js} +9 -5
- package/dist/chunk-V3S74J44.js.map +1 -0
- package/dist/{chunk-VDYA2HMS.js → chunk-VWEFXG73.js} +3 -3
- package/dist/{chunk-VDYA2HMS.js.map → chunk-VWEFXG73.js.map} +1 -1
- package/dist/{chunk-KXFUQNF2.js → chunk-W66YCXWT.js} +463 -1047
- package/dist/chunk-W66YCXWT.js.map +1 -0
- package/dist/{chunk-NQBYTLPW.js → chunk-XMEYZYGE.js} +6 -6
- package/dist/{chunk-NQBYTLPW.js.map → chunk-XMEYZYGE.js.map} +1 -1
- package/dist/{chunk-G3CSQLLT.js → chunk-Y5UC3IXF.js} +461 -6
- package/dist/chunk-Y5UC3IXF.js.map +1 -0
- package/dist/{chunk-SDHV2MWU.js → chunk-YGX4PMG6.js} +5 -5
- package/dist/{chunk-SDHV2MWU.js.map → chunk-YGX4PMG6.js.map} +1 -1
- package/dist/{chunk-E2Q7SP2K.cjs → chunk-YIX3BEBR.cjs} +86 -85
- package/dist/chunk-YIX3BEBR.cjs.map +1 -0
- package/dist/{chunk-X6RDQ5NB.cjs → chunk-YX3H63VV.cjs} +8 -2
- package/dist/chunk-YX3H63VV.cjs.map +1 -0
- package/dist/chunk-YYLMXERH.js +211 -0
- package/dist/chunk-YYLMXERH.js.map +1 -0
- package/dist/{chunk-YPUNPG2T.js → chunk-ZE7E46IZ.js} +5 -5
- package/dist/{chunk-YPUNPG2T.js.map → chunk-ZE7E46IZ.js.map} +1 -1
- package/dist/{chunk-Z2PPIVOO.js → chunk-ZVME6OSV.js} +5 -5
- package/dist/{chunk-Z2PPIVOO.js.map → chunk-ZVME6OSV.js.map} +1 -1
- package/dist/core/index.cjs +15 -3
- package/dist/core/index.d.cts +4 -3
- package/dist/core/index.d.ts +4 -3
- package/dist/core/index.js +2 -2
- package/dist/{ddl-J6sDyABg.d.cts → ddl-BCXFRLWg.d.cts} +3 -3
- package/dist/{ddl-Dx3Z0_WC.d.ts → ddl-ByLmGgn9.d.ts} +3 -3
- package/dist/{define-graph-DRo9xpYN.d.ts → define-graph-BSviZubs.d.ts} +1 -1
- package/dist/{define-graph-CzEvA_8F.d.cts → define-graph-XyJheaFm.d.cts} +1 -1
- package/dist/graph-merge/index.cjs +37 -38
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +6 -5
- package/dist/graph-merge/index.d.ts +6 -5
- package/dist/graph-merge/index.js +15 -16
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +146 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +23 -22
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +12 -14
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +5 -7
- package/dist/interchange/index.cjs +28 -29
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +6 -5
- package/dist/interchange/index.d.ts +6 -5
- package/dist/interchange/index.js +9 -10
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-CASfhmzV.d.ts → manager-C7iC5bk_.d.ts} +27 -3
- package/dist/{manager-nCEJiYBb.d.cts → manager-Dm6MCYO7.d.cts} +27 -3
- package/dist/{postgres-Cl1ZAN1G.d.ts → postgres-Cb6ceh4-.d.ts} +100 -49
- package/dist/{postgres-DMgIKQU-.d.cts → postgres-DZxwzCQ8.d.cts} +100 -49
- package/dist/profiler/index.d.cts +8 -7
- package/dist/profiler/index.d.ts +8 -7
- package/dist/provenance/index.cjs +19 -19
- package/dist/provenance/index.d.cts +6 -5
- package/dist/provenance/index.d.ts +6 -5
- package/dist/provenance/index.js +6 -6
- package/dist/schema/index.cjs +33 -101
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +55 -55
- package/dist/schema/index.d.ts +55 -55
- package/dist/schema/index.js +6 -86
- package/dist/schema/index.js.map +1 -1
- package/dist/{temporal-DqtOEo_B.d.ts → searchable-Cet4Oztt.d.ts} +3 -58
- package/dist/{temporal-BC_NQV5Y.d.cts → searchable-aUaKh3_r.d.cts} +3 -58
- package/dist/{sqlite-BDkW39aa.d.cts → sqlite-Cb3Ilj9_.d.ts} +124 -97
- package/dist/{sqlite-CYfhvESj.d.ts → sqlite-Dxklpizv.d.cts} +124 -97
- package/dist/{store-view-CLIhwMMX.d.ts → store-view-BDjGFjpN.d.ts} +67 -23
- package/dist/{store-view-BJd6Vwpt.d.cts → store-view-PCT7vTKH.d.cts} +67 -23
- package/dist/temporal-CyFsSPe8.d.ts +73 -0
- package/dist/temporal-Dn_JADWY.d.cts +73 -0
- package/dist/{types-CUevi_D1.d.ts → types-CFZiEEPh.d.ts} +1 -1
- package/dist/{types-COq3-vMC.d.cts → types-CsaG00wS.d.cts} +1 -1
- package/dist/{index-Bq7vSPHy.d.ts → types-D-vOo_pM.d.ts} +2 -2
- package/dist/{index-CrFL_ENI.d.cts → types-ho4DJJb_.d.cts} +2 -2
- package/dist/{where-BdE_cYtx.d.ts → where-DLYaXa4L.d.ts} +1 -1
- package/dist/{where-C92TXCzT.d.cts → where-udes1WRA.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3SK4SVTW.js.map +0 -1
- package/dist/chunk-3YFDFOYB.cjs.map +0 -1
- package/dist/chunk-5ELKD2FQ.cjs.map +0 -1
- package/dist/chunk-6SRLCSAV.cjs.map +0 -1
- package/dist/chunk-6XDBRDZE.js.map +0 -1
- package/dist/chunk-CBK2IVI2.js.map +0 -1
- package/dist/chunk-DDCIXXOO.js +0 -9
- package/dist/chunk-DDCIXXOO.js.map +0 -1
- package/dist/chunk-DDCYVIVV.cjs +0 -44
- package/dist/chunk-DDCYVIVV.cjs.map +0 -1
- package/dist/chunk-DOKUXLFH.js.map +0 -1
- package/dist/chunk-E2Q7SP2K.cjs.map +0 -1
- package/dist/chunk-EOJFGECD.cjs +0 -284
- package/dist/chunk-EOJFGECD.cjs.map +0 -1
- package/dist/chunk-FMNUSGZ4.cjs +0 -12
- package/dist/chunk-G3CSQLLT.js.map +0 -1
- package/dist/chunk-HTQOBY75.cjs.map +0 -1
- package/dist/chunk-I6FX7AAG.js +0 -39
- package/dist/chunk-I6FX7AAG.js.map +0 -1
- package/dist/chunk-IFDXG2YJ.js.map +0 -1
- package/dist/chunk-IFRPHG7O.js.map +0 -1
- package/dist/chunk-J6IJARLG.js +0 -94
- package/dist/chunk-J6IJARLG.js.map +0 -1
- package/dist/chunk-KXFUQNF2.js.map +0 -1
- package/dist/chunk-MTNEGGM2.js +0 -273
- package/dist/chunk-MTNEGGM2.js.map +0 -1
- package/dist/chunk-SU7VQOJ3.js.map +0 -1
- package/dist/chunk-SVUKGWSN.cjs +0 -102
- package/dist/chunk-SVUKGWSN.cjs.map +0 -1
- package/dist/chunk-UH2USOMG.cjs +0 -627
- package/dist/chunk-UH2USOMG.cjs.map +0 -1
- package/dist/chunk-VXAFOF6Z.cjs.map +0 -1
- package/dist/chunk-X6RDQ5NB.cjs.map +0 -1
- package/dist/chunk-Y6UA55YS.cjs.map +0 -1
- package/dist/chunk-Y7M44XEK.js +0 -462
- package/dist/chunk-Y7M44XEK.js.map +0 -1
- package/dist/chunk-Z5QHVL5U.cjs +0 -12
- package/dist/chunk-Z5QHVL5U.cjs.map +0 -1
- package/dist/chunk-ZKZAIX42.cjs +0 -479
- package/dist/chunk-ZKZAIX42.cjs.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkUDS5DZNY_cjs = require('./chunk-UDS5DZNY.cjs');
|
|
4
|
+
var chunkLFFVD5ZR_cjs = require('./chunk-LFFVD5ZR.cjs');
|
|
5
|
+
var chunk7UTUKH4E_cjs = require('./chunk-7UTUKH4E.cjs');
|
|
6
|
+
var chunkLLHMAHG4_cjs = require('./chunk-LLHMAHG4.cjs');
|
|
7
|
+
var chunkSE422RES_cjs = require('./chunk-SE422RES.cjs');
|
|
7
8
|
var chunkZDH3DX3C_cjs = require('./chunk-ZDH3DX3C.cjs');
|
|
8
|
-
var
|
|
9
|
+
var chunkQYDUCWD2_cjs = require('./chunk-QYDUCWD2.cjs');
|
|
9
10
|
var chunkHP6LWBLB_cjs = require('./chunk-HP6LWBLB.cjs');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
11
|
+
var chunkHAQVISUF_cjs = require('./chunk-HAQVISUF.cjs');
|
|
12
|
+
var chunkYX3H63VV_cjs = require('./chunk-YX3H63VV.cjs');
|
|
12
13
|
var chunk764JHTLT_cjs = require('./chunk-764JHTLT.cjs');
|
|
13
14
|
var chunkSAFZ6JTI_cjs = require('./chunk-SAFZ6JTI.cjs');
|
|
14
15
|
var drizzleOrm = require('drizzle-orm');
|
|
@@ -45,7 +46,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
45
46
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
46
47
|
var nextStatementId = 0;
|
|
47
48
|
function statementNameFor(sqlText, cacheMax) {
|
|
48
|
-
return
|
|
49
|
+
return chunkUDS5DZNY_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
49
50
|
const name = `tg_${nextStatementId}`;
|
|
50
51
|
nextStatementId += 1;
|
|
51
52
|
return name;
|
|
@@ -157,7 +158,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
157
158
|
options.useTransactionClient ?? false
|
|
158
159
|
);
|
|
159
160
|
function compile(query) {
|
|
160
|
-
return
|
|
161
|
+
return chunkSE422RES_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
|
|
161
162
|
}
|
|
162
163
|
if (pgClient === void 0) {
|
|
163
164
|
return {
|
|
@@ -165,7 +166,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
165
166
|
async execute(query) {
|
|
166
167
|
return executeDrizzleQuery(
|
|
167
168
|
db,
|
|
168
|
-
|
|
169
|
+
chunkYX3H63VV_cjs.isSqlFragment(query) ? chunkSE422RES_cjs.toDrizzleSql(query, "postgres") : query
|
|
169
170
|
);
|
|
170
171
|
}
|
|
171
172
|
};
|
|
@@ -182,7 +183,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
182
183
|
compile,
|
|
183
184
|
async execute(query) {
|
|
184
185
|
const compiled = compile(query);
|
|
185
|
-
if (
|
|
186
|
+
if (chunkYX3H63VV_cjs.isSqlFragment(query) && chunkYX3H63VV_cjs.shouldForceCustomPlan(query)) {
|
|
186
187
|
const result = await pgQueryClient.queryUnnamed(
|
|
187
188
|
compiled.sql,
|
|
188
189
|
compiled.params
|
|
@@ -254,57 +255,57 @@ var NODE_INSERT_PARAM_COUNT = 9;
|
|
|
254
255
|
var EDGE_INSERT_PARAM_COUNT = 12;
|
|
255
256
|
var POSTGRES_NODE_INSERT_BATCH_SIZE = Math.max(
|
|
256
257
|
1,
|
|
257
|
-
Math.floor(
|
|
258
|
+
Math.floor(chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS / NODE_INSERT_PARAM_COUNT)
|
|
258
259
|
);
|
|
259
260
|
var POSTGRES_EDGE_INSERT_BATCH_SIZE = Math.max(
|
|
260
261
|
1,
|
|
261
|
-
Math.floor(
|
|
262
|
+
Math.floor(chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS / EDGE_INSERT_PARAM_COUNT)
|
|
262
263
|
);
|
|
263
264
|
var POSTGRES_GET_NODES_ID_CHUNK_SIZE = Math.max(
|
|
264
265
|
1,
|
|
265
|
-
|
|
266
|
+
chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS - 2
|
|
266
267
|
);
|
|
267
268
|
var POSTGRES_GET_EDGES_ID_CHUNK_SIZE = Math.max(
|
|
268
269
|
1,
|
|
269
|
-
|
|
270
|
+
chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS - 1
|
|
270
271
|
);
|
|
271
272
|
var FULLTEXT_UPSERT_PARAM_COUNT = 6;
|
|
272
273
|
var FULLTEXT_DELETE_FIXED_PARAM_COUNT = 2;
|
|
273
274
|
var POSTGRES_FULLTEXT_UPSERT_BATCH_SIZE = Math.max(
|
|
274
275
|
1,
|
|
275
|
-
Math.floor(
|
|
276
|
+
Math.floor(chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS / FULLTEXT_UPSERT_PARAM_COUNT)
|
|
276
277
|
);
|
|
277
278
|
var POSTGRES_FULLTEXT_DELETE_CHUNK_SIZE = Math.max(
|
|
278
279
|
1,
|
|
279
|
-
|
|
280
|
+
chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS - FULLTEXT_DELETE_FIXED_PARAM_COUNT
|
|
280
281
|
);
|
|
281
282
|
var CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT = 3;
|
|
282
283
|
var POSTGRES_CHECK_UNIQUE_BATCH_CHUNK_SIZE = Math.max(
|
|
283
284
|
1,
|
|
284
|
-
|
|
285
|
+
chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
|
|
285
286
|
);
|
|
286
287
|
var UNIQUE_INSERT_PARAM_COUNT = 6;
|
|
287
288
|
var POSTGRES_UNIQUE_INSERT_BATCH_SIZE = Math.max(
|
|
288
289
|
1,
|
|
289
|
-
Math.floor(
|
|
290
|
+
Math.floor(chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS / UNIQUE_INSERT_PARAM_COUNT)
|
|
290
291
|
);
|
|
291
|
-
var toNodeRow =
|
|
292
|
-
var toEdgeRow =
|
|
293
|
-
var toUniqueRow =
|
|
294
|
-
var toSchemaVersionRow =
|
|
295
|
-
|
|
292
|
+
var toNodeRow = chunk7UTUKH4E_cjs.createNodeRowMapper(chunk7UTUKH4E_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
293
|
+
var toEdgeRow = chunk7UTUKH4E_cjs.createEdgeRowMapper(chunk7UTUKH4E_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
294
|
+
var toUniqueRow = chunk7UTUKH4E_cjs.createUniqueRowMapper(chunk7UTUKH4E_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
295
|
+
var toSchemaVersionRow = chunk7UTUKH4E_cjs.createSchemaVersionRowMapper(
|
|
296
|
+
chunk7UTUKH4E_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
296
297
|
);
|
|
297
298
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
298
299
|
return {
|
|
299
|
-
...
|
|
300
|
-
...vectorStrategy === void 0 ? {} : { vector:
|
|
301
|
-
fulltext:
|
|
300
|
+
...chunkQYDUCWD2_cjs.POSTGRES_CAPABILITIES,
|
|
301
|
+
...vectorStrategy === void 0 ? {} : { vector: chunkHAQVISUF_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
302
|
+
fulltext: chunkHAQVISUF_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
302
303
|
};
|
|
303
304
|
}
|
|
304
305
|
function createPostgresBackend(db, options = {}) {
|
|
305
|
-
const tables2 = options.tables ??
|
|
306
|
-
const fulltextStrategy = options.fulltext ??
|
|
307
|
-
const vectorStrategy = options.vector === false ? void 0 : options.vector ??
|
|
306
|
+
const tables2 = options.tables ?? chunkLLHMAHG4_cjs.tables;
|
|
307
|
+
const fulltextStrategy = options.fulltext ?? chunkHAQVISUF_cjs.tsvectorStrategy;
|
|
308
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkLFFVD5ZR_cjs.pgvectorStrategy;
|
|
308
309
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
309
310
|
const baseCapabilities = buildPostgresCapabilities(
|
|
310
311
|
fulltextStrategy,
|
|
@@ -317,7 +318,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
317
318
|
supported: false
|
|
318
319
|
}
|
|
319
320
|
} : {};
|
|
320
|
-
const capabilities =
|
|
321
|
+
const capabilities = chunkQYDUCWD2_cjs.normalizeGraphAnalyticsCapabilities({
|
|
321
322
|
...baseCapabilities,
|
|
322
323
|
...httpOnlyOverrides,
|
|
323
324
|
...options.capabilities
|
|
@@ -343,8 +344,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
343
344
|
drizzleOrm.getTableName(tables2.uniques),
|
|
344
345
|
tableNames.fulltext
|
|
345
346
|
].map(
|
|
346
|
-
(name) =>
|
|
347
|
-
|
|
347
|
+
(name) => chunkSE422RES_cjs.toDrizzleSql(
|
|
348
|
+
chunkYX3H63VV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkYX3H63VV_cjs.sql.identifier(name)}`,
|
|
348
349
|
"postgres"
|
|
349
350
|
)
|
|
350
351
|
);
|
|
@@ -353,11 +354,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
353
354
|
tableNames.recordedEdges,
|
|
354
355
|
tableNames.recordedClock
|
|
355
356
|
];
|
|
356
|
-
const operationStrategy =
|
|
357
|
+
const operationStrategy = chunkUDS5DZNY_cjs.createPostgresOperationStrategy(
|
|
357
358
|
tables2,
|
|
358
359
|
fulltextStrategy
|
|
359
360
|
);
|
|
360
|
-
const recordedTableExists =
|
|
361
|
+
const recordedTableExists = chunkUDS5DZNY_cjs.createCachedTableExistence(
|
|
361
362
|
async (tableName) => {
|
|
362
363
|
const rows = await executionAdapter.execute(
|
|
363
364
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -368,7 +369,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
368
369
|
);
|
|
369
370
|
const matTable = tables2.contributionMaterializations;
|
|
370
371
|
async function ensureContributionMaterializationsTableImpl() {
|
|
371
|
-
await db.execute(drizzleOrm.sql.raw(
|
|
372
|
+
await db.execute(drizzleOrm.sql.raw(chunkLLHMAHG4_cjs.generatePgCreateTableSQL(matTable)));
|
|
372
373
|
}
|
|
373
374
|
async function getContributionMaterializationRow(identity) {
|
|
374
375
|
const rows = await db.select().from(matTable).where(
|
|
@@ -381,25 +382,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
381
382
|
);
|
|
382
383
|
const row = rows[0];
|
|
383
384
|
if (row === void 0) return void 0;
|
|
384
|
-
return
|
|
385
|
+
return chunkUDS5DZNY_cjs.mapContributionMaterializationRow(
|
|
385
386
|
row,
|
|
386
|
-
|
|
387
|
+
chunkUDS5DZNY_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
387
388
|
);
|
|
388
389
|
}
|
|
389
390
|
async function getContributionMaterializationRows(graphId) {
|
|
390
391
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
391
392
|
return rows.map(
|
|
392
|
-
(row) =>
|
|
393
|
+
(row) => chunkUDS5DZNY_cjs.mapContributionMaterializationRow(
|
|
393
394
|
row,
|
|
394
|
-
|
|
395
|
+
chunkUDS5DZNY_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
395
396
|
)
|
|
396
397
|
);
|
|
397
398
|
}
|
|
398
399
|
async function recordContributionMaterializationRow(params) {
|
|
399
400
|
await db.insert(matTable).values(
|
|
400
|
-
|
|
401
|
+
chunkUDS5DZNY_cjs.buildContributionInsertValues(
|
|
401
402
|
params,
|
|
402
|
-
|
|
403
|
+
chunkUDS5DZNY_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
403
404
|
)
|
|
404
405
|
).onConflictDoUpdate({
|
|
405
406
|
target: [
|
|
@@ -408,7 +409,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
408
409
|
matTable.owner,
|
|
409
410
|
matTable.tableName
|
|
410
411
|
],
|
|
411
|
-
set:
|
|
412
|
+
set: chunkUDS5DZNY_cjs.buildContributionOnConflictSet(
|
|
412
413
|
matTable.materializedAt,
|
|
413
414
|
params.materializedAt
|
|
414
415
|
)
|
|
@@ -424,7 +425,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
424
425
|
)
|
|
425
426
|
);
|
|
426
427
|
}
|
|
427
|
-
const contributionMaterializer =
|
|
428
|
+
const contributionMaterializer = chunkUDS5DZNY_cjs.createContributionMaterializer({
|
|
428
429
|
dialect: "postgres",
|
|
429
430
|
fulltextStrategy,
|
|
430
431
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -493,7 +494,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
493
494
|
iterativeScanProbe
|
|
494
495
|
});
|
|
495
496
|
return {
|
|
496
|
-
backend:
|
|
497
|
+
backend: chunkUDS5DZNY_cjs.gateFulltext(
|
|
497
498
|
backend2,
|
|
498
499
|
contributionMaterializer.assertInitialized
|
|
499
500
|
),
|
|
@@ -516,35 +517,35 @@ function createPostgresBackend(db, options = {}) {
|
|
|
516
517
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
517
518
|
);
|
|
518
519
|
}
|
|
519
|
-
const trustedTx =
|
|
520
|
+
const trustedTx = chunkQYDUCWD2_cjs.createBackendOverlay(tx, {
|
|
520
521
|
executeRaw(sqlText, params) {
|
|
521
522
|
return executeCompiled({ params, sql: sqlText });
|
|
522
523
|
}
|
|
523
524
|
});
|
|
524
|
-
await
|
|
525
|
-
await
|
|
526
|
-
const indexDefinitions = await
|
|
525
|
+
await chunkUDS5DZNY_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
526
|
+
await chunkUDS5DZNY_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
527
|
+
const indexDefinitions = await chunkUDS5DZNY_cjs.suspendPostgresSecondaryIndexes(
|
|
527
528
|
trustedTx,
|
|
528
529
|
tableNames
|
|
529
530
|
);
|
|
530
531
|
const result = await fn(
|
|
531
|
-
|
|
532
|
+
chunkUDS5DZNY_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
532
533
|
);
|
|
533
|
-
await
|
|
534
|
-
await
|
|
534
|
+
await chunkUDS5DZNY_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
535
|
+
await chunkUDS5DZNY_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
535
536
|
return result;
|
|
536
537
|
});
|
|
537
538
|
}
|
|
538
539
|
} : {},
|
|
539
540
|
async bootstrapTables() {
|
|
540
|
-
const statements =
|
|
541
|
+
const statements = chunkLLHMAHG4_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
541
542
|
for (const statement of statements) {
|
|
542
543
|
await db.execute(drizzleOrm.sql.raw(statement));
|
|
543
544
|
}
|
|
544
545
|
},
|
|
545
546
|
async ensureRevisionOriginsTable() {
|
|
546
547
|
await db.execute(
|
|
547
|
-
drizzleOrm.sql.raw(
|
|
548
|
+
drizzleOrm.sql.raw(chunkLLHMAHG4_cjs.generatePgCreateTableSQL(tables2.revisionOrigins))
|
|
548
549
|
);
|
|
549
550
|
},
|
|
550
551
|
// Every fulltext-touching method asserts the durable marker instead
|
|
@@ -552,7 +553,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
552
553
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
553
554
|
// rather than self-healing on a read/write path (#135). Shared
|
|
554
555
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
555
|
-
...
|
|
556
|
+
...chunkUDS5DZNY_cjs.gateFulltextMethods(
|
|
556
557
|
operations,
|
|
557
558
|
contributionMaterializer.assertInitialized
|
|
558
559
|
),
|
|
@@ -561,7 +562,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
561
562
|
},
|
|
562
563
|
async ensureIndexMaterializationsTable() {
|
|
563
564
|
await db.execute(
|
|
564
|
-
drizzleOrm.sql.raw(
|
|
565
|
+
drizzleOrm.sql.raw(chunkLLHMAHG4_cjs.generatePgCreateTableSQL(tables2.indexMaterializations))
|
|
565
566
|
);
|
|
566
567
|
const tableName = drizzleOrm.getTableName(tables2.indexMaterializations);
|
|
567
568
|
await db.execute(
|
|
@@ -613,26 +614,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
613
614
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
614
615
|
const row = rows[0];
|
|
615
616
|
if (row === void 0) return void 0;
|
|
616
|
-
return
|
|
617
|
+
return chunkUDS5DZNY_cjs.mapMaterializationRow(row, chunkUDS5DZNY_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
617
618
|
},
|
|
618
619
|
async getIndexMaterializations(statusKeys) {
|
|
619
620
|
if (statusKeys.length === 0) return [];
|
|
620
621
|
const t = tables2.indexMaterializations;
|
|
621
622
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
622
623
|
return rows.map(
|
|
623
|
-
(row) =>
|
|
624
|
+
(row) => chunkUDS5DZNY_cjs.mapMaterializationRow(row, chunkUDS5DZNY_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
624
625
|
);
|
|
625
626
|
},
|
|
626
627
|
async recordIndexMaterialization(params) {
|
|
627
628
|
const t = tables2.indexMaterializations;
|
|
628
629
|
await db.insert(t).values(
|
|
629
|
-
|
|
630
|
+
chunkUDS5DZNY_cjs.buildMaterializationInsertValues(
|
|
630
631
|
params,
|
|
631
|
-
|
|
632
|
+
chunkUDS5DZNY_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
632
633
|
)
|
|
633
634
|
).onConflictDoUpdate({
|
|
634
635
|
target: t.indexName,
|
|
635
|
-
set:
|
|
636
|
+
set: chunkUDS5DZNY_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
636
637
|
});
|
|
637
638
|
},
|
|
638
639
|
async ensureContributionMaterializationsTable() {
|
|
@@ -648,37 +649,37 @@ function createPostgresBackend(db, options = {}) {
|
|
|
648
649
|
await contributionMaterializer.assertInitialized(graphId);
|
|
649
650
|
},
|
|
650
651
|
async ensureKindRemovalsTable() {
|
|
651
|
-
await db.execute(drizzleOrm.sql.raw(
|
|
652
|
+
await db.execute(drizzleOrm.sql.raw(chunkLLHMAHG4_cjs.generatePgCreateTableSQL(tables2.kindRemovals)));
|
|
652
653
|
},
|
|
653
654
|
async getPendingKindRemovals(graphId) {
|
|
654
655
|
const t = tables2.kindRemovals;
|
|
655
656
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
656
657
|
return rows.map(
|
|
657
|
-
(row) =>
|
|
658
|
+
(row) => chunkUDS5DZNY_cjs.mapKindRemovalRow(row, chunkUDS5DZNY_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
658
659
|
);
|
|
659
660
|
},
|
|
660
661
|
async getAllKindRemovals(graphId) {
|
|
661
662
|
const t = tables2.kindRemovals;
|
|
662
663
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
663
664
|
return rows.map(
|
|
664
|
-
(row) =>
|
|
665
|
+
(row) => chunkUDS5DZNY_cjs.mapKindRemovalRow(row, chunkUDS5DZNY_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
665
666
|
);
|
|
666
667
|
},
|
|
667
668
|
async recordKindRemoval(params) {
|
|
668
669
|
const t = tables2.kindRemovals;
|
|
669
670
|
await db.insert(t).values(
|
|
670
|
-
|
|
671
|
+
chunkUDS5DZNY_cjs.buildKindRemovalInsertValues(
|
|
671
672
|
params,
|
|
672
|
-
|
|
673
|
+
chunkUDS5DZNY_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
673
674
|
)
|
|
674
675
|
).onConflictDoUpdate({
|
|
675
676
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
676
|
-
set:
|
|
677
|
+
set: chunkUDS5DZNY_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
677
678
|
});
|
|
678
679
|
},
|
|
679
680
|
async ensureReconciliationMarkersTable() {
|
|
680
681
|
await db.execute(
|
|
681
|
-
drizzleOrm.sql.raw(
|
|
682
|
+
drizzleOrm.sql.raw(chunkLLHMAHG4_cjs.generatePgCreateTableSQL(tables2.reconciliationMarkers))
|
|
682
683
|
);
|
|
683
684
|
},
|
|
684
685
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -738,8 +739,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
738
739
|
const presentRecordedTables = tablePresence.filter((entry) => entry.exists).map((entry) => entry.tableName);
|
|
739
740
|
for (const tableName of presentRecordedTables) {
|
|
740
741
|
await db.execute(
|
|
741
|
-
|
|
742
|
-
|
|
742
|
+
chunkSE422RES_cjs.toDrizzleSql(
|
|
743
|
+
chunkYX3H63VV_cjs.sql`ANALYZE (SKIP_LOCKED) ${chunkYX3H63VV_cjs.sql.identifier(tableName)}`,
|
|
743
744
|
"postgres"
|
|
744
745
|
)
|
|
745
746
|
);
|
|
@@ -761,7 +762,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
761
762
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
762
763
|
},
|
|
763
764
|
async transactionWithNative(fn, options2) {
|
|
764
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
765
|
+
const temporaryWrites = options2?.temporaryWrites === chunkQYDUCWD2_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
765
766
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
766
767
|
throw new chunkSAFZ6JTI_cjs.ConfigurationError(
|
|
767
768
|
"Temporary-write transactions must be semantically read-only.",
|
|
@@ -796,7 +797,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
796
797
|
}
|
|
797
798
|
);
|
|
798
799
|
}
|
|
799
|
-
|
|
800
|
+
chunkUDS5DZNY_cjs.assertAdoptedDialect(
|
|
800
801
|
externalTx,
|
|
801
802
|
pgCore.PgTransaction,
|
|
802
803
|
"postgres"
|
|
@@ -956,7 +957,7 @@ function createPostgresOperationBackend(options) {
|
|
|
956
957
|
embeddingUpsertBatchSize: Math.max(
|
|
957
958
|
1,
|
|
958
959
|
Math.floor(
|
|
959
|
-
(capabilities.maxBindParameters ??
|
|
960
|
+
(capabilities.maxBindParameters ?? chunkQYDUCWD2_cjs.POSTGRES_MAX_BIND_PARAMETERS) / chunkUDS5DZNY_cjs.EMBEDDING_UPSERT_PARAM_COUNT
|
|
960
961
|
)
|
|
961
962
|
),
|
|
962
963
|
getEdgesChunkSize: POSTGRES_GET_EDGES_ID_CHUNK_SIZE,
|
|
@@ -964,14 +965,14 @@ function createPostgresOperationBackend(options) {
|
|
|
964
965
|
nodeInsertBatchSize: POSTGRES_NODE_INSERT_BATCH_SIZE,
|
|
965
966
|
uniqueInsertBatchSize: POSTGRES_UNIQUE_INSERT_BATCH_SIZE
|
|
966
967
|
};
|
|
967
|
-
const commonBackend =
|
|
968
|
+
const commonBackend = chunkUDS5DZNY_cjs.createCommonOperationBackend({
|
|
968
969
|
batchConfig,
|
|
969
970
|
execution: {
|
|
970
971
|
execAll,
|
|
971
972
|
execGet,
|
|
972
973
|
execRun
|
|
973
974
|
},
|
|
974
|
-
nowIso:
|
|
975
|
+
nowIso: chunk7UTUKH4E_cjs.nowIso,
|
|
975
976
|
operationStrategy,
|
|
976
977
|
rowMappers: {
|
|
977
978
|
toEdgeRow,
|
|
@@ -989,26 +990,26 @@ function createPostgresOperationBackend(options) {
|
|
|
989
990
|
};
|
|
990
991
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
991
992
|
async upsertEmbedding(params) {
|
|
992
|
-
const slot =
|
|
993
|
+
const slot = chunkUDS5DZNY_cjs.vectorSlotFromParams(params);
|
|
993
994
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
994
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
995
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunk7UTUKH4E_cjs.nowIso());
|
|
995
996
|
try {
|
|
996
997
|
for (const statement of statements) {
|
|
997
998
|
await execRun(statement);
|
|
998
999
|
}
|
|
999
1000
|
} catch (error) {
|
|
1000
|
-
throw
|
|
1001
|
+
throw chunkUDS5DZNY_cjs.mapVectorWriteError(error, params);
|
|
1001
1002
|
}
|
|
1002
1003
|
},
|
|
1003
1004
|
async upsertEmbeddingBatch(params) {
|
|
1004
1005
|
if (params.rows.length === 0) return;
|
|
1005
|
-
const slot =
|
|
1006
|
+
const slot = chunkUDS5DZNY_cjs.vectorSlotFromParams(params);
|
|
1006
1007
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1007
1008
|
const rowsById = new Map(
|
|
1008
1009
|
params.rows.map((row) => [row.nodeId, row])
|
|
1009
1010
|
);
|
|
1010
1011
|
const rows = [...rowsById.values()];
|
|
1011
|
-
const timestamp =
|
|
1012
|
+
const timestamp = chunk7UTUKH4E_cjs.nowIso();
|
|
1012
1013
|
try {
|
|
1013
1014
|
for (const chunk2 of chunkZDH3DX3C_cjs.chunk(
|
|
1014
1015
|
rows,
|
|
@@ -1039,11 +1040,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1039
1040
|
}
|
|
1040
1041
|
}
|
|
1041
1042
|
} catch (error) {
|
|
1042
|
-
throw
|
|
1043
|
+
throw chunkUDS5DZNY_cjs.mapVectorWriteError(error, params);
|
|
1043
1044
|
}
|
|
1044
1045
|
},
|
|
1045
1046
|
async deleteEmbedding(params) {
|
|
1046
|
-
const slot =
|
|
1047
|
+
const slot = chunkUDS5DZNY_cjs.vectorSlotFromParams(params);
|
|
1047
1048
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1048
1049
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1049
1050
|
for (const statement of statements) {
|
|
@@ -1051,19 +1052,19 @@ function createPostgresOperationBackend(options) {
|
|
|
1051
1052
|
}
|
|
1052
1053
|
},
|
|
1053
1054
|
async vectorSearch(params) {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
const slot =
|
|
1055
|
+
chunkHAQVISUF_cjs.assertVectorSearchLimit(params.limit);
|
|
1056
|
+
chunkLFFVD5ZR_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1057
|
+
const slot = chunkUDS5DZNY_cjs.vectorSlotFromParams(params);
|
|
1057
1058
|
const query = vectorStrategy.buildSearch(
|
|
1058
1059
|
slot,
|
|
1059
1060
|
params,
|
|
1060
1061
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1061
1062
|
// take precedence; the live-node default covers direct backend use.
|
|
1062
|
-
params.candidates ??
|
|
1063
|
+
params.candidates ?? chunkUDS5DZNY_cjs.buildLiveNodeCandidates(
|
|
1063
1064
|
tableNames.nodes,
|
|
1064
1065
|
params.graphId,
|
|
1065
1066
|
params.nodeKind,
|
|
1066
|
-
|
|
1067
|
+
chunk7UTUKH4E_cjs.nowIso()
|
|
1067
1068
|
)
|
|
1068
1069
|
);
|
|
1069
1070
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1071,7 +1072,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1071
1072
|
try {
|
|
1072
1073
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1073
1074
|
} catch (error) {
|
|
1074
|
-
throw
|
|
1075
|
+
throw chunkUDS5DZNY_cjs.mapVectorWriteError(error, params);
|
|
1075
1076
|
}
|
|
1076
1077
|
return rows.map((row) => ({
|
|
1077
1078
|
nodeId: row.node_id,
|
|
@@ -1083,10 +1084,10 @@ function createPostgresOperationBackend(options) {
|
|
|
1083
1084
|
// multi-statement fallback by simply not exposing the member.
|
|
1084
1085
|
...capabilities.windowFunctions ? {
|
|
1085
1086
|
async hybridSearch(params) {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
const slot =
|
|
1087
|
+
chunkHAQVISUF_cjs.assertVectorSearchLimit(params.limit);
|
|
1088
|
+
chunkHAQVISUF_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1089
|
+
chunkLFFVD5ZR_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1090
|
+
const slot = chunkUDS5DZNY_cjs.vectorSlotFromParams({
|
|
1090
1091
|
graphId: params.graphId,
|
|
1091
1092
|
nodeKind: params.nodeKind,
|
|
1092
1093
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1094,11 +1095,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1094
1095
|
metric: params.vector.metric,
|
|
1095
1096
|
indexType: params.vector.indexType
|
|
1096
1097
|
});
|
|
1097
|
-
const candidates = params.candidates ??
|
|
1098
|
+
const candidates = params.candidates ?? chunkUDS5DZNY_cjs.buildLiveNodeCandidates(
|
|
1098
1099
|
tableNames.nodes,
|
|
1099
1100
|
params.graphId,
|
|
1100
1101
|
params.nodeKind,
|
|
1101
|
-
|
|
1102
|
+
chunk7UTUKH4E_cjs.nowIso()
|
|
1102
1103
|
);
|
|
1103
1104
|
const vectorParams = {
|
|
1104
1105
|
graphId: params.graphId,
|
|
@@ -1114,11 +1115,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1114
1115
|
const vectorSql = vectorStrategy.buildSearch(
|
|
1115
1116
|
slot,
|
|
1116
1117
|
vectorParams,
|
|
1117
|
-
|
|
1118
|
+
chunkYX3H63VV_cjs.sql.raw("SELECT node_id FROM tg_hybrid_cand")
|
|
1118
1119
|
);
|
|
1119
1120
|
const statement = operationStrategy.buildHybridSearch(
|
|
1120
1121
|
{ ...params, candidates },
|
|
1121
|
-
|
|
1122
|
+
chunkSE422RES_cjs.toDrizzleSql(vectorSql, "postgres"),
|
|
1122
1123
|
params.vector.metric === "cosine"
|
|
1123
1124
|
);
|
|
1124
1125
|
const gucOverrides = await vectorSearchGucOverrides({
|
|
@@ -1132,9 +1133,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1132
1133
|
statement
|
|
1133
1134
|
);
|
|
1134
1135
|
} catch (error) {
|
|
1135
|
-
throw
|
|
1136
|
+
throw chunkUDS5DZNY_cjs.mapVectorWriteError(error, vectorParams);
|
|
1136
1137
|
}
|
|
1137
|
-
return raw.map((row) =>
|
|
1138
|
+
return raw.map((row) => chunkUDS5DZNY_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1138
1139
|
}
|
|
1139
1140
|
} : {}
|
|
1140
1141
|
};
|
|
@@ -1150,7 +1151,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1150
1151
|
// === Vector Index Operations ===
|
|
1151
1152
|
async createVectorIndex(params) {
|
|
1152
1153
|
if (vectorStrategy === void 0) return;
|
|
1153
|
-
const slot =
|
|
1154
|
+
const slot = chunkUDS5DZNY_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1154
1155
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1155
1156
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1156
1157
|
concurrent: params.concurrent === true
|
|
@@ -1164,7 +1165,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1164
1165
|
if (dropStatement !== void 0) {
|
|
1165
1166
|
await execRun(dropStatement);
|
|
1166
1167
|
}
|
|
1167
|
-
const table =
|
|
1168
|
+
const table = chunkYX3H63VV_cjs.sql.identifier(
|
|
1168
1169
|
vectorStrategy.tableName(
|
|
1169
1170
|
slot.graphId,
|
|
1170
1171
|
slot.nodeKind,
|
|
@@ -1172,13 +1173,13 @@ function createPostgresOperationBackend(options) {
|
|
|
1172
1173
|
)
|
|
1173
1174
|
);
|
|
1174
1175
|
await execRun(
|
|
1175
|
-
|
|
1176
|
+
chunkYX3H63VV_cjs.sql`ALTER TABLE ${table} SET (parallel_workers = 0)`
|
|
1176
1177
|
);
|
|
1177
1178
|
try {
|
|
1178
1179
|
await execRun(indexStatement);
|
|
1179
1180
|
} finally {
|
|
1180
1181
|
await execRun(
|
|
1181
|
-
|
|
1182
|
+
chunkYX3H63VV_cjs.sql`ALTER TABLE ${table} RESET (parallel_workers)`
|
|
1182
1183
|
);
|
|
1183
1184
|
}
|
|
1184
1185
|
}
|
|
@@ -1186,7 +1187,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1186
1187
|
},
|
|
1187
1188
|
// === Fulltext Operations ===
|
|
1188
1189
|
async upsertFulltext(params) {
|
|
1189
|
-
const timestamp =
|
|
1190
|
+
const timestamp = chunk7UTUKH4E_cjs.nowIso();
|
|
1190
1191
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1191
1192
|
params,
|
|
1192
1193
|
timestamp
|
|
@@ -1203,7 +1204,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1203
1204
|
},
|
|
1204
1205
|
async upsertFulltextBatch(params) {
|
|
1205
1206
|
if (params.rows.length === 0) return;
|
|
1206
|
-
const timestamp =
|
|
1207
|
+
const timestamp = chunk7UTUKH4E_cjs.nowIso();
|
|
1207
1208
|
for (const rows of chunkZDH3DX3C_cjs.chunk(
|
|
1208
1209
|
params.rows,
|
|
1209
1210
|
POSTGRES_FULLTEXT_UPSERT_BATCH_SIZE
|
|
@@ -1237,14 +1238,14 @@ function createPostgresOperationBackend(options) {
|
|
|
1237
1238
|
const rows = await execAll(query);
|
|
1238
1239
|
return rows.map((row, index) => ({
|
|
1239
1240
|
nodeId: row.node_id,
|
|
1240
|
-
score:
|
|
1241
|
+
score: chunk7UTUKH4E_cjs.coerceNumericScore(row.score),
|
|
1241
1242
|
rank: index + 1,
|
|
1242
1243
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1243
1244
|
}));
|
|
1244
1245
|
},
|
|
1245
1246
|
async dropVectorIndex(params) {
|
|
1246
1247
|
if (vectorStrategy === void 0) return;
|
|
1247
|
-
const slot =
|
|
1248
|
+
const slot = chunkUDS5DZNY_cjs.vectorSlotFromDropIndexParams(params);
|
|
1248
1249
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1249
1250
|
if (dropStatement === void 0) return;
|
|
1250
1251
|
try {
|
|
@@ -1255,7 +1256,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1255
1256
|
},
|
|
1256
1257
|
// === Query Execution ===
|
|
1257
1258
|
async execute(query) {
|
|
1258
|
-
const annTypes =
|
|
1259
|
+
const annTypes = chunkYX3H63VV_cjs.isSqlFragment(query) ? chunkYX3H63VV_cjs.annIndexScanTypes(query) : void 0;
|
|
1259
1260
|
if (annTypes !== void 0 && vectorStrategy !== void 0) {
|
|
1260
1261
|
const overrides = [];
|
|
1261
1262
|
for (const indexType of annTypes) {
|
|
@@ -1294,5 +1295,5 @@ function createTransactionBackend(options) {
|
|
|
1294
1295
|
}
|
|
1295
1296
|
|
|
1296
1297
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1297
|
-
//# sourceMappingURL=chunk-
|
|
1298
|
-
//# sourceMappingURL=chunk-
|
|
1298
|
+
//# sourceMappingURL=chunk-QXKVUJLI.cjs.map
|
|
1299
|
+
//# sourceMappingURL=chunk-QXKVUJLI.cjs.map
|