@nicia-ai/typegraph 0.14.0 → 0.15.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 +32 -26
- package/dist/backend/postgres/index.cjs.map +1 -1
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/index.js +14 -8
- package/dist/backend/postgres/index.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +12 -12
- package/dist/backend/sqlite/index.d.cts +5 -5
- package/dist/backend/sqlite/index.d.ts +5 -5
- package/dist/backend/sqlite/index.js +2 -2
- package/dist/backend/sqlite/local.cjs +5 -5
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +5 -5
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-QFZ5QB2J.cjs → chunk-3HQLOKS5.cjs} +25 -3
- package/dist/chunk-3HQLOKS5.cjs.map +1 -0
- package/dist/{chunk-OEKH5PWL.cjs → chunk-56RQFK7U.cjs} +22 -15
- package/dist/chunk-56RQFK7U.cjs.map +1 -0
- package/dist/{chunk-KE2BL3JZ.cjs → chunk-CRMN2NOM.cjs} +179 -179
- package/dist/chunk-CRMN2NOM.cjs.map +1 -0
- package/dist/{chunk-BNIBR5U2.js → chunk-HWWF3FOP.js} +91 -91
- package/dist/chunk-HWWF3FOP.js.map +1 -0
- package/dist/{chunk-KLOSTZDQ.js → chunk-L4ON6RJF.js} +25 -3
- package/dist/chunk-L4ON6RJF.js.map +1 -0
- package/dist/{chunk-RVUEBUBH.js → chunk-XZBAGJJH.js} +15 -8
- package/dist/chunk-XZBAGJJH.js.map +1 -0
- package/dist/{ddl-BJg93HDN.d.cts → ddl-BBo2EcFc.d.cts} +2 -2
- package/dist/{ddl-CsfWcl_B.d.ts → ddl-D4jlcOH_.d.ts} +2 -2
- package/dist/index.cjs +67 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +36 -42
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.d.cts +2 -2
- package/dist/indexes/index.d.ts +2 -2
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/{manager-oh2mTMvy.d.cts → manager-Bj1UEnhE.d.cts} +2 -2
- package/dist/{manager-qRSdnKEO.d.ts → manager-Chhrq1vl.d.ts} +2 -2
- package/dist/profiler/index.d.cts +3 -3
- package/dist/profiler/index.d.ts +3 -3
- package/dist/schema/index.cjs +20 -20
- package/dist/schema/index.d.cts +4 -4
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +2 -2
- package/dist/{sqlite-DVca_IIy.d.cts → sqlite-Blq-AhmK.d.ts} +1 -1
- package/dist/{sqlite-H01wIXvB.d.ts → sqlite-DE-6NWtC.d.cts} +1 -1
- package/dist/{store-BJPIoe8u.d.cts → store-BNercm8P.d.cts} +51 -16
- package/dist/{store-B9ItxA-Q.d.ts → store-CD_0yf2s.d.ts} +51 -16
- package/dist/{types-Ckfwgv9l.d.cts → types-B3mmOMJV.d.cts} +8 -0
- package/dist/{types-C8Ra3ROE.d.cts → types-CZd2PEOc.d.cts} +8 -2
- package/dist/{types-CC8eB0PB.d.ts → types-Ceb01czq.d.ts} +8 -2
- package/dist/{types-5t_MIcvv.d.ts → types-ThB4cFLp.d.ts} +8 -0
- package/package.json +1 -1
- package/dist/chunk-BNIBR5U2.js.map +0 -1
- package/dist/chunk-KE2BL3JZ.cjs.map +0 -1
- package/dist/chunk-KLOSTZDQ.js.map +0 -1
- package/dist/chunk-OEKH5PWL.cjs.map +0 -1
- package/dist/chunk-QFZ5QB2J.cjs.map +0 -1
- package/dist/chunk-RVUEBUBH.js.map +0 -1
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import { DatabaseOperationError, UniquenessError } from './chunk-SJ2QMDXY.js';
|
|
2
|
-
import {
|
|
2
|
+
import { buildPostgresNodeIndexBuilders, buildPostgresEdgeIndexBuilders, buildSqliteNodeIndexBuilders, buildSqliteEdgeIndexBuilders } from './chunk-6GWJH6AR.js';
|
|
3
3
|
import { MAX_PG_IDENTIFIER_LENGTH } from './chunk-GNIYZKBI.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { customType, pgTable, timestamp, integer, jsonb, text, primaryKey, index, boolean, getTableConfig as getTableConfig$1 } from 'drizzle-orm/pg-core';
|
|
5
|
+
import { sqliteTable, text as text$1, integer as integer$1, primaryKey as primaryKey$1, index as index$1, blob, getTableConfig } from 'drizzle-orm/sqlite-core';
|
|
6
6
|
import { sql, getTableName } from 'drizzle-orm';
|
|
7
7
|
|
|
8
|
+
var vector = customType({
|
|
9
|
+
dataType(config) {
|
|
10
|
+
return config?.dimensions ? `vector(${config.dimensions})` : "vector";
|
|
11
|
+
},
|
|
12
|
+
toDriver(value) {
|
|
13
|
+
return `[${value.join(",")}]`;
|
|
14
|
+
},
|
|
15
|
+
fromDriver(value) {
|
|
16
|
+
if (Array.isArray(value)) {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
const content = value.slice(1, -1);
|
|
20
|
+
if (content === "") {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
return content.split(",").map((s) => Number.parseFloat(s.trim()));
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// src/backend/drizzle/schema/postgres.ts
|
|
8
28
|
var DEFAULT_TABLE_NAMES = {
|
|
9
29
|
nodes: "typegraph_nodes",
|
|
10
30
|
edges: "typegraph_edges",
|
|
@@ -12,22 +32,22 @@ var DEFAULT_TABLE_NAMES = {
|
|
|
12
32
|
schemaVersions: "typegraph_schema_versions",
|
|
13
33
|
embeddings: "typegraph_node_embeddings"
|
|
14
34
|
};
|
|
15
|
-
function
|
|
35
|
+
function createPostgresTables(names = {}, options = {}) {
|
|
16
36
|
const n = { ...DEFAULT_TABLE_NAMES, ...names };
|
|
17
37
|
const indexes = options.indexes ?? [];
|
|
18
|
-
const nodes3 =
|
|
38
|
+
const nodes3 = pgTable(
|
|
19
39
|
n.nodes,
|
|
20
40
|
{
|
|
21
41
|
graphId: text("graph_id").notNull(),
|
|
22
42
|
kind: text("kind").notNull(),
|
|
23
43
|
id: text("id").notNull(),
|
|
24
|
-
props:
|
|
44
|
+
props: jsonb("props").notNull(),
|
|
25
45
|
version: integer("version").notNull().default(1),
|
|
26
|
-
validFrom:
|
|
27
|
-
validTo:
|
|
28
|
-
createdAt:
|
|
29
|
-
updatedAt:
|
|
30
|
-
deletedAt:
|
|
46
|
+
validFrom: timestamp("valid_from", { withTimezone: true }),
|
|
47
|
+
validTo: timestamp("valid_to", { withTimezone: true }),
|
|
48
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
49
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
50
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
31
51
|
},
|
|
32
52
|
(t) => [
|
|
33
53
|
primaryKey({ columns: [t.graphId, t.kind, t.id] }),
|
|
@@ -40,10 +60,10 @@ function createSqliteTables(names = {}, options = {}) {
|
|
|
40
60
|
),
|
|
41
61
|
index(`${n.nodes}_deleted_idx`).on(t.graphId, t.deletedAt),
|
|
42
62
|
index(`${n.nodes}_valid_idx`).on(t.graphId, t.validFrom, t.validTo),
|
|
43
|
-
...
|
|
63
|
+
...buildPostgresNodeIndexBuilders(t, indexes)
|
|
44
64
|
]
|
|
45
65
|
);
|
|
46
|
-
const edges3 =
|
|
66
|
+
const edges3 = pgTable(
|
|
47
67
|
n.edges,
|
|
48
68
|
{
|
|
49
69
|
graphId: text("graph_id").notNull(),
|
|
@@ -53,12 +73,12 @@ function createSqliteTables(names = {}, options = {}) {
|
|
|
53
73
|
fromId: text("from_id").notNull(),
|
|
54
74
|
toKind: text("to_kind").notNull(),
|
|
55
75
|
toId: text("to_id").notNull(),
|
|
56
|
-
props:
|
|
57
|
-
validFrom:
|
|
58
|
-
validTo:
|
|
59
|
-
createdAt:
|
|
60
|
-
updatedAt:
|
|
61
|
-
deletedAt:
|
|
76
|
+
props: jsonb("props").notNull(),
|
|
77
|
+
validFrom: timestamp("valid_from", { withTimezone: true }),
|
|
78
|
+
validTo: timestamp("valid_to", { withTimezone: true }),
|
|
79
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
80
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull(),
|
|
81
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
62
82
|
},
|
|
63
83
|
(t) => [
|
|
64
84
|
primaryKey({ columns: [t.graphId, t.id] }),
|
|
@@ -99,10 +119,10 @@ function createSqliteTables(names = {}, options = {}) {
|
|
|
99
119
|
t.fromId,
|
|
100
120
|
t.validTo
|
|
101
121
|
),
|
|
102
|
-
...
|
|
122
|
+
...buildPostgresEdgeIndexBuilders(t, indexes)
|
|
103
123
|
]
|
|
104
124
|
);
|
|
105
|
-
const uniques3 =
|
|
125
|
+
const uniques3 = pgTable(
|
|
106
126
|
n.uniques,
|
|
107
127
|
{
|
|
108
128
|
graphId: text("graph_id").notNull(),
|
|
@@ -111,7 +131,7 @@ function createSqliteTables(names = {}, options = {}) {
|
|
|
111
131
|
key: text("key").notNull(),
|
|
112
132
|
nodeId: text("node_id").notNull(),
|
|
113
133
|
concreteKind: text("concrete_kind").notNull(),
|
|
114
|
-
deletedAt:
|
|
134
|
+
deletedAt: timestamp("deleted_at", { withTimezone: true })
|
|
115
135
|
},
|
|
116
136
|
(t) => [
|
|
117
137
|
primaryKey({
|
|
@@ -120,38 +140,34 @@ function createSqliteTables(names = {}, options = {}) {
|
|
|
120
140
|
index(`${n.uniques}_node_idx`).on(t.graphId, t.concreteKind, t.nodeId)
|
|
121
141
|
]
|
|
122
142
|
);
|
|
123
|
-
const schemaVersions3 =
|
|
143
|
+
const schemaVersions3 = pgTable(
|
|
124
144
|
n.schemaVersions,
|
|
125
145
|
{
|
|
126
146
|
graphId: text("graph_id").notNull(),
|
|
127
147
|
version: integer("version").notNull(),
|
|
128
148
|
schemaHash: text("schema_hash").notNull(),
|
|
129
|
-
schemaDoc:
|
|
130
|
-
createdAt:
|
|
131
|
-
isActive:
|
|
149
|
+
schemaDoc: jsonb("schema_doc").notNull(),
|
|
150
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
151
|
+
isActive: boolean("is_active").notNull().default(false)
|
|
132
152
|
},
|
|
133
153
|
(t) => [
|
|
134
154
|
primaryKey({ columns: [t.graphId, t.version] }),
|
|
135
155
|
index(`${n.schemaVersions}_active_idx`).on(t.graphId, t.isActive)
|
|
136
156
|
]
|
|
137
157
|
);
|
|
138
|
-
const embeddings3 =
|
|
158
|
+
const embeddings3 = pgTable(
|
|
139
159
|
n.embeddings,
|
|
140
160
|
{
|
|
141
161
|
graphId: text("graph_id").notNull(),
|
|
142
162
|
nodeKind: text("node_kind").notNull(),
|
|
143
163
|
nodeId: text("node_id").notNull(),
|
|
144
164
|
fieldPath: text("field_path").notNull(),
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
-
* Stored as BLOB for sqlite-vec binary format, or JSON text for fallback.
|
|
148
|
-
* For sqlite-vec: use vec_f32() to convert JSON array to binary.
|
|
149
|
-
*/
|
|
150
|
-
embedding: blob("embedding", { mode: "buffer" }).notNull(),
|
|
165
|
+
/** Embedding vector stored as native pgvector type */
|
|
166
|
+
embedding: vector("embedding").notNull(),
|
|
151
167
|
/** Number of dimensions (for validation) */
|
|
152
168
|
dimensions: integer("dimensions").notNull(),
|
|
153
|
-
createdAt:
|
|
154
|
-
updatedAt:
|
|
169
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
170
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
155
171
|
},
|
|
156
172
|
(t) => [
|
|
157
173
|
primaryKey({
|
|
@@ -173,28 +189,8 @@ function createSqliteTables(names = {}, options = {}) {
|
|
|
173
189
|
);
|
|
174
190
|
return { nodes: nodes3, edges: edges3, uniques: uniques3, schemaVersions: schemaVersions3, embeddings: embeddings3 };
|
|
175
191
|
}
|
|
176
|
-
var tables =
|
|
192
|
+
var tables = createPostgresTables();
|
|
177
193
|
var { nodes, edges, uniques, schemaVersions, embeddings } = tables;
|
|
178
|
-
var vector = customType({
|
|
179
|
-
dataType(config) {
|
|
180
|
-
return config?.dimensions ? `vector(${config.dimensions})` : "vector";
|
|
181
|
-
},
|
|
182
|
-
toDriver(value) {
|
|
183
|
-
return `[${value.join(",")}]`;
|
|
184
|
-
},
|
|
185
|
-
fromDriver(value) {
|
|
186
|
-
if (Array.isArray(value)) {
|
|
187
|
-
return value;
|
|
188
|
-
}
|
|
189
|
-
const content = value.slice(1, -1);
|
|
190
|
-
if (content === "") {
|
|
191
|
-
return [];
|
|
192
|
-
}
|
|
193
|
-
return content.split(",").map((s) => Number.parseFloat(s.trim()));
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
// src/backend/drizzle/schema/postgres.ts
|
|
198
194
|
var DEFAULT_TABLE_NAMES2 = {
|
|
199
195
|
nodes: "typegraph_nodes",
|
|
200
196
|
edges: "typegraph_edges",
|
|
@@ -202,22 +198,22 @@ var DEFAULT_TABLE_NAMES2 = {
|
|
|
202
198
|
schemaVersions: "typegraph_schema_versions",
|
|
203
199
|
embeddings: "typegraph_node_embeddings"
|
|
204
200
|
};
|
|
205
|
-
function
|
|
201
|
+
function createSqliteTables(names = {}, options = {}) {
|
|
206
202
|
const n = { ...DEFAULT_TABLE_NAMES2, ...names };
|
|
207
203
|
const indexes = options.indexes ?? [];
|
|
208
|
-
const nodes3 =
|
|
204
|
+
const nodes3 = sqliteTable(
|
|
209
205
|
n.nodes,
|
|
210
206
|
{
|
|
211
207
|
graphId: text$1("graph_id").notNull(),
|
|
212
208
|
kind: text$1("kind").notNull(),
|
|
213
209
|
id: text$1("id").notNull(),
|
|
214
|
-
props:
|
|
210
|
+
props: text$1("props").notNull(),
|
|
215
211
|
version: integer$1("version").notNull().default(1),
|
|
216
|
-
validFrom:
|
|
217
|
-
validTo:
|
|
218
|
-
createdAt:
|
|
219
|
-
updatedAt:
|
|
220
|
-
deletedAt:
|
|
212
|
+
validFrom: text$1("valid_from"),
|
|
213
|
+
validTo: text$1("valid_to"),
|
|
214
|
+
createdAt: text$1("created_at").notNull(),
|
|
215
|
+
updatedAt: text$1("updated_at").notNull(),
|
|
216
|
+
deletedAt: text$1("deleted_at")
|
|
221
217
|
},
|
|
222
218
|
(t) => [
|
|
223
219
|
primaryKey$1({ columns: [t.graphId, t.kind, t.id] }),
|
|
@@ -230,10 +226,10 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
230
226
|
),
|
|
231
227
|
index$1(`${n.nodes}_deleted_idx`).on(t.graphId, t.deletedAt),
|
|
232
228
|
index$1(`${n.nodes}_valid_idx`).on(t.graphId, t.validFrom, t.validTo),
|
|
233
|
-
...
|
|
229
|
+
...buildSqliteNodeIndexBuilders(t, indexes)
|
|
234
230
|
]
|
|
235
231
|
);
|
|
236
|
-
const edges3 =
|
|
232
|
+
const edges3 = sqliteTable(
|
|
237
233
|
n.edges,
|
|
238
234
|
{
|
|
239
235
|
graphId: text$1("graph_id").notNull(),
|
|
@@ -243,12 +239,12 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
243
239
|
fromId: text$1("from_id").notNull(),
|
|
244
240
|
toKind: text$1("to_kind").notNull(),
|
|
245
241
|
toId: text$1("to_id").notNull(),
|
|
246
|
-
props:
|
|
247
|
-
validFrom:
|
|
248
|
-
validTo:
|
|
249
|
-
createdAt:
|
|
250
|
-
updatedAt:
|
|
251
|
-
deletedAt:
|
|
242
|
+
props: text$1("props").notNull(),
|
|
243
|
+
validFrom: text$1("valid_from"),
|
|
244
|
+
validTo: text$1("valid_to"),
|
|
245
|
+
createdAt: text$1("created_at").notNull(),
|
|
246
|
+
updatedAt: text$1("updated_at").notNull(),
|
|
247
|
+
deletedAt: text$1("deleted_at")
|
|
252
248
|
},
|
|
253
249
|
(t) => [
|
|
254
250
|
primaryKey$1({ columns: [t.graphId, t.id] }),
|
|
@@ -289,10 +285,10 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
289
285
|
t.fromId,
|
|
290
286
|
t.validTo
|
|
291
287
|
),
|
|
292
|
-
...
|
|
288
|
+
...buildSqliteEdgeIndexBuilders(t, indexes)
|
|
293
289
|
]
|
|
294
290
|
);
|
|
295
|
-
const uniques3 =
|
|
291
|
+
const uniques3 = sqliteTable(
|
|
296
292
|
n.uniques,
|
|
297
293
|
{
|
|
298
294
|
graphId: text$1("graph_id").notNull(),
|
|
@@ -301,7 +297,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
301
297
|
key: text$1("key").notNull(),
|
|
302
298
|
nodeId: text$1("node_id").notNull(),
|
|
303
299
|
concreteKind: text$1("concrete_kind").notNull(),
|
|
304
|
-
deletedAt:
|
|
300
|
+
deletedAt: text$1("deleted_at")
|
|
305
301
|
},
|
|
306
302
|
(t) => [
|
|
307
303
|
primaryKey$1({
|
|
@@ -310,34 +306,38 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
310
306
|
index$1(`${n.uniques}_node_idx`).on(t.graphId, t.concreteKind, t.nodeId)
|
|
311
307
|
]
|
|
312
308
|
);
|
|
313
|
-
const schemaVersions3 =
|
|
309
|
+
const schemaVersions3 = sqliteTable(
|
|
314
310
|
n.schemaVersions,
|
|
315
311
|
{
|
|
316
312
|
graphId: text$1("graph_id").notNull(),
|
|
317
313
|
version: integer$1("version").notNull(),
|
|
318
314
|
schemaHash: text$1("schema_hash").notNull(),
|
|
319
|
-
schemaDoc:
|
|
320
|
-
createdAt:
|
|
321
|
-
isActive:
|
|
315
|
+
schemaDoc: text$1("schema_doc").notNull(),
|
|
316
|
+
createdAt: text$1("created_at").notNull(),
|
|
317
|
+
isActive: integer$1("is_active", { mode: "boolean" }).notNull().default(false)
|
|
322
318
|
},
|
|
323
319
|
(t) => [
|
|
324
320
|
primaryKey$1({ columns: [t.graphId, t.version] }),
|
|
325
321
|
index$1(`${n.schemaVersions}_active_idx`).on(t.graphId, t.isActive)
|
|
326
322
|
]
|
|
327
323
|
);
|
|
328
|
-
const embeddings3 =
|
|
324
|
+
const embeddings3 = sqliteTable(
|
|
329
325
|
n.embeddings,
|
|
330
326
|
{
|
|
331
327
|
graphId: text$1("graph_id").notNull(),
|
|
332
328
|
nodeKind: text$1("node_kind").notNull(),
|
|
333
329
|
nodeId: text$1("node_id").notNull(),
|
|
334
330
|
fieldPath: text$1("field_path").notNull(),
|
|
335
|
-
/**
|
|
336
|
-
|
|
331
|
+
/**
|
|
332
|
+
* Embedding vector.
|
|
333
|
+
* Stored as BLOB for sqlite-vec binary format, or JSON text for fallback.
|
|
334
|
+
* For sqlite-vec: use vec_f32() to convert JSON array to binary.
|
|
335
|
+
*/
|
|
336
|
+
embedding: blob("embedding", { mode: "buffer" }).notNull(),
|
|
337
337
|
/** Number of dimensions (for validation) */
|
|
338
338
|
dimensions: integer$1("dimensions").notNull(),
|
|
339
|
-
createdAt:
|
|
340
|
-
updatedAt:
|
|
339
|
+
createdAt: text$1("created_at").notNull(),
|
|
340
|
+
updatedAt: text$1("updated_at").notNull()
|
|
341
341
|
},
|
|
342
342
|
(t) => [
|
|
343
343
|
primaryKey$1({
|
|
@@ -359,7 +359,7 @@ function createPostgresTables(names = {}, options = {}) {
|
|
|
359
359
|
);
|
|
360
360
|
return { nodes: nodes3, edges: edges3, uniques: uniques3, schemaVersions: schemaVersions3, embeddings: embeddings3 };
|
|
361
361
|
}
|
|
362
|
-
var tables2 =
|
|
362
|
+
var tables2 = createSqliteTables();
|
|
363
363
|
var { nodes: nodes2, edges: edges2, uniques: uniques2, schemaVersions: schemaVersions2, embeddings: embeddings2 } = tables2;
|
|
364
364
|
function getSqliteColumnType(column) {
|
|
365
365
|
switch (column.columnType) {
|
|
@@ -479,7 +479,7 @@ function generateSqliteCreateIndexSQL(table) {
|
|
|
479
479
|
}
|
|
480
480
|
return statements;
|
|
481
481
|
}
|
|
482
|
-
function generateSqliteDDL(tables3 =
|
|
482
|
+
function generateSqliteDDL(tables3 = tables2) {
|
|
483
483
|
const statements = [];
|
|
484
484
|
for (const table of Object.values(tables3)) {
|
|
485
485
|
statements.push(generateSqliteCreateTableSQL(table));
|
|
@@ -489,7 +489,7 @@ function generateSqliteDDL(tables3 = tables) {
|
|
|
489
489
|
}
|
|
490
490
|
return statements;
|
|
491
491
|
}
|
|
492
|
-
function generateSqliteMigrationSQL(tables3 =
|
|
492
|
+
function generateSqliteMigrationSQL(tables3 = tables2) {
|
|
493
493
|
return generateSqliteDDL(tables3).join("\n\n");
|
|
494
494
|
}
|
|
495
495
|
function getPgColumnType(column) {
|
|
@@ -571,7 +571,7 @@ function generatePgCreateIndexSQL(table) {
|
|
|
571
571
|
}
|
|
572
572
|
return statements;
|
|
573
573
|
}
|
|
574
|
-
function generatePostgresDDL(tables3 =
|
|
574
|
+
function generatePostgresDDL(tables3 = tables) {
|
|
575
575
|
const statements = [];
|
|
576
576
|
for (const table of Object.values(tables3)) {
|
|
577
577
|
statements.push(generatePgCreateTableSQL(table));
|
|
@@ -581,7 +581,7 @@ function generatePostgresDDL(tables3 = tables2) {
|
|
|
581
581
|
}
|
|
582
582
|
return statements;
|
|
583
583
|
}
|
|
584
|
-
function generatePostgresMigrationSQL(tables3 =
|
|
584
|
+
function generatePostgresMigrationSQL(tables3 = tables) {
|
|
585
585
|
const extensionSql = "-- Enable pgvector extension for vector similarity search\nCREATE EXTENSION IF NOT EXISTS vector;";
|
|
586
586
|
const ddlSql = generatePostgresDDL(tables3).join("\n\n");
|
|
587
587
|
return `${extensionSql}
|
|
@@ -2122,5 +2122,5 @@ function compileQueryWithDialect(db, query, backendName) {
|
|
|
2122
2122
|
}
|
|
2123
2123
|
|
|
2124
2124
|
export { POSTGRES_CAPABILITIES, POSTGRES_ROW_MAPPER_CONFIG, SQLITE_CAPABILITIES, SQLITE_ROW_MAPPER_CONFIG, compileQueryWithDialect, createCommonOperationBackend, createEdgeRowMapper, createNodeRowMapper, createPostgresOperationStrategy, createPostgresTables, createPostgresVectorIndex, createSchemaVersionRowMapper, createSqliteOperationStrategy, createSqliteTables, createSqliteVectorIndex, createUniqueRowMapper, dropPostgresVectorIndex, dropSqliteVectorIndex, edges, edges2, embeddings, embeddings2, formatPostgresTimestamp, generatePostgresDDL, generatePostgresMigrationSQL, generateSqliteDDL, generateSqliteMigrationSQL, generateVectorIndexName, nodes, nodes2, nowIso, schemaVersions, schemaVersions2, tables, tables2, uniques, uniques2 };
|
|
2125
|
-
//# sourceMappingURL=chunk-
|
|
2126
|
-
//# sourceMappingURL=chunk-
|
|
2125
|
+
//# sourceMappingURL=chunk-HWWF3FOP.js.map
|
|
2126
|
+
//# sourceMappingURL=chunk-HWWF3FOP.js.map
|