@nicia-ai/typegraph 0.31.0 → 0.32.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/postgres/index.cjs +16 -16
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/index.js +6 -6
- package/dist/backend/postgres/pglite.cjs +9 -9
- package/dist/backend/postgres/pglite.d.cts +2 -2
- package/dist/backend/postgres/pglite.d.ts +2 -2
- package/dist/backend/postgres/pglite.js +6 -6
- package/dist/backend/sqlite/index.cjs +14 -14
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +5 -5
- package/dist/backend/sqlite/libsql.cjs +10 -10
- package/dist/backend/sqlite/libsql.d.cts +2 -2
- package/dist/backend/sqlite/libsql.d.ts +2 -2
- package/dist/backend/sqlite/libsql.js +6 -6
- package/dist/backend/sqlite/local.cjs +10 -10
- package/dist/backend/sqlite/local.d.cts +2 -2
- package/dist/backend/sqlite/local.d.ts +2 -2
- package/dist/backend/sqlite/local.js +6 -6
- package/dist/{chunk-XKJQQQVR.js → chunk-2BVHPOIG.js} +3 -3
- package/dist/{chunk-XKJQQQVR.js.map → chunk-2BVHPOIG.js.map} +1 -1
- package/dist/{chunk-RZ4DH4E7.cjs → chunk-2LAT5BIK.cjs} +662 -217
- package/dist/chunk-2LAT5BIK.cjs.map +1 -0
- package/dist/{chunk-CIINW6PS.cjs → chunk-3HQDMOBK.cjs} +64 -64
- package/dist/{chunk-CIINW6PS.cjs.map → chunk-3HQDMOBK.cjs.map} +1 -1
- package/dist/{chunk-6SA7UIQJ.cjs → chunk-3QRBXYT5.cjs} +6 -6
- package/dist/{chunk-6SA7UIQJ.cjs.map → chunk-3QRBXYT5.cjs.map} +1 -1
- package/dist/{chunk-4A4GUZTQ.js → chunk-7WW3WL6E.js} +5 -5
- package/dist/{chunk-4A4GUZTQ.js.map → chunk-7WW3WL6E.js.map} +1 -1
- package/dist/{chunk-2HZGWCB4.js → chunk-C4C4Q7A6.js} +3 -3
- package/dist/chunk-C4C4Q7A6.js.map +1 -0
- package/dist/{chunk-SFFJ2IKN.cjs → chunk-CAMMC3E4.cjs} +58 -58
- package/dist/{chunk-SFFJ2IKN.cjs.map → chunk-CAMMC3E4.cjs.map} +1 -1
- package/dist/{chunk-O4VUR6SI.js → chunk-CEF2QOTO.js} +3 -3
- package/dist/{chunk-O4VUR6SI.js.map → chunk-CEF2QOTO.js.map} +1 -1
- package/dist/{chunk-V4IQYOQ4.cjs → chunk-CFNT3ITG.cjs} +3 -3
- package/dist/chunk-CFNT3ITG.cjs.map +1 -0
- package/dist/{chunk-LJLMDDCW.js → chunk-CWFPJ3RC.js} +3 -3
- package/dist/{chunk-LJLMDDCW.js.map → chunk-CWFPJ3RC.js.map} +1 -1
- package/dist/{chunk-7JGLPAFV.cjs → chunk-EEYV6UOE.cjs} +16 -16
- package/dist/chunk-EEYV6UOE.cjs.map +1 -0
- package/dist/{chunk-ASYQDPPU.cjs → chunk-FDN43KXV.cjs} +19 -19
- package/dist/{chunk-ASYQDPPU.cjs.map → chunk-FDN43KXV.cjs.map} +1 -1
- package/dist/{chunk-THX25XW6.js → chunk-HFBRAOF7.js} +27 -7
- package/dist/chunk-HFBRAOF7.js.map +1 -0
- package/dist/{chunk-54JVNOAQ.cjs → chunk-JKRKIEVA.cjs} +5 -5
- package/dist/{chunk-54JVNOAQ.cjs.map → chunk-JKRKIEVA.cjs.map} +1 -1
- package/dist/{chunk-5DTPBFX5.cjs → chunk-LAZGHOZW.cjs} +10 -10
- package/dist/{chunk-5DTPBFX5.cjs.map → chunk-LAZGHOZW.cjs.map} +1 -1
- package/dist/{chunk-N2MBPTAF.cjs → chunk-LM2IC4ZJ.cjs} +14 -14
- package/dist/{chunk-N2MBPTAF.cjs.map → chunk-LM2IC4ZJ.cjs.map} +1 -1
- package/dist/{chunk-STP7QVUB.js → chunk-NDM5PXEH.js} +5 -5
- package/dist/{chunk-STP7QVUB.js.map → chunk-NDM5PXEH.js.map} +1 -1
- package/dist/{chunk-2ZY4K43M.js → chunk-PIHXFF73.js} +3 -3
- package/dist/{chunk-2ZY4K43M.js.map → chunk-PIHXFF73.js.map} +1 -1
- package/dist/{chunk-ATTXBMAX.js → chunk-PRMKPFN5.js} +3 -3
- package/dist/{chunk-ATTXBMAX.js.map → chunk-PRMKPFN5.js.map} +1 -1
- package/dist/{chunk-3JBJEYWE.cjs → chunk-SB65GJNY.cjs} +32 -12
- package/dist/chunk-SB65GJNY.cjs.map +1 -0
- package/dist/{chunk-VZX2KSY3.js → chunk-TUA3MEJJ.js} +5 -5
- package/dist/{chunk-VZX2KSY3.js.map → chunk-TUA3MEJJ.js.map} +1 -1
- package/dist/{chunk-MAQJYNJR.js → chunk-W4ZX2GCP.js} +14 -16
- package/dist/chunk-W4ZX2GCP.js.map +1 -0
- package/dist/{chunk-UIFEEPME.js → chunk-WNORITK6.js} +593 -149
- package/dist/chunk-WNORITK6.js.map +1 -0
- package/dist/{chunk-VMEWZU2N.cjs → chunk-WWVV44DY.cjs} +11 -11
- package/dist/{chunk-VMEWZU2N.cjs.map → chunk-WWVV44DY.cjs.map} +1 -1
- package/dist/{chunk-UJ4V3YUQ.js → chunk-XKNAK27R.js} +3 -3
- package/dist/{chunk-UJ4V3YUQ.js.map → chunk-XKNAK27R.js.map} +1 -1
- package/dist/{chunk-GKFWM3DS.js → chunk-XQFAJVYW.js} +3 -3
- package/dist/{chunk-GKFWM3DS.js.map → chunk-XQFAJVYW.js.map} +1 -1
- package/dist/{chunk-FLOI7QOT.cjs → chunk-YL4F3CMD.cjs} +59 -59
- package/dist/{chunk-FLOI7QOT.cjs.map → chunk-YL4F3CMD.cjs.map} +1 -1
- package/dist/{chunk-5CN7B4CZ.cjs → chunk-YW7GHMF4.cjs} +17 -17
- package/dist/{chunk-5CN7B4CZ.cjs.map → chunk-YW7GHMF4.cjs.map} +1 -1
- package/dist/{ddl-BJcPrB4L.d.ts → ddl-C8e8zDAE.d.ts} +3 -3
- package/dist/{ddl-CPZ7mB7X.d.cts → ddl-CwyG4HoQ.d.cts} +3 -3
- package/dist/graph-merge/index.cjs +193 -49
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +3 -3
- package/dist/graph-merge/index.d.ts +3 -3
- package/dist/graph-merge/index.js +180 -36
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +89 -85
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +12 -12
- package/dist/indexes/index.cjs +10 -10
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +3 -3
- package/dist/interchange/index.cjs +15 -15
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +2 -2
- package/dist/{manager-By-WEd8M.d.ts → manager-8htmuGr-.d.ts} +1 -1
- package/dist/{manager-Np7VVSlE.d.cts → manager-aVgxbGt-.d.cts} +1 -1
- package/dist/{postgres-BdIb7tS_.d.ts → postgres-Dhom7iiX.d.ts} +1 -1
- package/dist/{postgres-4J2tmauh.d.cts → postgres-jgXmD45C.d.cts} +1 -1
- package/dist/profiler/index.d.cts +5 -5
- package/dist/profiler/index.d.ts +5 -5
- package/dist/schema/index.cjs +26 -26
- package/dist/schema/index.d.cts +4 -4
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +3 -3
- package/dist/{sqlite-aM_PAz-O.d.ts → sqlite-BfLsCEqO.d.ts} +1 -1
- package/dist/{sqlite-Gatk_iw_.d.cts → sqlite-DcQ_BCUW.d.cts} +1 -1
- package/dist/{store-DuCbdqsh.d.cts → store-view-lTcb_cnp.d.cts} +639 -311
- package/dist/{store-MloRPwb9.d.ts → store-view-pBOUrQte.d.ts} +639 -311
- package/dist/{types-DoByHGyU.d.cts → types-5RQwzWXx.d.cts} +1 -1
- package/dist/{types-K3vpaJAL.d.ts → types-DGDiXAYc.d.ts} +1 -1
- package/dist/{types-BKQljXom.d.ts → types-Dk8r09KY.d.ts} +1 -1
- package/dist/{types-C1CYxWrL.d.cts → types-Dvmn-eal.d.cts} +1 -1
- package/dist/{where-Dt49bvo6.d.ts → where-CHZFELX0.d.ts} +1 -1
- package/dist/{where-DydZjGOb.d.cts → where-Cx_glEEB.d.cts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-2HZGWCB4.js.map +0 -1
- package/dist/chunk-3JBJEYWE.cjs.map +0 -1
- package/dist/chunk-7JGLPAFV.cjs.map +0 -1
- package/dist/chunk-MAQJYNJR.js.map +0 -1
- package/dist/chunk-RZ4DH4E7.cjs.map +0 -1
- package/dist/chunk-THX25XW6.js.map +0 -1
- package/dist/chunk-UIFEEPME.js.map +0 -1
- package/dist/chunk-V4IQYOQ4.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkYW7GHMF4_cjs = require('./chunk-YW7GHMF4.cjs');
|
|
4
4
|
var chunkHTGDWIDE_cjs = require('./chunk-HTGDWIDE.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk3HQDMOBK_cjs = require('./chunk-3HQDMOBK.cjs');
|
|
6
6
|
var chunk6G35I3VW_cjs = require('./chunk-6G35I3VW.cjs');
|
|
7
7
|
var chunkRP7YITHX_cjs = require('./chunk-RP7YITHX.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkCFNT3ITG_cjs = require('./chunk-CFNT3ITG.cjs');
|
|
9
9
|
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
10
10
|
var drizzleOrm = require('drizzle-orm');
|
|
11
11
|
var pgCore = require('drizzle-orm/pg-core');
|
|
@@ -35,7 +35,7 @@ var DEFAULT_POSTGRES_STATEMENT_CACHE_MAX = 256;
|
|
|
35
35
|
var STATEMENT_NAME_CACHE = /* @__PURE__ */ new Map();
|
|
36
36
|
var nextStatementId = 0;
|
|
37
37
|
function statementNameFor(sqlText, cacheMax) {
|
|
38
|
-
return
|
|
38
|
+
return chunk3HQDMOBK_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
39
39
|
const name = `tg_${nextStatementId}`;
|
|
40
40
|
nextStatementId += 1;
|
|
41
41
|
return name;
|
|
@@ -129,7 +129,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
129
129
|
const cacheMax = options.preparedStatementCacheMax ?? DEFAULT_POSTGRES_STATEMENT_CACHE_MAX;
|
|
130
130
|
const pgClient = resolvePgClient(db, prepareStatements, cacheMax);
|
|
131
131
|
function compile(query) {
|
|
132
|
-
return
|
|
132
|
+
return chunk3HQDMOBK_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
|
|
133
133
|
}
|
|
134
134
|
if (pgClient === void 0) {
|
|
135
135
|
return {
|
|
@@ -185,24 +185,24 @@ var POSTGRES_CHECK_UNIQUE_BATCH_CHUNK_SIZE = Math.max(
|
|
|
185
185
|
1,
|
|
186
186
|
POSTGRES_MAX_BIND_PARAMETERS - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
|
|
187
187
|
);
|
|
188
|
-
var toNodeRow =
|
|
189
|
-
var toEdgeRow =
|
|
190
|
-
var toUniqueRow =
|
|
191
|
-
var toSchemaVersionRow =
|
|
192
|
-
|
|
188
|
+
var toNodeRow = chunk3HQDMOBK_cjs.createNodeRowMapper(chunk3HQDMOBK_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
189
|
+
var toEdgeRow = chunk3HQDMOBK_cjs.createEdgeRowMapper(chunk3HQDMOBK_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
190
|
+
var toUniqueRow = chunk3HQDMOBK_cjs.createUniqueRowMapper(chunk3HQDMOBK_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
191
|
+
var toSchemaVersionRow = chunk3HQDMOBK_cjs.createSchemaVersionRowMapper(
|
|
192
|
+
chunk3HQDMOBK_cjs.POSTGRES_ROW_MAPPER_CONFIG
|
|
193
193
|
);
|
|
194
194
|
function buildPostgresCapabilities(fulltextStrategy, vectorStrategy) {
|
|
195
195
|
return {
|
|
196
196
|
...chunk6G35I3VW_cjs.POSTGRES_CAPABILITIES,
|
|
197
|
-
...vectorStrategy === void 0 ? {} : { vector:
|
|
198
|
-
fulltext:
|
|
197
|
+
...vectorStrategy === void 0 ? {} : { vector: chunkCFNT3ITG_cjs.buildVectorCapabilities(vectorStrategy) },
|
|
198
|
+
fulltext: chunkCFNT3ITG_cjs.buildFulltextCapabilities(fulltextStrategy)
|
|
199
199
|
};
|
|
200
200
|
}
|
|
201
201
|
function createPostgresBackend(db, options = {}) {
|
|
202
|
-
const tables2 = options.tables ??
|
|
203
|
-
const fulltextStrategy = options.fulltext ??
|
|
204
|
-
const vectorStrategy = options.vector === false ? void 0 : options.vector ??
|
|
205
|
-
const vectorSlotLatch = vectorStrategy === void 0 ? void 0 :
|
|
202
|
+
const tables2 = options.tables ?? chunk3HQDMOBK_cjs.tables;
|
|
203
|
+
const fulltextStrategy = options.fulltext ?? chunkCFNT3ITG_cjs.tsvectorStrategy;
|
|
204
|
+
const vectorStrategy = options.vector === false ? void 0 : options.vector ?? chunkYW7GHMF4_cjs.pgvectorStrategy;
|
|
205
|
+
const vectorSlotLatch = vectorStrategy === void 0 ? void 0 : chunk3HQDMOBK_cjs.createVectorSlotLatch();
|
|
206
206
|
const baseCapabilities = buildPostgresCapabilities(
|
|
207
207
|
fulltextStrategy,
|
|
208
208
|
vectorStrategy
|
|
@@ -233,7 +233,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
233
233
|
].map((name) => chunkHTGDWIDE_cjs.quoteIdentifier(name)),
|
|
234
234
|
drizzleOrm.sql`, `
|
|
235
235
|
)}`;
|
|
236
|
-
const operationStrategy =
|
|
236
|
+
const operationStrategy = chunk3HQDMOBK_cjs.createPostgresOperationStrategy(
|
|
237
237
|
tables2,
|
|
238
238
|
fulltextStrategy
|
|
239
239
|
);
|
|
@@ -274,7 +274,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
274
274
|
}
|
|
275
275
|
const matTable = tables2.contributionMaterializations;
|
|
276
276
|
async function ensureContributionMaterializationsTableImpl() {
|
|
277
|
-
await db.execute(drizzleOrm.sql.raw(
|
|
277
|
+
await db.execute(drizzleOrm.sql.raw(chunk3HQDMOBK_cjs.generatePgCreateTableSQL(matTable)));
|
|
278
278
|
}
|
|
279
279
|
async function getContributionMaterializationRow(identity) {
|
|
280
280
|
const rows = await db.select().from(matTable).where(
|
|
@@ -287,16 +287,16 @@ function createPostgresBackend(db, options = {}) {
|
|
|
287
287
|
);
|
|
288
288
|
const row = rows[0];
|
|
289
289
|
if (row === void 0) return void 0;
|
|
290
|
-
return
|
|
290
|
+
return chunk3HQDMOBK_cjs.mapContributionMaterializationRow(
|
|
291
291
|
row,
|
|
292
|
-
|
|
292
|
+
chunk3HQDMOBK_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
295
|
async function recordContributionMaterializationRow(params) {
|
|
296
296
|
await db.insert(matTable).values(
|
|
297
|
-
|
|
297
|
+
chunk3HQDMOBK_cjs.buildContributionInsertValues(
|
|
298
298
|
params,
|
|
299
|
-
|
|
299
|
+
chunk3HQDMOBK_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
300
300
|
)
|
|
301
301
|
).onConflictDoUpdate({
|
|
302
302
|
target: [
|
|
@@ -305,13 +305,13 @@ function createPostgresBackend(db, options = {}) {
|
|
|
305
305
|
matTable.owner,
|
|
306
306
|
matTable.tableName
|
|
307
307
|
],
|
|
308
|
-
set:
|
|
308
|
+
set: chunk3HQDMOBK_cjs.buildContributionOnConflictSet(
|
|
309
309
|
matTable.materializedAt,
|
|
310
310
|
params.materializedAt
|
|
311
311
|
)
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
const contributionMaterializer =
|
|
314
|
+
const contributionMaterializer = chunk3HQDMOBK_cjs.createContributionMaterializer({
|
|
315
315
|
dialect: "postgres",
|
|
316
316
|
fulltextStrategy,
|
|
317
317
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -331,12 +331,12 @@ function createPostgresBackend(db, options = {}) {
|
|
|
331
331
|
capabilities,
|
|
332
332
|
fulltextStrategy,
|
|
333
333
|
vectorStrategy});
|
|
334
|
-
return
|
|
334
|
+
return chunk3HQDMOBK_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
|
|
335
335
|
}
|
|
336
336
|
const backend = {
|
|
337
337
|
...operations,
|
|
338
338
|
async bootstrapTables() {
|
|
339
|
-
const statements =
|
|
339
|
+
const statements = chunk3HQDMOBK_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
340
340
|
for (const statement of statements) {
|
|
341
341
|
await db.execute(drizzleOrm.sql.raw(statement));
|
|
342
342
|
}
|
|
@@ -346,7 +346,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
346
346
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
347
347
|
// rather than self-healing on a read/write path (#135). Shared
|
|
348
348
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
349
|
-
...
|
|
349
|
+
...chunk3HQDMOBK_cjs.gateFulltextMethods(
|
|
350
350
|
operations,
|
|
351
351
|
contributionMaterializer.assertInitialized
|
|
352
352
|
),
|
|
@@ -355,7 +355,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
355
355
|
},
|
|
356
356
|
async ensureIndexMaterializationsTable() {
|
|
357
357
|
await db.execute(
|
|
358
|
-
drizzleOrm.sql.raw(
|
|
358
|
+
drizzleOrm.sql.raw(chunk3HQDMOBK_cjs.generatePgCreateTableSQL(tables2.indexMaterializations))
|
|
359
359
|
);
|
|
360
360
|
},
|
|
361
361
|
async getIndexMaterialization(indexName) {
|
|
@@ -363,26 +363,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
363
363
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
364
364
|
const row = rows[0];
|
|
365
365
|
if (row === void 0) return void 0;
|
|
366
|
-
return
|
|
366
|
+
return chunk3HQDMOBK_cjs.mapMaterializationRow(row, chunk3HQDMOBK_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
367
367
|
},
|
|
368
368
|
async getIndexMaterializations(statusKeys) {
|
|
369
369
|
if (statusKeys.length === 0) return [];
|
|
370
370
|
const t = tables2.indexMaterializations;
|
|
371
371
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
372
372
|
return rows.map(
|
|
373
|
-
(row) =>
|
|
373
|
+
(row) => chunk3HQDMOBK_cjs.mapMaterializationRow(row, chunk3HQDMOBK_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
374
374
|
);
|
|
375
375
|
},
|
|
376
376
|
async recordIndexMaterialization(params) {
|
|
377
377
|
const t = tables2.indexMaterializations;
|
|
378
378
|
await db.insert(t).values(
|
|
379
|
-
|
|
379
|
+
chunk3HQDMOBK_cjs.buildMaterializationInsertValues(
|
|
380
380
|
params,
|
|
381
|
-
|
|
381
|
+
chunk3HQDMOBK_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
382
382
|
)
|
|
383
383
|
).onConflictDoUpdate({
|
|
384
384
|
target: t.indexName,
|
|
385
|
-
set:
|
|
385
|
+
set: chunk3HQDMOBK_cjs.buildMaterializationOnConflictSet(
|
|
386
386
|
t.materializedAt,
|
|
387
387
|
params.materializedAt
|
|
388
388
|
)
|
|
@@ -401,37 +401,37 @@ function createPostgresBackend(db, options = {}) {
|
|
|
401
401
|
await contributionMaterializer.assertInitialized(graphId);
|
|
402
402
|
},
|
|
403
403
|
async ensureKindRemovalsTable() {
|
|
404
|
-
await db.execute(drizzleOrm.sql.raw(
|
|
404
|
+
await db.execute(drizzleOrm.sql.raw(chunk3HQDMOBK_cjs.generatePgCreateTableSQL(tables2.kindRemovals)));
|
|
405
405
|
},
|
|
406
406
|
async getPendingKindRemovals(graphId) {
|
|
407
407
|
const t = tables2.kindRemovals;
|
|
408
408
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
409
409
|
return rows.map(
|
|
410
|
-
(row) =>
|
|
410
|
+
(row) => chunk3HQDMOBK_cjs.mapKindRemovalRow(row, chunk3HQDMOBK_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
411
411
|
);
|
|
412
412
|
},
|
|
413
413
|
async getAllKindRemovals(graphId) {
|
|
414
414
|
const t = tables2.kindRemovals;
|
|
415
415
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
416
416
|
return rows.map(
|
|
417
|
-
(row) =>
|
|
417
|
+
(row) => chunk3HQDMOBK_cjs.mapKindRemovalRow(row, chunk3HQDMOBK_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
418
418
|
);
|
|
419
419
|
},
|
|
420
420
|
async recordKindRemoval(params) {
|
|
421
421
|
const t = tables2.kindRemovals;
|
|
422
422
|
await db.insert(t).values(
|
|
423
|
-
|
|
423
|
+
chunk3HQDMOBK_cjs.buildKindRemovalInsertValues(
|
|
424
424
|
params,
|
|
425
|
-
|
|
425
|
+
chunk3HQDMOBK_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
426
426
|
)
|
|
427
427
|
).onConflictDoUpdate({
|
|
428
428
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
429
|
-
set:
|
|
429
|
+
set: chunk3HQDMOBK_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
430
430
|
});
|
|
431
431
|
},
|
|
432
432
|
async ensureReconciliationMarkersTable() {
|
|
433
433
|
await db.execute(
|
|
434
|
-
drizzleOrm.sql.raw(
|
|
434
|
+
drizzleOrm.sql.raw(chunk3HQDMOBK_cjs.generatePgCreateTableSQL(tables2.reconciliationMarkers))
|
|
435
435
|
);
|
|
436
436
|
},
|
|
437
437
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -492,7 +492,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
492
492
|
}
|
|
493
493
|
);
|
|
494
494
|
}
|
|
495
|
-
|
|
495
|
+
chunk3HQDMOBK_cjs.assertAdoptedDialect(externalTx, pgCore.PgDatabase, "postgres");
|
|
496
496
|
return bindTransactionBackend(externalTx);
|
|
497
497
|
},
|
|
498
498
|
async close() {
|
|
@@ -567,7 +567,7 @@ function createPostgresOperationBackend(options) {
|
|
|
567
567
|
await execRun(drizzleOrm.sql.raw(statement));
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
|
-
const commonBackend =
|
|
570
|
+
const commonBackend = chunk3HQDMOBK_cjs.createCommonOperationBackend({
|
|
571
571
|
batchConfig: {
|
|
572
572
|
checkUniqueBatchChunkSize: POSTGRES_CHECK_UNIQUE_BATCH_CHUNK_SIZE,
|
|
573
573
|
edgeInsertBatchSize: POSTGRES_EDGE_INSERT_BATCH_SIZE,
|
|
@@ -580,7 +580,7 @@ function createPostgresOperationBackend(options) {
|
|
|
580
580
|
execGet,
|
|
581
581
|
execRun
|
|
582
582
|
},
|
|
583
|
-
nowIso:
|
|
583
|
+
nowIso: chunk3HQDMOBK_cjs.nowIso,
|
|
584
584
|
operationStrategy,
|
|
585
585
|
rowMappers: {
|
|
586
586
|
toEdgeRow,
|
|
@@ -597,19 +597,19 @@ function createPostgresOperationBackend(options) {
|
|
|
597
597
|
};
|
|
598
598
|
const vectorEmbeddingMethods = vectorStrategy === void 0 ? {} : {
|
|
599
599
|
async upsertEmbedding(params) {
|
|
600
|
-
const slot =
|
|
600
|
+
const slot = chunk3HQDMOBK_cjs.vectorSlotFromParams(params);
|
|
601
601
|
await ensureVectorSlotStorage(slot);
|
|
602
|
-
const statements = vectorStrategy.buildUpsert(slot, params,
|
|
602
|
+
const statements = vectorStrategy.buildUpsert(slot, params, chunk3HQDMOBK_cjs.nowIso());
|
|
603
603
|
try {
|
|
604
604
|
for (const statement of statements) {
|
|
605
605
|
await execRun(statement);
|
|
606
606
|
}
|
|
607
607
|
} catch (error) {
|
|
608
|
-
throw
|
|
608
|
+
throw chunk3HQDMOBK_cjs.mapVectorWriteError(error, params);
|
|
609
609
|
}
|
|
610
610
|
},
|
|
611
611
|
async deleteEmbedding(params) {
|
|
612
|
-
const slot =
|
|
612
|
+
const slot = chunk3HQDMOBK_cjs.vectorSlotFromParams(params);
|
|
613
613
|
await ensureVectorSlotStorage(slot);
|
|
614
614
|
const statements = vectorStrategy.buildDelete(slot, params);
|
|
615
615
|
for (const statement of statements) {
|
|
@@ -617,16 +617,16 @@ function createPostgresOperationBackend(options) {
|
|
|
617
617
|
}
|
|
618
618
|
},
|
|
619
619
|
async vectorSearch(params) {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
const slot =
|
|
620
|
+
chunkCFNT3ITG_cjs.assertVectorSearchLimit(params.limit);
|
|
621
|
+
chunkYW7GHMF4_cjs.assertPgvectorEfSearch(params.efSearch);
|
|
622
|
+
const slot = chunk3HQDMOBK_cjs.vectorSlotFromParams(params);
|
|
623
623
|
await ensureVectorSlotStorage(slot);
|
|
624
624
|
const query = vectorStrategy.buildSearch(slot, params);
|
|
625
625
|
let rows;
|
|
626
626
|
try {
|
|
627
627
|
rows = await runVectorSearch(params.efSearch, query);
|
|
628
628
|
} catch (error) {
|
|
629
|
-
throw
|
|
629
|
+
throw chunk3HQDMOBK_cjs.mapVectorWriteError(error, params);
|
|
630
630
|
}
|
|
631
631
|
return rows.map((row) => ({
|
|
632
632
|
nodeId: row.node_id,
|
|
@@ -646,7 +646,7 @@ function createPostgresOperationBackend(options) {
|
|
|
646
646
|
// === Vector Index Operations ===
|
|
647
647
|
async createVectorIndex(params) {
|
|
648
648
|
if (vectorStrategy === void 0) return;
|
|
649
|
-
const slot =
|
|
649
|
+
const slot = chunk3HQDMOBK_cjs.vectorSlotFromCreateIndexParams(params);
|
|
650
650
|
await ensureVectorSlotStorage(slot);
|
|
651
651
|
const indexStatement = vectorStrategy.buildCreateIndex?.(slot, {
|
|
652
652
|
concurrent: params.concurrent === true
|
|
@@ -657,7 +657,7 @@ function createPostgresOperationBackend(options) {
|
|
|
657
657
|
},
|
|
658
658
|
// === Fulltext Operations ===
|
|
659
659
|
async upsertFulltext(params) {
|
|
660
|
-
const timestamp =
|
|
660
|
+
const timestamp = chunk3HQDMOBK_cjs.nowIso();
|
|
661
661
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
662
662
|
params,
|
|
663
663
|
timestamp
|
|
@@ -674,7 +674,7 @@ function createPostgresOperationBackend(options) {
|
|
|
674
674
|
},
|
|
675
675
|
async upsertFulltextBatch(params) {
|
|
676
676
|
if (params.rows.length === 0) return;
|
|
677
|
-
const timestamp =
|
|
677
|
+
const timestamp = chunk3HQDMOBK_cjs.nowIso();
|
|
678
678
|
const statements = operationStrategy.buildUpsertFulltextBatch(
|
|
679
679
|
params,
|
|
680
680
|
timestamp
|
|
@@ -695,14 +695,14 @@ function createPostgresOperationBackend(options) {
|
|
|
695
695
|
const rows = await execAll(query);
|
|
696
696
|
return rows.map((row, index) => ({
|
|
697
697
|
nodeId: row.node_id,
|
|
698
|
-
score:
|
|
698
|
+
score: chunk3HQDMOBK_cjs.coerceNumericScore(row.score),
|
|
699
699
|
rank: index + 1,
|
|
700
700
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
701
701
|
}));
|
|
702
702
|
},
|
|
703
703
|
async dropVectorIndex(params) {
|
|
704
704
|
if (vectorStrategy === void 0) return;
|
|
705
|
-
const slot =
|
|
705
|
+
const slot = chunk3HQDMOBK_cjs.vectorSlotFromDropIndexParams(params);
|
|
706
706
|
const dropStatement = vectorStrategy.buildDropIndex?.(slot);
|
|
707
707
|
if (dropStatement === void 0) return;
|
|
708
708
|
try {
|
|
@@ -732,10 +732,10 @@ function createTransactionBackend(options) {
|
|
|
732
732
|
capabilities: options.capabilities,
|
|
733
733
|
fulltextStrategy: options.fulltextStrategy,
|
|
734
734
|
vectorStrategy: options.vectorStrategy,
|
|
735
|
-
vectorSlotLatch: options.vectorStrategy === void 0 ? void 0 :
|
|
735
|
+
vectorSlotLatch: options.vectorStrategy === void 0 ? void 0 : chunk3HQDMOBK_cjs.createVectorSlotLatch()
|
|
736
736
|
});
|
|
737
737
|
}
|
|
738
738
|
|
|
739
739
|
exports.createPostgresBackend = createPostgresBackend;
|
|
740
|
-
//# sourceMappingURL=chunk-
|
|
741
|
-
//# sourceMappingURL=chunk-
|
|
740
|
+
//# sourceMappingURL=chunk-YL4F3CMD.cjs.map
|
|
741
|
+
//# sourceMappingURL=chunk-YL4F3CMD.cjs.map
|