@nicia-ai/typegraph 0.3.1 → 0.4.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/drizzle/index.cjs +6 -6
- package/dist/backend/drizzle/index.d.cts +1 -1
- package/dist/backend/drizzle/index.d.ts +1 -1
- package/dist/backend/drizzle/index.js +4 -4
- package/dist/backend/drizzle/postgres.cjs +4 -4
- package/dist/backend/drizzle/postgres.d.cts +1 -1
- package/dist/backend/drizzle/postgres.d.ts +1 -1
- package/dist/backend/drizzle/postgres.js +3 -3
- package/dist/backend/drizzle/sqlite.cjs +4 -4
- package/dist/backend/drizzle/sqlite.d.cts +1 -1
- package/dist/backend/drizzle/sqlite.d.ts +1 -1
- package/dist/backend/drizzle/sqlite.js +3 -3
- package/dist/backend/postgres/index.cjs +4 -4
- package/dist/backend/postgres/index.d.cts +1 -1
- package/dist/backend/postgres/index.d.ts +1 -1
- package/dist/backend/postgres/index.js +3 -3
- package/dist/backend/sqlite/index.cjs +6 -6
- package/dist/backend/sqlite/index.d.cts +1 -1
- package/dist/backend/sqlite/index.d.ts +1 -1
- package/dist/backend/sqlite/index.js +4 -4
- package/dist/{chunk-OYL2SGBD.cjs → chunk-44SXEVF4.cjs} +18 -2
- package/dist/chunk-44SXEVF4.cjs.map +1 -0
- package/dist/{chunk-SFY2PPOY.cjs → chunk-7RVSDXT3.cjs} +50 -10
- package/dist/chunk-7RVSDXT3.cjs.map +1 -0
- package/dist/{chunk-ZJHQZZT2.cjs → chunk-K2ROKOK3.cjs} +6 -6
- package/dist/{chunk-ZJHQZZT2.cjs.map → chunk-K2ROKOK3.cjs.map} +1 -1
- package/dist/{chunk-DD6ONEBN.cjs → chunk-LDM2AFKZ.cjs} +12 -12
- package/dist/{chunk-DD6ONEBN.cjs.map → chunk-LDM2AFKZ.cjs.map} +1 -1
- package/dist/{chunk-F23W4W3A.cjs → chunk-LUARLSYT.cjs} +18 -18
- package/dist/{chunk-F23W4W3A.cjs.map → chunk-LUARLSYT.cjs.map} +1 -1
- package/dist/{chunk-NP4G4ZKM.js → chunk-M5SOQ7UV.js} +4 -4
- package/dist/{chunk-NP4G4ZKM.js.map → chunk-M5SOQ7UV.js.map} +1 -1
- package/dist/{chunk-CMHFS34N.cjs → chunk-NYDXJGA3.cjs} +16 -16
- package/dist/{chunk-CMHFS34N.cjs.map → chunk-NYDXJGA3.cjs.map} +1 -1
- package/dist/{chunk-46YY2FRV.js → chunk-Q6PXIKRQ.js} +3 -3
- package/dist/{chunk-46YY2FRV.js.map → chunk-Q6PXIKRQ.js.map} +1 -1
- package/dist/{chunk-O5XPCJLF.js → chunk-SJ2QMDXY.js} +18 -3
- package/dist/chunk-SJ2QMDXY.js.map +1 -0
- package/dist/{chunk-XDTYTNYL.js → chunk-TGDFBLGS.js} +3 -3
- package/dist/{chunk-XDTYTNYL.js.map → chunk-TGDFBLGS.js.map} +1 -1
- package/dist/{chunk-F2BZSEFE.js → chunk-ZO2FRJ2U.js} +4 -4
- package/dist/{chunk-F2BZSEFE.js.map → chunk-ZO2FRJ2U.js.map} +1 -1
- package/dist/{chunk-4HARSV2G.js → chunk-ZQGOBVXZ.js} +43 -3
- package/dist/chunk-ZQGOBVXZ.js.map +1 -0
- package/dist/{index-Dkicw49A.d.ts → index-DyrR_d-H.d.cts} +9 -1
- package/dist/{index-Dkicw49A.d.cts → index-DyrR_d-H.d.ts} +9 -1
- package/dist/index.cjs +893 -218
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +687 -16
- package/dist/index.js.map +1 -1
- package/dist/interchange/index.cjs +7 -7
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/interchange/index.js +2 -2
- package/dist/{manager-Jc5Btay9.d.cts → manager-0NysX4s6.d.cts} +1 -1
- package/dist/{manager-e9LXthrx.d.ts → manager-DFKe7ql3.d.ts} +1 -1
- package/dist/profiler/index.d.cts +3 -3
- package/dist/profiler/index.d.ts +3 -3
- package/dist/schema/index.cjs +22 -22
- package/dist/schema/index.d.cts +5 -5
- package/dist/schema/index.d.ts +5 -5
- package/dist/schema/index.js +4 -4
- package/dist/{store-nbBybLWP.d.cts → store-DhoA5uRc.d.cts} +93 -7
- package/dist/{store-DM3Tk3Pw.d.ts → store-SiovWEYA.d.ts} +93 -7
- package/dist/{types-Cdbi4hcx.d.ts → types-6EKrWTs9.d.ts} +14 -0
- package/dist/{types-DDP0MGBF.d.cts → types-BUy-pHKH.d.cts} +14 -0
- package/package.json +2 -2
- package/dist/chunk-4HARSV2G.js.map +0 -1
- package/dist/chunk-O5XPCJLF.js.map +0 -1
- package/dist/chunk-OYL2SGBD.cjs.map +0 -1
- package/dist/chunk-SFY2PPOY.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
3
|
+
var chunkNYDXJGA3_cjs = require('../../chunk-NYDXJGA3.cjs');
|
|
4
|
+
var chunkLUARLSYT_cjs = require('../../chunk-LUARLSYT.cjs');
|
|
5
|
+
require('../../chunk-7RVSDXT3.cjs');
|
|
6
6
|
var chunkXZL6MCZJ_cjs = require('../../chunk-XZL6MCZJ.cjs');
|
|
7
7
|
var chunkNU2XNMVI_cjs = require('../../chunk-NU2XNMVI.cjs');
|
|
8
|
-
require('../../chunk-
|
|
8
|
+
require('../../chunk-44SXEVF4.cjs');
|
|
9
9
|
require('../../chunk-JQDWEX6V.cjs');
|
|
10
10
|
require('../../chunk-2WVFEIHR.cjs');
|
|
11
11
|
require('../../chunk-P5CNM325.cjs');
|
|
@@ -14,11 +14,11 @@ require('../../chunk-P5CNM325.cjs');
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "createSqliteBackend", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkNYDXJGA3_cjs.createSqliteBackend; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "createPostgresBackend", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkLUARLSYT_cjs.createPostgresBackend; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "createSqliteTables", {
|
|
24
24
|
enumerable: true,
|
|
@@ -2,7 +2,7 @@ export { SqliteBackendOptions, createSqliteBackend } from './sqlite.cjs';
|
|
|
2
2
|
export { PostgresBackendOptions, createPostgresBackend } from './postgres.cjs';
|
|
3
3
|
export { PostgresTables, createPostgresTables, tables as postgresTables } from './schema/postgres.cjs';
|
|
4
4
|
export { SqliteTables, createSqliteTables, tables as sqliteTables } from './schema/sqlite.cjs';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-BUy-pHKH.cjs';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
7
|
import '../../types-DTJEu_-h.cjs';
|
|
8
8
|
import 'zod';
|
|
@@ -2,7 +2,7 @@ export { SqliteBackendOptions, createSqliteBackend } from './sqlite.js';
|
|
|
2
2
|
export { PostgresBackendOptions, createPostgresBackend } from './postgres.js';
|
|
3
3
|
export { PostgresTables, createPostgresTables, tables as postgresTables } from './schema/postgres.js';
|
|
4
4
|
export { SqliteTables, createSqliteTables, tables as sqliteTables } from './schema/sqlite.js';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-6EKrWTs9.js';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
7
|
import '../../types-DTJEu_-h.js';
|
|
8
8
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { createSqliteBackend } from '../../chunk-
|
|
2
|
-
export { createPostgresBackend } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
1
|
+
export { createSqliteBackend } from '../../chunk-ZO2FRJ2U.js';
|
|
2
|
+
export { createPostgresBackend } from '../../chunk-Q6PXIKRQ.js';
|
|
3
|
+
import '../../chunk-ZQGOBVXZ.js';
|
|
4
4
|
export { createSqliteTables, tables as sqliteTables } from '../../chunk-OGGLFYFA.js';
|
|
5
5
|
export { createPostgresTables, tables as postgresTables } from '../../chunk-3PURVEA4.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-SJ2QMDXY.js';
|
|
7
7
|
import '../../chunk-U3452TEU.js';
|
|
8
8
|
import '../../chunk-54WJF3DW.js';
|
|
9
9
|
import '../../chunk-K7SQ3SWP.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var chunkLUARLSYT_cjs = require('../../chunk-LUARLSYT.cjs');
|
|
4
|
+
require('../../chunk-7RVSDXT3.cjs');
|
|
5
5
|
var chunkNU2XNMVI_cjs = require('../../chunk-NU2XNMVI.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-44SXEVF4.cjs');
|
|
7
7
|
require('../../chunk-JQDWEX6V.cjs');
|
|
8
8
|
require('../../chunk-2WVFEIHR.cjs');
|
|
9
9
|
require('../../chunk-P5CNM325.cjs');
|
|
@@ -12,7 +12,7 @@ require('../../chunk-P5CNM325.cjs');
|
|
|
12
12
|
|
|
13
13
|
Object.defineProperty(exports, "createPostgresBackend", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkLUARLSYT_cjs.createPostgresBackend; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createPostgresTables", {
|
|
18
18
|
enumerable: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GraphBackend } from '../../types-
|
|
1
|
+
import { G as GraphBackend } from '../../types-BUy-pHKH.cjs';
|
|
2
2
|
import { PgDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
3
3
|
import { PostgresTables } from './schema/postgres.cjs';
|
|
4
4
|
export { PostgresTableNames, createPostgresTables, tables } from './schema/postgres.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GraphBackend } from '../../types-
|
|
1
|
+
import { G as GraphBackend } from '../../types-6EKrWTs9.js';
|
|
2
2
|
import { PgDatabase, PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
3
3
|
import { PostgresTables } from './schema/postgres.js';
|
|
4
4
|
export { PostgresTableNames, createPostgresTables, tables } from './schema/postgres.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createPostgresBackend } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { createPostgresBackend } from '../../chunk-Q6PXIKRQ.js';
|
|
2
|
+
import '../../chunk-ZQGOBVXZ.js';
|
|
3
3
|
export { createPostgresTables, tables } from '../../chunk-3PURVEA4.js';
|
|
4
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-SJ2QMDXY.js';
|
|
5
5
|
import '../../chunk-U3452TEU.js';
|
|
6
6
|
import '../../chunk-54WJF3DW.js';
|
|
7
7
|
import '../../chunk-K7SQ3SWP.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var chunkNYDXJGA3_cjs = require('../../chunk-NYDXJGA3.cjs');
|
|
4
|
+
require('../../chunk-7RVSDXT3.cjs');
|
|
5
5
|
var chunkXZL6MCZJ_cjs = require('../../chunk-XZL6MCZJ.cjs');
|
|
6
|
-
require('../../chunk-
|
|
6
|
+
require('../../chunk-44SXEVF4.cjs');
|
|
7
7
|
require('../../chunk-JQDWEX6V.cjs');
|
|
8
8
|
require('../../chunk-2WVFEIHR.cjs');
|
|
9
9
|
require('../../chunk-P5CNM325.cjs');
|
|
@@ -12,7 +12,7 @@ require('../../chunk-P5CNM325.cjs');
|
|
|
12
12
|
|
|
13
13
|
Object.defineProperty(exports, "createSqliteBackend", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkNYDXJGA3_cjs.createSqliteBackend; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createSqliteTables", {
|
|
18
18
|
enumerable: true,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GraphBackend } from '../../types-
|
|
1
|
+
import { G as GraphBackend } from '../../types-BUy-pHKH.cjs';
|
|
2
2
|
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
3
3
|
import { SqliteTables } from './schema/sqlite.cjs';
|
|
4
4
|
export { SqliteTableNames, createSqliteTables, tables } from './schema/sqlite.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GraphBackend } from '../../types-
|
|
1
|
+
import { G as GraphBackend } from '../../types-6EKrWTs9.js';
|
|
2
2
|
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
3
3
|
import { SqliteTables } from './schema/sqlite.js';
|
|
4
4
|
export { SqliteTableNames, createSqliteTables, tables } from './schema/sqlite.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createSqliteBackend } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { createSqliteBackend } from '../../chunk-ZO2FRJ2U.js';
|
|
2
|
+
import '../../chunk-ZQGOBVXZ.js';
|
|
3
3
|
export { createSqliteTables, tables } from '../../chunk-OGGLFYFA.js';
|
|
4
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-SJ2QMDXY.js';
|
|
5
5
|
import '../../chunk-U3452TEU.js';
|
|
6
6
|
import '../../chunk-54WJF3DW.js';
|
|
7
7
|
import '../../chunk-K7SQ3SWP.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkUYMT4LO2_cjs = require('../../chunk-UYMT4LO2.cjs');
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
4
|
+
var chunkLUARLSYT_cjs = require('../../chunk-LUARLSYT.cjs');
|
|
5
|
+
require('../../chunk-7RVSDXT3.cjs');
|
|
6
6
|
require('../../chunk-XZL6MCZJ.cjs');
|
|
7
7
|
var chunkNU2XNMVI_cjs = require('../../chunk-NU2XNMVI.cjs');
|
|
8
|
-
require('../../chunk-
|
|
8
|
+
require('../../chunk-44SXEVF4.cjs');
|
|
9
9
|
require('../../chunk-JQDWEX6V.cjs');
|
|
10
10
|
require('../../chunk-2WVFEIHR.cjs');
|
|
11
11
|
require('../../chunk-P5CNM325.cjs');
|
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "getPostgresMigrationSQL", {
|
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "createPostgresBackend", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkLUARLSYT_cjs.createPostgresBackend; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "createPostgresTables", {
|
|
28
28
|
enumerable: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PostgresBackendOptions, createPostgresBackend } from '../drizzle/postgres.cjs';
|
|
2
2
|
export { PostgresTableNames, PostgresTables, createPostgresTables, edges, embeddings, nodes, schemaVersions, tables, uniques } from '../drizzle/schema/postgres.cjs';
|
|
3
3
|
export { g as generatePostgresDDL, a as getPostgresMigrationSQL } from '../../test-helpers-DPRFVky4.cjs';
|
|
4
|
-
import '../../types-
|
|
4
|
+
import '../../types-BUy-pHKH.cjs';
|
|
5
5
|
import 'drizzle-orm';
|
|
6
6
|
import '../../types-DTJEu_-h.cjs';
|
|
7
7
|
import 'zod';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PostgresBackendOptions, createPostgresBackend } from '../drizzle/postgres.js';
|
|
2
2
|
export { PostgresTableNames, PostgresTables, createPostgresTables, edges, embeddings, nodes, schemaVersions, tables, uniques } from '../drizzle/schema/postgres.js';
|
|
3
3
|
export { g as generatePostgresDDL, a as getPostgresMigrationSQL } from '../../test-helpers-CIq1Hhj1.js';
|
|
4
|
-
import '../../types-
|
|
4
|
+
import '../../types-6EKrWTs9.js';
|
|
5
5
|
import 'drizzle-orm';
|
|
6
6
|
import '../../types-DTJEu_-h.js';
|
|
7
7
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { generatePostgresDDL, getPostgresMigrationSQL } from '../../chunk-SMLIWLS7.js';
|
|
2
|
-
export { createPostgresBackend } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
2
|
+
export { createPostgresBackend } from '../../chunk-Q6PXIKRQ.js';
|
|
3
|
+
import '../../chunk-ZQGOBVXZ.js';
|
|
4
4
|
import '../../chunk-OGGLFYFA.js';
|
|
5
5
|
export { createPostgresTables, edges, embeddings, nodes, schemaVersions, tables, uniques } from '../../chunk-3PURVEA4.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-SJ2QMDXY.js';
|
|
7
7
|
import '../../chunk-U3452TEU.js';
|
|
8
8
|
import '../../chunk-54WJF3DW.js';
|
|
9
9
|
import '../../chunk-K7SQ3SWP.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkUYMT4LO2_cjs = require('../../chunk-UYMT4LO2.cjs');
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
4
|
+
var chunkNYDXJGA3_cjs = require('../../chunk-NYDXJGA3.cjs');
|
|
5
|
+
require('../../chunk-7RVSDXT3.cjs');
|
|
6
6
|
var chunkXZL6MCZJ_cjs = require('../../chunk-XZL6MCZJ.cjs');
|
|
7
7
|
require('../../chunk-NU2XNMVI.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunk44SXEVF4_cjs = require('../../chunk-44SXEVF4.cjs');
|
|
9
9
|
require('../../chunk-JQDWEX6V.cjs');
|
|
10
10
|
require('../../chunk-2WVFEIHR.cjs');
|
|
11
11
|
require('../../chunk-P5CNM325.cjs');
|
|
@@ -37,7 +37,7 @@ function createDatabase(path) {
|
|
|
37
37
|
const message = getUnknownErrorMessage(error);
|
|
38
38
|
const mismatch = parseNodeModuleVersionMismatchMessage(message);
|
|
39
39
|
if (!mismatch) throw error;
|
|
40
|
-
throw new
|
|
40
|
+
throw new chunk44SXEVF4_cjs.ConfigurationError(
|
|
41
41
|
[
|
|
42
42
|
"Failed to load better-sqlite3 native addon.",
|
|
43
43
|
`It was compiled for NODE_MODULE_VERSION ${mismatch.compiled}, but this Node.js runtime requires ${mismatch.required}.`,
|
|
@@ -63,7 +63,7 @@ function createLocalSqliteBackend(options = {}) {
|
|
|
63
63
|
for (const statement of ddlStatements) {
|
|
64
64
|
sqlite.exec(statement);
|
|
65
65
|
}
|
|
66
|
-
const backend =
|
|
66
|
+
const backend = chunkNYDXJGA3_cjs.createSqliteBackend(db, {
|
|
67
67
|
executionProfile: {
|
|
68
68
|
isD1: false,
|
|
69
69
|
isSync: true
|
|
@@ -91,7 +91,7 @@ Object.defineProperty(exports, "getSqliteMigrationSQL", {
|
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "createSqliteBackend", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkNYDXJGA3_cjs.createSqliteBackend; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "createSqliteTables", {
|
|
97
97
|
enumerable: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
2
2
|
export { SqliteBackendOptions, createSqliteBackend } from '../drizzle/sqlite.cjs';
|
|
3
|
-
import { G as GraphBackend } from '../../types-
|
|
3
|
+
import { G as GraphBackend } from '../../types-BUy-pHKH.cjs';
|
|
4
4
|
import { SqliteTables } from '../drizzle/schema/sqlite.cjs';
|
|
5
5
|
export { SqliteTableNames, createSqliteTables, edges, nodes, schemaVersions, tables, uniques } from '../drizzle/schema/sqlite.cjs';
|
|
6
6
|
export { b as generateSqliteDDL, c as getSqliteMigrationSQL } from '../../test-helpers-DPRFVky4.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
2
2
|
export { SqliteBackendOptions, createSqliteBackend } from '../drizzle/sqlite.js';
|
|
3
|
-
import { G as GraphBackend } from '../../types-
|
|
3
|
+
import { G as GraphBackend } from '../../types-6EKrWTs9.js';
|
|
4
4
|
import { SqliteTables } from '../drizzle/schema/sqlite.js';
|
|
5
5
|
export { SqliteTableNames, createSqliteTables, edges, nodes, schemaVersions, tables, uniques } from '../drizzle/schema/sqlite.js';
|
|
6
6
|
export { b as generateSqliteDDL, c as getSqliteMigrationSQL } from '../../test-helpers-CIq1Hhj1.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { generateSqliteDDL } from '../../chunk-SMLIWLS7.js';
|
|
2
2
|
export { generateSqliteDDL, getSqliteMigrationSQL } from '../../chunk-SMLIWLS7.js';
|
|
3
|
-
import { createSqliteBackend } from '../../chunk-
|
|
4
|
-
export { createSqliteBackend } from '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
3
|
+
import { createSqliteBackend } from '../../chunk-ZO2FRJ2U.js';
|
|
4
|
+
export { createSqliteBackend } from '../../chunk-ZO2FRJ2U.js';
|
|
5
|
+
import '../../chunk-ZQGOBVXZ.js';
|
|
6
6
|
import { tables } from '../../chunk-OGGLFYFA.js';
|
|
7
7
|
export { createSqliteTables, edges, nodes, schemaVersions, tables, uniques } from '../../chunk-OGGLFYFA.js';
|
|
8
8
|
import '../../chunk-3PURVEA4.js';
|
|
9
|
-
import { ConfigurationError } from '../../chunk-
|
|
9
|
+
import { ConfigurationError } from '../../chunk-SJ2QMDXY.js';
|
|
10
10
|
import '../../chunk-U3452TEU.js';
|
|
11
11
|
import '../../chunk-54WJF3DW.js';
|
|
12
12
|
import '../../chunk-K7SQ3SWP.js';
|
|
@@ -123,6 +123,21 @@ var KindNotFoundError = class extends TypeGraphError {
|
|
|
123
123
|
this.name = "KindNotFoundError";
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
|
+
var NodeConstraintNotFoundError = class extends TypeGraphError {
|
|
127
|
+
constructor(constraintName, kind, options) {
|
|
128
|
+
super(
|
|
129
|
+
`Constraint not found: "${constraintName}" on node kind "${kind}"`,
|
|
130
|
+
"CONSTRAINT_NOT_FOUND",
|
|
131
|
+
{
|
|
132
|
+
details: { constraintName, kind },
|
|
133
|
+
category: "user",
|
|
134
|
+
suggestion: `Verify the constraint name "${constraintName}" is defined in the unique constraints for "${kind}".`,
|
|
135
|
+
cause: options?.cause
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
this.name = "NodeConstraintNotFoundError";
|
|
139
|
+
}
|
|
140
|
+
};
|
|
126
141
|
var EndpointNotFoundError = class extends TypeGraphError {
|
|
127
142
|
constructor(details, options) {
|
|
128
143
|
super(
|
|
@@ -328,6 +343,7 @@ exports.EndpointError = EndpointError;
|
|
|
328
343
|
exports.EndpointNotFoundError = EndpointNotFoundError;
|
|
329
344
|
exports.KindNotFoundError = KindNotFoundError;
|
|
330
345
|
exports.MigrationError = MigrationError;
|
|
346
|
+
exports.NodeConstraintNotFoundError = NodeConstraintNotFoundError;
|
|
331
347
|
exports.NodeNotFoundError = NodeNotFoundError;
|
|
332
348
|
exports.RestrictedDeleteError = RestrictedDeleteError;
|
|
333
349
|
exports.SchemaMismatchError = SchemaMismatchError;
|
|
@@ -341,5 +357,5 @@ exports.isConstraintError = isConstraintError;
|
|
|
341
357
|
exports.isSystemError = isSystemError;
|
|
342
358
|
exports.isTypeGraphError = isTypeGraphError;
|
|
343
359
|
exports.isUserRecoverable = isUserRecoverable;
|
|
344
|
-
//# sourceMappingURL=chunk-
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
360
|
+
//# sourceMappingURL=chunk-44SXEVF4.cjs.map
|
|
361
|
+
//# sourceMappingURL=chunk-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AU,QAAA;AAAA,MACV,UAAA,EAAY,CAAA,+FAAA,CAAA;AAAA,MACZ,OAAO,OAAA,EAAS;AAAA,KACjB,CAAA;AACD,IAAA,IAAA,CAAK,IAAA,GAAO,wBAAA;AAAA,EACd;AACF;AAoBO,SAAS,iBAAiB,KAAA,EAAyC;AACxE,EAAA,OAAO,KAAA,YAAiB,cAAA;AAC1B;AAmBO,SAAS,kBAAkB,KAAA,EAAyB;AACzD,EAAA,IAAI,CAAC,gBAAA,CAAiB,KAAK,CAAA,EAAG,OAAO,KAAA;AACrC,EAAA,OAAO,KAAA,CAAM,QAAA,KAAa,MAAA,IAAU,KAAA,CAAM,QAAA,KAAa,YAAA;AACzD;AAUO,SAAS,cAAc,KAAA,EAAyB;AACrD,EAAA,OAAO,gBAAA,CAAiB,KAAK,CAAA,IAAK,KAAA,CAAM,QAAA,KAAa,QAAA;AACvD;AAKO,SAAS,kBAAkB,KAAA,EAAyB;AACzD,EAAA,OAAO,gBAAA,CAAiB,KAAK,CAAA,IAAK,KAAA,CAAM,QAAA,KAAa,YAAA;AACvD;AAKO,SAAS,mBAAmB,KAAA,EAAoC;AACrE,EAAA,OAAO,gBAAA,CAAiB,KAAK,CAAA,GAAI,KAAA,CAAM,UAAA,GAAa,MAAA;AACtD","file":"chunk-44SXEVF4.cjs","sourcesContent":["/**\n * TypeGraph Error Hierarchy\n *\n * All errors extend TypeGraphError with:\n * - `code`: Machine-readable error code for programmatic handling\n * - `category`: Classification for error handling strategies\n * - `suggestion`: Optional recovery guidance for users\n * - `details`: Structured context about the error\n *\n * @example\n * ```typescript\n * try {\n * await store.nodes.Person.create({ name: \"\" });\n * } catch (error) {\n * if (isTypeGraphError(error)) {\n * console.error(error.toUserMessage());\n * if (isUserRecoverable(error)) {\n * // Show to user for correction\n * }\n * }\n * }\n * ```\n */\n\n// ============================================================\n// Types\n// ============================================================\n\n/**\n * Error category for programmatic handling.\n *\n * - `user`: Caused by invalid input or incorrect usage. Recoverable by fixing input.\n * - `constraint`: Business rule or schema constraint violation. Recoverable by changing data.\n * - `system`: Internal error or infrastructure issue. May require investigation or retry.\n */\nexport type ErrorCategory = \"user\" | \"constraint\" | \"system\";\n\n/**\n * Options for TypeGraphError constructor.\n */\nexport type TypeGraphErrorOptions = Readonly<{\n /** Structured context about the error */\n details?: Record<string, unknown>;\n /** Error category for handling strategies */\n category: ErrorCategory;\n /** Recovery guidance for users */\n suggestion?: string;\n /** Underlying cause of the error */\n cause?: unknown;\n}>;\n\nfunction formatCause(cause: unknown): string {\n if (cause instanceof Error) {\n return cause.stack ?? cause.message;\n }\n if (typeof cause === \"string\") {\n return cause;\n }\n if (\n typeof cause === \"number\" ||\n typeof cause === \"boolean\" ||\n typeof cause === \"bigint\"\n ) {\n return String(cause);\n }\n if (typeof cause === \"symbol\") {\n return cause.description ?? \"Symbol\";\n }\n if (cause === undefined) {\n return \"Unknown cause\";\n }\n\n try {\n return JSON.stringify(cause);\n } catch (error) {\n return `Unserializable cause: ${\n error instanceof Error ? error.message : \"Unknown error\"\n }`;\n }\n}\n\n// ============================================================\n// Base Error\n// ============================================================\n\n/**\n * Base error class for all TypeGraph errors.\n *\n * Provides structured error information for both programmatic handling\n * and user-friendly messages.\n */\nexport class TypeGraphError extends Error {\n /** Machine-readable error code (e.g., \"VALIDATION_ERROR\") */\n readonly code: string;\n\n /** Error category for handling strategies */\n readonly category: ErrorCategory;\n\n /** Structured context about the error */\n readonly details: Readonly<Record<string, unknown>>;\n\n /** Recovery guidance for users */\n readonly suggestion?: string;\n\n constructor(message: string, code: string, options: TypeGraphErrorOptions) {\n super(message, options.cause ? { cause: options.cause } : undefined);\n this.name = \"TypeGraphError\";\n this.code = code;\n this.category = options.category;\n this.details = Object.freeze(options.details ?? {});\n if (options.suggestion !== undefined) {\n this.suggestion = options.suggestion;\n }\n }\n\n /**\n * Returns a user-friendly error message with suggestion if available.\n */\n toUserMessage(): string {\n if (this.suggestion) {\n return `${this.message}\\n\\nSuggestion: ${this.suggestion}`;\n }\n return this.message;\n }\n\n /**\n * Returns a detailed string representation for logging.\n */\n toLogString(): string {\n const lines = [\n `[${this.code}] ${this.message}`,\n ` Category: ${this.category}`,\n ];\n\n if (this.suggestion) {\n lines.push(` Suggestion: ${this.suggestion}`);\n }\n\n const detailKeys = Object.keys(this.details);\n if (detailKeys.length > 0) {\n lines.push(` Details: ${JSON.stringify(this.details)}`);\n }\n\n if (this.cause) {\n lines.push(` Cause: ${formatCause(this.cause)}`);\n }\n\n return lines.join(\"\\n\");\n }\n}\n\n// ============================================================\n// Validation Errors (category: \"user\")\n// ============================================================\n\n/**\n * Validation issue from Zod or custom validation.\n */\nexport type ValidationIssue = Readonly<{\n /** Path to the invalid field (e.g., \"address.city\") */\n path: string;\n /** Human-readable error message */\n message: string;\n /** Zod error code if from Zod validation */\n code?: string;\n}>;\n\n/**\n * Details for ValidationError.\n */\nexport type ValidationErrorDetails = Readonly<{\n /** Type of entity being validated */\n entityType?: \"node\" | \"edge\";\n /** Kind/type name of the entity */\n kind?: string;\n /** Operation being performed */\n operation?: \"create\" | \"update\";\n /** Entity ID if updating */\n id?: string;\n /** Individual validation issues */\n issues: readonly ValidationIssue[];\n}>;\n\n/**\n * Thrown when schema validation fails during node or edge operations.\n *\n * @example\n * ```typescript\n * try {\n * await store.nodes.Person.create({ email: \"invalid\" });\n * } catch (error) {\n * if (error instanceof ValidationError) {\n * console.log(error.details.issues);\n * // [{ path: \"email\", message: \"Invalid email\" }]\n * }\n * }\n * ```\n */\nexport class ValidationError extends TypeGraphError {\n declare readonly details: ValidationErrorDetails;\n\n constructor(\n message: string,\n details: ValidationErrorDetails,\n options?: { cause?: unknown; suggestion?: string },\n ) {\n const fieldList =\n details.issues.length > 0 ?\n details.issues.map((index) => index.path || \"(root)\").join(\", \")\n : \"unknown\";\n\n super(message, \"VALIDATION_ERROR\", {\n details,\n category: \"user\",\n suggestion:\n options?.suggestion ??\n `Check the following fields: ${fieldList}. See error.details.issues for specific validation failures.`,\n cause: options?.cause,\n });\n this.name = \"ValidationError\";\n }\n}\n\n// ============================================================\n// Not Found Errors (category: \"user\")\n// ============================================================\n\n/**\n * Thrown when a node is not found.\n *\n * @example\n * ```typescript\n * try {\n * await store.nodes.Person.get(\"nonexistent-id\");\n * } catch (error) {\n * if (error instanceof NodeNotFoundError) {\n * console.log(error.details.kind, error.details.id);\n * }\n * }\n * ```\n */\nexport class NodeNotFoundError extends TypeGraphError {\n constructor(kind: string, id: string, options?: { cause?: unknown }) {\n super(`Node not found: ${kind}/${id}`, \"NODE_NOT_FOUND\", {\n details: { kind, id },\n category: \"user\",\n suggestion: `Verify the node ID \"${id}\" exists and has not been deleted.`,\n cause: options?.cause,\n });\n this.name = \"NodeNotFoundError\";\n }\n}\n\n/**\n * Thrown when an edge is not found.\n */\nexport class EdgeNotFoundError extends TypeGraphError {\n constructor(kind: string, id: string, options?: { cause?: unknown }) {\n super(`Edge not found: ${kind}/${id}`, \"EDGE_NOT_FOUND\", {\n details: { kind, id },\n category: \"user\",\n suggestion: `Verify the edge ID \"${id}\" exists and has not been deleted.`,\n cause: options?.cause,\n });\n this.name = \"EdgeNotFoundError\";\n }\n}\n\n/**\n * Thrown when a kind is not found in the graph registry.\n */\nexport class KindNotFoundError extends TypeGraphError {\n constructor(\n kind: string,\n type: \"node\" | \"edge\",\n options?: { cause?: unknown },\n ) {\n super(\n `${type === \"node\" ? \"Node\" : \"Edge\"} kind not found: ${kind}`,\n \"KIND_NOT_FOUND\",\n {\n details: { kind, type },\n category: \"user\",\n suggestion: `Verify \"${kind}\" is defined in your graph schema and spelled correctly.`,\n cause: options?.cause,\n },\n );\n this.name = \"KindNotFoundError\";\n }\n}\n\n/**\n * Thrown when a uniqueness constraint name is not found on a node kind.\n */\nexport class NodeConstraintNotFoundError extends TypeGraphError {\n constructor(\n constraintName: string,\n kind: string,\n options?: { cause?: unknown },\n ) {\n super(\n `Constraint not found: \"${constraintName}\" on node kind \"${kind}\"`,\n \"CONSTRAINT_NOT_FOUND\",\n {\n details: { constraintName, kind },\n category: \"user\",\n suggestion: `Verify the constraint name \"${constraintName}\" is defined in the unique constraints for \"${kind}\".`,\n cause: options?.cause,\n },\n );\n this.name = \"NodeConstraintNotFoundError\";\n }\n}\n\n// ============================================================\n// Constraint Errors (category: \"constraint\")\n// ============================================================\n\n/**\n * Thrown when edge endpoint node does not exist or is deleted.\n */\nexport class EndpointNotFoundError extends TypeGraphError {\n constructor(\n details: Readonly<{\n edgeKind: string;\n endpoint: \"from\" | \"to\";\n nodeKind: string;\n nodeId: string;\n }>,\n options?: { cause?: unknown },\n ) {\n super(\n `Endpoint node not found for edge \"${details.edgeKind}\": ${details.nodeKind}/${details.nodeId} (${details.endpoint})`,\n \"ENDPOINT_NOT_FOUND\",\n {\n details,\n category: \"constraint\",\n suggestion: `Ensure the ${details.endpoint} node exists before creating the edge.`,\n cause: options?.cause,\n },\n );\n this.name = \"EndpointNotFoundError\";\n }\n}\n\n/**\n * Thrown when edge endpoint has wrong node type.\n */\nexport class EndpointError extends TypeGraphError {\n constructor(\n details: Readonly<{\n edgeKind: string;\n endpoint: \"from\" | \"to\";\n actualKind: string;\n expectedKinds: readonly string[];\n }>,\n options?: { cause?: unknown },\n ) {\n const expected = details.expectedKinds.join(\" | \");\n super(\n `Invalid ${details.endpoint} endpoint for edge \"${details.edgeKind}\": got \"${details.actualKind}\", expected ${expected}`,\n \"ENDPOINT_ERROR\",\n {\n details,\n category: \"constraint\",\n suggestion: `Use a node of type ${expected} as the ${details.endpoint} endpoint.`,\n cause: options?.cause,\n },\n );\n this.name = \"EndpointError\";\n }\n}\n\n/**\n * Thrown when uniqueness constraint is violated.\n */\nexport class UniquenessError extends TypeGraphError {\n constructor(\n details: Readonly<{\n constraintName: string;\n kind: string;\n existingId: string;\n newId: string;\n fields: readonly string[];\n }>,\n options?: { cause?: unknown },\n ) {\n const fieldList = details.fields.join(\", \");\n super(\n `Uniqueness violation on \"${details.kind}\": constraint \"${details.constraintName}\" (fields: ${fieldList}) conflicts with existing node ${details.existingId}`,\n \"UNIQUENESS_VIOLATION\",\n {\n details,\n category: \"constraint\",\n suggestion: `Change the values for fields [${fieldList}] to be unique, or update the existing node ${details.existingId} instead.`,\n cause: options?.cause,\n },\n );\n this.name = \"UniquenessError\";\n }\n}\n\n/**\n * Thrown when cardinality constraint is violated.\n */\nexport class CardinalityError extends TypeGraphError {\n constructor(\n details: Readonly<{\n edgeKind: string;\n fromKind: string;\n fromId: string;\n cardinality: string;\n existingCount: number;\n }>,\n options?: { cause?: unknown },\n ) {\n super(\n `Cardinality violation: \"${details.edgeKind}\" from ${details.fromKind}/${details.fromId} allows \"${details.cardinality}\" but ${details.existingCount} edge(s) already exist`,\n \"CARDINALITY_ERROR\",\n {\n details,\n category: \"constraint\",\n suggestion:\n details.cardinality === \"one\" || details.cardinality === \"unique\" ?\n `Delete the existing edge before creating a new one, or use cardinality \"many\".`\n : `Check if the cardinality constraint \"${details.cardinality}\" is correct for your use case.`,\n cause: options?.cause,\n },\n );\n this.name = \"CardinalityError\";\n }\n}\n\n/**\n * Thrown when disjointness constraint is violated.\n *\n * Disjoint types cannot share the same ID - a node cannot be both\n * a Person and an Organization if they are declared disjoint.\n */\nexport class DisjointError extends TypeGraphError {\n constructor(\n details: Readonly<{\n nodeId: string;\n attemptedKind: string;\n conflictingKind: string;\n }>,\n options?: { cause?: unknown },\n ) {\n super(\n `Disjoint constraint violation: cannot create ${details.attemptedKind} with ID \"${details.nodeId}\" - conflicts with existing ${details.conflictingKind}`,\n \"DISJOINT_ERROR\",\n {\n details,\n category: \"constraint\",\n suggestion: `Use a different ID for the new ${details.attemptedKind} node, or delete the existing ${details.conflictingKind}/${details.nodeId} first.`,\n cause: options?.cause,\n },\n );\n this.name = \"DisjointError\";\n }\n}\n\n/**\n * Thrown when deletion is blocked due to existing edges (restrict behavior).\n */\nexport class RestrictedDeleteError extends TypeGraphError {\n constructor(\n details: Readonly<{\n nodeKind: string;\n nodeId: string;\n edgeCount: number;\n edgeKinds: readonly string[];\n }>,\n options?: { cause?: unknown },\n ) {\n const edgeList = details.edgeKinds.join(\", \");\n super(\n `Cannot delete ${details.nodeKind}/${details.nodeId}: ${details.edgeCount} connected edge(s) exist (${edgeList})`,\n \"RESTRICTED_DELETE\",\n {\n details,\n category: \"constraint\",\n suggestion: `Delete the connected edges first, or change onDelete behavior to \"cascade\" (auto-delete edges) or \"disconnect\" (soft-delete edges).`,\n cause: options?.cause,\n },\n );\n this.name = \"RestrictedDeleteError\";\n }\n}\n\n// ============================================================\n// Concurrency Errors (category: \"system\")\n// ============================================================\n\n/**\n * Thrown when optimistic locking detects a concurrent modification.\n *\n * This occurs when two operations try to update the same entity simultaneously.\n * The operation with the stale version fails.\n */\nexport class VersionConflictError extends TypeGraphError {\n constructor(\n details: Readonly<{\n kind: string;\n id: string;\n expectedVersion: number;\n actualVersion: number;\n }>,\n options?: { cause?: unknown },\n ) {\n super(\n `Version conflict on ${details.kind}/${details.id}: expected version ${details.expectedVersion}, found ${details.actualVersion}`,\n \"VERSION_CONFLICT\",\n {\n details,\n category: \"system\",\n suggestion: `Fetch the latest version of the entity and retry the operation. This error indicates concurrent modification.`,\n cause: options?.cause,\n },\n );\n this.name = \"VersionConflictError\";\n }\n}\n\n// ============================================================\n// Schema Errors (category: \"system\")\n// ============================================================\n\n/**\n * Thrown when the schema in code doesn't match the schema in the database.\n */\nexport class SchemaMismatchError extends TypeGraphError {\n constructor(\n details: Readonly<{\n graphId: string;\n expectedHash: string;\n actualHash: string;\n }>,\n options?: { cause?: unknown },\n ) {\n super(\n `Schema mismatch for graph \"${details.graphId}\": code schema differs from database schema`,\n \"SCHEMA_MISMATCH\",\n {\n details,\n category: \"system\",\n suggestion: `Run schema migration to update the database, or use createStoreWithSchema() for automatic migration.`,\n cause: options?.cause,\n },\n );\n this.name = \"SchemaMismatchError\";\n }\n}\n\n/**\n * Thrown when schema migration fails.\n */\nexport class MigrationError extends TypeGraphError {\n constructor(\n message: string,\n details: Readonly<{\n graphId: string;\n fromVersion: number;\n toVersion: number;\n reason?: string;\n }>,\n options?: { cause?: unknown },\n ) {\n super(message, \"MIGRATION_ERROR\", {\n details,\n category: \"system\",\n suggestion: `Review the schema changes and ensure they are backwards compatible, or implement a data migration.`,\n cause: options?.cause,\n });\n this.name = \"MigrationError\";\n }\n}\n\n// ============================================================\n// Configuration Errors (category: \"user\")\n// ============================================================\n\n/**\n * Thrown when graph configuration is invalid.\n *\n * This includes invalid schema definitions, ontology conflicts,\n * and other configuration issues detected at graph creation time.\n */\nexport class ConfigurationError extends TypeGraphError {\n constructor(\n message: string,\n details: Record<string, unknown> = {},\n options?: { cause?: unknown; suggestion?: string },\n ) {\n super(message, \"CONFIGURATION_ERROR\", {\n details,\n category: \"user\",\n suggestion:\n options?.suggestion ?? `Review your graph definition for errors.`,\n cause: options?.cause,\n });\n this.name = \"ConfigurationError\";\n }\n}\n\n// ============================================================\n// Database Errors (category: \"system\")\n// ============================================================\n\n/**\n * Thrown when a database operation fails unexpectedly.\n *\n * This indicates a system-level failure in the database backend,\n * not a user-recoverable error.\n */\nexport class DatabaseOperationError extends TypeGraphError {\n constructor(\n message: string,\n details: Readonly<{ operation: string; entity: string }>,\n options?: { cause?: unknown },\n ) {\n super(message, \"DATABASE_OPERATION_ERROR\", {\n details,\n category: \"system\",\n suggestion: `This is a system-level database error. Check the database connection and retry the operation. If the problem persists, investigate the underlying cause.`,\n cause: options?.cause,\n });\n this.name = \"DatabaseOperationError\";\n }\n}\n\n// ============================================================\n// Query Errors (category: \"system\")\n// ============================================================\n\n/**\n * Thrown when a query predicate cannot be compiled for the target database.\n */\nexport class UnsupportedPredicateError extends TypeGraphError {\n constructor(\n message: string,\n details: Readonly<Record<string, unknown>> = {},\n options?: { cause?: unknown; suggestion?: string },\n ) {\n super(message, \"UNSUPPORTED_PREDICATE\", {\n details,\n category: \"system\",\n suggestion:\n options?.suggestion ??\n `This predicate may not be supported by your database backend. Check the documentation for supported predicates.`,\n cause: options?.cause,\n });\n this.name = \"UnsupportedPredicateError\";\n }\n}\n\n// ============================================================\n// Compiler Errors (category: \"system\")\n// ============================================================\n\n/**\n * Thrown when a compiler invariant is violated.\n *\n * This indicates a bug in the query compiler — the compiler reached\n * a state that should be unreachable. These errors are not user-recoverable.\n */\nexport class CompilerInvariantError extends TypeGraphError {\n constructor(\n message: string,\n details?: Readonly<Record<string, unknown>>,\n options?: { cause?: unknown },\n ) {\n super(message, \"COMPILER_INVARIANT_ERROR\", {\n details: details ?? {},\n category: \"system\",\n suggestion: `This is an internal compiler error. Please report it as a bug with the query that triggered it.`,\n cause: options?.cause,\n });\n this.name = \"CompilerInvariantError\";\n }\n}\n\n// ============================================================\n// Utility Functions\n// ============================================================\n\n/**\n * Type guard for TypeGraphError.\n *\n * @example\n * ```typescript\n * try {\n * await store.nodes.Person.create({});\n * } catch (error) {\n * if (isTypeGraphError(error)) {\n * console.log(error.code, error.category);\n * }\n * }\n * ```\n */\nexport function isTypeGraphError(error: unknown): error is TypeGraphError {\n return error instanceof TypeGraphError;\n}\n\n/**\n * Check if error is recoverable by user action (user or constraint error).\n *\n * User-recoverable errors can typically be resolved by:\n * - Fixing invalid input data\n * - Using different IDs or values\n * - Deleting conflicting data first\n *\n * @example\n * ```typescript\n * if (isUserRecoverable(error)) {\n * showErrorToUser(error.toUserMessage());\n * } else {\n * logAndAlertOps(error);\n * }\n * ```\n */\nexport function isUserRecoverable(error: unknown): boolean {\n if (!isTypeGraphError(error)) return false;\n return error.category === \"user\" || error.category === \"constraint\";\n}\n\n/**\n * Check if error indicates a system/infrastructure issue.\n *\n * System errors typically require:\n * - Retry logic (for transient failures)\n * - Investigation (for persistent failures)\n * - Ops team notification\n */\nexport function isSystemError(error: unknown): boolean {\n return isTypeGraphError(error) && error.category === \"system\";\n}\n\n/**\n * Check if error is a constraint violation.\n */\nexport function isConstraintError(error: unknown): boolean {\n return isTypeGraphError(error) && error.category === \"constraint\";\n}\n\n/**\n * Extract suggestion from error if available.\n */\nexport function getErrorSuggestion(error: unknown): string | undefined {\n return isTypeGraphError(error) ? error.suggestion : undefined;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk44SXEVF4_cjs = require('./chunk-44SXEVF4.cjs');
|
|
4
4
|
var drizzleOrm = require('drizzle-orm');
|
|
5
5
|
|
|
6
6
|
// src/backend/types.ts
|
|
@@ -42,7 +42,7 @@ var D1_CAPABILITIES = {
|
|
|
42
42
|
// src/backend/drizzle/row-mappers.ts
|
|
43
43
|
function requireTimestamp(value, field) {
|
|
44
44
|
if (value === void 0) {
|
|
45
|
-
throw new
|
|
45
|
+
throw new chunk44SXEVF4_cjs.DatabaseOperationError(
|
|
46
46
|
`Expected non-null ${field} timestamp`,
|
|
47
47
|
{ operation: "select", entity: "row" }
|
|
48
48
|
);
|
|
@@ -153,7 +153,7 @@ function createCommonOperationBackend(options) {
|
|
|
153
153
|
const timestamp = nowIso2();
|
|
154
154
|
const query = operationStrategy.buildInsertNode(params, timestamp);
|
|
155
155
|
const row = await execution.execGet(query);
|
|
156
|
-
if (!row) throw new
|
|
156
|
+
if (!row) throw new chunk44SXEVF4_cjs.DatabaseOperationError("Insert node failed: no row returned", { operation: "insert", entity: "node" });
|
|
157
157
|
return rowMappers.toNodeRow(row);
|
|
158
158
|
},
|
|
159
159
|
async insertNodeNoReturn(params) {
|
|
@@ -203,7 +203,7 @@ function createCommonOperationBackend(options) {
|
|
|
203
203
|
const timestamp = nowIso2();
|
|
204
204
|
const query = operationStrategy.buildUpdateNode(params, timestamp);
|
|
205
205
|
const row = await execution.execGet(query);
|
|
206
|
-
if (!row) throw new
|
|
206
|
+
if (!row) throw new chunk44SXEVF4_cjs.DatabaseOperationError("Update node failed: no row returned", { operation: "update", entity: "node" });
|
|
207
207
|
return rowMappers.toNodeRow(row);
|
|
208
208
|
},
|
|
209
209
|
async deleteNode(params) {
|
|
@@ -238,7 +238,7 @@ function createCommonOperationBackend(options) {
|
|
|
238
238
|
const timestamp = nowIso2();
|
|
239
239
|
const query = operationStrategy.buildInsertEdge(params, timestamp);
|
|
240
240
|
const row = await execution.execGet(query);
|
|
241
|
-
if (!row) throw new
|
|
241
|
+
if (!row) throw new chunk44SXEVF4_cjs.DatabaseOperationError("Insert edge failed: no row returned", { operation: "insert", entity: "edge" });
|
|
242
242
|
return rowMappers.toEdgeRow(row);
|
|
243
243
|
},
|
|
244
244
|
async insertEdgeNoReturn(params) {
|
|
@@ -288,7 +288,7 @@ function createCommonOperationBackend(options) {
|
|
|
288
288
|
const timestamp = nowIso2();
|
|
289
289
|
const query = operationStrategy.buildUpdateEdge(params, timestamp);
|
|
290
290
|
const row = await execution.execGet(query);
|
|
291
|
-
if (!row) throw new
|
|
291
|
+
if (!row) throw new chunk44SXEVF4_cjs.DatabaseOperationError("Update edge failed: no row returned", { operation: "update", entity: "edge" });
|
|
292
292
|
return rowMappers.toEdgeRow(row);
|
|
293
293
|
},
|
|
294
294
|
async deleteEdge(params) {
|
|
@@ -339,7 +339,7 @@ function createCommonOperationBackend(options) {
|
|
|
339
339
|
const query = operationStrategy.buildInsertUnique(params);
|
|
340
340
|
const result = await execution.execGet(query);
|
|
341
341
|
if (result && result.node_id !== params.nodeId) {
|
|
342
|
-
throw new
|
|
342
|
+
throw new chunk44SXEVF4_cjs.UniquenessError({
|
|
343
343
|
constraintName: params.constraintName,
|
|
344
344
|
kind: params.nodeKind,
|
|
345
345
|
existingId: result.node_id,
|
|
@@ -358,6 +358,12 @@ function createCommonOperationBackend(options) {
|
|
|
358
358
|
const row = await execution.execGet(query);
|
|
359
359
|
return row ? rowMappers.toUniqueRow(row) : void 0;
|
|
360
360
|
},
|
|
361
|
+
async checkUniqueBatch(params) {
|
|
362
|
+
if (params.keys.length === 0) return [];
|
|
363
|
+
const query = operationStrategy.buildCheckUniqueBatch(params);
|
|
364
|
+
const rows = await execution.execAll(query);
|
|
365
|
+
return rows.map((row) => rowMappers.toUniqueRow(row));
|
|
366
|
+
},
|
|
361
367
|
async getActiveSchema(graphId) {
|
|
362
368
|
const query = operationStrategy.buildGetActiveSchema(graphId);
|
|
363
369
|
const row = await execution.execGet(query);
|
|
@@ -367,7 +373,7 @@ function createCommonOperationBackend(options) {
|
|
|
367
373
|
const timestamp = nowIso2();
|
|
368
374
|
const query = operationStrategy.buildInsertSchema(params, timestamp);
|
|
369
375
|
const row = await execution.execGet(query);
|
|
370
|
-
if (!row) throw new
|
|
376
|
+
if (!row) throw new chunk44SXEVF4_cjs.DatabaseOperationError("Insert schema failed: no row returned", { operation: "insert", entity: "schema" });
|
|
371
377
|
return rowMappers.toSchemaVersionRow(row);
|
|
372
378
|
},
|
|
373
379
|
async getSchemaVersion(graphId, version) {
|
|
@@ -1009,6 +1015,15 @@ function buildHardDeleteEmbeddingsByNode(tables, graphId, nodeKind, nodeId) {
|
|
|
1009
1015
|
}
|
|
1010
1016
|
function buildCheckUnique(tables, params) {
|
|
1011
1017
|
const { uniques } = tables;
|
|
1018
|
+
if (params.includeDeleted) {
|
|
1019
|
+
return drizzleOrm.sql`
|
|
1020
|
+
SELECT * FROM ${uniques}
|
|
1021
|
+
WHERE ${uniques.graphId} = ${params.graphId}
|
|
1022
|
+
AND ${uniques.nodeKind} = ${params.nodeKind}
|
|
1023
|
+
AND ${uniques.constraintName} = ${params.constraintName}
|
|
1024
|
+
AND ${uniques.key} = ${params.key}
|
|
1025
|
+
`;
|
|
1026
|
+
}
|
|
1012
1027
|
return drizzleOrm.sql`
|
|
1013
1028
|
SELECT * FROM ${uniques}
|
|
1014
1029
|
WHERE ${uniques.graphId} = ${params.graphId}
|
|
@@ -1018,6 +1033,30 @@ function buildCheckUnique(tables, params) {
|
|
|
1018
1033
|
AND ${uniques.deletedAt} IS NULL
|
|
1019
1034
|
`;
|
|
1020
1035
|
}
|
|
1036
|
+
function buildCheckUniqueBatch(tables, params) {
|
|
1037
|
+
const { uniques } = tables;
|
|
1038
|
+
const keyPlaceholders = drizzleOrm.sql.join(
|
|
1039
|
+
params.keys.map((key) => drizzleOrm.sql`${key}`),
|
|
1040
|
+
drizzleOrm.sql`, `
|
|
1041
|
+
);
|
|
1042
|
+
if (params.includeDeleted) {
|
|
1043
|
+
return drizzleOrm.sql`
|
|
1044
|
+
SELECT * FROM ${uniques}
|
|
1045
|
+
WHERE ${uniques.graphId} = ${params.graphId}
|
|
1046
|
+
AND ${uniques.nodeKind} = ${params.nodeKind}
|
|
1047
|
+
AND ${uniques.constraintName} = ${params.constraintName}
|
|
1048
|
+
AND ${uniques.key} IN (${keyPlaceholders})
|
|
1049
|
+
`;
|
|
1050
|
+
}
|
|
1051
|
+
return drizzleOrm.sql`
|
|
1052
|
+
SELECT * FROM ${uniques}
|
|
1053
|
+
WHERE ${uniques.graphId} = ${params.graphId}
|
|
1054
|
+
AND ${uniques.nodeKind} = ${params.nodeKind}
|
|
1055
|
+
AND ${uniques.constraintName} = ${params.constraintName}
|
|
1056
|
+
AND ${uniques.key} IN (${keyPlaceholders})
|
|
1057
|
+
AND ${uniques.deletedAt} IS NULL
|
|
1058
|
+
`;
|
|
1059
|
+
}
|
|
1021
1060
|
function assertFiniteNumberArray(array, name) {
|
|
1022
1061
|
for (const [index, value] of array.entries()) {
|
|
1023
1062
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
@@ -1214,6 +1253,7 @@ var COMMON_TABLE_OPERATION_BUILDERS = {
|
|
|
1214
1253
|
buildHardDeleteUniquesByNode,
|
|
1215
1254
|
buildHardDeleteEmbeddingsByNode,
|
|
1216
1255
|
buildCheckUnique,
|
|
1256
|
+
buildCheckUniqueBatch,
|
|
1217
1257
|
buildGetSchemaVersion
|
|
1218
1258
|
};
|
|
1219
1259
|
function createCommonOperationStrategy(tables, dialect) {
|
|
@@ -1465,5 +1505,5 @@ exports.dropSqliteVectorIndex = dropSqliteVectorIndex;
|
|
|
1465
1505
|
exports.formatPostgresTimestamp = formatPostgresTimestamp;
|
|
1466
1506
|
exports.generateVectorIndexName = generateVectorIndexName;
|
|
1467
1507
|
exports.nowIso = nowIso;
|
|
1468
|
-
//# sourceMappingURL=chunk-
|
|
1469
|
-
//# sourceMappingURL=chunk-
|
|
1508
|
+
//# sourceMappingURL=chunk-7RVSDXT3.cjs.map
|
|
1509
|
+
//# sourceMappingURL=chunk-7RVSDXT3.cjs.map
|