@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,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkJKRKIEVA_cjs = require('./chunk-JKRKIEVA.cjs');
|
|
4
|
+
var chunkWWVV44DY_cjs = require('./chunk-WWVV44DY.cjs');
|
|
5
5
|
var chunkRP7YITHX_cjs = require('./chunk-RP7YITHX.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkCFNT3ITG_cjs = require('./chunk-CFNT3ITG.cjs');
|
|
7
7
|
var chunk73KASJGO_cjs = require('./chunk-73KASJGO.cjs');
|
|
8
8
|
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
9
9
|
var drizzleOrm = require('drizzle-orm');
|
|
@@ -57,7 +57,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
57
57
|
),
|
|
58
58
|
pgCore.index(`${n.nodes}_deleted_idx`).on(t.graphId, t.deletedAt),
|
|
59
59
|
pgCore.index(`${n.nodes}_valid_idx`).on(t.graphId, t.validFrom, t.validTo),
|
|
60
|
-
...
|
|
60
|
+
...chunkWWVV44DY_cjs.buildPostgresNodeIndexBuilders(t, indexes)
|
|
61
61
|
]
|
|
62
62
|
);
|
|
63
63
|
const edges2 = pgCore.pgTable(
|
|
@@ -116,7 +116,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
116
116
|
t.fromId,
|
|
117
117
|
t.validTo
|
|
118
118
|
),
|
|
119
|
-
...
|
|
119
|
+
...chunkWWVV44DY_cjs.buildPostgresEdgeIndexBuilders(t, indexes)
|
|
120
120
|
]
|
|
121
121
|
);
|
|
122
122
|
const uniques2 = pgCore.pgTable(
|
|
@@ -387,13 +387,13 @@ function isSqliteTable(value) {
|
|
|
387
387
|
function runtimeStrategyContributions(fulltextStrategy, fulltextTableName) {
|
|
388
388
|
return fulltextStrategy.ownedTables(fulltextTableName).filter((contribution) => contribution.runtimeEnsure);
|
|
389
389
|
}
|
|
390
|
-
function sqliteContributions(tables3 =
|
|
390
|
+
function sqliteContributions(tables3 = chunkJKRKIEVA_cjs.tables, fulltextStrategy = chunkCFNT3ITG_cjs.fts5Strategy) {
|
|
391
391
|
const contributions = [];
|
|
392
392
|
for (const [key, table] of Object.entries(tables3)) {
|
|
393
393
|
if (!isSqliteTable(table)) continue;
|
|
394
394
|
contributions.push({
|
|
395
395
|
logicalName: key,
|
|
396
|
-
owner:
|
|
396
|
+
owner: chunkCFNT3ITG_cjs.BASE_CONTRIBUTION_OWNER,
|
|
397
397
|
tableName: sqliteCore.getTableConfig(table).name,
|
|
398
398
|
createDdl: [
|
|
399
399
|
generateSqliteCreateTableSQL(table),
|
|
@@ -409,12 +409,12 @@ function sqliteContributions(tables3 = chunk54JVNOAQ_cjs.tables, fulltextStrateg
|
|
|
409
409
|
}
|
|
410
410
|
return contributions;
|
|
411
411
|
}
|
|
412
|
-
function generateSqliteDDL(tables3 =
|
|
412
|
+
function generateSqliteDDL(tables3 = chunkJKRKIEVA_cjs.tables, fulltextStrategy = chunkCFNT3ITG_cjs.fts5Strategy) {
|
|
413
413
|
return sqliteContributions(tables3, fulltextStrategy).flatMap(
|
|
414
414
|
(contribution) => [...contribution.createDdl]
|
|
415
415
|
);
|
|
416
416
|
}
|
|
417
|
-
function generateSqliteMigrationSQL(tables3 =
|
|
417
|
+
function generateSqliteMigrationSQL(tables3 = chunkJKRKIEVA_cjs.tables, fulltextStrategy = chunkCFNT3ITG_cjs.fts5Strategy) {
|
|
418
418
|
return generateSqliteDDL(tables3, fulltextStrategy).join("\n\n");
|
|
419
419
|
}
|
|
420
420
|
function getPgColumnType(column) {
|
|
@@ -496,14 +496,14 @@ function generatePgCreateIndexSQL(table) {
|
|
|
496
496
|
function isPgTable(value) {
|
|
497
497
|
return drizzleOrm.is(value, pgCore.PgTable);
|
|
498
498
|
}
|
|
499
|
-
function postgresContributions(tables3 = tables2, fulltextStrategy =
|
|
499
|
+
function postgresContributions(tables3 = tables2, fulltextStrategy = chunkCFNT3ITG_cjs.tsvectorStrategy) {
|
|
500
500
|
const contributions = [];
|
|
501
501
|
for (const [key, table] of Object.entries(tables3)) {
|
|
502
502
|
if (!isPgTable(table)) continue;
|
|
503
503
|
if (table === tables3.fulltext) continue;
|
|
504
504
|
contributions.push({
|
|
505
505
|
logicalName: key,
|
|
506
|
-
owner:
|
|
506
|
+
owner: chunkCFNT3ITG_cjs.BASE_CONTRIBUTION_OWNER,
|
|
507
507
|
tableName: pgCore.getTableConfig(table).name,
|
|
508
508
|
createDdl: [
|
|
509
509
|
generatePgCreateTableSQL(table),
|
|
@@ -519,12 +519,12 @@ function postgresContributions(tables3 = tables2, fulltextStrategy = chunkV4IQYO
|
|
|
519
519
|
}
|
|
520
520
|
return contributions;
|
|
521
521
|
}
|
|
522
|
-
function generatePostgresDDL(tables3 = tables2, fulltextStrategy =
|
|
522
|
+
function generatePostgresDDL(tables3 = tables2, fulltextStrategy = chunkCFNT3ITG_cjs.tsvectorStrategy) {
|
|
523
523
|
return postgresContributions(tables3, fulltextStrategy).flatMap(
|
|
524
524
|
(contribution) => [...contribution.createDdl]
|
|
525
525
|
);
|
|
526
526
|
}
|
|
527
|
-
function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy =
|
|
527
|
+
function generatePostgresMigrationSQL(tables3 = tables2, fulltextStrategy = chunkCFNT3ITG_cjs.tsvectorStrategy) {
|
|
528
528
|
const extensionSql = "-- Enable pgvector extension for vector similarity search\nCREATE EXTENSION IF NOT EXISTS vector;";
|
|
529
529
|
const ddlSql = generatePostgresDDL(tables3, fulltextStrategy).join("\n\n");
|
|
530
530
|
return `${extensionSql}
|
|
@@ -1461,7 +1461,7 @@ function createCommonOperationBackend(options) {
|
|
|
1461
1461
|
};
|
|
1462
1462
|
}
|
|
1463
1463
|
function buildClearGraph(tables3, graphId) {
|
|
1464
|
-
const fulltext2 =
|
|
1464
|
+
const fulltext2 = chunkCFNT3ITG_cjs.quotedTableName(tables3.fulltextTableName);
|
|
1465
1465
|
return [
|
|
1466
1466
|
drizzleOrm.sql`DELETE FROM ${fulltext2} WHERE "graph_id" = ${graphId}`,
|
|
1467
1467
|
drizzleOrm.sql`DELETE FROM ${tables3.uniques} WHERE ${tables3.uniques.graphId} = ${graphId}`,
|
|
@@ -1614,13 +1614,13 @@ function buildCountEdgesByKind(tables3, params) {
|
|
|
1614
1614
|
function buildInsertEdge(tables3, params, timestamp2) {
|
|
1615
1615
|
const { edges: edges2 } = tables3;
|
|
1616
1616
|
const propsJson = JSON.stringify(params.props);
|
|
1617
|
-
const columns =
|
|
1617
|
+
const columns = chunkCFNT3ITG_cjs.edgeColumnList(edges2);
|
|
1618
1618
|
return drizzleOrm.sql`
|
|
1619
1619
|
INSERT INTO ${edges2} (${columns})
|
|
1620
1620
|
VALUES (
|
|
1621
1621
|
${params.graphId}, ${params.id}, ${params.kind},
|
|
1622
1622
|
${params.fromKind}, ${params.fromId}, ${params.toKind}, ${params.toId},
|
|
1623
|
-
${propsJson}, ${
|
|
1623
|
+
${propsJson}, ${chunkCFNT3ITG_cjs.sqlNull(params.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(params.validTo)},
|
|
1624
1624
|
${timestamp2}, ${timestamp2}
|
|
1625
1625
|
)
|
|
1626
1626
|
RETURNING *
|
|
@@ -1629,23 +1629,23 @@ function buildInsertEdge(tables3, params, timestamp2) {
|
|
|
1629
1629
|
function buildInsertEdgeNoReturn(tables3, params, timestamp2) {
|
|
1630
1630
|
const { edges: edges2 } = tables3;
|
|
1631
1631
|
const propsJson = JSON.stringify(params.props);
|
|
1632
|
-
const columns =
|
|
1632
|
+
const columns = chunkCFNT3ITG_cjs.edgeColumnList(edges2);
|
|
1633
1633
|
return drizzleOrm.sql`
|
|
1634
1634
|
INSERT INTO ${edges2} (${columns})
|
|
1635
1635
|
VALUES (
|
|
1636
1636
|
${params.graphId}, ${params.id}, ${params.kind},
|
|
1637
1637
|
${params.fromKind}, ${params.fromId}, ${params.toKind}, ${params.toId},
|
|
1638
|
-
${propsJson}, ${
|
|
1638
|
+
${propsJson}, ${chunkCFNT3ITG_cjs.sqlNull(params.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(params.validTo)},
|
|
1639
1639
|
${timestamp2}, ${timestamp2}
|
|
1640
1640
|
)
|
|
1641
1641
|
`;
|
|
1642
1642
|
}
|
|
1643
1643
|
function buildInsertEdgesBatch(tables3, params, timestamp2) {
|
|
1644
1644
|
const { edges: edges2 } = tables3;
|
|
1645
|
-
const columns =
|
|
1645
|
+
const columns = chunkCFNT3ITG_cjs.edgeColumnList(edges2);
|
|
1646
1646
|
const values = params.map((edgeParams) => {
|
|
1647
1647
|
const propsJson = JSON.stringify(edgeParams.props);
|
|
1648
|
-
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}, ${chunkCFNT3ITG_cjs.sqlNull(edgeParams.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(edgeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1649
1649
|
});
|
|
1650
1650
|
return drizzleOrm.sql`
|
|
1651
1651
|
INSERT INTO ${edges2} (${columns})
|
|
@@ -1654,10 +1654,10 @@ function buildInsertEdgesBatch(tables3, params, timestamp2) {
|
|
|
1654
1654
|
}
|
|
1655
1655
|
function buildInsertEdgesBatchReturning(tables3, params, timestamp2) {
|
|
1656
1656
|
const { edges: edges2 } = tables3;
|
|
1657
|
-
const columns =
|
|
1657
|
+
const columns = chunkCFNT3ITG_cjs.edgeColumnList(edges2);
|
|
1658
1658
|
const values = params.map((edgeParams) => {
|
|
1659
1659
|
const propsJson = JSON.stringify(edgeParams.props);
|
|
1660
|
-
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}, ${chunkCFNT3ITG_cjs.sqlNull(edgeParams.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(edgeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1661
1661
|
});
|
|
1662
1662
|
return drizzleOrm.sql`
|
|
1663
1663
|
INSERT INTO ${edges2} (${columns})
|
|
@@ -1689,14 +1689,14 @@ function buildUpdateEdge(tables3, params, timestamp2) {
|
|
|
1689
1689
|
const { edges: edges2 } = tables3;
|
|
1690
1690
|
const propsJson = JSON.stringify(params.props);
|
|
1691
1691
|
const setParts = [
|
|
1692
|
-
drizzleOrm.sql`${
|
|
1693
|
-
drizzleOrm.sql`${
|
|
1692
|
+
drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(edges2.props)} = ${propsJson}`,
|
|
1693
|
+
drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(edges2.updatedAt)} = ${timestamp2}`
|
|
1694
1694
|
];
|
|
1695
1695
|
if (params.validTo !== void 0) {
|
|
1696
|
-
setParts.push(drizzleOrm.sql`${
|
|
1696
|
+
setParts.push(drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(edges2.validTo)} = ${params.validTo}`);
|
|
1697
1697
|
}
|
|
1698
1698
|
if (params.clearDeleted) {
|
|
1699
|
-
setParts.push(drizzleOrm.sql`${
|
|
1699
|
+
setParts.push(drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(edges2.deletedAt)} = NULL`);
|
|
1700
1700
|
}
|
|
1701
1701
|
const setClause = drizzleOrm.sql.join(setParts, drizzleOrm.sql`, `);
|
|
1702
1702
|
if (params.clearDeleted) {
|
|
@@ -1721,7 +1721,7 @@ function buildDeleteEdge(tables3, params, timestamp2) {
|
|
|
1721
1721
|
const { edges: edges2 } = tables3;
|
|
1722
1722
|
return drizzleOrm.sql`
|
|
1723
1723
|
UPDATE ${edges2}
|
|
1724
|
-
SET ${
|
|
1724
|
+
SET ${chunkCFNT3ITG_cjs.quotedColumn(edges2.deletedAt)} = ${timestamp2}
|
|
1725
1725
|
WHERE ${edges2.graphId} = ${params.graphId}
|
|
1726
1726
|
AND ${edges2.id} = ${params.id}
|
|
1727
1727
|
AND ${edges2.deletedAt} IS NULL
|
|
@@ -1808,7 +1808,7 @@ function resolveMode(mode) {
|
|
|
1808
1808
|
function buildFulltextSearch(tableName, params, strategy) {
|
|
1809
1809
|
assertValidSearchParams(params);
|
|
1810
1810
|
const mode = resolveMode(params.mode);
|
|
1811
|
-
const table =
|
|
1811
|
+
const table = chunkCFNT3ITG_cjs.quotedTableName(tableName);
|
|
1812
1812
|
const matchCondition = strategy.matchCondition(
|
|
1813
1813
|
tableName,
|
|
1814
1814
|
params.query,
|
|
@@ -1859,12 +1859,12 @@ function assertValidSearchParams(params) {
|
|
|
1859
1859
|
function buildInsertNode(tables3, params, timestamp2) {
|
|
1860
1860
|
const { nodes: nodes2 } = tables3;
|
|
1861
1861
|
const propsJson = JSON.stringify(params.props);
|
|
1862
|
-
const columns =
|
|
1862
|
+
const columns = chunkCFNT3ITG_cjs.nodeColumnList(nodes2);
|
|
1863
1863
|
return drizzleOrm.sql`
|
|
1864
1864
|
INSERT INTO ${nodes2} (${columns})
|
|
1865
1865
|
VALUES (
|
|
1866
1866
|
${params.graphId}, ${params.kind}, ${params.id}, ${propsJson},
|
|
1867
|
-
1, ${
|
|
1867
|
+
1, ${chunkCFNT3ITG_cjs.sqlNull(params.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(params.validTo)},
|
|
1868
1868
|
${timestamp2}, ${timestamp2}
|
|
1869
1869
|
)
|
|
1870
1870
|
RETURNING *
|
|
@@ -1873,22 +1873,22 @@ function buildInsertNode(tables3, params, timestamp2) {
|
|
|
1873
1873
|
function buildInsertNodeNoReturn(tables3, params, timestamp2) {
|
|
1874
1874
|
const { nodes: nodes2 } = tables3;
|
|
1875
1875
|
const propsJson = JSON.stringify(params.props);
|
|
1876
|
-
const columns =
|
|
1876
|
+
const columns = chunkCFNT3ITG_cjs.nodeColumnList(nodes2);
|
|
1877
1877
|
return drizzleOrm.sql`
|
|
1878
1878
|
INSERT INTO ${nodes2} (${columns})
|
|
1879
1879
|
VALUES (
|
|
1880
1880
|
${params.graphId}, ${params.kind}, ${params.id}, ${propsJson},
|
|
1881
|
-
1, ${
|
|
1881
|
+
1, ${chunkCFNT3ITG_cjs.sqlNull(params.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(params.validTo)},
|
|
1882
1882
|
${timestamp2}, ${timestamp2}
|
|
1883
1883
|
)
|
|
1884
1884
|
`;
|
|
1885
1885
|
}
|
|
1886
1886
|
function buildInsertNodesBatch(tables3, params, timestamp2) {
|
|
1887
1887
|
const { nodes: nodes2 } = tables3;
|
|
1888
|
-
const columns =
|
|
1888
|
+
const columns = chunkCFNT3ITG_cjs.nodeColumnList(nodes2);
|
|
1889
1889
|
const values = params.map((nodeParams) => {
|
|
1890
1890
|
const propsJson = JSON.stringify(nodeParams.props);
|
|
1891
|
-
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${
|
|
1891
|
+
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${chunkCFNT3ITG_cjs.sqlNull(nodeParams.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(nodeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1892
1892
|
});
|
|
1893
1893
|
return drizzleOrm.sql`
|
|
1894
1894
|
INSERT INTO ${nodes2} (${columns})
|
|
@@ -1897,10 +1897,10 @@ function buildInsertNodesBatch(tables3, params, timestamp2) {
|
|
|
1897
1897
|
}
|
|
1898
1898
|
function buildInsertNodesBatchReturning(tables3, params, timestamp2) {
|
|
1899
1899
|
const { nodes: nodes2 } = tables3;
|
|
1900
|
-
const columns =
|
|
1900
|
+
const columns = chunkCFNT3ITG_cjs.nodeColumnList(nodes2);
|
|
1901
1901
|
const values = params.map((nodeParams) => {
|
|
1902
1902
|
const propsJson = JSON.stringify(nodeParams.props);
|
|
1903
|
-
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${
|
|
1903
|
+
return drizzleOrm.sql`(${nodeParams.graphId}, ${nodeParams.kind}, ${nodeParams.id}, ${propsJson}, 1, ${chunkCFNT3ITG_cjs.sqlNull(nodeParams.validFrom)}, ${chunkCFNT3ITG_cjs.sqlNull(nodeParams.validTo)}, ${timestamp2}, ${timestamp2})`;
|
|
1904
1904
|
});
|
|
1905
1905
|
return drizzleOrm.sql`
|
|
1906
1906
|
INSERT INTO ${nodes2} (${columns})
|
|
@@ -1934,19 +1934,19 @@ function buildUpdateNode(tables3, params, timestamp2) {
|
|
|
1934
1934
|
const { nodes: nodes2 } = tables3;
|
|
1935
1935
|
const propsJson = JSON.stringify(params.props);
|
|
1936
1936
|
const setParts = [
|
|
1937
|
-
drizzleOrm.sql`${
|
|
1938
|
-
drizzleOrm.sql`${
|
|
1937
|
+
drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(nodes2.props)} = ${propsJson}`,
|
|
1938
|
+
drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(nodes2.updatedAt)} = ${timestamp2}`
|
|
1939
1939
|
];
|
|
1940
1940
|
if (params.incrementVersion) {
|
|
1941
1941
|
setParts.push(
|
|
1942
|
-
drizzleOrm.sql`${
|
|
1942
|
+
drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(nodes2.version)} = ${chunkCFNT3ITG_cjs.quotedColumn(nodes2.version)} + 1`
|
|
1943
1943
|
);
|
|
1944
1944
|
}
|
|
1945
1945
|
if (params.validTo !== void 0) {
|
|
1946
|
-
setParts.push(drizzleOrm.sql`${
|
|
1946
|
+
setParts.push(drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(nodes2.validTo)} = ${params.validTo}`);
|
|
1947
1947
|
}
|
|
1948
1948
|
if (params.clearDeleted) {
|
|
1949
|
-
setParts.push(drizzleOrm.sql`${
|
|
1949
|
+
setParts.push(drizzleOrm.sql`${chunkCFNT3ITG_cjs.quotedColumn(nodes2.deletedAt)} = NULL`);
|
|
1950
1950
|
}
|
|
1951
1951
|
const setClause = drizzleOrm.sql.join(setParts, drizzleOrm.sql`, `);
|
|
1952
1952
|
if (params.clearDeleted) {
|
|
@@ -1973,7 +1973,7 @@ function buildDeleteNode(tables3, params, timestamp2) {
|
|
|
1973
1973
|
const { nodes: nodes2 } = tables3;
|
|
1974
1974
|
return drizzleOrm.sql`
|
|
1975
1975
|
UPDATE ${nodes2}
|
|
1976
|
-
SET ${
|
|
1976
|
+
SET ${chunkCFNT3ITG_cjs.quotedColumn(nodes2.deletedAt)} = ${timestamp2}
|
|
1977
1977
|
WHERE ${nodes2.graphId} = ${params.graphId}
|
|
1978
1978
|
AND ${nodes2.kind} = ${params.kind}
|
|
1979
1979
|
AND ${nodes2.id} = ${params.id}
|
|
@@ -2040,12 +2040,12 @@ function buildSetActiveSchema(tables3, graphId, version, dialect = "sqlite") {
|
|
|
2040
2040
|
const strategy = SCHEMA_DIALECT_STRATEGIES[dialect];
|
|
2041
2041
|
const deactivateAll = drizzleOrm.sql`
|
|
2042
2042
|
UPDATE ${schemaVersions2}
|
|
2043
|
-
SET ${
|
|
2043
|
+
SET ${chunkCFNT3ITG_cjs.quotedColumn(schemaVersions2.isActive)} = ${strategy.booleanLiteral(false)}
|
|
2044
2044
|
WHERE ${schemaVersions2.graphId} = ${graphId}
|
|
2045
2045
|
`;
|
|
2046
2046
|
const activateVersion = drizzleOrm.sql`
|
|
2047
2047
|
UPDATE ${schemaVersions2}
|
|
2048
|
-
SET ${
|
|
2048
|
+
SET ${chunkCFNT3ITG_cjs.quotedColumn(schemaVersions2.isActive)} = ${strategy.booleanLiteral(true)}
|
|
2049
2049
|
WHERE ${schemaVersions2.graphId} = ${graphId}
|
|
2050
2050
|
AND ${schemaVersions2.version} = ${version}
|
|
2051
2051
|
`;
|
|
@@ -2063,22 +2063,22 @@ function buildInsertUniqueSqlite(tables3, params) {
|
|
|
2063
2063
|
)
|
|
2064
2064
|
ON CONFLICT (${conflictColumns})
|
|
2065
2065
|
DO UPDATE SET
|
|
2066
|
-
${
|
|
2067
|
-
WHEN ${
|
|
2068
|
-
WHEN ${
|
|
2069
|
-
ELSE ${
|
|
2066
|
+
${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)} = CASE
|
|
2067
|
+
WHEN ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.nodeId}
|
|
2068
|
+
WHEN ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.nodeId}
|
|
2069
|
+
ELSE ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)}
|
|
2070
2070
|
END,
|
|
2071
|
-
${
|
|
2072
|
-
WHEN ${
|
|
2073
|
-
WHEN ${
|
|
2074
|
-
ELSE ${
|
|
2071
|
+
${chunkCFNT3ITG_cjs.quotedColumn(uniques2.concreteKind)} = CASE
|
|
2072
|
+
WHEN ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.concreteKind}
|
|
2073
|
+
WHEN ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.concreteKind}
|
|
2074
|
+
ELSE ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.concreteKind)}
|
|
2075
2075
|
END,
|
|
2076
|
-
${
|
|
2077
|
-
WHEN ${
|
|
2078
|
-
WHEN ${
|
|
2079
|
-
ELSE ${
|
|
2076
|
+
${chunkCFNT3ITG_cjs.quotedColumn(uniques2.deletedAt)} = CASE
|
|
2077
|
+
WHEN ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)} = ${params.nodeId} THEN NULL
|
|
2078
|
+
WHEN ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.deletedAt)} IS NOT NULL THEN NULL
|
|
2079
|
+
ELSE ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.deletedAt)}
|
|
2080
2080
|
END
|
|
2081
|
-
RETURNING ${
|
|
2081
|
+
RETURNING ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)} as node_id
|
|
2082
2082
|
`;
|
|
2083
2083
|
}
|
|
2084
2084
|
function buildInsertUniquePostgres(tables3, params) {
|
|
@@ -2095,22 +2095,22 @@ function buildInsertUniquePostgres(tables3, params) {
|
|
|
2095
2095
|
)
|
|
2096
2096
|
ON CONFLICT (${conflictColumns})
|
|
2097
2097
|
DO UPDATE SET
|
|
2098
|
-
${
|
|
2098
|
+
${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)} = CASE
|
|
2099
2099
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.nodeId}
|
|
2100
2100
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.nodeId}
|
|
2101
2101
|
ELSE ${existingColumn(uniques2.nodeId)}
|
|
2102
2102
|
END,
|
|
2103
|
-
${
|
|
2103
|
+
${chunkCFNT3ITG_cjs.quotedColumn(uniques2.concreteKind)} = CASE
|
|
2104
2104
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN ${params.concreteKind}
|
|
2105
2105
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN ${params.concreteKind}
|
|
2106
2106
|
ELSE ${existingColumn(uniques2.concreteKind)}
|
|
2107
2107
|
END,
|
|
2108
|
-
${
|
|
2108
|
+
${chunkCFNT3ITG_cjs.quotedColumn(uniques2.deletedAt)} = CASE
|
|
2109
2109
|
WHEN ${existingColumn(uniques2.nodeId)} = ${params.nodeId} THEN NULL
|
|
2110
2110
|
WHEN ${existingColumn(uniques2.deletedAt)} IS NOT NULL THEN NULL
|
|
2111
2111
|
ELSE ${existingColumn(uniques2.deletedAt)}
|
|
2112
2112
|
END
|
|
2113
|
-
RETURNING ${
|
|
2113
|
+
RETURNING ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.nodeId)} as node_id
|
|
2114
2114
|
`;
|
|
2115
2115
|
}
|
|
2116
2116
|
var UNIQUE_INSERT_BUILDERS = {
|
|
@@ -2125,7 +2125,7 @@ function buildDeleteUnique(tables3, params, timestamp2) {
|
|
|
2125
2125
|
const { uniques: uniques2 } = tables3;
|
|
2126
2126
|
return drizzleOrm.sql`
|
|
2127
2127
|
UPDATE ${uniques2}
|
|
2128
|
-
SET ${
|
|
2128
|
+
SET ${chunkCFNT3ITG_cjs.quotedColumn(uniques2.deletedAt)} = ${timestamp2}
|
|
2129
2129
|
WHERE ${uniques2.graphId} = ${params.graphId}
|
|
2130
2130
|
AND ${uniques2.nodeKind} = ${params.nodeKind}
|
|
2131
2131
|
AND ${uniques2.constraintName} = ${params.constraintName}
|
|
@@ -2351,5 +2351,5 @@ exports.uniques = uniques;
|
|
|
2351
2351
|
exports.vectorSlotFromCreateIndexParams = vectorSlotFromCreateIndexParams;
|
|
2352
2352
|
exports.vectorSlotFromDropIndexParams = vectorSlotFromDropIndexParams;
|
|
2353
2353
|
exports.vectorSlotFromParams = vectorSlotFromParams;
|
|
2354
|
-
//# sourceMappingURL=chunk-
|
|
2355
|
-
//# sourceMappingURL=chunk-
|
|
2354
|
+
//# sourceMappingURL=chunk-3HQDMOBK.cjs.map
|
|
2355
|
+
//# sourceMappingURL=chunk-3HQDMOBK.cjs.map
|