@nicia-ai/typegraph 0.28.0 → 0.28.1
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 +55 -55
- package/dist/backend/postgres/index.js +3 -3
- package/dist/backend/sqlite/index.cjs +13 -13
- package/dist/backend/sqlite/index.js +3 -3
- package/dist/backend/sqlite/libsql.cjs +6 -6
- package/dist/backend/sqlite/libsql.js +3 -3
- package/dist/backend/sqlite/local.cjs +6 -6
- package/dist/backend/sqlite/local.js +3 -3
- package/dist/{chunk-X53YKGHR.js → chunk-5MTOKWDA.js} +3 -3
- package/dist/{chunk-X53YKGHR.js.map → chunk-5MTOKWDA.js.map} +1 -1
- package/dist/chunk-FFHW2JEK.cjs +55 -0
- package/dist/chunk-FFHW2JEK.cjs.map +1 -0
- package/dist/{chunk-33K3ZYFG.cjs → chunk-NMOE2ZEU.cjs} +44 -44
- package/dist/{chunk-33K3ZYFG.cjs.map → chunk-NMOE2ZEU.cjs.map} +1 -1
- package/dist/{chunk-2E4VTD2E.cjs → chunk-NYQFPGYP.cjs} +5 -5
- package/dist/{chunk-2E4VTD2E.cjs.map → chunk-NYQFPGYP.cjs.map} +1 -1
- package/dist/chunk-O57GYGYK.js +51 -0
- package/dist/chunk-O57GYGYK.js.map +1 -0
- package/dist/{chunk-UKG7XHZ3.js → chunk-PGU2XKMA.js} +3 -3
- package/dist/{chunk-UKG7XHZ3.js.map → chunk-PGU2XKMA.js.map} +1 -1
- package/dist/{chunk-DFHLG75V.js → chunk-TKM2WDT4.js} +3 -3
- package/dist/{chunk-DFHLG75V.js.map → chunk-TKM2WDT4.js.map} +1 -1
- package/dist/{chunk-ZGEMI7MJ.cjs → chunk-WZH2MKHW.cjs} +15 -15
- package/dist/{chunk-ZGEMI7MJ.cjs.map → chunk-WZH2MKHW.cjs.map} +1 -1
- package/dist/index.cjs +64 -64
- package/dist/index.js +3 -3
- package/dist/schema/index.cjs +26 -26
- package/dist/schema/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-5H3BAMTB.js +0 -32
- package/dist/chunk-5H3BAMTB.js.map +0 -1
- package/dist/chunk-IUIWCFG3.cjs +0 -36
- package/dist/chunk-IUIWCFG3.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkHTGDWIDE_cjs = require('../../chunk-HTGDWIDE.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkNYQFPGYP_cjs = require('../../chunk-NYQFPGYP.cjs');
|
|
5
5
|
var chunkLYRUNG6E_cjs = require('../../chunk-LYRUNG6E.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-FFHW2JEK.cjs');
|
|
7
7
|
var chunkPN37HVAV_cjs = require('../../chunk-PN37HVAV.cjs');
|
|
8
8
|
require('../../chunk-CTHNVU6K.cjs');
|
|
9
9
|
require('../../chunk-EK6RJ373.cjs');
|
|
@@ -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 chunkNYQFPGYP_cjs.getOrCreateLru(STATEMENT_NAME_CACHE, sqlText, cacheMax, () => {
|
|
39
39
|
const name = `tg_${nextStatementId}`;
|
|
40
40
|
nextStatementId += 1;
|
|
41
41
|
return name;
|
|
@@ -126,7 +126,7 @@ function createPostgresExecutionAdapter(db, options = {}) {
|
|
|
126
126
|
const cacheMax = options.preparedStatementCacheMax ?? DEFAULT_POSTGRES_STATEMENT_CACHE_MAX;
|
|
127
127
|
const pgClient = resolvePgClient(db, prepareStatements, cacheMax);
|
|
128
128
|
function compile(query) {
|
|
129
|
-
return
|
|
129
|
+
return chunkNYQFPGYP_cjs.compileQueryWithDialect(db, query, "PostgreSQL");
|
|
130
130
|
}
|
|
131
131
|
if (pgClient === void 0) {
|
|
132
132
|
return {
|
|
@@ -182,10 +182,10 @@ var POSTGRES_CHECK_UNIQUE_BATCH_CHUNK_SIZE = Math.max(
|
|
|
182
182
|
1,
|
|
183
183
|
POSTGRES_MAX_BIND_PARAMETERS - CHECK_UNIQUE_BATCH_FIXED_PARAM_COUNT
|
|
184
184
|
);
|
|
185
|
-
var toNodeRow =
|
|
186
|
-
var toEdgeRow =
|
|
187
|
-
var toUniqueRow =
|
|
188
|
-
var toSchemaVersionRow =
|
|
185
|
+
var toNodeRow = chunkNYQFPGYP_cjs.createNodeRowMapper(chunkNYQFPGYP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
186
|
+
var toEdgeRow = chunkNYQFPGYP_cjs.createEdgeRowMapper(chunkNYQFPGYP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
187
|
+
var toUniqueRow = chunkNYQFPGYP_cjs.createUniqueRowMapper(chunkNYQFPGYP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
188
|
+
var toSchemaVersionRow = chunkNYQFPGYP_cjs.createSchemaVersionRowMapper(chunkNYQFPGYP_cjs.POSTGRES_ROW_MAPPER_CONFIG);
|
|
189
189
|
function toEmbeddingRow(row) {
|
|
190
190
|
let embedding;
|
|
191
191
|
if (typeof row.embedding === "string") {
|
|
@@ -203,8 +203,8 @@ function toEmbeddingRow(row) {
|
|
|
203
203
|
field_path: row.field_path,
|
|
204
204
|
embedding,
|
|
205
205
|
dimensions: row.dimensions,
|
|
206
|
-
created_at:
|
|
207
|
-
updated_at:
|
|
206
|
+
created_at: chunkNYQFPGYP_cjs.formatPostgresTimestamp(row.created_at) ?? "",
|
|
207
|
+
updated_at: chunkNYQFPGYP_cjs.formatPostgresTimestamp(row.updated_at) ?? ""
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
function buildPostgresCapabilities(strategy) {
|
|
@@ -221,7 +221,7 @@ function buildPostgresCapabilities(strategy) {
|
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
223
|
function createPostgresBackend(db, options = {}) {
|
|
224
|
-
const tables2 = options.tables ??
|
|
224
|
+
const tables2 = options.tables ?? chunkNYQFPGYP_cjs.tables;
|
|
225
225
|
const fulltextStrategy = options.fulltext ?? chunkPN37HVAV_cjs.tsvectorStrategy;
|
|
226
226
|
const baseCapabilities = buildPostgresCapabilities(fulltextStrategy);
|
|
227
227
|
const httpOnlyOverrides = isNeonHttpClient(db) ? { transactions: false } : {};
|
|
@@ -252,7 +252,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
252
252
|
].map((name) => chunkHTGDWIDE_cjs.quoteIdentifier(name)),
|
|
253
253
|
drizzleOrm.sql`, `
|
|
254
254
|
)}`;
|
|
255
|
-
const operationStrategy =
|
|
255
|
+
const operationStrategy = chunkNYQFPGYP_cjs.createPostgresOperationStrategy(
|
|
256
256
|
tables2,
|
|
257
257
|
fulltextStrategy
|
|
258
258
|
);
|
|
@@ -293,7 +293,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
293
293
|
}
|
|
294
294
|
const matTable = tables2.contributionMaterializations;
|
|
295
295
|
async function ensureContributionMaterializationsTableImpl() {
|
|
296
|
-
await db.execute(drizzleOrm.sql.raw(
|
|
296
|
+
await db.execute(drizzleOrm.sql.raw(chunkNYQFPGYP_cjs.generatePgCreateTableSQL(matTable)));
|
|
297
297
|
}
|
|
298
298
|
async function getContributionMaterializationRow(identity) {
|
|
299
299
|
const rows = await db.select().from(matTable).where(
|
|
@@ -306,16 +306,16 @@ function createPostgresBackend(db, options = {}) {
|
|
|
306
306
|
);
|
|
307
307
|
const row = rows[0];
|
|
308
308
|
if (row === void 0) return void 0;
|
|
309
|
-
return
|
|
309
|
+
return chunkNYQFPGYP_cjs.mapContributionMaterializationRow(
|
|
310
310
|
row,
|
|
311
|
-
|
|
311
|
+
chunkNYQFPGYP_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.decode
|
|
312
312
|
);
|
|
313
313
|
}
|
|
314
314
|
async function recordContributionMaterializationRow(params) {
|
|
315
315
|
await db.insert(matTable).values(
|
|
316
|
-
|
|
316
|
+
chunkNYQFPGYP_cjs.buildContributionInsertValues(
|
|
317
317
|
params,
|
|
318
|
-
|
|
318
|
+
chunkNYQFPGYP_cjs.POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS.encode
|
|
319
319
|
)
|
|
320
320
|
).onConflictDoUpdate({
|
|
321
321
|
target: [
|
|
@@ -324,13 +324,13 @@ function createPostgresBackend(db, options = {}) {
|
|
|
324
324
|
matTable.owner,
|
|
325
325
|
matTable.tableName
|
|
326
326
|
],
|
|
327
|
-
set:
|
|
327
|
+
set: chunkNYQFPGYP_cjs.buildContributionOnConflictSet(
|
|
328
328
|
matTable.materializedAt,
|
|
329
329
|
params.materializedAt
|
|
330
330
|
)
|
|
331
331
|
});
|
|
332
332
|
}
|
|
333
|
-
const contributionMaterializer =
|
|
333
|
+
const contributionMaterializer = chunkNYQFPGYP_cjs.createContributionMaterializer({
|
|
334
334
|
dialect: "postgres",
|
|
335
335
|
fulltextStrategy,
|
|
336
336
|
fulltextTableName: tables2.fulltextTableName,
|
|
@@ -350,12 +350,12 @@ function createPostgresBackend(db, options = {}) {
|
|
|
350
350
|
capabilities,
|
|
351
351
|
fulltextStrategy
|
|
352
352
|
});
|
|
353
|
-
return
|
|
353
|
+
return chunkNYQFPGYP_cjs.gateFulltext(txBackend, contributionMaterializer.assertInitialized);
|
|
354
354
|
}
|
|
355
355
|
const backend = {
|
|
356
356
|
...operations,
|
|
357
357
|
async bootstrapTables() {
|
|
358
|
-
const statements =
|
|
358
|
+
const statements = chunkNYQFPGYP_cjs.generatePostgresDDL(tables2, fulltextStrategy);
|
|
359
359
|
for (const statement of statements) {
|
|
360
360
|
await db.execute(drizzleOrm.sql.raw(statement));
|
|
361
361
|
}
|
|
@@ -365,7 +365,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
365
365
|
// uninitialized database throws `StoreNotInitializedError` loudly
|
|
366
366
|
// rather than self-healing on a read/write path (#135). Shared
|
|
367
367
|
// verbatim with the tx-scoped gate via `gateFulltextMethods`.
|
|
368
|
-
...
|
|
368
|
+
...chunkNYQFPGYP_cjs.gateFulltextMethods(
|
|
369
369
|
operations,
|
|
370
370
|
contributionMaterializer.assertInitialized
|
|
371
371
|
),
|
|
@@ -374,7 +374,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
374
374
|
},
|
|
375
375
|
async ensureIndexMaterializationsTable() {
|
|
376
376
|
await db.execute(
|
|
377
|
-
drizzleOrm.sql.raw(
|
|
377
|
+
drizzleOrm.sql.raw(chunkNYQFPGYP_cjs.generatePgCreateTableSQL(tables2.indexMaterializations))
|
|
378
378
|
);
|
|
379
379
|
},
|
|
380
380
|
async getIndexMaterialization(indexName) {
|
|
@@ -382,26 +382,26 @@ function createPostgresBackend(db, options = {}) {
|
|
|
382
382
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.indexName, indexName));
|
|
383
383
|
const row = rows[0];
|
|
384
384
|
if (row === void 0) return void 0;
|
|
385
|
-
return
|
|
385
|
+
return chunkNYQFPGYP_cjs.mapMaterializationRow(row, chunkNYQFPGYP_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode);
|
|
386
386
|
},
|
|
387
387
|
async getIndexMaterializations(statusKeys) {
|
|
388
388
|
if (statusKeys.length === 0) return [];
|
|
389
389
|
const t = tables2.indexMaterializations;
|
|
390
390
|
const rows = await db.select().from(t).where(drizzleOrm.inArray(t.indexName, [...statusKeys]));
|
|
391
391
|
return rows.map(
|
|
392
|
-
(row) =>
|
|
392
|
+
(row) => chunkNYQFPGYP_cjs.mapMaterializationRow(row, chunkNYQFPGYP_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.decode)
|
|
393
393
|
);
|
|
394
394
|
},
|
|
395
395
|
async recordIndexMaterialization(params) {
|
|
396
396
|
const t = tables2.indexMaterializations;
|
|
397
397
|
await db.insert(t).values(
|
|
398
|
-
|
|
398
|
+
chunkNYQFPGYP_cjs.buildMaterializationInsertValues(
|
|
399
399
|
params,
|
|
400
|
-
|
|
400
|
+
chunkNYQFPGYP_cjs.POSTGRES_INDEX_MAT_TIMESTAMPS.encode
|
|
401
401
|
)
|
|
402
402
|
).onConflictDoUpdate({
|
|
403
403
|
target: t.indexName,
|
|
404
|
-
set:
|
|
404
|
+
set: chunkNYQFPGYP_cjs.buildMaterializationOnConflictSet(
|
|
405
405
|
t.materializedAt,
|
|
406
406
|
params.materializedAt
|
|
407
407
|
)
|
|
@@ -421,38 +421,38 @@ function createPostgresBackend(db, options = {}) {
|
|
|
421
421
|
},
|
|
422
422
|
async ensureKindRemovalsTable() {
|
|
423
423
|
await db.execute(
|
|
424
|
-
drizzleOrm.sql.raw(
|
|
424
|
+
drizzleOrm.sql.raw(chunkNYQFPGYP_cjs.generatePgCreateTableSQL(tables2.kindRemovals))
|
|
425
425
|
);
|
|
426
426
|
},
|
|
427
427
|
async getPendingKindRemovals(graphId) {
|
|
428
428
|
const t = tables2.kindRemovals;
|
|
429
429
|
const rows = await db.select().from(t).where(drizzleOrm.and(drizzleOrm.eq(t.graphId, graphId), drizzleOrm.isNull(t.removedAt)));
|
|
430
430
|
return rows.map(
|
|
431
|
-
(row) =>
|
|
431
|
+
(row) => chunkNYQFPGYP_cjs.mapKindRemovalRow(row, chunkNYQFPGYP_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
432
432
|
);
|
|
433
433
|
},
|
|
434
434
|
async getAllKindRemovals(graphId) {
|
|
435
435
|
const t = tables2.kindRemovals;
|
|
436
436
|
const rows = await db.select().from(t).where(drizzleOrm.eq(t.graphId, graphId));
|
|
437
437
|
return rows.map(
|
|
438
|
-
(row) =>
|
|
438
|
+
(row) => chunkNYQFPGYP_cjs.mapKindRemovalRow(row, chunkNYQFPGYP_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.decode)
|
|
439
439
|
);
|
|
440
440
|
},
|
|
441
441
|
async recordKindRemoval(params) {
|
|
442
442
|
const t = tables2.kindRemovals;
|
|
443
443
|
await db.insert(t).values(
|
|
444
|
-
|
|
444
|
+
chunkNYQFPGYP_cjs.buildKindRemovalInsertValues(
|
|
445
445
|
params,
|
|
446
|
-
|
|
446
|
+
chunkNYQFPGYP_cjs.POSTGRES_KIND_REMOVAL_TIMESTAMPS.encode
|
|
447
447
|
)
|
|
448
448
|
).onConflictDoUpdate({
|
|
449
449
|
target: [t.graphId, t.kindName, t.entity, t.schemaVersion],
|
|
450
|
-
set:
|
|
450
|
+
set: chunkNYQFPGYP_cjs.buildKindRemovalOnConflictSet(t.removedAt, params.removedAt)
|
|
451
451
|
});
|
|
452
452
|
},
|
|
453
453
|
async ensureReconciliationMarkersTable() {
|
|
454
454
|
await db.execute(
|
|
455
|
-
drizzleOrm.sql.raw(
|
|
455
|
+
drizzleOrm.sql.raw(chunkNYQFPGYP_cjs.generatePgCreateTableSQL(tables2.reconciliationMarkers))
|
|
456
456
|
);
|
|
457
457
|
},
|
|
458
458
|
async ensureRuntimeContributions(graphId) {
|
|
@@ -513,7 +513,7 @@ function createPostgresBackend(db, options = {}) {
|
|
|
513
513
|
}
|
|
514
514
|
);
|
|
515
515
|
}
|
|
516
|
-
|
|
516
|
+
chunkNYQFPGYP_cjs.assertAdoptedDialect(externalTx, pgCore.PgDatabase, "postgres");
|
|
517
517
|
return bindTransactionBackend(externalTx);
|
|
518
518
|
},
|
|
519
519
|
async close() {
|
|
@@ -580,7 +580,7 @@ function createPostgresOperationBackend(options) {
|
|
|
580
580
|
return txAdapter.execute(query);
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
|
-
const commonBackend =
|
|
583
|
+
const commonBackend = chunkNYQFPGYP_cjs.createCommonOperationBackend({
|
|
584
584
|
batchConfig: {
|
|
585
585
|
checkUniqueBatchChunkSize: POSTGRES_CHECK_UNIQUE_BATCH_CHUNK_SIZE,
|
|
586
586
|
edgeInsertBatchSize: POSTGRES_EDGE_INSERT_BATCH_SIZE,
|
|
@@ -593,7 +593,7 @@ function createPostgresOperationBackend(options) {
|
|
|
593
593
|
execGet,
|
|
594
594
|
execRun
|
|
595
595
|
},
|
|
596
|
-
nowIso:
|
|
596
|
+
nowIso: chunkNYQFPGYP_cjs.nowIso,
|
|
597
597
|
operationStrategy,
|
|
598
598
|
rowMappers: {
|
|
599
599
|
toEdgeRow,
|
|
@@ -617,7 +617,7 @@ function createPostgresOperationBackend(options) {
|
|
|
617
617
|
tableNames,
|
|
618
618
|
// === Embedding Operations ===
|
|
619
619
|
async upsertEmbedding(params) {
|
|
620
|
-
const timestamp =
|
|
620
|
+
const timestamp = chunkNYQFPGYP_cjs.nowIso();
|
|
621
621
|
const query = operationStrategy.buildUpsertEmbedding(params, timestamp);
|
|
622
622
|
await execRun(query);
|
|
623
623
|
},
|
|
@@ -657,7 +657,7 @@ function createPostgresOperationBackend(options) {
|
|
|
657
657
|
...params.indexParams?.lists === void 0 ? {} : { ivfflatLists: params.indexParams.lists },
|
|
658
658
|
...params.concurrent === true ? { concurrent: true } : {}
|
|
659
659
|
};
|
|
660
|
-
const result = await
|
|
660
|
+
const result = await chunkNYQFPGYP_cjs.createPostgresVectorIndex(db, indexOptions);
|
|
661
661
|
if (!result.success) {
|
|
662
662
|
throw new Error(
|
|
663
663
|
result.message ?? "Failed to create PostgreSQL vector index"
|
|
@@ -666,7 +666,7 @@ function createPostgresOperationBackend(options) {
|
|
|
666
666
|
},
|
|
667
667
|
// === Fulltext Operations ===
|
|
668
668
|
async upsertFulltext(params) {
|
|
669
|
-
const timestamp =
|
|
669
|
+
const timestamp = chunkNYQFPGYP_cjs.nowIso();
|
|
670
670
|
const statements = operationStrategy.buildUpsertFulltext(
|
|
671
671
|
params,
|
|
672
672
|
timestamp
|
|
@@ -683,7 +683,7 @@ function createPostgresOperationBackend(options) {
|
|
|
683
683
|
},
|
|
684
684
|
async upsertFulltextBatch(params) {
|
|
685
685
|
if (params.rows.length === 0) return;
|
|
686
|
-
const timestamp =
|
|
686
|
+
const timestamp = chunkNYQFPGYP_cjs.nowIso();
|
|
687
687
|
const statements = operationStrategy.buildUpsertFulltextBatch(
|
|
688
688
|
params,
|
|
689
689
|
timestamp
|
|
@@ -704,7 +704,7 @@ function createPostgresOperationBackend(options) {
|
|
|
704
704
|
const rows = await execAll(query);
|
|
705
705
|
return rows.map((row, index) => ({
|
|
706
706
|
nodeId: row.node_id,
|
|
707
|
-
score:
|
|
707
|
+
score: chunkNYQFPGYP_cjs.coerceNumericScore(row.score),
|
|
708
708
|
rank: index + 1,
|
|
709
709
|
...row.snippet === null ? {} : { snippet: row.snippet }
|
|
710
710
|
}));
|
|
@@ -713,13 +713,13 @@ function createPostgresOperationBackend(options) {
|
|
|
713
713
|
const metrics = capabilities.vector?.metrics ?? ["cosine"];
|
|
714
714
|
await Promise.all(
|
|
715
715
|
metrics.map(async (metric) => {
|
|
716
|
-
const indexName =
|
|
716
|
+
const indexName = chunkNYQFPGYP_cjs.generateVectorIndexName(
|
|
717
717
|
params.graphId,
|
|
718
718
|
params.nodeKind,
|
|
719
719
|
params.fieldPath,
|
|
720
720
|
metric
|
|
721
721
|
);
|
|
722
|
-
const result = await
|
|
722
|
+
const result = await chunkNYQFPGYP_cjs.dropPostgresVectorIndex(db, indexName);
|
|
723
723
|
if (!result.success) {
|
|
724
724
|
throw new Error(
|
|
725
725
|
result.message ?? "Failed to drop PostgreSQL vector index"
|
|
@@ -753,43 +753,43 @@ function createTransactionBackend(options) {
|
|
|
753
753
|
|
|
754
754
|
Object.defineProperty(exports, "createPostgresTables", {
|
|
755
755
|
enumerable: true,
|
|
756
|
-
get: function () { return
|
|
756
|
+
get: function () { return chunkNYQFPGYP_cjs.createPostgresTables; }
|
|
757
757
|
});
|
|
758
758
|
Object.defineProperty(exports, "edges", {
|
|
759
759
|
enumerable: true,
|
|
760
|
-
get: function () { return
|
|
760
|
+
get: function () { return chunkNYQFPGYP_cjs.edges; }
|
|
761
761
|
});
|
|
762
762
|
Object.defineProperty(exports, "embeddings", {
|
|
763
763
|
enumerable: true,
|
|
764
|
-
get: function () { return
|
|
764
|
+
get: function () { return chunkNYQFPGYP_cjs.embeddings; }
|
|
765
765
|
});
|
|
766
766
|
Object.defineProperty(exports, "fulltext", {
|
|
767
767
|
enumerable: true,
|
|
768
|
-
get: function () { return
|
|
768
|
+
get: function () { return chunkNYQFPGYP_cjs.fulltext; }
|
|
769
769
|
});
|
|
770
770
|
Object.defineProperty(exports, "generatePostgresDDL", {
|
|
771
771
|
enumerable: true,
|
|
772
|
-
get: function () { return
|
|
772
|
+
get: function () { return chunkNYQFPGYP_cjs.generatePostgresDDL; }
|
|
773
773
|
});
|
|
774
774
|
Object.defineProperty(exports, "generatePostgresMigrationSQL", {
|
|
775
775
|
enumerable: true,
|
|
776
|
-
get: function () { return
|
|
776
|
+
get: function () { return chunkNYQFPGYP_cjs.generatePostgresMigrationSQL; }
|
|
777
777
|
});
|
|
778
778
|
Object.defineProperty(exports, "nodes", {
|
|
779
779
|
enumerable: true,
|
|
780
|
-
get: function () { return
|
|
780
|
+
get: function () { return chunkNYQFPGYP_cjs.nodes; }
|
|
781
781
|
});
|
|
782
782
|
Object.defineProperty(exports, "schemaVersions", {
|
|
783
783
|
enumerable: true,
|
|
784
|
-
get: function () { return
|
|
784
|
+
get: function () { return chunkNYQFPGYP_cjs.schemaVersions; }
|
|
785
785
|
});
|
|
786
786
|
Object.defineProperty(exports, "tables", {
|
|
787
787
|
enumerable: true,
|
|
788
|
-
get: function () { return
|
|
788
|
+
get: function () { return chunkNYQFPGYP_cjs.tables; }
|
|
789
789
|
});
|
|
790
790
|
Object.defineProperty(exports, "uniques", {
|
|
791
791
|
enumerable: true,
|
|
792
|
-
get: function () { return
|
|
792
|
+
get: function () { return chunkNYQFPGYP_cjs.uniques; }
|
|
793
793
|
});
|
|
794
794
|
exports.createPostgresBackend = createPostgresBackend;
|
|
795
795
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { quoteIdentifier } from '../../chunk-3EUKJEQ3.js';
|
|
2
|
-
import { createNodeRowMapper, POSTGRES_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, tables, createPostgresOperationStrategy, createContributionMaterializer, gateFulltextMethods, createCommonOperationBackend, nowIso, generatePgCreateTableSQL, mapContributionMaterializationRow, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, assertAdoptedDialect, buildKindRemovalInsertValues, POSTGRES_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, POSTGRES_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, generatePostgresDDL, generateVectorIndexName, dropPostgresVectorIndex, coerceNumericScore, createPostgresVectorIndex, gateFulltext, compileQueryWithDialect, formatPostgresTimestamp, getOrCreateLru } from '../../chunk-
|
|
3
|
-
export { createPostgresTables, edges, embeddings, fulltext, generatePostgresDDL, generatePostgresMigrationSQL, nodes, schemaVersions, tables, uniques } from '../../chunk-
|
|
2
|
+
import { createNodeRowMapper, POSTGRES_ROW_MAPPER_CONFIG, createEdgeRowMapper, createUniqueRowMapper, createSchemaVersionRowMapper, tables, createPostgresOperationStrategy, createContributionMaterializer, gateFulltextMethods, createCommonOperationBackend, nowIso, generatePgCreateTableSQL, mapContributionMaterializationRow, POSTGRES_CONTRIBUTION_MAT_TIMESTAMPS, buildContributionInsertValues, buildContributionOnConflictSet, assertAdoptedDialect, buildKindRemovalInsertValues, POSTGRES_KIND_REMOVAL_TIMESTAMPS, buildKindRemovalOnConflictSet, mapKindRemovalRow, buildMaterializationInsertValues, POSTGRES_INDEX_MAT_TIMESTAMPS, buildMaterializationOnConflictSet, mapMaterializationRow, generatePostgresDDL, generateVectorIndexName, dropPostgresVectorIndex, coerceNumericScore, createPostgresVectorIndex, gateFulltext, compileQueryWithDialect, formatPostgresTimestamp, getOrCreateLru } from '../../chunk-TKM2WDT4.js';
|
|
3
|
+
export { createPostgresTables, edges, embeddings, fulltext, generatePostgresDDL, generatePostgresMigrationSQL, nodes, schemaVersions, tables, uniques } from '../../chunk-TKM2WDT4.js';
|
|
4
4
|
import { POSTGRES_CAPABILITIES } from '../../chunk-PCHTTG42.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-O57GYGYK.js';
|
|
6
6
|
import { tsvectorStrategy, buildFulltextCapabilities } from '../../chunk-ZTREJOGB.js';
|
|
7
7
|
import '../../chunk-EJCDOA37.js';
|
|
8
8
|
import '../../chunk-OOS2RKRH.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkNMOE2ZEU_cjs = require('../../chunk-NMOE2ZEU.cjs');
|
|
4
|
+
var chunkNYQFPGYP_cjs = require('../../chunk-NYQFPGYP.cjs');
|
|
5
5
|
require('../../chunk-LYRUNG6E.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-FFHW2JEK.cjs');
|
|
7
7
|
require('../../chunk-PN37HVAV.cjs');
|
|
8
8
|
require('../../chunk-CTHNVU6K.cjs');
|
|
9
9
|
require('../../chunk-EK6RJ373.cjs');
|
|
@@ -15,43 +15,43 @@ require('../../chunk-7V335GHG.cjs');
|
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "createSqliteBackend", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkNMOE2ZEU_cjs.createSqliteBackend; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "createSqliteTables", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkNYQFPGYP_cjs.createSqliteTables; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "edges", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkNYQFPGYP_cjs.edges2; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "embeddings", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkNYQFPGYP_cjs.embeddings2; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "generateSqliteDDL", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkNYQFPGYP_cjs.generateSqliteDDL; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "generateSqliteMigrationSQL", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkNYQFPGYP_cjs.generateSqliteMigrationSQL; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "nodes", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkNYQFPGYP_cjs.nodes2; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "schemaVersions", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkNYQFPGYP_cjs.schemaVersions2; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "tables", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkNYQFPGYP_cjs.tables2; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "uniques", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkNYQFPGYP_cjs.uniques2; }
|
|
55
55
|
});
|
|
56
56
|
//# sourceMappingURL=index.cjs.map
|
|
57
57
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createSqliteBackend } from '../../chunk-
|
|
2
|
-
export { createSqliteTables, edges2 as edges, embeddings2 as embeddings, generateSqliteDDL, generateSqliteMigrationSQL, nodes2 as nodes, schemaVersions2 as schemaVersions, tables2 as tables, uniques2 as uniques } from '../../chunk-
|
|
1
|
+
export { createSqliteBackend } from '../../chunk-PGU2XKMA.js';
|
|
2
|
+
export { createSqliteTables, edges2 as edges, embeddings2 as embeddings, generateSqliteDDL, generateSqliteMigrationSQL, nodes2 as nodes, schemaVersions2 as schemaVersions, tables2 as tables, uniques2 as uniques } from '../../chunk-TKM2WDT4.js';
|
|
3
3
|
import '../../chunk-PCHTTG42.js';
|
|
4
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-O57GYGYK.js';
|
|
5
5
|
import '../../chunk-ZTREJOGB.js';
|
|
6
6
|
import '../../chunk-EJCDOA37.js';
|
|
7
7
|
import '../../chunk-OOS2RKRH.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkNMOE2ZEU_cjs = require('../../chunk-NMOE2ZEU.cjs');
|
|
4
|
+
var chunkNYQFPGYP_cjs = require('../../chunk-NYQFPGYP.cjs');
|
|
5
5
|
require('../../chunk-LYRUNG6E.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-FFHW2JEK.cjs');
|
|
7
7
|
require('../../chunk-PN37HVAV.cjs');
|
|
8
8
|
require('../../chunk-CTHNVU6K.cjs');
|
|
9
9
|
require('../../chunk-EK6RJ373.cjs');
|
|
@@ -13,11 +13,11 @@ require('../../chunk-7V335GHG.cjs');
|
|
|
13
13
|
var libsql = require('drizzle-orm/libsql');
|
|
14
14
|
|
|
15
15
|
async function createLibsqlBackend(client, options = {}) {
|
|
16
|
-
const tables2 = options.tables ??
|
|
16
|
+
const tables2 = options.tables ?? chunkNYQFPGYP_cjs.tables2;
|
|
17
17
|
const db = libsql.drizzle(client);
|
|
18
|
-
const ddlStatements =
|
|
18
|
+
const ddlStatements = chunkNYQFPGYP_cjs.generateSqliteDDL(tables2);
|
|
19
19
|
await client.executeMultiple(ddlStatements.join(";\n"));
|
|
20
|
-
const backend =
|
|
20
|
+
const backend = chunkNMOE2ZEU_cjs.createSqliteBackend(db, {
|
|
21
21
|
executionProfile: {
|
|
22
22
|
isSync: false,
|
|
23
23
|
transactionMode: "drizzle"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createSqliteBackend } from '../../chunk-
|
|
2
|
-
import { tables2, generateSqliteDDL } from '../../chunk-
|
|
1
|
+
import { createSqliteBackend } from '../../chunk-PGU2XKMA.js';
|
|
2
|
+
import { tables2, generateSqliteDDL } from '../../chunk-TKM2WDT4.js';
|
|
3
3
|
import '../../chunk-PCHTTG42.js';
|
|
4
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-O57GYGYK.js';
|
|
5
5
|
import '../../chunk-ZTREJOGB.js';
|
|
6
6
|
import '../../chunk-EJCDOA37.js';
|
|
7
7
|
import '../../chunk-OOS2RKRH.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkNMOE2ZEU_cjs = require('../../chunk-NMOE2ZEU.cjs');
|
|
4
|
+
var chunkNYQFPGYP_cjs = require('../../chunk-NYQFPGYP.cjs');
|
|
5
5
|
var chunkLYRUNG6E_cjs = require('../../chunk-LYRUNG6E.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-FFHW2JEK.cjs');
|
|
7
7
|
require('../../chunk-PN37HVAV.cjs');
|
|
8
8
|
require('../../chunk-CTHNVU6K.cjs');
|
|
9
9
|
require('../../chunk-EK6RJ373.cjs');
|
|
@@ -60,15 +60,15 @@ function createDatabase(path) {
|
|
|
60
60
|
}
|
|
61
61
|
function createLocalSqliteBackend(options = {}) {
|
|
62
62
|
const path = options.path ?? ":memory:";
|
|
63
|
-
const tables2 = options.tables ??
|
|
63
|
+
const tables2 = options.tables ?? chunkNYQFPGYP_cjs.tables2;
|
|
64
64
|
const sqlite = createDatabase(path);
|
|
65
65
|
const hasVectorEmbeddings = tryLoadSqliteVec(sqlite);
|
|
66
66
|
const db = betterSqlite3.drizzle(sqlite);
|
|
67
|
-
const ddlStatements =
|
|
67
|
+
const ddlStatements = chunkNYQFPGYP_cjs.generateSqliteDDL(tables2);
|
|
68
68
|
for (const statement of ddlStatements) {
|
|
69
69
|
sqlite.exec(statement);
|
|
70
70
|
}
|
|
71
|
-
const backend =
|
|
71
|
+
const backend = chunkNMOE2ZEU_cjs.createSqliteBackend(db, {
|
|
72
72
|
executionProfile: {
|
|
73
73
|
isSync: true
|
|
74
74
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createSqliteBackend } from '../../chunk-
|
|
2
|
-
import { tables2, generateSqliteDDL } from '../../chunk-
|
|
1
|
+
import { createSqliteBackend } from '../../chunk-PGU2XKMA.js';
|
|
2
|
+
import { tables2, generateSqliteDDL } from '../../chunk-TKM2WDT4.js';
|
|
3
3
|
import { wrapWithManagedClose } from '../../chunk-PCHTTG42.js';
|
|
4
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-O57GYGYK.js';
|
|
5
5
|
import '../../chunk-ZTREJOGB.js';
|
|
6
6
|
import '../../chunk-EJCDOA37.js';
|
|
7
7
|
import '../../chunk-OOS2RKRH.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NODE_TYPE_BRAND, EDGE_TYPE_BRAND, nowIso, getNodeKinds, getEdgeKinds, autoDeriveVectorIndexes, mergeVectorIndexes } from './chunk-OYLF3IC7.js';
|
|
2
2
|
import { ALL_META_EDGE_NAMES, META_EDGE_IMPLIES, META_EDGE_INVERSE_OF, META_EDGE_PART_OF, META_EDGE_HAS_PART, META_EDGE_DISJOINT_WITH, META_EDGE_DIFFERENT_FROM, META_EDGE_SAME_AS, META_EDGE_EQUIVALENT_TO, META_EDGE_RELATED_TO, META_EDGE_BROADER, META_EDGE_NARROWER, META_EDGE_SUB_CLASS_OF, assertJsonValue, isReachable, computeTransitiveClosure, invertClosure, LEGACY_GRAPH_EXTENSION_VERSION, unwrap, validateGraphExtension, compactUndefined, KindCollisionError, GraphExtensionUnresolvedEndpointError, freezeDeep, assertSchemaKeysAreFree, RESERVED_NODE_KEYS, RESERVED_EDGE_KEYS } from './chunk-TSGBRPNE.js';
|
|
3
|
-
import { canonicalEqual, sortedReplacer, isMissingTableError } from './chunk-
|
|
3
|
+
import { canonicalEqual, sortedReplacer, isMissingTableError } from './chunk-O57GYGYK.js';
|
|
4
4
|
import { sha256Hex, defineNodeIndex, defineEdgeIndex } from './chunk-EJCDOA37.js';
|
|
5
5
|
import { searchable } from './chunk-OOS2RKRH.js';
|
|
6
6
|
import { embedding } from './chunk-WVQXAFP3.js';
|
|
@@ -2665,5 +2665,5 @@ function createValidationError(message, issues, context) {
|
|
|
2665
2665
|
}
|
|
2666
2666
|
|
|
2667
2667
|
export { KindRegistry, META_EDGE_BRAND, applyDeprecatedKinds, assertSchemaCurrent, broader, buildGraphExtensionOntologyKeySet, commitNewSchemaVersion, compileTimeOntologyKey, computeClosuresFromOntology, computeSchemaDiff, computeSchemaHash, core, createEmptyClosures, createValidationError, defineEdge, defineNode, deserializeWherePredicate, differentFrom, disjointWith, ensureSchema, equivalentTo, extensionKindNames, getActiveSchema, getMigrationActions, getSchemaChanges, getTypeName, hasPart, implies, initializeSchema, inverseOf, isBackwardsCompatible, isMetaEdge, isSchemaInitialized, loadActiveSchemaWithBootstrap, loadAndMergeGraphExtensionDocument, loadAndVerifyGraph, mergeGraphExtension, migrateSchema, narrower, parseSerializedSchema, partOf, relatedTo, rollbackSchema, sameAs, serializeSchema, serializeSchemaProperties, subClassOf, validateEdgeProps, validateNodeProps, validateProps, wrapZodError };
|
|
2668
|
-
//# sourceMappingURL=chunk-
|
|
2669
|
-
//# sourceMappingURL=chunk-
|
|
2668
|
+
//# sourceMappingURL=chunk-5MTOKWDA.js.map
|
|
2669
|
+
//# sourceMappingURL=chunk-5MTOKWDA.js.map
|