@nicia-ai/typegraph 0.30.0 → 0.31.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/README.md +39 -0
- package/dist/backend/postgres/index.cjs +19 -18
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +9 -8
- package/dist/backend/postgres/pglite.cjs +13 -12
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +9 -8
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +16 -16
- package/dist/backend/sqlite/index.d.cts +7 -7
- package/dist/backend/sqlite/index.d.ts +7 -7
- package/dist/backend/sqlite/index.js +7 -7
- package/dist/backend/sqlite/libsql.cjs +12 -12
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +8 -8
- package/dist/backend/sqlite/local.cjs +13 -13
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +8 -8
- package/dist/{chunk-AI3RNREM.js → chunk-2HZGWCB4.js} +94 -496
- package/dist/chunk-2HZGWCB4.js.map +1 -0
- package/dist/chunk-2YMGNYXY.js +40 -0
- package/dist/chunk-2YMGNYXY.js.map +1 -0
- package/dist/chunk-2ZY4K43M.js +90 -0
- package/dist/chunk-2ZY4K43M.js.map +1 -0
- package/dist/chunk-3EUKJEQ3.js +77 -0
- package/dist/chunk-3EUKJEQ3.js.map +1 -0
- package/dist/chunk-3JBJEYWE.cjs +604 -0
- package/dist/chunk-3JBJEYWE.cjs.map +1 -0
- package/dist/{chunk-IUIJJYPI.js → chunk-4A4GUZTQ.js} +6 -5
- package/dist/chunk-4A4GUZTQ.js.map +1 -0
- package/dist/{chunk-WEMZM7J7.cjs → chunk-54JVNOAQ.cjs} +5 -41
- package/dist/chunk-54JVNOAQ.cjs.map +1 -0
- package/dist/{chunk-IE6GN7L3.cjs → chunk-5CN7B4CZ.cjs} +17 -98
- package/dist/chunk-5CN7B4CZ.cjs.map +1 -0
- package/dist/{chunk-K4N35E7B.cjs → chunk-5DTPBFX5.cjs} +64 -63
- package/dist/chunk-5DTPBFX5.cjs.map +1 -0
- package/dist/chunk-6G35I3VW.cjs +40 -0
- package/dist/chunk-6G35I3VW.cjs.map +1 -0
- package/dist/{chunk-4BXHVEFB.cjs → chunk-6RMLO5O4.cjs} +6 -51
- package/dist/chunk-6RMLO5O4.cjs.map +1 -0
- package/dist/chunk-6SA7UIQJ.cjs +94 -0
- package/dist/chunk-6SA7UIQJ.cjs.map +1 -0
- package/dist/chunk-6ZR4QC3O.cjs +12 -0
- package/dist/{chunk-LUHU4T2F.cjs.map → chunk-6ZR4QC3O.cjs.map} +1 -1
- package/dist/chunk-73KASJGO.cjs +52 -0
- package/dist/chunk-73KASJGO.cjs.map +1 -0
- package/dist/chunk-A3W7QG7K.js +45 -0
- package/dist/chunk-A3W7QG7K.js.map +1 -0
- package/dist/{chunk-FWBVPATK.cjs → chunk-ASYQDPPU.cjs} +19 -19
- package/dist/{chunk-FWBVPATK.cjs.map → chunk-ASYQDPPU.cjs.map} +1 -1
- package/dist/{chunk-FVIGJTS7.js → chunk-ATTXBMAX.js} +4 -74
- package/dist/chunk-ATTXBMAX.js.map +1 -0
- package/dist/chunk-AW4A3P5A.cjs +51 -0
- package/dist/chunk-AW4A3P5A.cjs.map +1 -0
- package/dist/{chunk-WFCECD6Q.cjs → chunk-CIINW6PS.cjs} +73 -68
- package/dist/chunk-CIINW6PS.cjs.map +1 -0
- package/dist/{chunk-26HWIIVS.cjs → chunk-FLOI7QOT.cjs} +63 -62
- package/dist/chunk-FLOI7QOT.cjs.map +1 -0
- package/dist/{chunk-633N7DSE.js → chunk-GKFWM3DS.js} +4 -36
- package/dist/chunk-GKFWM3DS.js.map +1 -0
- package/dist/chunk-HTGDWIDE.cjs +89 -0
- package/dist/chunk-HTGDWIDE.cjs.map +1 -0
- package/dist/{chunk-R4JOBEJU.js → chunk-IJORSAC3.js} +4 -40
- package/dist/chunk-IJORSAC3.js.map +1 -0
- package/dist/{chunk-SGPXKJ4A.cjs → chunk-KTIEB7VH.cjs} +26 -16
- package/dist/chunk-KTIEB7VH.cjs.map +1 -0
- package/dist/chunk-LJLMDDCW.js +282 -0
- package/dist/chunk-LJLMDDCW.js.map +1 -0
- package/dist/{chunk-VFX3LC76.cjs → chunk-N2MBPTAF.cjs} +14 -14
- package/dist/{chunk-VFX3LC76.cjs.map → chunk-N2MBPTAF.cjs.map} +1 -1
- package/dist/{chunk-3IRMLJEK.js → chunk-O4VUR6SI.js} +3 -3
- package/dist/{chunk-3IRMLJEK.js.map → chunk-O4VUR6SI.js.map} +1 -1
- package/dist/chunk-RZ4DH4E7.cjs +15832 -0
- package/dist/chunk-RZ4DH4E7.cjs.map +1 -0
- package/dist/chunk-SAJSMR2B.js +35 -0
- package/dist/chunk-SAJSMR2B.js.map +1 -0
- package/dist/{chunk-4LBO6KIF.cjs → chunk-SFFJ2IKN.cjs} +60 -59
- package/dist/chunk-SFFJ2IKN.cjs.map +1 -0
- package/dist/{chunk-K5VREXMZ.js → chunk-STP7QVUB.js} +7 -6
- package/dist/chunk-STP7QVUB.js.map +1 -0
- package/dist/chunk-THX25XW6.js +590 -0
- package/dist/chunk-THX25XW6.js.map +1 -0
- package/dist/chunk-UIFEEPME.js +15787 -0
- package/dist/chunk-UIFEEPME.js.map +1 -0
- package/dist/{chunk-2QA5EHEN.js → chunk-UJ4V3YUQ.js} +3 -3
- package/dist/{chunk-2QA5EHEN.js.map → chunk-UJ4V3YUQ.js.map} +1 -1
- package/dist/{chunk-UESTHN47.cjs → chunk-V4IQYOQ4.cjs} +95 -507
- package/dist/chunk-V4IQYOQ4.cjs.map +1 -0
- package/dist/chunk-VMEWZU2N.cjs +287 -0
- package/dist/chunk-VMEWZU2N.cjs.map +1 -0
- package/dist/{chunk-N2OEOGBB.js → chunk-VZX2KSY3.js} +13 -8
- package/dist/chunk-VZX2KSY3.js.map +1 -0
- package/dist/{chunk-IX7RE7CG.js → chunk-WYTUF3QO.js} +3 -3
- package/dist/{chunk-IX7RE7CG.js.map → chunk-WYTUF3QO.js.map} +1 -1
- package/dist/{chunk-3JLRHQ67.js → chunk-XKJQQQVR.js} +6 -5
- package/dist/chunk-XKJQQQVR.js.map +1 -0
- package/dist/{chunk-ENDUY2CD.js → chunk-YCV72E6L.js} +23 -17
- package/dist/chunk-YCV72E6L.js.map +1 -0
- package/dist/{ddl-EdkIiFVU.d.ts → ddl-BJcPrB4L.d.ts} +3 -3
- package/dist/{ddl-BSFlbGQF.d.cts → ddl-CPZ7mB7X.d.cts} +3 -3
- package/dist/{extension-types-CwHV-Uk4.d.cts → extension-types-D1k0inWU.d.cts} +1 -1
- package/dist/{extension-types-CwHV-Uk4.d.ts → extension-types-D1k0inWU.d.ts} +1 -1
- package/dist/graph-extension/index.cjs +17 -17
- package/dist/graph-extension/index.d.cts +5 -16
- package/dist/graph-extension/index.d.ts +5 -16
- package/dist/graph-extension/index.js +2 -2
- package/dist/graph-merge/index.cjs +3822 -0
- package/dist/graph-merge/index.cjs.map +1 -0
- package/dist/graph-merge/index.d.cts +1191 -0
- package/dist/graph-merge/index.d.ts +1191 -0
- package/dist/graph-merge/index.js +3791 -0
- package/dist/graph-merge/index.js.map +1 -0
- package/dist/{index-DzeIiMO3.d.ts → index-BEK0VtNB.d.ts} +2 -2
- package/dist/{index-Ln_KHTGA.d.cts → index-C8sSTErx.d.cts} +2 -2
- package/dist/index.cjs +281 -15913
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.js +23 -15790
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +30 -26
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +6 -2
- package/dist/interchange/index.cjs +49 -592
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +5 -5
- package/dist/interchange/index.d.ts +5 -5
- package/dist/interchange/index.js +2 -588
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-BbdyNhkv.d.ts → manager-By-WEd8M.d.ts} +3 -3
- package/dist/{manager-wTDgjoXG.d.cts → manager-Np7VVSlE.d.cts} +3 -3
- package/dist/{materialize-indexes-lkawaDor.d.ts → materialize-indexes-CAGhqPHQ.d.ts} +1 -1
- package/dist/{materialize-indexes-oanE3RU0.d.cts → materialize-indexes-DEYkU-wr.d.cts} +1 -1
- package/dist/{postgres-CK2ByP1q.d.cts → postgres-4J2tmauh.d.cts} +1 -1
- package/dist/{postgres-ymXYC6Rr.d.ts → postgres-BdIb7tS_.d.ts} +1 -1
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/result-DWo6mUVz.d.cts +37 -0
- package/dist/result-DWo6mUVz.d.ts +37 -0
- package/dist/schema/index.cjs +29 -28
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +6 -5
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-DxH1lrwD.d.cts → sqlite-Gatk_iw_.d.cts} +1 -1
- package/dist/{sqlite-R8YGOqVQ.d.ts → sqlite-aM_PAz-O.d.ts} +1 -1
- package/dist/{store--z1Tmk7U.d.cts → store-DuCbdqsh.d.cts} +49 -49
- package/dist/{store-CNKM334w.d.ts → store-MloRPwb9.d.ts} +49 -49
- package/dist/{types-BBiDqJCU.d.ts → types-BKQljXom.d.ts} +16 -2
- package/dist/{types-dL-clxO3.d.cts → types-C1CYxWrL.d.cts} +16 -2
- package/dist/{types-D5B6Be5c.d.cts → types-DoByHGyU.d.cts} +2 -2
- package/dist/{types-CMvxx2kd.d.ts → types-K3vpaJAL.d.ts} +2 -2
- package/dist/{where-CAo6wsBZ.d.ts → where-Dt49bvo6.d.ts} +2 -2
- package/dist/{where-bJjuOCeV.d.cts → where-DydZjGOb.d.cts} +2 -2
- package/package.json +6 -1
- package/dist/chunk-26HWIIVS.cjs.map +0 -1
- package/dist/chunk-3JLRHQ67.js.map +0 -1
- package/dist/chunk-4BXHVEFB.cjs.map +0 -1
- package/dist/chunk-4LBO6KIF.cjs.map +0 -1
- package/dist/chunk-633N7DSE.js.map +0 -1
- package/dist/chunk-AI3RNREM.js.map +0 -1
- package/dist/chunk-ENDUY2CD.js.map +0 -1
- package/dist/chunk-FVIGJTS7.js.map +0 -1
- package/dist/chunk-IE6GN7L3.cjs.map +0 -1
- package/dist/chunk-IUIJJYPI.js.map +0 -1
- package/dist/chunk-K4N35E7B.cjs.map +0 -1
- package/dist/chunk-K5VREXMZ.js.map +0 -1
- package/dist/chunk-LUHU4T2F.cjs +0 -12
- package/dist/chunk-N2OEOGBB.js.map +0 -1
- package/dist/chunk-R4JOBEJU.js.map +0 -1
- package/dist/chunk-SGPXKJ4A.cjs.map +0 -1
- package/dist/chunk-UESTHN47.cjs.map +0 -1
- package/dist/chunk-WEMZM7J7.cjs.map +0 -1
- package/dist/chunk-WFCECD6Q.cjs.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk54JVNOAQ_cjs = require('./chunk-54JVNOAQ.cjs');
|
|
4
|
+
var chunkVMEWZU2N_cjs = require('./chunk-VMEWZU2N.cjs');
|
|
4
5
|
var chunkRP7YITHX_cjs = require('./chunk-RP7YITHX.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
6
|
+
var chunkV4IQYOQ4_cjs = require('./chunk-V4IQYOQ4.cjs');
|
|
7
|
+
var chunk73KASJGO_cjs = require('./chunk-73KASJGO.cjs');
|
|
7
8
|
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
8
9
|
var drizzleOrm = require('drizzle-orm');
|
|
9
10
|
var pgCore = require('drizzle-orm/pg-core');
|
|
@@ -56,7 +57,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
56
57
|
),
|
|
57
58
|
pgCore.index(`${n.nodes}_deleted_idx`).on(t.graphId, t.deletedAt),
|
|
58
59
|
pgCore.index(`${n.nodes}_valid_idx`).on(t.graphId, t.validFrom, t.validTo),
|
|
59
|
-
...
|
|
60
|
+
...chunkVMEWZU2N_cjs.buildPostgresNodeIndexBuilders(t, indexes)
|
|
60
61
|
]
|
|
61
62
|
);
|
|
62
63
|
const edges2 = pgCore.pgTable(
|
|
@@ -115,7 +116,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
115
116
|
t.fromId,
|
|
116
117
|
t.validTo
|
|
117
118
|
),
|
|
118
|
-
...
|
|
119
|
+
...chunkVMEWZU2N_cjs.buildPostgresEdgeIndexBuilders(t, indexes)
|
|
119
120
|
]
|
|
120
121
|
);
|
|
121
122
|
const uniques2 = pgCore.pgTable(
|
|
@@ -386,13 +387,13 @@ function isSqliteTable(value) {
|
|
|
386
387
|
function runtimeStrategyContributions(fulltextStrategy, fulltextTableName) {
|
|
387
388
|
return fulltextStrategy.ownedTables(fulltextTableName).filter((contribution) => contribution.runtimeEnsure);
|
|
388
389
|
}
|
|
389
|
-
function sqliteContributions(tables3 =
|
|
390
|
+
function sqliteContributions(tables3 = chunk54JVNOAQ_cjs.tables, fulltextStrategy = chunkV4IQYOQ4_cjs.fts5Strategy) {
|
|
390
391
|
const contributions = [];
|
|
391
392
|
for (const [key, table] of Object.entries(tables3)) {
|
|
392
393
|
if (!isSqliteTable(table)) continue;
|
|
393
394
|
contributions.push({
|
|
394
395
|
logicalName: key,
|
|
395
|
-
owner:
|
|
396
|
+
owner: chunkV4IQYOQ4_cjs.BASE_CONTRIBUTION_OWNER,
|
|
396
397
|
tableName: sqliteCore.getTableConfig(table).name,
|
|
397
398
|
createDdl: [
|
|
398
399
|
generateSqliteCreateTableSQL(table),
|
|
@@ -408,12 +409,12 @@ function sqliteContributions(tables3 = chunkWEMZM7J7_cjs.tables, fulltextStrateg
|
|
|
408
409
|
}
|
|
409
410
|
return contributions;
|
|
410
411
|
}
|
|
411
|
-
function generateSqliteDDL(tables3 =
|
|
412
|
+
function generateSqliteDDL(tables3 = chunk54JVNOAQ_cjs.tables, fulltextStrategy = chunkV4IQYOQ4_cjs.fts5Strategy) {
|
|
412
413
|
return sqliteContributions(tables3, fulltextStrategy).flatMap(
|
|
413
414
|
(contribution) => [...contribution.createDdl]
|
|
414
415
|
);
|
|
415
416
|
}
|
|
416
|
-
function generateSqliteMigrationSQL(tables3 =
|
|
417
|
+
function generateSqliteMigrationSQL(tables3 = chunk54JVNOAQ_cjs.tables, fulltextStrategy = chunkV4IQYOQ4_cjs.fts5Strategy) {
|
|
417
418
|
return generateSqliteDDL(tables3, fulltextStrategy).join("\n\n");
|
|
418
419
|
}
|
|
419
420
|
function getPgColumnType(column) {
|
|
@@ -495,14 +496,14 @@ function generatePgCreateIndexSQL(table) {
|
|
|
495
496
|
function isPgTable(value) {
|
|
496
497
|
return drizzleOrm.is(value, pgCore.PgTable);
|
|
497
498
|
}
|
|
498
|
-
function postgresContributions(tables3 = tables2, fulltextStrategy =
|
|
499
|
+
function postgresContributions(tables3 = tables2, fulltextStrategy = chunkV4IQYOQ4_cjs.tsvectorStrategy) {
|
|
499
500
|
const contributions = [];
|
|
500
501
|
for (const [key, table] of Object.entries(tables3)) {
|
|
501
502
|
if (!isPgTable(table)) continue;
|
|
502
503
|
if (table === tables3.fulltext) continue;
|
|
503
504
|
contributions.push({
|
|
504
505
|
logicalName: key,
|
|
505
|
-
owner:
|
|
506
|
+
owner: chunkV4IQYOQ4_cjs.BASE_CONTRIBUTION_OWNER,
|
|
506
507
|
tableName: pgCore.getTableConfig(table).name,
|
|
507
508
|
createDdl: [
|
|
508
509
|
generatePgCreateTableSQL(table),
|
|
@@ -518,12 +519,12 @@ function postgresContributions(tables3 = tables2, fulltextStrategy = chunkUESTHN
|
|
|
518
519
|
}
|
|
519
520
|
return contributions;
|
|
520
521
|
}
|
|
521
|
-
function generatePostgresDDL(tables3 = tables2, fulltextStrategy =
|
|
522
|
+
function generatePostgresDDL(tables3 = tables2, fulltextStrategy = chunkV4IQYOQ4_cjs.tsvectorStrategy) {
|
|
522
523
|
return postgresContributions(tables3, fulltextStrategy).flatMap(
|
|
523
524
|
(contribution) => [...contribution.createDdl]
|
|
524
525
|
);
|
|
525
526
|
}
|
|
526
|
-
function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy =
|
|
527
|
+
function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy = chunkV4IQYOQ4_cjs.tsvectorStrategy) {
|
|
527
528
|
const extensionSql = "-- Enable pgvector extension for vector similarity search\nCREATE EXTENSION IF NOT EXISTS vector;";
|
|
528
529
|
const ddlSql = generatePostgresDDL(tables3, fulltextStrategy).join("\n\n");
|
|
529
530
|
return `${extensionSql}
|
|
@@ -802,7 +803,7 @@ async function computeContributionSignature(dialect, identity, createDdl) {
|
|
|
802
803
|
tableName: identity.tableName,
|
|
803
804
|
createDdl
|
|
804
805
|
};
|
|
805
|
-
return
|
|
806
|
+
return chunk73KASJGO_cjs.sha256Hex(JSON.stringify(hashable, chunkRP7YITHX_cjs.sortedReplacer), 16);
|
|
806
807
|
}
|
|
807
808
|
function evaluateContributionState(row, signature) {
|
|
808
809
|
if (row === void 0) return "missing";
|
|
@@ -1460,7 +1461,7 @@ function createCommonOperationBackend(options) {
|
|
|
1460
1461
|
};
|
|
1461
1462
|
}
|
|
1462
1463
|
function buildClearGraph(tables3, graphId) {
|
|
1463
|
-
const fulltext2 =
|
|
1464
|
+
const fulltext2 = chunkV4IQYOQ4_cjs.quotedTableName(tables3.fulltextTableName);
|
|
1464
1465
|
return [
|
|
1465
1466
|
drizzleOrm.sql`DELETE FROM ${fulltext2} WHERE "graph_id" = ${graphId}`,
|
|
1466
1467
|
drizzleOrm.sql`DELETE FROM ${tables3.uniques} WHERE ${tables3.uniques.graphId} = ${graphId}`,
|
|
@@ -1558,12 +1559,16 @@ function buildFindEdgesByKind(tables3, params) {
|
|
|
1558
1559
|
if (params.toId !== void 0) {
|
|
1559
1560
|
conditions.push(drizzleOrm.sql`${edges2.toId} = ${params.toId}`);
|
|
1560
1561
|
}
|
|
1562
|
+
if (params.orderBy === "id" && params.after !== void 0) {
|
|
1563
|
+
conditions.push(drizzleOrm.sql`${edges2.id} > ${params.after}`);
|
|
1564
|
+
}
|
|
1561
1565
|
const whereClause = drizzleOrm.sql.join(conditions, drizzleOrm.sql` AND `);
|
|
1566
|
+
const orderByClause = params.orderBy === "id" ? drizzleOrm.sql`${edges2.id} ASC` : drizzleOrm.sql`${edges2.createdAt} DESC, ${edges2.id} DESC`;
|
|
1562
1567
|
if (params.limit !== void 0 && params.offset !== void 0) {
|
|
1563
1568
|
return drizzleOrm.sql`
|
|
1564
1569
|
SELECT * FROM ${edges2}
|
|
1565
1570
|
WHERE ${whereClause}
|
|
1566
|
-
ORDER BY ${
|
|
1571
|
+
ORDER BY ${orderByClause}
|
|
1567
1572
|
LIMIT ${params.limit} OFFSET ${params.offset}
|
|
1568
1573
|
`;
|
|
1569
1574
|
}
|
|
@@ -1571,14 +1576,14 @@ function buildFindEdgesByKind(tables3, params) {
|
|
|
1571
1576
|
return drizzleOrm.sql`
|
|
1572
1577
|
SELECT * FROM ${edges2}
|
|
1573
1578
|
WHERE ${whereClause}
|
|
1574
|
-
ORDER BY ${
|
|
1579
|
+
ORDER BY ${orderByClause}
|
|
1575
1580
|
LIMIT ${params.limit}
|
|
1576
1581
|
`;
|
|
1577
1582
|
}
|
|
1578
1583
|
return drizzleOrm.sql`
|
|
1579
1584
|
SELECT * FROM ${edges2}
|
|
1580
1585
|
WHERE ${whereClause}
|
|
1581
|
-
ORDER BY ${
|
|
1586
|
+
ORDER BY ${orderByClause}
|
|
1582
1587
|
`;
|
|
1583
1588
|
}
|
|
1584
1589
|
function buildCountEdgesByKind(tables3, params) {
|
|
@@ -1609,13 +1614,13 @@ function buildCountEdgesByKind(tables3, params) {
|
|
|
1609
1614
|
function buildInsertEdge(tables3, params, timestamp2) {
|
|
1610
1615
|
const { edges: edges2 } = tables3;
|
|
1611
1616
|
const propsJson = JSON.stringify(params.props);
|
|
1612
|
-
const columns =
|
|
1617
|
+
const columns = chunkV4IQYOQ4_cjs.edgeColumnList(edges2);
|
|
1613
1618
|
return drizzleOrm.sql`
|
|
1614
1619
|
INSERT INTO ${edges2} (${columns})
|
|
1615
1620
|
VALUES (
|
|
1616
1621
|
${params.graphId}, ${params.id}, ${params.kind},
|
|
1617
1622
|
${params.fromKind}, ${params.fromId}, ${params.toKind}, ${params.toId},
|
|
1618
|
-
${propsJson}, ${
|
|
1623
|
+
${propsJson}, ${chunkV4IQYOQ4_cjs.sqlNull(params.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(params.validTo)},
|
|
1619
1624
|
${timestamp2}, ${timestamp2}
|
|
1620
1625
|
)
|
|
1621
1626
|
RETURNING *
|
|
@@ -1624,23 +1629,23 @@ function buildInsertEdge(tables3, params, timestamp2) {
|
|
|
1624
1629
|
function buildInsertEdgeNoReturn(tables3, params, timestamp2) {
|
|
1625
1630
|
const { edges: edges2 } = tables3;
|
|
1626
1631
|
const propsJson = JSON.stringify(params.props);
|
|
1627
|
-
const columns =
|
|
1632
|
+
const columns = chunkV4IQYOQ4_cjs.edgeColumnList(edges2);
|
|
1628
1633
|
return drizzleOrm.sql`
|
|
1629
1634
|
INSERT INTO ${edges2} (${columns})
|
|
1630
1635
|
VALUES (
|
|
1631
1636
|
${params.graphId}, ${params.id}, ${params.kind},
|
|
1632
1637
|
${params.fromKind}, ${params.fromId}, ${params.toKind}, ${params.toId},
|
|
1633
|
-
${propsJson}, ${
|
|
1638
|
+
${propsJson}, ${chunkV4IQYOQ4_cjs.sqlNull(params.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(params.validTo)},
|
|
1634
1639
|
${timestamp2}, ${timestamp2}
|
|
1635
1640
|
)
|
|
1636
1641
|
`;
|
|
1637
1642
|
}
|
|
1638
1643
|
function buildInsertEdgesBatch(tables3, params, timestamp2) {
|
|
1639
1644
|
const { edges: edges2 } = tables3;
|
|
1640
|
-
const columns =
|
|
1645
|
+
const columns = chunkV4IQYOQ4_cjs.edgeColumnList(edges2);
|
|
1641
1646
|
const values = params.map((edgeParams) => {
|
|
1642
1647
|
const propsJson = JSON.stringify(edgeParams.props);
|
|
1643
|
-
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${
|
|
1648
|
+
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${chunkV4IQYOQ4_cjs.sqlNull(edgeParams.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(edgeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1644
1649
|
});
|
|
1645
1650
|
return drizzleOrm.sql`
|
|
1646
1651
|
INSERT INTO ${edges2} (${columns})
|
|
@@ -1649,10 +1654,10 @@ function buildInsertEdgesBatch(tables3, params, timestamp2) {
|
|
|
1649
1654
|
}
|
|
1650
1655
|
function buildInsertEdgesBatchReturning(tables3, params, timestamp2) {
|
|
1651
1656
|
const { edges: edges2 } = tables3;
|
|
1652
|
-
const columns =
|
|
1657
|
+
const columns = chunkV4IQYOQ4_cjs.edgeColumnList(edges2);
|
|
1653
1658
|
const values = params.map((edgeParams) => {
|
|
1654
1659
|
const propsJson = JSON.stringify(edgeParams.props);
|
|
1655
|
-
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${
|
|
1660
|
+
return drizzleOrm.sql`(${edgeParams.graphId}, ${edgeParams.id}, ${edgeParams.kind}, ${edgeParams.fromKind}, ${edgeParams.fromId}, ${edgeParams.toKind}, ${edgeParams.toId}, ${propsJson}, ${chunkV4IQYOQ4_cjs.sqlNull(edgeParams.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(edgeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1656
1661
|
});
|
|
1657
1662
|
return drizzleOrm.sql`
|
|
1658
1663
|
INSERT INTO ${edges2} (${columns})
|
|
@@ -1684,14 +1689,14 @@ function buildUpdateEdge(tables3, params, timestamp2) {
|
|
|
1684
1689
|
const { edges: edges2 } = tables3;
|
|
1685
1690
|
const propsJson = JSON.stringify(params.props);
|
|
1686
1691
|
const setParts = [
|
|
1687
|
-
drizzleOrm.sql`${
|
|
1688
|
-
drizzleOrm.sql`${
|
|
1692
|
+
drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(edges2.props)} = ${propsJson}`,
|
|
1693
|
+
drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(edges2.updatedAt)} = ${timestamp2}`
|
|
1689
1694
|
];
|
|
1690
1695
|
if (params.validTo !== void 0) {
|
|
1691
|
-
setParts.push(drizzleOrm.sql`${
|
|
1696
|
+
setParts.push(drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(edges2.validTo)} = ${params.validTo}`);
|
|
1692
1697
|
}
|
|
1693
1698
|
if (params.clearDeleted) {
|
|
1694
|
-
setParts.push(drizzleOrm.sql`${
|
|
1699
|
+
setParts.push(drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(edges2.deletedAt)} = NULL`);
|
|
1695
1700
|
}
|
|
1696
1701
|
const setClause = drizzleOrm.sql.join(setParts, drizzleOrm.sql`, `);
|
|
1697
1702
|
if (params.clearDeleted) {
|
|
@@ -1716,7 +1721,7 @@ function buildDeleteEdge(tables3, params, timestamp2) {
|
|
|
1716
1721
|
const { edges: edges2 } = tables3;
|
|
1717
1722
|
return drizzleOrm.sql`
|
|
1718
1723
|
UPDATE ${edges2}
|
|
1719
|
-
SET ${
|
|
1724
|
+
SET ${chunkV4IQYOQ4_cjs.quotedColumn(edges2.deletedAt)} = ${timestamp2}
|
|
1720
1725
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1721
1726
|
AND ${edges2.id} = ${params.id}
|
|
1722
1727
|
AND ${edges2.deletedAt} IS NULL
|
|
@@ -1803,7 +1808,7 @@ function resolveMode(mode) {
|
|
|
1803
1808
|
function buildFulltextSearch(tableName, params, strategy) {
|
|
1804
1809
|
assertValidSearchParams(params);
|
|
1805
1810
|
const mode = resolveMode(params.mode);
|
|
1806
|
-
const table =
|
|
1811
|
+
const table = chunkV4IQYOQ4_cjs.quotedTableName(tableName);
|
|
1807
1812
|
const matchCondition = strategy.matchCondition(
|
|
1808
1813
|
tableName,
|
|
1809
1814
|
params.query,
|
|
@@ -1854,12 +1859,12 @@ function assertValidSearchParams(params) {
|
|
|
1854
1859
|
function buildInsertNode(tables3, params, timestamp2) {
|
|
1855
1860
|
const { nodes: nodes2 } = tables3;
|
|
1856
1861
|
const propsJson = JSON.stringify(params.props);
|
|
1857
|
-
const columns =
|
|
1862
|
+
const columns = chunkV4IQYOQ4_cjs.nodeColumnList(nodes2);
|
|
1858
1863
|
return drizzleOrm.sql`
|
|
1859
1864
|
INSERT INTO ${nodes2} (${columns})
|
|
1860
1865
|
VALUES (
|
|
1861
1866
|
${params.graphId}, ${params.kind}, ${params.id}, ${propsJson},
|
|
1862
|
-
1, ${
|
|
1867
|
+
1, ${chunkV4IQYOQ4_cjs.sqlNull(params.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(params.validTo)},
|
|
1863
1868
|
${timestamp2}, ${timestamp2}
|
|
1864
1869
|
)
|
|
1865
1870
|
RETURNING *
|
|
@@ -1868,22 +1873,22 @@ function buildInsertNode(tables3, params, timestamp2) {
|
|
|
1868
1873
|
function buildInsertNodeNoReturn(tables3, params, timestamp2) {
|
|
1869
1874
|
const { nodes: nodes2 } = tables3;
|
|
1870
1875
|
const propsJson = JSON.stringify(params.props);
|
|
1871
|
-
const columns =
|
|
1876
|
+
const columns = chunkV4IQYOQ4_cjs.nodeColumnList(nodes2);
|
|
1872
1877
|
return drizzleOrm.sql`
|
|
1873
1878
|
INSERT INTO ${nodes2} (${columns})
|
|
1874
1879
|
VALUES (
|
|
1875
1880
|
${params.graphId}, ${params.kind}, ${params.id}, ${propsJson},
|
|
1876
|
-
1, ${
|
|
1881
|
+
1, ${chunkV4IQYOQ4_cjs.sqlNull(params.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(params.validTo)},
|
|
1877
1882
|
${timestamp2}, ${timestamp2}
|
|
1878
1883
|
)
|
|
1879
1884
|
`;
|
|
1880
1885
|
}
|
|
1881
1886
|
function buildInsertNodesBatch(tables3, params, timestamp2) {
|
|
1882
1887
|
const { nodes: nodes2 } = tables3;
|
|
1883
|
-
const columns =
|
|
1888
|
+
const columns = chunkV4IQYOQ4_cjs.nodeColumnList(nodes2);
|
|
1884
1889
|
const values = params.map((nodeParams) => {
|
|
1885
1890
|
const propsJson = JSON.stringify(nodeParams.props);
|
|
1886
|
-
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${
|
|
1891
|
+
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${chunkV4IQYOQ4_cjs.sqlNull(nodeParams.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(nodeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1887
1892
|
});
|
|
1888
1893
|
return drizzleOrm.sql`
|
|
1889
1894
|
INSERT INTO ${nodes2} (${columns})
|
|
@@ -1892,10 +1897,10 @@ function buildInsertNodesBatch(tables3, params, timestamp2) {
|
|
|
1892
1897
|
}
|
|
1893
1898
|
function buildInsertNodesBatchReturning(tables3, params, timestamp2) {
|
|
1894
1899
|
const { nodes: nodes2 } = tables3;
|
|
1895
|
-
const columns =
|
|
1900
|
+
const columns = chunkV4IQYOQ4_cjs.nodeColumnList(nodes2);
|
|
1896
1901
|
const values = params.map((nodeParams) => {
|
|
1897
1902
|
const propsJson = JSON.stringify(nodeParams.props);
|
|
1898
|
-
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${
|
|
1903
|
+
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${chunkV4IQYOQ4_cjs.sqlNull(nodeParams.validFrom)}, ${chunkV4IQYOQ4_cjs.sqlNull(nodeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1899
1904
|
});
|
|
1900
1905
|
return drizzleOrm.sql`
|
|
1901
1906
|
INSERT INTO ${nodes2} (${columns})
|
|
@@ -1929,19 +1934,19 @@ function buildUpdateNode(tables3, params, timestamp2) {
|
|
|
1929
1934
|
const { nodes: nodes2 } = tables3;
|
|
1930
1935
|
const propsJson = JSON.stringify(params.props);
|
|
1931
1936
|
const setParts = [
|
|
1932
|
-
drizzleOrm.sql`${
|
|
1933
|
-
drizzleOrm.sql`${
|
|
1937
|
+
drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(nodes2.props)} = ${propsJson}`,
|
|
1938
|
+
drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(nodes2.updatedAt)} = ${timestamp2}`
|
|
1934
1939
|
];
|
|
1935
1940
|
if (params.incrementVersion) {
|
|
1936
1941
|
setParts.push(
|
|
1937
|
-
drizzleOrm.sql`${
|
|
1942
|
+
drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(nodes2.version)} = ${chunkV4IQYOQ4_cjs.quotedColumn(nodes2.version)} + 1`
|
|
1938
1943
|
);
|
|
1939
1944
|
}
|
|
1940
1945
|
if (params.validTo !== void 0) {
|
|
1941
|
-
setParts.push(drizzleOrm.sql`${
|
|
1946
|
+
setParts.push(drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(nodes2.validTo)} = ${params.validTo}`);
|
|
1942
1947
|
}
|
|
1943
1948
|
if (params.clearDeleted) {
|
|
1944
|
-
setParts.push(drizzleOrm.sql`${
|
|
1949
|
+
setParts.push(drizzleOrm.sql`${chunkV4IQYOQ4_cjs.quotedColumn(nodes2.deletedAt)} = NULL`);
|
|
1945
1950
|
}
|
|
1946
1951
|
const setClause = drizzleOrm.sql.join(setParts, drizzleOrm.sql`, `);
|
|
1947
1952
|
if (params.clearDeleted) {
|
|
@@ -1968,7 +1973,7 @@ function buildDeleteNode(tables3, params, timestamp2) {
|
|
|
1968
1973
|
const { nodes: nodes2 } = tables3;
|
|
1969
1974
|
return drizzleOrm.sql`
|
|
1970
1975
|
UPDATE ${nodes2}
|
|
1971
|
-
SET ${
|
|
1976
|
+
SET ${chunkV4IQYOQ4_cjs.quotedColumn(nodes2.deletedAt)} = ${timestamp2}
|
|
1972
1977
|
WHERE ${nodes2.graphId} = ${params.graphId}
|
|
1973
1978
|
AND ${nodes2.kind} = ${params.kind}
|
|
1974
1979
|
AND ${nodes2.id} = ${params.id}
|
|
@@ -2035,12 +2040,12 @@ function buildSetActiveSchema(tables3, graphId, version, dialect = "sqlite") {
|
|
|
2035
2040
|
const strategy = SCHEMA_DIALECT_STRATEGIES[dialect];
|
|
2036
2041
|
const deactivateAll = drizzleOrm.sql`
|
|
2037
2042
|
UPDATE ${schemaVersions2}
|
|
2038
|
-
SET ${
|
|
2043
|
+
SET ${chunkV4IQYOQ4_cjs.quotedColumn(schemaVersions2.isActive)} = ${strategy.booleanLiteral(false)}
|
|
2039
2044
|
WHERE ${schemaVersions2.graphId} = ${graphId}
|
|
2040
2045
|
`;
|
|
2041
2046
|
const activateVersion = drizzleOrm.sql`
|
|
2042
2047
|
UPDATE ${schemaVersions2}
|
|
2043
|
-
SET ${
|
|
2048
|
+
SET ${chunkV4IQYOQ4_cjs.quotedColumn(schemaVersions2.isActive)} = ${strategy.booleanLiteral(true)}
|
|
2044
2049
|
WHERE ${schemaVersions2.graphId} = ${graphId}
|
|
2045
2050
|
AND ${schemaVersions2.version} = ${version}
|
|
2046
2051
|
`;
|
|
@@ -2058,22 +2063,22 @@ function buildInsertUniqueSqlite(tables3, params) {
|
|
|
2058
2063
|
)
|
|
2059
2064
|
ON CONFLICT (${conflictColumns})
|
|
2060
2065
|
DO UPDATE SET
|
|
2061
|
-
${
|
|
2062
|
-
WHEN ${
|
|
2063
|
-
WHEN ${
|
|
2064
|
-
ELSE ${
|
|
2066
|
+
${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)} = CASE
|
|
2067
|
+
WHEN ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.nodeId}
|
|
2068
|
+
WHEN ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.nodeId}
|
|
2069
|
+
ELSE ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)}
|
|
2065
2070
|
END,
|
|
2066
|
-
${
|
|
2067
|
-
WHEN ${
|
|
2068
|
-
WHEN ${
|
|
2069
|
-
ELSE ${
|
|
2071
|
+
${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.concreteKind)} = CASE
|
|
2072
|
+
WHEN ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.concreteKind}
|
|
2073
|
+
WHEN ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.concreteKind}
|
|
2074
|
+
ELSE ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.concreteKind)}
|
|
2070
2075
|
END,
|
|
2071
|
-
${
|
|
2072
|
-
WHEN ${
|
|
2073
|
-
WHEN ${
|
|
2074
|
-
ELSE ${
|
|
2076
|
+
${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.deletedAt)} = CASE
|
|
2077
|
+
WHEN ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN NULL
|
|
2078
|
+
WHEN ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN NULL
|
|
2079
|
+
ELSE ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.deletedAt)}
|
|
2075
2080
|
END
|
|
2076
|
-
RETURNING ${
|
|
2081
|
+
RETURNING ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)} as node_id
|
|
2077
2082
|
`;
|
|
2078
2083
|
}
|
|
2079
2084
|
function buildInsertUniquePostgres(tables3, params) {
|
|
@@ -2090,22 +2095,22 @@ function buildInsertUniquePostgres(tables3, params) {
|
|
|
2090
2095
|
)
|
|
2091
2096
|
ON CONFLICT (${conflictColumns})
|
|
2092
2097
|
DO UPDATE SET
|
|
2093
|
-
${
|
|
2098
|
+
${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)} = CASE
|
|
2094
2099
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.nodeId}
|
|
2095
2100
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.nodeId}
|
|
2096
2101
|
ELSE ${existingColumn(uniques2.nodeId)}
|
|
2097
2102
|
END,
|
|
2098
|
-
${
|
|
2103
|
+
${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.concreteKind)} = CASE
|
|
2099
2104
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.concreteKind}
|
|
2100
2105
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.concreteKind}
|
|
2101
2106
|
ELSE ${existingColumn(uniques2.concreteKind)}
|
|
2102
2107
|
END,
|
|
2103
|
-
${
|
|
2108
|
+
${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.deletedAt)} = CASE
|
|
2104
2109
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN NULL
|
|
2105
2110
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN NULL
|
|
2106
2111
|
ELSE ${existingColumn(uniques2.deletedAt)}
|
|
2107
2112
|
END
|
|
2108
|
-
RETURNING ${
|
|
2113
|
+
RETURNING ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.nodeId)} as node_id
|
|
2109
2114
|
`;
|
|
2110
2115
|
}
|
|
2111
2116
|
var UNIQUE_INSERT_BUILDERS = {
|
|
@@ -2120,7 +2125,7 @@ function buildDeleteUnique(tables3, params, timestamp2) {
|
|
|
2120
2125
|
const { uniques: uniques2 } = tables3;
|
|
2121
2126
|
return drizzleOrm.sql`
|
|
2122
2127
|
UPDATE ${uniques2}
|
|
2123
|
-
SET ${
|
|
2128
|
+
SET ${chunkV4IQYOQ4_cjs.quotedColumn(uniques2.deletedAt)} = ${timestamp2}
|
|
2124
2129
|
WHERE ${uniques2.graphId} = ${params.graphId}
|
|
2125
2130
|
AND ${uniques2.nodeKind} = ${params.nodeKind}
|
|
2126
2131
|
AND ${uniques2.constraintName} = ${params.constraintName}
|
|
@@ -2346,5 +2351,5 @@ exports.uniques = uniques;
|
|
|
2346
2351
|
exports.vectorSlotFromCreateIndexParams = vectorSlotFromCreateIndexParams;
|
|
2347
2352
|
exports.vectorSlotFromDropIndexParams = vectorSlotFromDropIndexParams;
|
|
2348
2353
|
exports.vectorSlotFromParams = vectorSlotFromParams;
|
|
2349
|
-
//# sourceMappingURL=chunk-
|
|
2350
|
-
//# sourceMappingURL=chunk-
|
|
2354
|
+
//# sourceMappingURL=chunk-CIINW6PS.cjs.map
|
|
2355
|
+
//# sourceMappingURL=chunk-CIINW6PS.cjs.map
|