@nicia-ai/typegraph 0.55.0 → 0.56.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/CHANGELOG.md +14 -0
- package/dist/backend/index.cjs +86 -86
- package/dist/backend/index.js +7 -7
- package/dist/backend/postgres/index.cjs +22 -22
- package/dist/backend/postgres/index.js +8 -8
- package/dist/backend/postgres/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +2 -2
- package/dist/backend/postgres/pglite-store.d.ts +2 -2
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/postgres/pglite.cjs +10 -10
- package/dist/backend/postgres/pglite.js +9 -9
- package/dist/backend/sqlite/index.cjs +21 -21
- package/dist/backend/sqlite/index.js +8 -8
- package/dist/backend/sqlite/libsql.cjs +12 -12
- package/dist/backend/sqlite/libsql.js +8 -8
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.d.cts +2 -2
- package/dist/backend/sqlite/local-store.d.ts +2 -2
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/backend/sqlite/local.cjs +10 -10
- package/dist/backend/sqlite/local.js +9 -9
- package/dist/{chunk-S5WG5AFG.cjs → chunk-2XUAUSMI.cjs} +12 -12
- package/dist/{chunk-S5WG5AFG.cjs.map → chunk-2XUAUSMI.cjs.map} +1 -1
- package/dist/{chunk-MTE255N3.cjs → chunk-36XLQHZA.cjs} +4 -4
- package/dist/{chunk-MTE255N3.cjs.map → chunk-36XLQHZA.cjs.map} +1 -1
- package/dist/{chunk-FWSGKOBN.js → chunk-6LTRZOUU.js} +6 -6
- package/dist/{chunk-FWSGKOBN.js.map → chunk-6LTRZOUU.js.map} +1 -1
- package/dist/{chunk-YVKPUSHS.js → chunk-75KH6Y2W.js} +16 -7
- package/dist/chunk-75KH6Y2W.js.map +1 -0
- package/dist/{chunk-MJXEO7YA.js → chunk-762VPGHN.js} +5 -5
- package/dist/{chunk-MJXEO7YA.js.map → chunk-762VPGHN.js.map} +1 -1
- package/dist/{chunk-GGDTMBNA.cjs → chunk-7CCVR2QF.cjs} +54 -54
- package/dist/{chunk-GGDTMBNA.cjs.map → chunk-7CCVR2QF.cjs.map} +1 -1
- package/dist/{chunk-7EOJO6QB.js → chunk-7MHENVRG.js} +3 -3
- package/dist/{chunk-7EOJO6QB.js.map → chunk-7MHENVRG.js.map} +1 -1
- package/dist/{chunk-7B3DSFX3.cjs → chunk-AUTRK6WM.cjs} +4 -4
- package/dist/{chunk-7B3DSFX3.cjs.map → chunk-AUTRK6WM.cjs.map} +1 -1
- package/dist/{chunk-SIQ4BFL5.js → chunk-AZP5CCHL.js} +4 -4
- package/dist/{chunk-SIQ4BFL5.js.map → chunk-AZP5CCHL.js.map} +1 -1
- package/dist/{chunk-WTW7RWAG.cjs → chunk-BYUIOM4L.cjs} +6 -6
- package/dist/{chunk-WTW7RWAG.cjs.map → chunk-BYUIOM4L.cjs.map} +1 -1
- package/dist/{chunk-74FNI3PT.js → chunk-C3TJU4KQ.js} +6 -6
- package/dist/chunk-C3TJU4KQ.js.map +1 -0
- package/dist/{chunk-7V2R4MH6.js → chunk-CEQOTZGB.js} +5 -5
- package/dist/{chunk-7V2R4MH6.js.map → chunk-CEQOTZGB.js.map} +1 -1
- package/dist/{chunk-TKFQLKH2.cjs → chunk-CYKHSH5O.cjs} +36 -36
- package/dist/{chunk-TKFQLKH2.cjs.map → chunk-CYKHSH5O.cjs.map} +1 -1
- package/dist/{chunk-D5TCKAQT.cjs → chunk-DGIA64DM.cjs} +4 -4
- package/dist/{chunk-D5TCKAQT.cjs.map → chunk-DGIA64DM.cjs.map} +1 -1
- package/dist/{chunk-FFR3YUY2.js → chunk-E4QYEWVH.js} +5 -5
- package/dist/{chunk-FFR3YUY2.js.map → chunk-E4QYEWVH.js.map} +1 -1
- package/dist/{chunk-467YITD4.cjs → chunk-ETU5IILQ.cjs} +13 -13
- package/dist/{chunk-467YITD4.cjs.map → chunk-ETU5IILQ.cjs.map} +1 -1
- package/dist/{chunk-HW3IX2RF.js → chunk-EWRLWI7W.js} +4 -4
- package/dist/{chunk-HW3IX2RF.js.map → chunk-EWRLWI7W.js.map} +1 -1
- package/dist/{chunk-KZ6OHFDV.js → chunk-F2S5JWCT.js} +3 -3
- package/dist/{chunk-KZ6OHFDV.js.map → chunk-F2S5JWCT.js.map} +1 -1
- package/dist/{chunk-45WPPI64.js → chunk-FMCPKMQI.js} +3 -3
- package/dist/{chunk-45WPPI64.js.map → chunk-FMCPKMQI.js.map} +1 -1
- package/dist/{chunk-QM6IQW7B.js → chunk-ILHVYKXJ.js} +7 -7
- package/dist/{chunk-QM6IQW7B.js.map → chunk-ILHVYKXJ.js.map} +1 -1
- package/dist/{chunk-ECYEWFEH.cjs → chunk-J34FSPSC.cjs} +16 -6
- package/dist/chunk-J34FSPSC.cjs.map +1 -0
- package/dist/{chunk-GFYCLCGU.cjs → chunk-KM3CLHDB.cjs} +9 -9
- package/dist/{chunk-GFYCLCGU.cjs.map → chunk-KM3CLHDB.cjs.map} +1 -1
- package/dist/{chunk-SLNH62T3.js → chunk-KQYUKOGX.js} +3 -3
- package/dist/{chunk-SLNH62T3.js.map → chunk-KQYUKOGX.js.map} +1 -1
- package/dist/{chunk-7I2PYI4U.cjs → chunk-KR3N6Y7O.cjs} +67 -67
- package/dist/{chunk-7I2PYI4U.cjs.map → chunk-KR3N6Y7O.cjs.map} +1 -1
- package/dist/{chunk-HZCOCNIX.cjs → chunk-L2REUAJB.cjs} +24 -24
- package/dist/{chunk-HZCOCNIX.cjs.map → chunk-L2REUAJB.cjs.map} +1 -1
- package/dist/{chunk-VU65FXEG.js → chunk-LFXBFPI2.js} +66 -29
- package/dist/chunk-LFXBFPI2.js.map +1 -0
- package/dist/{chunk-NXRSR6QG.js → chunk-MHM6OGZR.js} +9 -9
- package/dist/{chunk-NXRSR6QG.js.map → chunk-MHM6OGZR.js.map} +1 -1
- package/dist/{chunk-FCUSVSYX.js → chunk-MRGWM5LE.js} +10 -10
- package/dist/{chunk-FCUSVSYX.js.map → chunk-MRGWM5LE.js.map} +1 -1
- package/dist/{chunk-WXGMDROJ.js → chunk-QDNEXTON.js} +7 -7
- package/dist/{chunk-WXGMDROJ.js.map → chunk-QDNEXTON.js.map} +1 -1
- package/dist/{chunk-VYU5H4FO.js → chunk-RXA2D3UR.js} +3 -3
- package/dist/{chunk-VYU5H4FO.js.map → chunk-RXA2D3UR.js.map} +1 -1
- package/dist/{chunk-XODNY4QI.js → chunk-TIBSLFHR.js} +6 -6
- package/dist/{chunk-XODNY4QI.js.map → chunk-TIBSLFHR.js.map} +1 -1
- package/dist/{chunk-KZG7HQSN.cjs → chunk-UVMSWO6X.cjs} +173 -173
- package/dist/{chunk-KZG7HQSN.cjs.map → chunk-UVMSWO6X.cjs.map} +1 -1
- package/dist/{chunk-ORPT5EQW.cjs → chunk-UZ6CJUC5.cjs} +27 -27
- package/dist/chunk-UZ6CJUC5.cjs.map +1 -0
- package/dist/{chunk-GNF3PHEQ.cjs → chunk-VF2IMMZT.cjs} +17 -17
- package/dist/{chunk-GNF3PHEQ.cjs.map → chunk-VF2IMMZT.cjs.map} +1 -1
- package/dist/{chunk-PGZV3E3I.cjs → chunk-VXEHEPC4.cjs} +4 -4
- package/dist/{chunk-PGZV3E3I.cjs.map → chunk-VXEHEPC4.cjs.map} +1 -1
- package/dist/{chunk-OJ47LMOB.cjs → chunk-WIUHN6SZ.cjs} +669 -628
- package/dist/chunk-WIUHN6SZ.cjs.map +1 -0
- package/dist/{chunk-HNW5IDB3.js → chunk-WIZB5U6N.js} +7 -7
- package/dist/{chunk-HNW5IDB3.js.map → chunk-WIZB5U6N.js.map} +1 -1
- package/dist/{chunk-IDQZI6GL.js → chunk-XH75W3O5.js} +3 -3
- package/dist/{chunk-IDQZI6GL.js.map → chunk-XH75W3O5.js.map} +1 -1
- package/dist/{chunk-T7LSSV7J.cjs → chunk-XXEFDJHY.cjs} +45 -45
- package/dist/{chunk-T7LSSV7J.cjs.map → chunk-XXEFDJHY.cjs.map} +1 -1
- package/dist/{chunk-GORCU2GR.cjs → chunk-Z4NU4MYB.cjs} +123 -123
- package/dist/{chunk-GORCU2GR.cjs.map → chunk-Z4NU4MYB.cjs.map} +1 -1
- package/dist/{chunk-KFC3OUV4.cjs → chunk-ZHK3HEZ2.cjs} +130 -130
- package/dist/{chunk-KFC3OUV4.cjs.map → chunk-ZHK3HEZ2.cjs.map} +1 -1
- package/dist/{chunk-FYMYLZGX.cjs → chunk-ZXXGMQC3.cjs} +10 -10
- package/dist/{chunk-FYMYLZGX.cjs.map → chunk-ZXXGMQC3.cjs.map} +1 -1
- package/dist/graph-merge/index.cjs +577 -99
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +108 -4
- package/dist/graph-merge/index.d.ts +108 -4
- package/dist/graph-merge/index.js +495 -21
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{graph-templates-qraW63Ry.d.ts → graph-templates-BSA9VU_O.d.ts} +1 -1
- package/dist/{graph-templates--hp2U4kn.d.cts → graph-templates-Cg7DpEOF.d.cts} +1 -1
- package/dist/index.cjs +95 -95
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -16
- package/dist/interchange/index.cjs +33 -33
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +10 -10
- package/dist/{local-store-impl-HXBO3VF4.js → local-store-impl-77DCLAAY.js} +18 -18
- package/dist/{local-store-impl-HXBO3VF4.js.map → local-store-impl-77DCLAAY.js.map} +1 -1
- package/dist/{local-store-impl-CUQKHHOZ.cjs → local-store-impl-NJCWM3KR.cjs} +22 -22
- package/dist/{local-store-impl-CUQKHHOZ.cjs.map → local-store-impl-NJCWM3KR.cjs.map} +1 -1
- package/dist/{pglite-store-impl-BD3AVOUH.js → pglite-store-impl-3VFSYLAJ.js} +18 -18
- package/dist/{pglite-store-impl-BD3AVOUH.js.map → pglite-store-impl-3VFSYLAJ.js.map} +1 -1
- package/dist/{pglite-store-impl-C3MQ72LT.cjs → pglite-store-impl-LHLJ3GBQ.cjs} +22 -22
- package/dist/{pglite-store-impl-C3MQ72LT.cjs.map → pglite-store-impl-LHLJ3GBQ.cjs.map} +1 -1
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/provenance/index.cjs +21 -21
- package/dist/provenance/index.d.cts +1 -1
- package/dist/provenance/index.d.ts +1 -1
- package/dist/provenance/index.js +5 -5
- package/dist/schema/index.cjs +36 -36
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +6 -6
- package/dist/{store-stw2AEB4.d.ts → store-CQ3uzXla.d.ts} +58 -27
- package/dist/{store-DTEkUQ0k.d.cts → store-DbHAgVMH.d.cts} +58 -27
- package/package.json +1 -1
- package/dist/chunk-74FNI3PT.js.map +0 -1
- package/dist/chunk-ECYEWFEH.cjs.map +0 -1
- package/dist/chunk-OJ47LMOB.cjs.map +0 -1
- package/dist/chunk-ORPT5EQW.cjs.map +0 -1
- package/dist/chunk-VU65FXEG.js.map +0 -1
- package/dist/chunk-YVKPUSHS.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7CCVR2QF_cjs = require('./chunk-7CCVR2QF.cjs');
|
|
4
4
|
var chunkIZKJF3ZP_cjs = require('./chunk-IZKJF3ZP.cjs');
|
|
5
5
|
var chunkWOD3VQQE_cjs = require('./chunk-WOD3VQQE.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
6
|
+
var chunkBYUIOM4L_cjs = require('./chunk-BYUIOM4L.cjs');
|
|
7
|
+
var chunkVXEHEPC4_cjs = require('./chunk-VXEHEPC4.cjs');
|
|
8
|
+
var chunkDGIA64DM_cjs = require('./chunk-DGIA64DM.cjs');
|
|
9
9
|
var chunk6OWTUEUL_cjs = require('./chunk-6OWTUEUL.cjs');
|
|
10
10
|
var chunk5X46XWNH_cjs = require('./chunk-5X46XWNH.cjs');
|
|
11
|
-
var
|
|
11
|
+
var chunkJ34FSPSC_cjs = require('./chunk-J34FSPSC.cjs');
|
|
12
12
|
var chunkI2W5N2LC_cjs = require('./chunk-I2W5N2LC.cjs');
|
|
13
13
|
var chunkAYQBEVQY_cjs = require('./chunk-AYQBEVQY.cjs');
|
|
14
14
|
var chunkASKXTVK5_cjs = require('./chunk-ASKXTVK5.cjs');
|
|
@@ -74,7 +74,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
74
74
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
75
75
|
var nextStatementId = 0;
|
|
76
76
|
function statementNameFor(sqlText, cacheMax) {
|
|
77
|
-
return
|
|
77
|
+
return chunk7CCVR2QF_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
78
78
|
const name = `tg_${nextStatementId}`;
|
|
79
79
|
nextStatementId += 1;
|
|
80
80
|
return name;
|
|
@@ -453,11 +453,11 @@ function computePostgresBatchChunkSizes(maxBindParameters) {
|
|
|
453
453
|
),
|
|
454
454
|
embeddingUpsertBatchSize: Math.max(
|
|
455
455
|
1,
|
|
456
|
-
Math.floor(maxBindParameters /
|
|
456
|
+
Math.floor(maxBindParameters / chunk7CCVR2QF_cjs.EMBEDDING_UPSERT_PARAM_COUNT)
|
|
457
457
|
),
|
|
458
458
|
findEdgesEndpointChunkSize: Math.max(
|
|
459
459
|
1,
|
|
460
|
-
maxBindParameters -
|
|
460
|
+
maxBindParameters - chunk7CCVR2QF_cjs.FIND_EDGES_ENDPOINT_FIXED_PARAM_COUNT
|
|
461
461
|
),
|
|
462
462
|
fulltextDeleteChunkSize: Math.max(
|
|
463
463
|
1,
|
|
@@ -617,26 +617,26 @@ async function runSerialVectorIndexBuild(execute, tableName, indexStatement, par
|
|
|
617
617
|
}
|
|
618
618
|
if (buildFailure !== void 0) throw buildFailure.error;
|
|
619
619
|
}
|
|
620
|
-
var toNodeRow =
|
|
621
|
-
var toEdgeRow =
|
|
622
|
-
var toUniqueRow =
|
|
623
|
-
var toSchemaVersionRow =
|
|
624
|
-
|
|
620
|
+
var toNodeRow = chunkBYUIOM4L_cjs.createNodeRowMapper(chunkBYUIOM4L_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
621
|
+
var toEdgeRow = chunkBYUIOM4L_cjs.createEdgeRowMapper(chunkBYUIOM4L_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
622
|
+
var toUniqueRow = chunkBYUIOM4L_cjs.createUniqueRowMapper(chunkBYUIOM4L_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
623
|
+
var toSchemaVersionRow = chunkBYUIOM4L_cjs.createSchemaVersionRowMapper(
|
|
624
|
+
chunkBYUIOM4L_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
625
625
|
);
|
|
626
626
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
627
627
|
return {
|
|
628
|
-
...
|
|
628
|
+
...chunkJ34FSPSC_cjs.POSTGRES_CAPABILITIES,
|
|
629
629
|
...vectorStrategy === void 0 ? {} : { vector: chunkI2W5N2LC_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
630
630
|
fulltext: chunkI2W5N2LC_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
633
|
function createPostgresBackend(db, options = {}) {
|
|
634
|
-
|
|
635
|
-
const resourceAudit =
|
|
634
|
+
chunk7CCVR2QF_cjs.assertNoLegacyTransactionCapability(options.capabilities);
|
|
635
|
+
const resourceAudit = chunkJ34FSPSC_cjs.resolveDeclaredBackendResource(
|
|
636
636
|
getSerializedPostgresClient(db),
|
|
637
637
|
options.serializedResource
|
|
638
638
|
);
|
|
639
|
-
const tables2 = options.tables ??
|
|
639
|
+
const tables2 = options.tables ?? chunk7CCVR2QF_cjs.tables;
|
|
640
640
|
const fulltextStrategy = options.fulltext ?? chunkI2W5N2LC_cjs.tsvectorStrategy;
|
|
641
641
|
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkWOD3VQQE_cjs.pgvectorStrategy;
|
|
642
642
|
const iterativeScanProbe = createIterativeScanProbe();
|
|
@@ -646,7 +646,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
646
646
|
);
|
|
647
647
|
const httpOnlyOverrides = isNeonHttpClient(db) ? {
|
|
648
648
|
execution: {
|
|
649
|
-
...
|
|
649
|
+
...chunkJ34FSPSC_cjs.POSTGRES_CAPABILITIES.execution,
|
|
650
650
|
interactiveTransactions: false,
|
|
651
651
|
atomicBatch: "root"
|
|
652
652
|
},
|
|
@@ -655,7 +655,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
655
655
|
supported: false
|
|
656
656
|
}
|
|
657
657
|
} : {};
|
|
658
|
-
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ??
|
|
658
|
+
const configuredMaxBindParameters = options.capabilities?.maxBindParameters ?? chunkJ34FSPSC_cjs.POSTGRES_MAX_BIND_PARAMETERS;
|
|
659
659
|
const driverBindParameterOverrides = isPgliteDatabase(db) ? {
|
|
660
660
|
maxBindParameters: Math.min(
|
|
661
661
|
configuredMaxBindParameters,
|
|
@@ -672,12 +672,12 @@ function createPostgresBackend(db, options = {}) {
|
|
|
672
672
|
}
|
|
673
673
|
);
|
|
674
674
|
}
|
|
675
|
-
const pessimisticLocks = requestedPessimisticLocks === void 0 ?
|
|
675
|
+
const pessimisticLocks = requestedPessimisticLocks === void 0 ? chunkJ34FSPSC_cjs.POSTGRES_CAPABILITIES.pessimisticLocks : {
|
|
676
676
|
advisoryLocks: requestedPessimisticLocks.advisoryLocks,
|
|
677
677
|
tableLocks: requestedPessimisticLocks.tableLocks,
|
|
678
678
|
serializedWriters: false
|
|
679
679
|
};
|
|
680
|
-
const declaredCapabilities =
|
|
680
|
+
const declaredCapabilities = chunkJ34FSPSC_cjs.normalizeGraphAnalyticsCapabilities({
|
|
681
681
|
...baseCapabilities,
|
|
682
682
|
...httpOnlyOverrides,
|
|
683
683
|
...options.capabilities,
|
|
@@ -692,12 +692,12 @@ function createPostgresBackend(db, options = {}) {
|
|
|
692
692
|
const adapterOptions = {
|
|
693
693
|
...options.prepareStatements === void 0 ? {} : { prepareStatements: options.prepareStatements },
|
|
694
694
|
...options.preparedStatementCacheMax === void 0 ? {} : { preparedStatementCacheMax: options.preparedStatementCacheMax },
|
|
695
|
-
maxBindParameters: declaredCapabilities.maxBindParameters ??
|
|
695
|
+
maxBindParameters: declaredCapabilities.maxBindParameters ?? chunkJ34FSPSC_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
696
696
|
interactiveAtomicBatch: declaredCapabilities.execution.interactiveTransactions && (resourceAudit.kind === "independent" || isPgliteDatabase(db))
|
|
697
697
|
};
|
|
698
698
|
const executionAdapter = createPostgresExecutionAdapter(db, adapterOptions);
|
|
699
|
-
const atomicSqlProgramExecutor =
|
|
700
|
-
const capabilities =
|
|
699
|
+
const atomicSqlProgramExecutor = chunkDGIA64DM_cjs.createAtomicSqlProgramExecutor(executionAdapter);
|
|
700
|
+
const capabilities = chunk7CCVR2QF_cjs.assertBundledCapabilityDeclarations(
|
|
701
701
|
{
|
|
702
702
|
...declaredCapabilities,
|
|
703
703
|
execution: {
|
|
@@ -707,7 +707,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
707
707
|
contributions: {
|
|
708
708
|
supported: true,
|
|
709
709
|
probe: true,
|
|
710
|
-
rebuild:
|
|
710
|
+
rebuild: chunk7CCVR2QF_cjs.contributionRebuildSupported(
|
|
711
711
|
fulltextStrategy,
|
|
712
712
|
tables2.fulltextTableName,
|
|
713
713
|
declaredCapabilities.execution.interactiveTransactions
|
|
@@ -750,12 +750,12 @@ function createPostgresBackend(db, options = {}) {
|
|
|
750
750
|
tableNames.identityClosure,
|
|
751
751
|
tableNames.identitySeparation
|
|
752
752
|
];
|
|
753
|
-
const operationStrategy =
|
|
753
|
+
const operationStrategy = chunk7CCVR2QF_cjs.createPostgresOperationStrategy(
|
|
754
754
|
tables2,
|
|
755
755
|
fulltextStrategy,
|
|
756
756
|
vectorStrategy
|
|
757
757
|
);
|
|
758
|
-
const guardedTableExists =
|
|
758
|
+
const guardedTableExists = chunk7CCVR2QF_cjs.createCachedTableExistence(
|
|
759
759
|
async (tableName) => {
|
|
760
760
|
const rows = await executionAdapter.execute(
|
|
761
761
|
operationStrategy.buildTableExists(tableName)
|
|
@@ -772,18 +772,18 @@ function createPostgresBackend(db, options = {}) {
|
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
async function ensureTableWithConcurrentCreateRetry(table) {
|
|
775
|
-
await executeConcurrentCreateDdl(
|
|
775
|
+
await executeConcurrentCreateDdl(chunk7CCVR2QF_cjs.generatePgCreateTableSQL(table));
|
|
776
776
|
}
|
|
777
777
|
async function ensureDatabaseExtension(name) {
|
|
778
|
-
const validated =
|
|
778
|
+
const validated = chunkJ34FSPSC_cjs.DATABASE_EXTENSION_NAMES.find(
|
|
779
779
|
(candidate) => candidate === name
|
|
780
780
|
);
|
|
781
781
|
if (validated === void 0) {
|
|
782
782
|
throw new chunkASKXTVK5_cjs.ConfigurationError(
|
|
783
783
|
`Unsupported database extension "${name}".`,
|
|
784
|
-
{ extension: name, supported:
|
|
784
|
+
{ extension: name, supported: chunkJ34FSPSC_cjs.DATABASE_EXTENSION_NAMES },
|
|
785
785
|
{
|
|
786
|
-
suggestion: `Request one of: ${
|
|
786
|
+
suggestion: `Request one of: ${chunkJ34FSPSC_cjs.DATABASE_EXTENSION_NAMES.join(", ")}.`
|
|
787
787
|
}
|
|
788
788
|
);
|
|
789
789
|
}
|
|
@@ -805,23 +805,23 @@ function createPostgresBackend(db, options = {}) {
|
|
|
805
805
|
await ensureTableWithConcurrentCreateRetry(matTable);
|
|
806
806
|
}
|
|
807
807
|
function identityContributionsFor(identityTableNames) {
|
|
808
|
-
const identityTables =
|
|
808
|
+
const identityTables = chunk7CCVR2QF_cjs.createPostgresTables({
|
|
809
809
|
identityAssertions: identityTableNames.identityAssertions,
|
|
810
810
|
recordedIdentityAssertions: identityTableNames.recordedIdentityAssertions,
|
|
811
811
|
identityClosure: identityTableNames.identityClosure,
|
|
812
812
|
identitySeparation: identityTableNames.identitySeparation
|
|
813
813
|
});
|
|
814
|
-
return
|
|
814
|
+
return chunk7CCVR2QF_cjs.postgresContributions(identityTables, fulltextStrategy).filter(
|
|
815
815
|
(contribution) => IDENTITY_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
816
816
|
);
|
|
817
817
|
}
|
|
818
818
|
function recordedContributionsFor(recordedTableNames) {
|
|
819
|
-
const recordedTables =
|
|
819
|
+
const recordedTables = chunk7CCVR2QF_cjs.createPostgresTables({
|
|
820
820
|
recordedNodes: recordedTableNames.recordedNodes,
|
|
821
821
|
recordedEdges: recordedTableNames.recordedEdges,
|
|
822
822
|
recordedClock: recordedTableNames.recordedClock
|
|
823
823
|
});
|
|
824
|
-
return
|
|
824
|
+
return chunk7CCVR2QF_cjs.postgresContributions(recordedTables, fulltextStrategy).filter(
|
|
825
825
|
(contribution) => RECORDED_TABLE_LOGICAL_NAMES.has(contribution.logicalName)
|
|
826
826
|
);
|
|
827
827
|
}
|
|
@@ -836,25 +836,25 @@ function createPostgresBackend(db, options = {}) {
|
|
|
836
836
|
);
|
|
837
837
|
const row = rows[0];
|
|
838
838
|
if (row === void 0) return void 0;
|
|
839
|
-
return
|
|
839
|
+
return chunk7CCVR2QF_cjs.mapContributionMaterializationRow(
|
|
840
840
|
row,
|
|
841
|
-
|
|
841
|
+
chunk7CCVR2QF_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
842
842
|
);
|
|
843
843
|
}
|
|
844
844
|
async function getContributionMaterializationRows(graphId) {
|
|
845
845
|
const rows = await db.select().from(matTable).where(drizzleOrm.eq(matTable.graphId, graphId));
|
|
846
846
|
return rows.map(
|
|
847
|
-
(row) =>
|
|
847
|
+
(row) => chunk7CCVR2QF_cjs.mapContributionMaterializationRow(
|
|
848
848
|
row,
|
|
849
|
-
|
|
849
|
+
chunk7CCVR2QF_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
850
850
|
)
|
|
851
851
|
);
|
|
852
852
|
}
|
|
853
853
|
async function recordContributionMaterializationRow(params) {
|
|
854
854
|
await db.insert(matTable).values(
|
|
855
|
-
|
|
855
|
+
chunk7CCVR2QF_cjs.buildContributionInsertValues(
|
|
856
856
|
params,
|
|
857
|
-
|
|
857
|
+
chunk7CCVR2QF_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
858
858
|
)
|
|
859
859
|
).onConflictDoUpdate({
|
|
860
860
|
target: [
|
|
@@ -863,7 +863,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
863
863
|
matTable.owner,
|
|
864
864
|
matTable.tableName
|
|
865
865
|
],
|
|
866
|
-
set:
|
|
866
|
+
set: chunk7CCVR2QF_cjs.buildContributionOnConflictSet(
|
|
867
867
|
matTable.materializedAt,
|
|
868
868
|
params.materializedAt
|
|
869
869
|
)
|
|
@@ -883,13 +883,13 @@ function createPostgresBackend(db, options = {}) {
|
|
|
883
883
|
const rows = await executionAdapter.execute(
|
|
884
884
|
operationStrategy.buildTableExists(tableName)
|
|
885
885
|
);
|
|
886
|
-
return
|
|
886
|
+
return chunk7CCVR2QF_cjs.tableExistsFromRow(rows[0]);
|
|
887
887
|
}
|
|
888
|
-
const fenceTarget =
|
|
888
|
+
const fenceTarget = chunkJ34FSPSC_cjs.markFirstPartyFactory({
|
|
889
889
|
dialect: "postgres",
|
|
890
890
|
capabilities
|
|
891
891
|
});
|
|
892
|
-
const contributionMaterializer =
|
|
892
|
+
const contributionMaterializer = chunk7CCVR2QF_cjs.createContributionMaterializer({
|
|
893
893
|
dialect: "postgres",
|
|
894
894
|
fenceTarget,
|
|
895
895
|
fulltextStrategy,
|
|
@@ -932,8 +932,8 @@ function createPostgresBackend(db, options = {}) {
|
|
|
932
932
|
transactionScoped: false
|
|
933
933
|
});
|
|
934
934
|
async function acquireSchemaWriteFence(tx, graphId) {
|
|
935
|
-
const plan =
|
|
936
|
-
|
|
935
|
+
const plan = chunkJ34FSPSC_cjs.requireWriteFence(
|
|
936
|
+
chunkJ34FSPSC_cjs.resolveWriteFencePlan(fenceTarget),
|
|
937
937
|
"The PostgreSQL schema-commit fence",
|
|
938
938
|
"advisory-lock"
|
|
939
939
|
);
|
|
@@ -1003,9 +1003,9 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1003
1003
|
schemaVersionsTable: tables2.schemaVersions,
|
|
1004
1004
|
fenceTarget
|
|
1005
1005
|
});
|
|
1006
|
-
const gatedBackend =
|
|
1006
|
+
const gatedBackend = chunkDGIA64DM_cjs.carryAtomicMutationSessionRegistration(
|
|
1007
1007
|
backend2,
|
|
1008
|
-
|
|
1008
|
+
chunk7CCVR2QF_cjs.gateFulltext(
|
|
1009
1009
|
backend2,
|
|
1010
1010
|
contributionMaterializer.assertInitialized,
|
|
1011
1011
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -1020,26 +1020,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1020
1020
|
const edgeTableName = drizzleOrm.getTableName(tables2.edges);
|
|
1021
1021
|
const [storage] = await executionAdapter.execute(
|
|
1022
1022
|
chunkAYQBEVQY_cjs.sql`SELECT
|
|
1023
|
-
to_regclass(${
|
|
1023
|
+
to_regclass(${chunk7CCVR2QF_cjs.postgresIdentifierRegclassName(edgeTableName)}) AS table_name,
|
|
1024
1024
|
EXISTS (
|
|
1025
1025
|
SELECT 1 FROM pg_attribute
|
|
1026
|
-
WHERE attrelid = to_regclass(${
|
|
1026
|
+
WHERE attrelid = to_regclass(${chunk7CCVR2QF_cjs.postgresIdentifierRegclassName(edgeTableName)})
|
|
1027
1027
|
AND attname = 'match_identity_name' AND NOT attisdropped
|
|
1028
1028
|
) AS has_name,
|
|
1029
1029
|
EXISTS (
|
|
1030
1030
|
SELECT 1 FROM pg_attribute
|
|
1031
|
-
WHERE attrelid = to_regclass(${
|
|
1031
|
+
WHERE attrelid = to_regclass(${chunk7CCVR2QF_cjs.postgresIdentifierRegclassName(edgeTableName)})
|
|
1032
1032
|
AND attname = 'match_identity_key' AND NOT attisdropped
|
|
1033
1033
|
) AS has_key,
|
|
1034
1034
|
EXISTS (
|
|
1035
1035
|
SELECT 1 FROM pg_constraint
|
|
1036
|
-
WHERE conrelid = to_regclass(${
|
|
1037
|
-
AND conname = ${
|
|
1036
|
+
WHERE conrelid = to_regclass(${chunk7CCVR2QF_cjs.postgresIdentifierRegclassName(edgeTableName)})
|
|
1037
|
+
AND conname = ${chunk7CCVR2QF_cjs.edgeMatchIdentityPairCheckName(edgeTableName)}
|
|
1038
1038
|
) AS has_check,
|
|
1039
|
-
to_regclass(${
|
|
1039
|
+
to_regclass(${chunk7CCVR2QF_cjs.postgresIdentifierRegclassName(chunk7CCVR2QF_cjs.edgeMatchIdentityUniqueIndexName(edgeTableName))}) IS NOT NULL AS has_index`
|
|
1040
1040
|
);
|
|
1041
1041
|
if (typeof storage?.table_name !== "string") return;
|
|
1042
|
-
const statements =
|
|
1042
|
+
const statements = chunk7CCVR2QF_cjs.generatePostgresEdgeMatchIdentityUpgradeDDL(edgeTableName);
|
|
1043
1043
|
const missingStatements = [
|
|
1044
1044
|
storage.has_name === true ? void 0 : statements[0],
|
|
1045
1045
|
storage.has_key === true ? void 0 : statements[1],
|
|
@@ -1061,7 +1061,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
async function ensureBaseSchemaVersionTable() {
|
|
1063
1063
|
await executeConcurrentCreateDdl(
|
|
1064
|
-
|
|
1064
|
+
chunk7CCVR2QF_cjs.generatePgCreateTableSQL(tables2.baseSchemaVersions)
|
|
1065
1065
|
);
|
|
1066
1066
|
}
|
|
1067
1067
|
async function writeBaseSchemaVersion(version) {
|
|
@@ -1076,10 +1076,10 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
async function ensureGraphTemplatesTable() {
|
|
1078
1078
|
await executeConcurrentCreateDdl(
|
|
1079
|
-
|
|
1079
|
+
chunk7CCVR2QF_cjs.generatePgCreateTableSQL(tables2.graphTemplates)
|
|
1080
1080
|
);
|
|
1081
1081
|
}
|
|
1082
|
-
const baseSchemaLifecycle =
|
|
1082
|
+
const baseSchemaLifecycle = chunk7CCVR2QF_cjs.createBaseSchemaLifecycle({
|
|
1083
1083
|
readVersion: readBaseSchemaVersion,
|
|
1084
1084
|
ensureVersionTable: ensureBaseSchemaVersionTable,
|
|
1085
1085
|
writeVersion: writeBaseSchemaVersion,
|
|
@@ -1120,22 +1120,22 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1120
1120
|
{ capability: "trustedImport", dialect: "postgres" }
|
|
1121
1121
|
);
|
|
1122
1122
|
}
|
|
1123
|
-
const trustedTx =
|
|
1123
|
+
const trustedTx = chunkJ34FSPSC_cjs.deriveBackend(tx, {
|
|
1124
1124
|
executeRaw(sqlText, params) {
|
|
1125
1125
|
return executeCompiled({ params, sql: sqlText });
|
|
1126
1126
|
}
|
|
1127
1127
|
});
|
|
1128
|
-
await
|
|
1129
|
-
await
|
|
1130
|
-
const indexDefinitions = await
|
|
1128
|
+
await chunk7CCVR2QF_cjs.lockPostgresTrustedImportTables(trustedTx, tableNames);
|
|
1129
|
+
await chunk7CCVR2QF_cjs.assertTrustedImportDatabaseEmpty(trustedTx, tableNames);
|
|
1130
|
+
const indexDefinitions = await chunk7CCVR2QF_cjs.suspendPostgresSecondaryIndexes(
|
|
1131
1131
|
trustedTx,
|
|
1132
1132
|
tableNames
|
|
1133
1133
|
);
|
|
1134
1134
|
const result = await fn(
|
|
1135
|
-
|
|
1135
|
+
chunk7CCVR2QF_cjs.createPostgresTrustedImportSession(trustedTx, tableNames)
|
|
1136
1136
|
);
|
|
1137
|
-
await
|
|
1138
|
-
await
|
|
1137
|
+
await chunk7CCVR2QF_cjs.restoreSecondaryIndexes(trustedTx, indexDefinitions);
|
|
1138
|
+
await chunk7CCVR2QF_cjs.analyzeImportedTables(trustedTx, tableNames);
|
|
1139
1139
|
return result;
|
|
1140
1140
|
});
|
|
1141
1141
|
}
|
|
@@ -1143,7 +1143,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1143
1143
|
async bootstrapTables() {
|
|
1144
1144
|
const startingBaseSchemaVersion = await baseSchemaLifecycle.prepareBootstrap();
|
|
1145
1145
|
await baseSchemaLifecycle.adoptBeforeBootstrap(startingBaseSchemaVersion);
|
|
1146
|
-
const statements =
|
|
1146
|
+
const statements = chunk7CCVR2QF_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
1147
1147
|
for (const statement of statements) {
|
|
1148
1148
|
await executeConcurrentCreateDdl(statement);
|
|
1149
1149
|
}
|
|
@@ -1177,7 +1177,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1177
1177
|
},
|
|
1178
1178
|
async instantiateGraphTemplate(params) {
|
|
1179
1179
|
const rows = await operations.execute(
|
|
1180
|
-
|
|
1180
|
+
chunk7CCVR2QF_cjs.instantiateGraphTemplateSql({
|
|
1181
1181
|
dialect: "postgres",
|
|
1182
1182
|
graphId: params.graphId,
|
|
1183
1183
|
schemaHash: params.schemaHash,
|
|
@@ -1247,7 +1247,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1247
1247
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
1248
1248
|
// rather than self-healing on a read/write path (#135). Shared
|
|
1249
1249
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
1250
|
-
...
|
|
1250
|
+
...chunk7CCVR2QF_cjs.gateFulltextMethods(
|
|
1251
1251
|
operations,
|
|
1252
1252
|
contributionMaterializer.assertInitialized,
|
|
1253
1253
|
contributionMaterializer.refuseUnavailableFulltext
|
|
@@ -1307,26 +1307,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1307
1307
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
1308
1308
|
const row = rows[0];
|
|
1309
1309
|
if (row === void 0) return void 0;
|
|
1310
|
-
return
|
|
1310
|
+
return chunk7CCVR2QF_cjs.mapMaterializationRow(row, chunk7CCVR2QF_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
1311
1311
|
},
|
|
1312
1312
|
async getIndexMaterializations(statusKeys) {
|
|
1313
1313
|
if (statusKeys.length === 0) return [];
|
|
1314
1314
|
const t = tables2.indexMaterializations;
|
|
1315
1315
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
1316
1316
|
return rows.map(
|
|
1317
|
-
(row) =>
|
|
1317
|
+
(row) => chunk7CCVR2QF_cjs.mapMaterializationRow(row, chunk7CCVR2QF_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
1318
1318
|
);
|
|
1319
1319
|
},
|
|
1320
1320
|
async recordIndexMaterialization(params) {
|
|
1321
1321
|
const t = tables2.indexMaterializations;
|
|
1322
1322
|
await db.insert(t).values(
|
|
1323
|
-
|
|
1323
|
+
chunk7CCVR2QF_cjs.buildMaterializationInsertValues(
|
|
1324
1324
|
params,
|
|
1325
|
-
|
|
1325
|
+
chunk7CCVR2QF_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
1326
1326
|
)
|
|
1327
1327
|
).onConflictDoUpdate({
|
|
1328
1328
|
target: t.indexName,
|
|
1329
|
-
set:
|
|
1329
|
+
set: chunk7CCVR2QF_cjs.buildMaterializationOnConflictSet(params.materializedAt)
|
|
1330
1330
|
});
|
|
1331
1331
|
},
|
|
1332
1332
|
async ensureContributionMaterializationsTable() {
|
|
@@ -1348,26 +1348,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1348
1348
|
const t = tables2.kindRemovals;
|
|
1349
1349
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
1350
1350
|
return rows.map(
|
|
1351
|
-
(row) =>
|
|
1351
|
+
(row) => chunk7CCVR2QF_cjs.mapKindRemovalRow(row, chunk7CCVR2QF_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1352
1352
|
);
|
|
1353
1353
|
},
|
|
1354
1354
|
async getAllKindRemovals(graphId) {
|
|
1355
1355
|
const t = tables2.kindRemovals;
|
|
1356
1356
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
1357
1357
|
return rows.map(
|
|
1358
|
-
(row) =>
|
|
1358
|
+
(row) => chunk7CCVR2QF_cjs.mapKindRemovalRow(row, chunk7CCVR2QF_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
1359
1359
|
);
|
|
1360
1360
|
},
|
|
1361
1361
|
async recordKindRemoval(params) {
|
|
1362
1362
|
const t = tables2.kindRemovals;
|
|
1363
1363
|
await db.insert(t).values(
|
|
1364
|
-
|
|
1364
|
+
chunk7CCVR2QF_cjs.buildKindRemovalInsertValues(
|
|
1365
1365
|
params,
|
|
1366
|
-
|
|
1366
|
+
chunk7CCVR2QF_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
1367
1367
|
)
|
|
1368
1368
|
).onConflictDoUpdate({
|
|
1369
1369
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
1370
|
-
set:
|
|
1370
|
+
set: chunk7CCVR2QF_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
1371
1371
|
});
|
|
1372
1372
|
},
|
|
1373
1373
|
async ensureReconciliationMarkersTable() {
|
|
@@ -1462,7 +1462,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1462
1462
|
async commitSchemaVersionIfKindsEmpty(params, probes) {
|
|
1463
1463
|
return runSchemaWriteTransaction(
|
|
1464
1464
|
params.graphId,
|
|
1465
|
-
(target) =>
|
|
1465
|
+
(target) => chunk7CCVR2QF_cjs.commitSchemaVersionIfKindsEmpty(target, params, probes)
|
|
1466
1466
|
);
|
|
1467
1467
|
},
|
|
1468
1468
|
async commitSchemaVersionWithPreflight(params, preflight) {
|
|
@@ -1484,7 +1484,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1484
1484
|
return backend.transactionWithNative((tx) => fn(tx), options2);
|
|
1485
1485
|
},
|
|
1486
1486
|
async transactionWithNative(fn, options2) {
|
|
1487
|
-
const temporaryWrites = options2?.temporaryWrites ===
|
|
1487
|
+
const temporaryWrites = options2?.temporaryWrites === chunkJ34FSPSC_cjs.INTERNAL_TEMPORARY_WRITES;
|
|
1488
1488
|
if (temporaryWrites && options2.accessMode !== "read_only") {
|
|
1489
1489
|
throw new chunkASKXTVK5_cjs.ConfigurationError(
|
|
1490
1490
|
"Temporary-write transactions must be semantically read-only.",
|
|
@@ -1502,7 +1502,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1502
1502
|
return db.transaction(async (tx) => {
|
|
1503
1503
|
const { backend: txBackend, drainAndClose } = bindTransactionBackend(tx);
|
|
1504
1504
|
try {
|
|
1505
|
-
return await fn(
|
|
1505
|
+
return await fn(chunkJ34FSPSC_cjs.markSchemaFencedInsertEligible(txBackend), tx);
|
|
1506
1506
|
} finally {
|
|
1507
1507
|
await drainAndClose();
|
|
1508
1508
|
}
|
|
@@ -1519,7 +1519,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1519
1519
|
}
|
|
1520
1520
|
);
|
|
1521
1521
|
}
|
|
1522
|
-
|
|
1522
|
+
chunk7CCVR2QF_cjs.assertAdoptedDialect(
|
|
1523
1523
|
externalTx,
|
|
1524
1524
|
pgCore.PgTransaction,
|
|
1525
1525
|
"postgres"
|
|
@@ -1529,13 +1529,13 @@ function createPostgresBackend(db, options = {}) {
|
|
|
1529
1529
|
async close() {
|
|
1530
1530
|
}
|
|
1531
1531
|
};
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1532
|
+
chunkJ34FSPSC_cjs.auditBackendResource(backend, resourceAudit);
|
|
1533
|
+
chunkJ34FSPSC_cjs.markFirstPartyFactory(backend);
|
|
1534
|
+
chunkJ34FSPSC_cjs.markSchemaFencedInsertEligible(backend);
|
|
1535
|
+
chunkVXEHEPC4_cjs.markBundledRootAutocommitEligible(backend);
|
|
1536
1536
|
if (atomicSqlProgramExecutor !== void 0) {
|
|
1537
|
-
|
|
1538
|
-
|
|
1537
|
+
chunkDGIA64DM_cjs.registerAtomicSqlProgram(backend, executionAdapter);
|
|
1538
|
+
chunkDGIA64DM_cjs.registerAtomicMutationPrograms(backend, {
|
|
1539
1539
|
createNodes: operations.executeAtomicNodeBatch,
|
|
1540
1540
|
replaceNodes: operations.executeAtomicNodeReplacementBatch,
|
|
1541
1541
|
createEdges: operations.executeAtomicEdgeBatch,
|
|
@@ -1727,13 +1727,13 @@ function createPostgresOperationBackend(options) {
|
|
|
1727
1727
|
});
|
|
1728
1728
|
}
|
|
1729
1729
|
const batchConfig = computePostgresBatchChunkSizes(
|
|
1730
|
-
capabilities.maxBindParameters ??
|
|
1730
|
+
capabilities.maxBindParameters ?? chunkJ34FSPSC_cjs.POSTGRES_MAX_BIND_PARAMETERS
|
|
1731
1731
|
);
|
|
1732
1732
|
const schemaFenceInsertLockClause = (() => {
|
|
1733
|
-
const plan =
|
|
1733
|
+
const plan = chunkJ34FSPSC_cjs.resolveWriteFencePlan(fenceTarget);
|
|
1734
1734
|
return plan.kind === "lock" ? drizzleOrm.sql.raw("FOR SHARE") : drizzleOrm.sql.raw("");
|
|
1735
1735
|
})();
|
|
1736
|
-
const commonOperationMembers =
|
|
1736
|
+
const commonOperationMembers = chunk7CCVR2QF_cjs.createCommonOperationBackend({
|
|
1737
1737
|
batchConfig,
|
|
1738
1738
|
commandSession: transactionScoped ? "transaction" : "root",
|
|
1739
1739
|
execution: {
|
|
@@ -1743,8 +1743,8 @@ function createPostgresOperationBackend(options) {
|
|
|
1743
1743
|
execRun
|
|
1744
1744
|
},
|
|
1745
1745
|
...atomicSqlProgramExecutor === void 0 ? {} : { atomicSqlProgramExecutor },
|
|
1746
|
-
nowIso:
|
|
1747
|
-
maxBindParameters: capabilities.maxBindParameters ??
|
|
1746
|
+
nowIso: chunkBYUIOM4L_cjs.nowIso,
|
|
1747
|
+
maxBindParameters: capabilities.maxBindParameters ?? chunkJ34FSPSC_cjs.POSTGRES_MAX_BIND_PARAMETERS,
|
|
1748
1748
|
operationStrategy,
|
|
1749
1749
|
rowMappers: {
|
|
1750
1750
|
toEdgeRow,
|
|
@@ -1754,7 +1754,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1754
1754
|
},
|
|
1755
1755
|
schemaFenceLockClause: schemaFenceInsertLockClause,
|
|
1756
1756
|
async resolveAtomicNodeProjectionEvidence(creates, updates) {
|
|
1757
|
-
const requirements =
|
|
1757
|
+
const requirements = chunk7CCVR2QF_cjs.resolveAtomicNodeProjectionRequirements(
|
|
1758
1758
|
creates,
|
|
1759
1759
|
updates
|
|
1760
1760
|
);
|
|
@@ -1765,7 +1765,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1765
1765
|
);
|
|
1766
1766
|
},
|
|
1767
1767
|
async diagnoseAtomicNodeProjectionEvidence(creates, updates) {
|
|
1768
|
-
const requirements =
|
|
1768
|
+
const requirements = chunk7CCVR2QF_cjs.resolveAtomicNodeProjectionRequirements(
|
|
1769
1769
|
creates,
|
|
1770
1770
|
updates
|
|
1771
1771
|
);
|
|
@@ -1776,7 +1776,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1776
1776
|
);
|
|
1777
1777
|
},
|
|
1778
1778
|
async refuseAtomicNodeProjectionError(creates, updates, error) {
|
|
1779
|
-
const requirements =
|
|
1779
|
+
const requirements = chunk7CCVR2QF_cjs.resolveAtomicNodeProjectionRequirements(
|
|
1780
1780
|
creates,
|
|
1781
1781
|
updates
|
|
1782
1782
|
);
|
|
@@ -1808,7 +1808,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1808
1808
|
(projection) => projection.embedding.length !== projection.dimensions
|
|
1809
1809
|
) ?? (embeddingProjections.length === 1 ? embeddingProjections[0] : void 0);
|
|
1810
1810
|
if (dimensionProjection !== void 0) {
|
|
1811
|
-
const mapped =
|
|
1811
|
+
const mapped = chunk7CCVR2QF_cjs.mapVectorWriteError(error, {
|
|
1812
1812
|
nodeKind: params.kind,
|
|
1813
1813
|
fieldPath: dimensionProjection.fieldPath
|
|
1814
1814
|
});
|
|
@@ -1840,26 +1840,26 @@ function createPostgresOperationBackend(options) {
|
|
|
1840
1840
|
};
|
|
1841
1841
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
1842
1842
|
async upsertEmbedding(params) {
|
|
1843
|
-
const slot =
|
|
1843
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
1844
1844
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1845
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
1845
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunkBYUIOM4L_cjs.nowIso());
|
|
1846
1846
|
try {
|
|
1847
1847
|
for (const statement of statements) {
|
|
1848
1848
|
await execRun(statement);
|
|
1849
1849
|
}
|
|
1850
1850
|
} catch (error) {
|
|
1851
|
-
throw
|
|
1851
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, params);
|
|
1852
1852
|
}
|
|
1853
1853
|
},
|
|
1854
1854
|
async upsertEmbeddingBatch(params) {
|
|
1855
1855
|
if (params.rows.length === 0) return;
|
|
1856
|
-
const slot =
|
|
1856
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
1857
1857
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1858
1858
|
const rowsById = new Map(
|
|
1859
1859
|
params.rows.map((row) => [row.nodeId, row])
|
|
1860
1860
|
);
|
|
1861
1861
|
const rows = [...rowsById.values()];
|
|
1862
|
-
const timestamp =
|
|
1862
|
+
const timestamp = chunkBYUIOM4L_cjs.nowIso();
|
|
1863
1863
|
try {
|
|
1864
1864
|
for (const chunk2 of chunk5X46XWNH_cjs.chunk(
|
|
1865
1865
|
rows,
|
|
@@ -1890,11 +1890,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
}
|
|
1892
1892
|
} catch (error) {
|
|
1893
|
-
throw
|
|
1893
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, params);
|
|
1894
1894
|
}
|
|
1895
1895
|
},
|
|
1896
1896
|
async deleteEmbedding(params) {
|
|
1897
|
-
const slot =
|
|
1897
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
1898
1898
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1899
1899
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
1900
1900
|
for (const statement of statements) {
|
|
@@ -1903,7 +1903,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1903
1903
|
},
|
|
1904
1904
|
async deleteEmbeddingBatch(params) {
|
|
1905
1905
|
if (params.nodeIds.length === 0) return;
|
|
1906
|
-
const slot =
|
|
1906
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
1907
1907
|
await contributionMaterializer.assertVectorSlot(slot);
|
|
1908
1908
|
for (const nodeIds of chunk5X46XWNH_cjs.chunk(
|
|
1909
1909
|
[...new Set(params.nodeIds)],
|
|
@@ -1919,17 +1919,17 @@ function createPostgresOperationBackend(options) {
|
|
|
1919
1919
|
async vectorSearch(params) {
|
|
1920
1920
|
chunkI2W5N2LC_cjs.assertVectorSearchLimit(params.limit);
|
|
1921
1921
|
chunkWOD3VQQE_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
1922
|
-
const slot =
|
|
1922
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams(params);
|
|
1923
1923
|
const query = vectorStrategy.buildSearch(
|
|
1924
1924
|
slot,
|
|
1925
1925
|
params,
|
|
1926
1926
|
// Store-compiled candidates (predicates + subclass + currency)
|
|
1927
1927
|
// take precedence; the live-node default covers direct backend use.
|
|
1928
|
-
params.candidates ??
|
|
1928
|
+
params.candidates ?? chunk7CCVR2QF_cjs.buildLiveNodeCandidates(
|
|
1929
1929
|
tableNames.nodes,
|
|
1930
1930
|
params.graphId,
|
|
1931
1931
|
params.nodeKind,
|
|
1932
|
-
|
|
1932
|
+
chunkBYUIOM4L_cjs.nowIso()
|
|
1933
1933
|
)
|
|
1934
1934
|
);
|
|
1935
1935
|
const gucOverrides = await vectorSearchGucOverrides(params);
|
|
@@ -1937,7 +1937,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1937
1937
|
try {
|
|
1938
1938
|
rows = await runVectorSearch(gucOverrides, query);
|
|
1939
1939
|
} catch (error) {
|
|
1940
|
-
throw
|
|
1940
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, params);
|
|
1941
1941
|
}
|
|
1942
1942
|
return rows.map((row) => ({
|
|
1943
1943
|
nodeId: row.node_id,
|
|
@@ -1952,7 +1952,7 @@ function createPostgresOperationBackend(options) {
|
|
|
1952
1952
|
chunkI2W5N2LC_cjs.assertVectorSearchLimit(params.limit);
|
|
1953
1953
|
chunkI2W5N2LC_cjs.assertVectorSearchLimit(params.vector.k);
|
|
1954
1954
|
chunkWOD3VQQE_cjs.assertPgvectorEfSearch(params.vector.efSearch);
|
|
1955
|
-
const slot =
|
|
1955
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromParams({
|
|
1956
1956
|
graphId: params.graphId,
|
|
1957
1957
|
nodeKind: params.nodeKind,
|
|
1958
1958
|
fieldPath: params.vector.fieldPath,
|
|
@@ -1960,11 +1960,11 @@ function createPostgresOperationBackend(options) {
|
|
|
1960
1960
|
metric: params.vector.metric,
|
|
1961
1961
|
indexType: params.vector.indexType
|
|
1962
1962
|
});
|
|
1963
|
-
const candidates = params.candidates ??
|
|
1963
|
+
const candidates = params.candidates ?? chunk7CCVR2QF_cjs.buildLiveNodeCandidates(
|
|
1964
1964
|
tableNames.nodes,
|
|
1965
1965
|
params.graphId,
|
|
1966
1966
|
params.nodeKind,
|
|
1967
|
-
|
|
1967
|
+
chunkBYUIOM4L_cjs.nowIso()
|
|
1968
1968
|
);
|
|
1969
1969
|
const vectorParams = {
|
|
1970
1970
|
graphId: params.graphId,
|
|
@@ -1998,15 +1998,15 @@ function createPostgresOperationBackend(options) {
|
|
|
1998
1998
|
statement
|
|
1999
1999
|
);
|
|
2000
2000
|
} catch (error) {
|
|
2001
|
-
throw
|
|
2001
|
+
throw chunk7CCVR2QF_cjs.mapVectorWriteError(error, vectorParams);
|
|
2002
2002
|
}
|
|
2003
|
-
return raw.map((row) =>
|
|
2003
|
+
return raw.map((row) => chunk7CCVR2QF_cjs.mapHybridSearchRow(row, toNodeRow));
|
|
2004
2004
|
}
|
|
2005
2005
|
} : {}
|
|
2006
2006
|
};
|
|
2007
2007
|
async function lockActiveSchemaVersion(graphId) {
|
|
2008
|
-
const plan =
|
|
2009
|
-
|
|
2008
|
+
const plan = chunkJ34FSPSC_cjs.requireWriteFence(
|
|
2009
|
+
chunkJ34FSPSC_cjs.resolveWriteFencePlan(fenceTarget),
|
|
2010
2010
|
"The PostgreSQL schema write fence",
|
|
2011
2011
|
"advisory-lock"
|
|
2012
2012
|
);
|
|
@@ -2071,7 +2071,7 @@ function createPostgresOperationBackend(options) {
|
|
|
2071
2071
|
}
|
|
2072
2072
|
const locked = await lockActiveSchemaVersion(params.graphId);
|
|
2073
2073
|
if (locked !== void 0) {
|
|
2074
|
-
|
|
2074
|
+
chunk7CCVR2QF_cjs.assertActiveSchemaVersion(
|
|
2075
2075
|
params.graphId,
|
|
2076
2076
|
params.expectedVersion,
|
|
2077
2077
|
locked
|
|
@@ -2090,7 +2090,7 @@ function createPostgresOperationBackend(options) {
|
|
|
2090
2090
|
// === Vector Index Operations ===
|
|
2091
2091
|
async createVectorIndex(params) {
|
|
2092
2092
|
if (vectorStrategy === void 0) return;
|
|
2093
|
-
const slot =
|
|
2093
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromCreateIndexParams(params);
|
|
2094
2094
|
await contributionMaterializer.ensureVectorSlot(slot);
|
|
2095
2095
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
2096
2096
|
concurrent: params.concurrent === true
|
|
@@ -2112,7 +2112,7 @@ function createPostgresOperationBackend(options) {
|
|
|
2112
2112
|
},
|
|
2113
2113
|
// === Fulltext Operations ===
|
|
2114
2114
|
async upsertFulltext(params) {
|
|
2115
|
-
const timestamp =
|
|
2115
|
+
const timestamp = chunkBYUIOM4L_cjs.nowIso();
|
|
2116
2116
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
2117
2117
|
params,
|
|
2118
2118
|
timestamp
|
|
@@ -2129,7 +2129,7 @@ function createPostgresOperationBackend(options) {
|
|
|
2129
2129
|
},
|
|
2130
2130
|
async upsertFulltextBatch(params) {
|
|
2131
2131
|
if (params.rows.length === 0) return;
|
|
2132
|
-
const timestamp =
|
|
2132
|
+
const timestamp = chunkBYUIOM4L_cjs.nowIso();
|
|
2133
2133
|
for (const rows of chunk5X46XWNH_cjs.chunk(
|
|
2134
2134
|
params.rows,
|
|
2135
2135
|
batchConfig.fulltextUpsertBatchSize
|
|
@@ -2163,14 +2163,14 @@ function createPostgresOperationBackend(options) {
|
|
|
2163
2163
|
const rows = await execAll(query);
|
|
2164
2164
|
return rows.map((row, index) => ({
|
|
2165
2165
|
nodeId: row.node_id,
|
|
2166
|
-
score:
|
|
2166
|
+
score: chunkBYUIOM4L_cjs.coerceNumericScore(row.score),
|
|
2167
2167
|
rank: index + 1,
|
|
2168
2168
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
2169
2169
|
}));
|
|
2170
2170
|
},
|
|
2171
2171
|
async dropVectorIndex(params) {
|
|
2172
2172
|
if (vectorStrategy === void 0) return;
|
|
2173
|
-
const slot =
|
|
2173
|
+
const slot = chunk7CCVR2QF_cjs.vectorSlotFromDropIndexParams(params);
|
|
2174
2174
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
2175
2175
|
if (dropStatement === void 0) return;
|
|
2176
2176
|
try {
|
|
@@ -2229,12 +2229,12 @@ function createTransactionBackend(options) {
|
|
|
2229
2229
|
);
|
|
2230
2230
|
const runExclusive = txExecutionAdapter.runExclusive;
|
|
2231
2231
|
const sessionAtomicBatchAdapter = executeCompiled === void 0 ? void 0 : createSessionAtomicBatchAdapter({ executeCompiled, runExclusive });
|
|
2232
|
-
const sessionAtomicSqlProgramExecutor = sessionAtomicBatchAdapter === void 0 ? void 0 :
|
|
2233
|
-
const sessionCapabilities =
|
|
2232
|
+
const sessionAtomicSqlProgramExecutor = sessionAtomicBatchAdapter === void 0 ? void 0 : chunkDGIA64DM_cjs.createAtomicSqlProgramExecutor(sessionAtomicBatchAdapter);
|
|
2233
|
+
const sessionCapabilities = chunkJ34FSPSC_cjs.scopeAtomicBatchToSession(
|
|
2234
2234
|
options.capabilities,
|
|
2235
2235
|
sessionAtomicSqlProgramExecutor !== void 0
|
|
2236
2236
|
);
|
|
2237
|
-
const backend =
|
|
2237
|
+
const backend = chunkJ34FSPSC_cjs.markFirstPartyFactory(
|
|
2238
2238
|
createPostgresOperationBackend({
|
|
2239
2239
|
db: options.db,
|
|
2240
2240
|
executionAdapter: txExecutionAdapter,
|
|
@@ -2255,11 +2255,11 @@ function createTransactionBackend(options) {
|
|
|
2255
2255
|
})
|
|
2256
2256
|
);
|
|
2257
2257
|
if (sessionAtomicBatchAdapter !== void 0) {
|
|
2258
|
-
|
|
2258
|
+
chunkDGIA64DM_cjs.registerAtomicSqlProgram(backend, sessionAtomicBatchAdapter);
|
|
2259
2259
|
const mutateEdges = chunkBXHAPCQG_cjs.requireDefined(
|
|
2260
2260
|
backend.executeAtomicEdgeMutationProgram
|
|
2261
2261
|
);
|
|
2262
|
-
|
|
2262
|
+
chunkDGIA64DM_cjs.registerAtomicMutationPrograms(backend, {
|
|
2263
2263
|
mutateNodes: chunkBXHAPCQG_cjs.requireDefined(backend.executeAtomicNodeResolvedMutationSet),
|
|
2264
2264
|
mutateEdges: resolvedSetOnlyEdgeMutationProgram(mutateEdges),
|
|
2265
2265
|
replaceNodes: chunkBXHAPCQG_cjs.requireDefined(backend.executeAtomicNodeReplacementBatch)
|
|
@@ -2269,5 +2269,5 @@ function createTransactionBackend(options) {
|
|
|
2269
2269
|
}
|
|
2270
2270
|
|
|
2271
2271
|
exports.createPostgresBackend = createPostgresBackend;
|
|
2272
|
-
//# sourceMappingURL=chunk-
|
|
2273
|
-
//# sourceMappingURL=chunk-
|
|
2272
|
+
//# sourceMappingURL=chunk-ZHK3HEZ2.cjs.map
|
|
2273
|
+
//# sourceMappingURL=chunk-ZHK3HEZ2.cjs.map
|