@nicia-ai/typegraph 0.47.0 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.cjs +27 -19
- package/dist/backend/index.d.cts +37 -55
- package/dist/backend/index.d.ts +37 -55
- package/dist/backend/index.js +4 -4
- package/dist/backend/postgres/index.cjs +7 -7
- package/dist/backend/postgres/index.d.cts +21 -7
- package/dist/backend/postgres/index.d.ts +21 -7
- package/dist/backend/postgres/index.js +6 -6
- package/dist/backend/postgres/pglite-store.cjs +17 -17
- 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 +14 -14
- package/dist/backend/postgres/pglite.cjs +8 -8
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +7 -7
- package/dist/backend/sqlite/index.cjs +7 -7
- package/dist/backend/sqlite/index.d.cts +20 -7
- package/dist/backend/sqlite/index.d.ts +20 -7
- package/dist/backend/sqlite/index.js +6 -6
- package/dist/backend/sqlite/libsql.cjs +8 -8
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +6 -6
- package/dist/backend/sqlite/local-store.cjs +18 -18
- 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 +15 -15
- package/dist/backend/sqlite/local.cjs +9 -9
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +7 -7
- package/dist/{chunk-EMIB2RXD.cjs → chunk-2HIYYMWY.cjs} +99 -96
- package/dist/chunk-2HIYYMWY.cjs.map +1 -0
- package/dist/{chunk-6KFLYYOC.cjs → chunk-2QGYQBS2.cjs} +5 -5
- package/dist/{chunk-6KFLYYOC.cjs.map → chunk-2QGYQBS2.cjs.map} +1 -1
- package/dist/{chunk-5FT3TLPK.js → chunk-2SYZXD54.js} +16 -13
- package/dist/chunk-2SYZXD54.js.map +1 -0
- package/dist/{chunk-XYBQI6LE.js → chunk-2TYSSBU5.js} +6 -6
- package/dist/{chunk-XYBQI6LE.js.map → chunk-2TYSSBU5.js.map} +1 -1
- package/dist/{chunk-6JVZSOHQ.cjs → chunk-3FPR224C.cjs} +26 -26
- package/dist/{chunk-6JVZSOHQ.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
- package/dist/{chunk-MFZR4QKM.cjs → chunk-3KOY4FH3.cjs} +181 -4
- package/dist/chunk-3KOY4FH3.cjs.map +1 -0
- package/dist/{chunk-6FWSNSRE.js → chunk-4WMMBDS5.js} +4 -4
- package/dist/chunk-4WMMBDS5.js.map +1 -0
- package/dist/{chunk-NG2RB5WL.js → chunk-5K2BKEBD.js} +18 -3
- package/dist/chunk-5K2BKEBD.js.map +1 -0
- package/dist/chunk-5PRKMB24.cjs +124 -0
- package/dist/chunk-5PRKMB24.cjs.map +1 -0
- package/dist/chunk-6LN7FIVU.js +107 -0
- package/dist/chunk-6LN7FIVU.js.map +1 -0
- package/dist/{chunk-I4G3SQPF.cjs → chunk-7XUYFFR4.cjs} +7 -7
- package/dist/chunk-7XUYFFR4.cjs.map +1 -0
- package/dist/{chunk-KH7XW7VV.js → chunk-ACGSAMD3.js} +24 -27
- package/dist/chunk-ACGSAMD3.js.map +1 -0
- package/dist/{chunk-QS3NQZVC.js → chunk-AX6JGVTZ.js} +16 -11
- package/dist/chunk-AX6JGVTZ.js.map +1 -0
- package/dist/{chunk-DJZTXBWY.js → chunk-BRRP76WO.js} +71 -30
- package/dist/chunk-BRRP76WO.js.map +1 -0
- package/dist/{chunk-5UMTUOM5.js → chunk-CT3ZKTOF.js} +5 -4
- package/dist/chunk-CT3ZKTOF.js.map +1 -0
- package/dist/{chunk-XY5OMOJD.js → chunk-DZAICA5J.js} +3 -3
- package/dist/{chunk-XY5OMOJD.js.map → chunk-DZAICA5J.js.map} +1 -1
- package/dist/{chunk-OIFSOPSR.cjs → chunk-EZEEWCFJ.cjs} +38 -156
- package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
- package/dist/{chunk-AMMWA76F.cjs → chunk-FA2AFWLP.cjs} +6 -6
- package/dist/{chunk-AMMWA76F.cjs.map → chunk-FA2AFWLP.cjs.map} +1 -1
- package/dist/{chunk-FNOMT74T.js → chunk-I4GAZH5Z.js} +180 -5
- package/dist/chunk-I4GAZH5Z.js.map +1 -0
- package/dist/{chunk-WGX7JH7E.cjs → chunk-JB6T4GLL.cjs} +106 -134
- package/dist/chunk-JB6T4GLL.cjs.map +1 -0
- package/dist/{chunk-MX4DHSQP.cjs → chunk-JFRT7S3B.cjs} +92 -98
- package/dist/chunk-JFRT7S3B.cjs.map +1 -0
- package/dist/{chunk-SE6EGQSD.js → chunk-KF6K7TGH.js} +38 -66
- package/dist/chunk-KF6K7TGH.js.map +1 -0
- package/dist/{chunk-ZHNXLS3C.js → chunk-NACVVDWB.js} +208 -8
- package/dist/chunk-NACVVDWB.js.map +1 -0
- package/dist/{chunk-M35DF33T.js → chunk-OD4SSY2U.js} +29 -16
- package/dist/chunk-OD4SSY2U.js.map +1 -0
- package/dist/{chunk-U5EDAVOJ.cjs → chunk-OTUPEF2W.cjs} +54 -49
- package/dist/chunk-OTUPEF2W.cjs.map +1 -0
- package/dist/{chunk-BCQ76AXA.cjs → chunk-PFBRJBUL.cjs} +107 -94
- package/dist/chunk-PFBRJBUL.cjs.map +1 -0
- package/dist/{chunk-AVGUJWVX.js → chunk-S5TERQVW.js} +15 -132
- package/dist/chunk-S5TERQVW.js.map +1 -0
- package/dist/chunk-SIT26LAZ.cjs +614 -0
- package/dist/chunk-SIT26LAZ.cjs.map +1 -0
- package/dist/{chunk-BR7SHKGM.cjs → chunk-SR725PWF.cjs} +548 -507
- package/dist/chunk-SR725PWF.cjs.map +1 -0
- package/dist/{chunk-5FBRVORR.cjs → chunk-TKZXMWQF.cjs} +8 -7
- package/dist/chunk-TKZXMWQF.cjs.map +1 -0
- package/dist/{chunk-425IZOQ5.cjs → chunk-TQHGE7UC.cjs} +20 -2
- package/dist/chunk-TQHGE7UC.cjs.map +1 -0
- package/dist/{chunk-GYUJZARH.cjs → chunk-TUNPBZY3.cjs} +4 -4
- package/dist/{chunk-GYUJZARH.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
- package/dist/chunk-UGHG7PGX.js +592 -0
- package/dist/chunk-UGHG7PGX.js.map +1 -0
- package/dist/{chunk-KABFHAL7.cjs → chunk-UMGZDVOA.cjs} +213 -12
- package/dist/chunk-UMGZDVOA.cjs.map +1 -0
- package/dist/{chunk-UPAJHMW3.cjs → chunk-WCCATHMB.cjs} +54 -57
- package/dist/chunk-WCCATHMB.cjs.map +1 -0
- package/dist/{chunk-LEWHMOUY.js → chunk-YIURNGXI.js} +4 -4
- package/dist/{chunk-LEWHMOUY.js.map → chunk-YIURNGXI.js.map} +1 -1
- package/dist/{chunk-EP4RUYD6.js → chunk-YVF2EM7B.js} +3 -3
- package/dist/{chunk-EP4RUYD6.js.map → chunk-YVF2EM7B.js.map} +1 -1
- package/dist/{chunk-NNQ6A3RM.js → chunk-ZFMCDJGB.js} +7 -12
- package/dist/chunk-ZFMCDJGB.js.map +1 -0
- package/dist/core/index.cjs +6 -6
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +2 -2
- package/dist/ddl-BL1NZLMY.d.cts +78 -0
- package/dist/ddl-D_oW-EVO.d.ts +78 -0
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-merge/index.cjs +334 -191
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +65 -15
- package/dist/graph-merge/index.d.ts +65 -15
- package/dist/graph-merge/index.js +174 -32
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-CHTv4XMZ.d.cts → index-COs_z6nV.d.cts} +2 -2
- package/dist/{index-CzoJ3MUw.d.ts → index-D7d1u2gr.d.ts} +2 -2
- package/dist/index.cjs +90 -86
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/interchange/index.cjs +38 -38
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +10 -10
- package/dist/{manager-DlY1vlla.d.cts → manager-CYaff3n3.d.cts} +2 -2
- package/dist/{manager-B6sOQzcQ.d.ts → manager-D9eRT_ns.d.ts} +2 -2
- package/dist/{materialize-indexes-DQL4xcpf.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
- package/dist/{materialize-indexes-sskhp-c_.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
- package/dist/{postgres-BXy_nyMs.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
- package/dist/{postgres-B6YOUcaK.d.ts → postgres-DMj39MEu.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +25 -26
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
- package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +8 -8
- package/dist/{searchable-D9gMiwcS.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
- package/dist/{searchable-0Cn_lY8U.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
- package/dist/{sqlite-DioSxaPe.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
- package/dist/{sqlite-ClXuBYAj.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
- package/dist/{store-5j-w5onJ.d.ts → store-JUVvtmR4.d.cts} +113 -26
- package/dist/{store-CFedKGU5.d.cts → store-UzrGvZOo.d.ts} +113 -26
- package/dist/{temporal-CjO9FH1l.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
- package/dist/{temporal-Ce1pG0S1.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
- package/dist/{types-DKkMJZjR.d.cts → types-BqFZTQmV.d.cts} +29 -4
- package/dist/{types-DKkMJZjR.d.ts → types-BqFZTQmV.d.ts} +29 -4
- package/dist/{types-BrdOFu48.d.ts → types-Bx74kaTt.d.ts} +1 -1
- package/dist/{types-oj_OGAaZ.d.cts → types-CXAhpW-c.d.cts} +1 -1
- package/dist/{where-D1wKCJ4Q.d.cts → where-DI_Fqz-X.d.cts} +1 -1
- package/dist/{where-C8w2627G.d.ts → where-O-k2wgYm.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3HGRTCDU.cjs +0 -269
- package/dist/chunk-3HGRTCDU.cjs.map +0 -1
- package/dist/chunk-425IZOQ5.cjs.map +0 -1
- package/dist/chunk-5FBRVORR.cjs.map +0 -1
- package/dist/chunk-5FT3TLPK.js.map +0 -1
- package/dist/chunk-5UMTUOM5.js.map +0 -1
- package/dist/chunk-6FWSNSRE.js.map +0 -1
- package/dist/chunk-AVGUJWVX.js.map +0 -1
- package/dist/chunk-BCQ76AXA.cjs.map +0 -1
- package/dist/chunk-BR7SHKGM.cjs.map +0 -1
- package/dist/chunk-DJZTXBWY.js.map +0 -1
- package/dist/chunk-EMIB2RXD.cjs.map +0 -1
- package/dist/chunk-FNOMT74T.js.map +0 -1
- package/dist/chunk-I4G3SQPF.cjs.map +0 -1
- package/dist/chunk-JR6SX5RH.cjs +0 -268
- package/dist/chunk-JR6SX5RH.cjs.map +0 -1
- package/dist/chunk-KABFHAL7.cjs.map +0 -1
- package/dist/chunk-KH7XW7VV.js.map +0 -1
- package/dist/chunk-M35DF33T.js.map +0 -1
- package/dist/chunk-MFZR4QKM.cjs.map +0 -1
- package/dist/chunk-MX4DHSQP.cjs.map +0 -1
- package/dist/chunk-NAZ2RA4L.js +0 -254
- package/dist/chunk-NAZ2RA4L.js.map +0 -1
- package/dist/chunk-NG2RB5WL.js.map +0 -1
- package/dist/chunk-NNQ6A3RM.js.map +0 -1
- package/dist/chunk-OIFSOPSR.cjs.map +0 -1
- package/dist/chunk-QS3NQZVC.js.map +0 -1
- package/dist/chunk-SE6EGQSD.js.map +0 -1
- package/dist/chunk-SHSSRCFR.js +0 -246
- package/dist/chunk-SHSSRCFR.js.map +0 -1
- package/dist/chunk-U5EDAVOJ.cjs.map +0 -1
- package/dist/chunk-UPAJHMW3.cjs.map +0 -1
- package/dist/chunk-WGX7JH7E.cjs.map +0 -1
- package/dist/chunk-ZHNXLS3C.js.map +0 -1
- package/dist/ddl-CprnMXJ-.d.ts +0 -38
- package/dist/ddl-DJA7Lci5.d.cts +0 -38
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkWCCATHMB_cjs = require('./chunk-WCCATHMB.cjs');
|
|
4
4
|
var chunkROR5ZR6A_cjs = require('./chunk-ROR5ZR6A.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkFA2AFWLP_cjs = require('./chunk-FA2AFWLP.cjs');
|
|
6
6
|
var chunkHDL2ARHX_cjs = require('./chunk-HDL2ARHX.cjs');
|
|
7
7
|
var chunkWODMN3Q2_cjs = require('./chunk-WODMN3Q2.cjs');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var chunkSIT26LAZ_cjs = require('./chunk-SIT26LAZ.cjs');
|
|
9
|
+
var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.cjs');
|
|
10
10
|
var chunkL3LQNR34_cjs = require('./chunk-L3LQNR34.cjs');
|
|
11
11
|
var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
|
|
12
12
|
var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
|
|
@@ -53,7 +53,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
53
53
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
54
54
|
var nextStatementId = 0;
|
|
55
55
|
function statementNameFor(sqlText, cacheMax) {
|
|
56
|
-
return
|
|
56
|
+
return chunkWCCATHMB_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
57
57
|
const name = `tg_${nextStatementId}`;
|
|
58
58
|
nextStatementId += 1;
|
|
59
59
|
return name;
|
|
@@ -310,11 +310,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
310
310
|
),
|
|
311
311
|
embeddingUpsertBatchSize: Math.max(
|
|
312
312
|
1,
|
|
313
|
-
Math.floor(maxBindParameters /
|
|
313
|
+
Math.floor(maxBindParameters / chunkWCCATHMB_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
314
314
|
),
|
|
315
315
|
findEdgesEndpointChunkSize: Math.max(
|
|
316
316
|
1,
|
|
317
|
-
maxBindParameters -
|
|
317
|
+
maxBindParameters - chunkWCCATHMB_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
318
318
|
),
|
|
319
319
|
fulltextDeleteChunkSize: Math.max(
|
|
320
320
|
1,
|
|
@@ -399,7 +399,7 @@ async function runVectorIndexBuildWithSerialFallback(execute, tableName, indexSt
|
|
|
399
399
|
try {
|
|
400
400
|
await execute(indexStatement);
|
|
401
401
|
} catch (error) {
|
|
402
|
-
if (!
|
|
402
|
+
if (!chunkSIT26LAZ_cjs.isInsufficientResourcesError(error)) throw error;
|
|
403
403
|
if (dropStatement !== void 0) {
|
|
404
404
|
try {
|
|
405
405
|
await execute(dropStatement);
|
|
@@ -459,21 +459,24 @@ async function runSerialVectorIndexBuild(execute, tableName, indexStatement, par
|
|
|
459
459
|
}
|
|
460
460
|
if (buildFailure !== void 0) throw buildFailure.error;
|
|
461
461
|
}
|
|
462
|
-
var toNodeRow =
|
|
463
|
-
var toEdgeRow =
|
|
464
|
-
var toUniqueRow =
|
|
465
|
-
var toSchemaVersionRow =
|
|
466
|
-
|
|
462
|
+
var toNodeRow = chunkFA2AFWLP_cjs.createNodeRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
463
|
+
var toEdgeRow = chunkFA2AFWLP_cjs.createEdgeRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
464
|
+
var toUniqueRow = chunkFA2AFWLP_cjs.createUniqueRowMapper(chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
465
|
+
var toSchemaVersionRow = chunkFA2AFWLP_cjs.createSchemaVersionRowMapper(
|
|
466
|
+
chunkFA2AFWLP_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
467
467
|
);
|
|
468
468
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
469
469
|
return {
|
|
470
|
-
...
|
|
470
|
+
...chunk5PRKMB24_cjs.POSTGRES_CAPABILITIES,
|
|
471
471
|
...vectorStrategy === void 0 ? {} : { vector: chunkL3LQNR34_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
472
472
|
fulltext: chunkL3LQNR34_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
473
473
|
};
|
|
474
474
|
}
|
|
475
475
|
function createPostgresBackend(db, options = {}) {
|
|
476
|
-
const
|
|
476
|
+
const resourceAudit = chunkSIT26LAZ_cjs.resolveDeclaredBackendResource(
|
|
477
|
+
getSerializedPostgresClient(db),
|
|
478
|
+
options.serializedResource
|
|
479
|
+
);
|
|
477
480
|
const tables2 = options.tables ?? chunkHDL2ARHX_cjs.tables;
|
|
478
481
|
const fulltextStrategy = options.fulltext ?? chunkL3LQNR34_cjs.tsvectorStrategy;
|
|
479
482
|
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkROR5ZR6A_cjs.pgvectorStrategy;
|
|
@@ -489,14 +492,14 @@ function createPostgresBackend(db, options = {}) {
|
|
|
489
492
|
supported: false
|
|
490
493
|
}
|
|
491
494
|
} : {};
|
|
492
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
495
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
493
496
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
494
497
|
maxBindParameters: Math.min(
|
|
495
498
|
configuredMaxBindParameters,
|
|
496
499
|
PGLITE_MAX_BIND_PARAMETERS
|
|
497
500
|
)
|
|
498
501
|
} : {};
|
|
499
|
-
const declaredCapabilities =
|
|
502
|
+
const declaredCapabilities = chunk5PRKMB24_cjs.normalizeGraphAnalyticsCapabilities({
|
|
500
503
|
...baseCapabilities,
|
|
501
504
|
...httpOnlyOverrides,
|
|
502
505
|
...options.capabilities,
|
|
@@ -507,7 +510,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
507
510
|
contributions: {
|
|
508
511
|
supported: true,
|
|
509
512
|
probe: true,
|
|
510
|
-
rebuild:
|
|
513
|
+
rebuild: chunkWCCATHMB_cjs.contributionRebuildSupported(
|
|
511
514
|
fulltextStrategy,
|
|
512
515
|
tables2.fulltextTableName,
|
|
513
516
|
declaredCapabilities.transactions
|
|
@@ -517,7 +520,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
517
520
|
const adapterOptions = {
|
|
518
521
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
519
522
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
520
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
523
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
521
524
|
};
|
|
522
525
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
523
526
|
const tableNames = {
|
|
@@ -554,11 +557,11 @@ function createPostgresBackend(db, options = {}) {
|
|
|
554
557
|
tableNames.identityClosure,
|
|
555
558
|
tableNames.identitySeparation
|
|
556
559
|
];
|
|
557
|
-
const operationStrategy =
|
|
560
|
+
const operationStrategy = chunkWCCATHMB_cjs.createPostgresOperationStrategy(
|
|
558
561
|
tables2,
|
|
559
562
|
fulltextStrategy
|
|
560
563
|
);
|
|
561
|
-
const guardedTableExists =
|
|
564
|
+
const guardedTableExists = chunkWCCATHMB_cjs.createCachedTableExistence(
|
|
562
565
|
async (tableName) => {
|
|
563
566
|
const rows = await executionAdapter.execute(
|
|
564
567
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -573,7 +576,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
573
576
|
try {
|
|
574
577
|
await db.execute(statement);
|
|
575
578
|
} catch (error) {
|
|
576
|
-
if (!
|
|
579
|
+
if (!chunkSIT26LAZ_cjs.isPostgresConcurrentDdlRaceError(error)) throw error;
|
|
577
580
|
await db.execute(statement);
|
|
578
581
|
}
|
|
579
582
|
}
|
|
@@ -605,25 +608,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
605
608
|
);
|
|
606
609
|
const row = rows[0];
|
|
607
610
|
if (row === void 0) return void 0;
|
|
608
|
-
return
|
|
611
|
+
return chunkWCCATHMB_cjs.mapContributionMaterializationRow(
|
|
609
612
|
row,
|
|
610
|
-
|
|
613
|
+
chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
611
614
|
);
|
|
612
615
|
}
|
|
613
616
|
async function getContributionMaterializationRows(graphId) {
|
|
614
617
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
615
618
|
return rows.map(
|
|
616
|
-
(row) =>
|
|
619
|
+
(row) => chunkWCCATHMB_cjs.mapContributionMaterializationRow(
|
|
617
620
|
row,
|
|
618
|
-
|
|
621
|
+
chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
619
622
|
)
|
|
620
623
|
);
|
|
621
624
|
}
|
|
622
625
|
async function recordContributionMaterializationRow(params) {
|
|
623
626
|
await db.insert(matTable).values(
|
|
624
|
-
|
|
627
|
+
chunkWCCATHMB_cjs.buildContributionInsertValues(
|
|
625
628
|
params,
|
|
626
|
-
|
|
629
|
+
chunkWCCATHMB_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
627
630
|
)
|
|
628
631
|
).onConflictDoUpdate({
|
|
629
632
|
target: [
|
|
@@ -632,7 +635,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
632
635
|
matTable.owner,
|
|
633
636
|
matTable.tableName
|
|
634
637
|
],
|
|
635
|
-
set:
|
|
638
|
+
set: chunkWCCATHMB_cjs.buildContributionOnConflictSet(
|
|
636
639
|
matTable.materializedAt,
|
|
637
640
|
params.materializedAt
|
|
638
641
|
)
|
|
@@ -652,9 +655,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
652
655
|
const rows = await executionAdapter.execute(
|
|
653
656
|
operationStrategy.buildTableExists(tableName)
|
|
654
657
|
);
|
|
655
|
-
return
|
|
658
|
+
return chunkWCCATHMB_cjs.tableExistsFromRow(rows[0]);
|
|
656
659
|
}
|
|
657
|
-
const contributionMaterializer =
|
|
660
|
+
const contributionMaterializer = chunkWCCATHMB_cjs.createContributionMaterializer({
|
|
658
661
|
dialect: "postgres",
|
|
659
662
|
fulltextStrategy,
|
|
660
663
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -746,7 +749,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
746
749
|
schemaVersionsTable: tables2.schemaVersions
|
|
747
750
|
});
|
|
748
751
|
return {
|
|
749
|
-
backend:
|
|
752
|
+
backend: chunkWCCATHMB_cjs.gateFulltext(
|
|
750
753
|
backend2,
|
|
751
754
|
contributionMaterializer.assertInitialized,
|
|
752
755
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -775,22 +778,22 @@ function createPostgresBackend(db, options = {}) {
|
|
|
775
778
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
776
779
|
);
|
|
777
780
|
}
|
|
778
|
-
const trustedTx =
|
|
781
|
+
const trustedTx = chunkSIT26LAZ_cjs.deriveBackend(tx, {
|
|
779
782
|
executeRaw(sqlText, params) {
|
|
780
783
|
return executeCompiled({ params, sql: sqlText });
|
|
781
784
|
}
|
|
782
785
|
});
|
|
783
|
-
await
|
|
784
|
-
await
|
|
785
|
-
const indexDefinitions = await
|
|
786
|
+
await chunkWCCATHMB_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
787
|
+
await chunkWCCATHMB_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
788
|
+
const indexDefinitions = await chunkWCCATHMB_cjs.suspendPostgresSecondaryIndexes(
|
|
786
789
|
trustedTx,
|
|
787
790
|
tableNames
|
|
788
791
|
);
|
|
789
792
|
const result = await fn(
|
|
790
|
-
|
|
793
|
+
chunkWCCATHMB_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
791
794
|
);
|
|
792
|
-
await
|
|
793
|
-
await
|
|
795
|
+
await chunkWCCATHMB_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
796
|
+
await chunkWCCATHMB_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
794
797
|
return result;
|
|
795
798
|
});
|
|
796
799
|
}
|
|
@@ -831,7 +834,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
831
834
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
832
835
|
// rather than self-healing on a read/write path (#135). Shared
|
|
833
836
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
834
|
-
...
|
|
837
|
+
...chunkWCCATHMB_cjs.gateFulltextMethods(
|
|
835
838
|
operations,
|
|
836
839
|
contributionMaterializer.assertInitialized,
|
|
837
840
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -899,26 +902,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
899
902
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
900
903
|
const row = rows[0];
|
|
901
904
|
if (row === void 0) return void 0;
|
|
902
|
-
return
|
|
905
|
+
return chunkWCCATHMB_cjs.mapMaterializationRow(row, chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
903
906
|
},
|
|
904
907
|
async getIndexMaterializations(statusKeys) {
|
|
905
908
|
if (statusKeys.length === 0) return [];
|
|
906
909
|
const t = tables2.indexMaterializations;
|
|
907
910
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
908
911
|
return rows.map(
|
|
909
|
-
(row) =>
|
|
912
|
+
(row) => chunkWCCATHMB_cjs.mapMaterializationRow(row, chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
910
913
|
);
|
|
911
914
|
},
|
|
912
915
|
async recordIndexMaterialization(params) {
|
|
913
916
|
const t = tables2.indexMaterializations;
|
|
914
917
|
await db.insert(t).values(
|
|
915
|
-
|
|
918
|
+
chunkWCCATHMB_cjs.buildMaterializationInsertValues(
|
|
916
919
|
params,
|
|
917
|
-
|
|
920
|
+
chunkWCCATHMB_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
918
921
|
)
|
|
919
922
|
).onConflictDoUpdate({
|
|
920
923
|
target: t.indexName,
|
|
921
|
-
set:
|
|
924
|
+
set: chunkWCCATHMB_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
922
925
|
});
|
|
923
926
|
},
|
|
924
927
|
async ensureContributionMaterializationsTable() {
|
|
@@ -940,26 +943,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
940
943
|
const t = tables2.kindRemovals;
|
|
941
944
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
942
945
|
return rows.map(
|
|
943
|
-
(row) =>
|
|
946
|
+
(row) => chunkWCCATHMB_cjs.mapKindRemovalRow(row, chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
944
947
|
);
|
|
945
948
|
},
|
|
946
949
|
async getAllKindRemovals(graphId) {
|
|
947
950
|
const t = tables2.kindRemovals;
|
|
948
951
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
949
952
|
return rows.map(
|
|
950
|
-
(row) =>
|
|
953
|
+
(row) => chunkWCCATHMB_cjs.mapKindRemovalRow(row, chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
951
954
|
);
|
|
952
955
|
},
|
|
953
956
|
async recordKindRemoval(params) {
|
|
954
957
|
const t = tables2.kindRemovals;
|
|
955
958
|
await db.insert(t).values(
|
|
956
|
-
|
|
959
|
+
chunkWCCATHMB_cjs.buildKindRemovalInsertValues(
|
|
957
960
|
params,
|
|
958
|
-
|
|
961
|
+
chunkWCCATHMB_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
959
962
|
)
|
|
960
963
|
).onConflictDoUpdate({
|
|
961
964
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
962
|
-
set:
|
|
965
|
+
set: chunkWCCATHMB_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
963
966
|
});
|
|
964
967
|
},
|
|
965
968
|
async ensureReconciliationMarkersTable() {
|
|
@@ -1054,7 +1057,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1054
1057
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
1055
1058
|
return runSchemaWriteTransaction(
|
|
1056
1059
|
params.graphId,
|
|
1057
|
-
(target) =>
|
|
1060
|
+
(target) => chunkWCCATHMB_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
1058
1061
|
);
|
|
1059
1062
|
},
|
|
1060
1063
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -1076,7 +1079,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1076
1079
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1077
1080
|
},
|
|
1078
1081
|
async transactionWithNative(fn, options2) {
|
|
1079
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1082
|
+
const temporaryWrites = options2?.temporaryWrites === chunk5PRKMB24_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
1080
1083
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1081
1084
|
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1082
1085
|
"Temporary-write transactions must be semantically read-only.",
|
|
@@ -1111,7 +1114,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1111
1114
|
}
|
|
1112
1115
|
);
|
|
1113
1116
|
}
|
|
1114
|
-
|
|
1117
|
+
chunkWCCATHMB_cjs.assertAdoptedDialect(
|
|
1115
1118
|
externalTx,
|
|
1116
1119
|
pgCore.PgTransaction,
|
|
1117
1120
|
"postgres"
|
|
@@ -1121,9 +1124,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1121
1124
|
async close() {
|
|
1122
1125
|
}
|
|
1123
1126
|
};
|
|
1124
|
-
|
|
1125
|
-
chunk3HGRTCDU_cjs.markSerializedTransactionResource(backend, serializedClient);
|
|
1126
|
-
}
|
|
1127
|
+
chunkSIT26LAZ_cjs.auditBackendResource(backend, resourceAudit);
|
|
1127
1128
|
return backend;
|
|
1128
1129
|
}
|
|
1129
1130
|
function getSerializedPostgresClient(db) {
|
|
@@ -1142,14 +1143,24 @@ function getSerializedPostgresClient(db) {
|
|
|
1142
1143
|
function isSingleConnectionPgPool(candidate) {
|
|
1143
1144
|
const options = candidate["options"];
|
|
1144
1145
|
if (typeof options !== "object" || options === null) return false;
|
|
1145
|
-
return
|
|
1146
|
+
return isSingleConnectionPgPoolCap(
|
|
1147
|
+
options["max"]
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
function isSingleConnectionPgPoolCap(value) {
|
|
1151
|
+
return value === 1 || typeof value === "string" && Number(value) === 1;
|
|
1146
1152
|
}
|
|
1147
1153
|
function isSingleConnectionCallablePgClient(client) {
|
|
1148
1154
|
if (client === void 0 || client === null) return false;
|
|
1149
1155
|
const options = client["options"];
|
|
1150
1156
|
if (!isPostgresJsClient(client)) return false;
|
|
1151
1157
|
if (typeof options !== "object" || options === null) return false;
|
|
1152
|
-
return
|
|
1158
|
+
return isSingleConnectionPostgresJsCap(
|
|
1159
|
+
options["max"]
|
|
1160
|
+
);
|
|
1161
|
+
}
|
|
1162
|
+
function isSingleConnectionPostgresJsCap(value) {
|
|
1163
|
+
return value === 1 || typeof value === "string" && Number(value) === 1;
|
|
1153
1164
|
}
|
|
1154
1165
|
function isBarePgClient(candidate) {
|
|
1155
1166
|
if (candidate["options"] !== void 0 || candidate["totalCount"] !== void 0 || candidate["idleCount"] !== void 0 || candidate["waitingCount"] !== void 0) {
|
|
@@ -1292,17 +1303,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1292
1303
|
});
|
|
1293
1304
|
}
|
|
1294
1305
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1295
|
-
capabilities.maxBindParameters ??
|
|
1306
|
+
capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1296
1307
|
);
|
|
1297
|
-
const
|
|
1308
|
+
const commonOperationMembers = chunkWCCATHMB_cjs.createCommonOperationBackend({
|
|
1298
1309
|
batchConfig,
|
|
1299
1310
|
execution: {
|
|
1300
1311
|
execAll,
|
|
1301
1312
|
execGet,
|
|
1302
1313
|
execRun
|
|
1303
1314
|
},
|
|
1304
|
-
nowIso:
|
|
1305
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
1315
|
+
nowIso: chunkFA2AFWLP_cjs.nowIso,
|
|
1316
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunk5PRKMB24_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1306
1317
|
operationStrategy,
|
|
1307
1318
|
rowMappers: {
|
|
1308
1319
|
toEdgeRow,
|
|
@@ -1320,28 +1331,28 @@ function createPostgresOperationBackend(options) {
|
|
|
1320
1331
|
};
|
|
1321
1332
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1322
1333
|
async upsertEmbedding(params) {
|
|
1323
|
-
const slot =
|
|
1334
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1324
1335
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1325
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1336
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkFA2AFWLP_cjs.nowIso());
|
|
1326
1337
|
try {
|
|
1327
1338
|
for (const statement of statements) {
|
|
1328
1339
|
await execRun(statement);
|
|
1329
1340
|
}
|
|
1330
1341
|
} catch (error) {
|
|
1331
|
-
throw
|
|
1342
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
|
|
1332
1343
|
}
|
|
1333
1344
|
},
|
|
1334
1345
|
async upsertEmbeddingBatch(params) {
|
|
1335
1346
|
if (params.rows.length === 0) return;
|
|
1336
|
-
const slot =
|
|
1347
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1337
1348
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1338
1349
|
const rowsById = new Map(
|
|
1339
1350
|
params.rows.map((row) => [row.nodeId, row])
|
|
1340
1351
|
);
|
|
1341
1352
|
const rows = [...rowsById.values()];
|
|
1342
|
-
const timestamp =
|
|
1353
|
+
const timestamp = chunkFA2AFWLP_cjs.nowIso();
|
|
1343
1354
|
try {
|
|
1344
|
-
for (const chunk2 of
|
|
1355
|
+
for (const chunk2 of chunkSIT26LAZ_cjs.chunk(
|
|
1345
1356
|
rows,
|
|
1346
1357
|
batchConfig.embeddingUpsertBatchSize
|
|
1347
1358
|
)) {
|
|
@@ -1370,11 +1381,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1370
1381
|
}
|
|
1371
1382
|
}
|
|
1372
1383
|
} catch (error) {
|
|
1373
|
-
throw
|
|
1384
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
|
|
1374
1385
|
}
|
|
1375
1386
|
},
|
|
1376
1387
|
async deleteEmbedding(params) {
|
|
1377
|
-
const slot =
|
|
1388
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1378
1389
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1379
1390
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1380
1391
|
for (const statement of statements) {
|
|
@@ -1383,9 +1394,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1383
1394
|
},
|
|
1384
1395
|
async deleteEmbeddingBatch(params) {
|
|
1385
1396
|
if (params.nodeIds.length === 0) return;
|
|
1386
|
-
const slot =
|
|
1397
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1387
1398
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1388
|
-
for (const nodeIds of
|
|
1399
|
+
for (const nodeIds of chunkSIT26LAZ_cjs.chunk(
|
|
1389
1400
|
[...new Set(params.nodeIds)],
|
|
1390
1401
|
batchConfig.embeddingUpsertBatchSize
|
|
1391
1402
|
)) {
|
|
@@ -1399,17 +1410,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1399
1410
|
async vectorSearch(params) {
|
|
1400
1411
|
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
|
|
1401
1412
|
chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1402
|
-
const slot =
|
|
1413
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams(params);
|
|
1403
1414
|
const query = vectorStrategy.buildSearch(
|
|
1404
1415
|
slot,
|
|
1405
1416
|
params,
|
|
1406
1417
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1407
1418
|
// take precedence; the live-node default covers direct backend use.
|
|
1408
|
-
params.candidates ??
|
|
1419
|
+
params.candidates ?? chunkWCCATHMB_cjs.buildLiveNodeCandidates(
|
|
1409
1420
|
tableNames.nodes,
|
|
1410
1421
|
params.graphId,
|
|
1411
1422
|
params.nodeKind,
|
|
1412
|
-
|
|
1423
|
+
chunkFA2AFWLP_cjs.nowIso()
|
|
1413
1424
|
)
|
|
1414
1425
|
);
|
|
1415
1426
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1417,7 +1428,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1417
1428
|
try {
|
|
1418
1429
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1419
1430
|
} catch (error) {
|
|
1420
|
-
throw
|
|
1431
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, params);
|
|
1421
1432
|
}
|
|
1422
1433
|
return rows.map((row) => ({
|
|
1423
1434
|
nodeId: row.node_id,
|
|
@@ -1432,7 +1443,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1432
1443
|
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.limit);
|
|
1433
1444
|
chunkL3LQNR34_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1434
1445
|
chunkROR5ZR6A_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1435
|
-
const slot =
|
|
1446
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromParams({
|
|
1436
1447
|
graphId: params.graphId,
|
|
1437
1448
|
nodeKind: params.nodeKind,
|
|
1438
1449
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1440,11 +1451,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1440
1451
|
metric: params.vector.metric,
|
|
1441
1452
|
indexType: params.vector.indexType
|
|
1442
1453
|
});
|
|
1443
|
-
const candidates = params.candidates ??
|
|
1454
|
+
const candidates = params.candidates ?? chunkWCCATHMB_cjs.buildLiveNodeCandidates(
|
|
1444
1455
|
tableNames.nodes,
|
|
1445
1456
|
params.graphId,
|
|
1446
1457
|
params.nodeKind,
|
|
1447
|
-
|
|
1458
|
+
chunkFA2AFWLP_cjs.nowIso()
|
|
1448
1459
|
);
|
|
1449
1460
|
const vectorParams = {
|
|
1450
1461
|
graphId: params.graphId,
|
|
@@ -1478,9 +1489,9 @@ function createPostgresOperationBackend(options) {
|
|
|
1478
1489
|
statement
|
|
1479
1490
|
);
|
|
1480
1491
|
} catch (error) {
|
|
1481
|
-
throw
|
|
1492
|
+
throw chunkWCCATHMB_cjs.mapVectorWriteError(error, vectorParams);
|
|
1482
1493
|
}
|
|
1483
|
-
return raw.map((row) =>
|
|
1494
|
+
return raw.map((row) => chunkWCCATHMB_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
1484
1495
|
}
|
|
1485
1496
|
} : {}
|
|
1486
1497
|
};
|
|
@@ -1495,7 +1506,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1495
1506
|
return active?.version;
|
|
1496
1507
|
}
|
|
1497
1508
|
const operationBackend = {
|
|
1498
|
-
...
|
|
1509
|
+
...commonOperationMembers,
|
|
1499
1510
|
...executeRawMethod,
|
|
1500
1511
|
...vectorEmbeddingMethods,
|
|
1501
1512
|
/**
|
|
@@ -1545,14 +1556,16 @@ function createPostgresOperationBackend(options) {
|
|
|
1545
1556
|
}
|
|
1546
1557
|
const locked = await lockActiveSchemaVersion(params.graphId);
|
|
1547
1558
|
if (locked !== void 0) {
|
|
1548
|
-
|
|
1559
|
+
chunkWCCATHMB_cjs.assertActiveSchemaVersion(
|
|
1549
1560
|
params.graphId,
|
|
1550
1561
|
params.expectedVersion,
|
|
1551
1562
|
locked
|
|
1552
1563
|
);
|
|
1553
1564
|
return;
|
|
1554
1565
|
}
|
|
1555
|
-
const settled = await
|
|
1566
|
+
const settled = await commonOperationMembers.getActiveSchema(
|
|
1567
|
+
params.graphId
|
|
1568
|
+
);
|
|
1556
1569
|
throw new chunkMRDBBHIZ_cjs.StaleVersionError({
|
|
1557
1570
|
graphId: params.graphId,
|
|
1558
1571
|
expected: params.expectedVersion,
|
|
@@ -1562,7 +1575,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1562
1575
|
// === Vector Index Operations ===
|
|
1563
1576
|
async createVectorIndex(params) {
|
|
1564
1577
|
if (vectorStrategy === void 0) return;
|
|
1565
|
-
const slot =
|
|
1578
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromCreateIndexParams(params);
|
|
1566
1579
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
1567
1580
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
1568
1581
|
concurrent: params.concurrent === true
|
|
@@ -1584,7 +1597,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1584
1597
|
},
|
|
1585
1598
|
// === Fulltext Operations ===
|
|
1586
1599
|
async upsertFulltext(params) {
|
|
1587
|
-
const timestamp =
|
|
1600
|
+
const timestamp = chunkFA2AFWLP_cjs.nowIso();
|
|
1588
1601
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
1589
1602
|
params,
|
|
1590
1603
|
timestamp
|
|
@@ -1601,8 +1614,8 @@ function createPostgresOperationBackend(options) {
|
|
|
1601
1614
|
},
|
|
1602
1615
|
async upsertFulltextBatch(params) {
|
|
1603
1616
|
if (params.rows.length === 0) return;
|
|
1604
|
-
const timestamp =
|
|
1605
|
-
for (const rows of
|
|
1617
|
+
const timestamp = chunkFA2AFWLP_cjs.nowIso();
|
|
1618
|
+
for (const rows of chunkSIT26LAZ_cjs.chunk(
|
|
1606
1619
|
params.rows,
|
|
1607
1620
|
batchConfig.fulltextUpsertBatchSize
|
|
1608
1621
|
)) {
|
|
@@ -1617,7 +1630,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1617
1630
|
},
|
|
1618
1631
|
async deleteFulltextBatch(params) {
|
|
1619
1632
|
if (params.nodeIds.length === 0) return;
|
|
1620
|
-
for (const nodeIds of
|
|
1633
|
+
for (const nodeIds of chunkSIT26LAZ_cjs.chunk(
|
|
1621
1634
|
params.nodeIds,
|
|
1622
1635
|
batchConfig.fulltextDeleteChunkSize
|
|
1623
1636
|
)) {
|
|
@@ -1635,20 +1648,20 @@ function createPostgresOperationBackend(options) {
|
|
|
1635
1648
|
const rows = await execAll(query);
|
|
1636
1649
|
return rows.map((row, index) => ({
|
|
1637
1650
|
nodeId: row.node_id,
|
|
1638
|
-
score:
|
|
1651
|
+
score: chunkFA2AFWLP_cjs.coerceNumericScore(row.score),
|
|
1639
1652
|
rank: index + 1,
|
|
1640
1653
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
1641
1654
|
}));
|
|
1642
1655
|
},
|
|
1643
1656
|
async dropVectorIndex(params) {
|
|
1644
1657
|
if (vectorStrategy === void 0) return;
|
|
1645
|
-
const slot =
|
|
1658
|
+
const slot = chunkWCCATHMB_cjs.vectorSlotFromDropIndexParams(params);
|
|
1646
1659
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
1647
1660
|
if (dropStatement === void 0) return;
|
|
1648
1661
|
try {
|
|
1649
1662
|
await execRun(dropStatement);
|
|
1650
1663
|
} catch (error) {
|
|
1651
|
-
if (!
|
|
1664
|
+
if (!chunkSIT26LAZ_cjs.isMissingTableError(error)) throw error;
|
|
1652
1665
|
}
|
|
1653
1666
|
},
|
|
1654
1667
|
// === Query Execution ===
|
|
@@ -1694,5 +1707,5 @@ function createTransactionBackend(options) {
|
|
|
1694
1707
|
}
|
|
1695
1708
|
|
|
1696
1709
|
exports.createPostgresBackend = createPostgresBackend;
|
|
1697
|
-
//# sourceMappingURL=chunk-
|
|
1698
|
-
//# sourceMappingURL=chunk-
|
|
1710
|
+
//# sourceMappingURL=chunk-PFBRJBUL.cjs.map
|
|
1711
|
+
//# sourceMappingURL=chunk-PFBRJBUL.cjs.map
|