@askdb/sqlite 0.1.0-beta.18 → 0.1.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/connector/describe.d.ts +5 -55
- package/dist/connector/describe.d.ts.map +1 -1
- package/dist/connector/describe.js +62 -91
- package/dist/connector/describe.js.map +1 -1
- package/dist/connector/provider.d.ts +6 -2
- package/dist/connector/provider.d.ts.map +1 -1
- package/dist/connector/provider.js +19 -15
- package/dist/connector/provider.js.map +1 -1
- package/dist/exec/sqlite.d.ts +1 -5
- package/dist/exec/sqlite.d.ts.map +1 -1
- package/dist/exec/sqlite.js +9 -65
- package/dist/exec/sqlite.js.map +1 -1
- package/dist/label.d.ts +11 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +28 -0
- package/dist/label.js.map +1 -0
- package/package.json +6 -7
- package/dist/connector/glob.d.ts +0 -3
- package/dist/connector/glob.d.ts.map +0 -1
- package/dist/connector/glob.js +0 -26
- package/dist/connector/glob.js.map +0 -1
- package/dist/connector/ids.d.ts +0 -8
- package/dist/connector/ids.d.ts.map +0 -1
- package/dist/connector/ids.js +0 -12
- package/dist/connector/ids.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,9 +9,11 @@ SQLite integration for AskDB. Bundles three pieces:
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
pnpm add @askdb/core @askdb/introspect @askdb/sqlite
|
|
12
|
+
pnpm add @askdb/core @askdb/introspect @askdb/sqlite ai
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
`ai` (Vercel AI SDK 6 or 7) is a required peer dependency of `@askdb/core`; your app owns its version.
|
|
16
|
+
|
|
15
17
|
`better-sqlite3` is an **optional peer dependency** — install it only when using live introspection mode:
|
|
16
18
|
|
|
17
19
|
```bash
|
|
@@ -58,7 +60,9 @@ const result = await introspect(
|
|
|
58
60
|
|
|
59
61
|
## Captured metadata
|
|
60
62
|
|
|
61
|
-
Tables, views, columns (SQLite affinity type strings), primary keys, unique constraints, foreign keys, and indexes. Requires SQLite ≥ 3.16 for `pragma_*` table-valued functions.
|
|
63
|
+
Tables, views, columns (SQLite affinity type strings), primary keys, unique constraints, foreign keys, and indexes. Requires SQLite ≥ 3.16 for `pragma_*` table-valued functions. A foreign key declared without a column list (`REFERENCES authors`) resolves to the parent table's primary key. Internal `sqlite_*` objects are skipped.
|
|
64
|
+
|
|
65
|
+
`sqliteConnectorProvider` gives a connector registry's `connectionLabel()` (and the `sourceLabel` from `resolveConnection()`) the file path. A plain path is returned unchanged unless it contains `?`, `#`, `;`, `=`, `@`, `://` or a control character; for a `file:` URI only the path is shown and the query string (where encryption keys go) is never read (`file:app.db?mode=ro&key=S3cret` → `app.db`), and a `file:` URI that contains `#` or names a host other than `localhost` gets no path. Anything else becomes `configured sqlite connection`.
|
|
62
66
|
|
|
63
67
|
## License
|
|
64
68
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CatalogQueryRunner, IntrospectionFilters, IntrospectionResult } from "@askdb/introspect";
|
|
2
|
-
import { compileTableFilters } from "./glob.js";
|
|
3
2
|
export type DescribeSqliteInput = {
|
|
4
3
|
runner: CatalogQueryRunner;
|
|
5
4
|
filters?: IntrospectionFilters;
|
|
@@ -8,60 +7,11 @@ export type DescribeSqliteInput = {
|
|
|
8
7
|
};
|
|
9
8
|
/** Internal: the catalog SQL strings, exposed for snapshot-based tests. */
|
|
10
9
|
export declare const SQLITE_CATALOG_SQL: {
|
|
11
|
-
readonly objects:
|
|
12
|
-
readonly columns:
|
|
13
|
-
readonly foreign_keys:
|
|
14
|
-
readonly index_list:
|
|
15
|
-
readonly index_info:
|
|
16
|
-
};
|
|
17
|
-
type ObjectRow = {
|
|
18
|
-
name: string;
|
|
19
|
-
type: "table" | "view" | string;
|
|
20
|
-
sql: string | null;
|
|
21
|
-
};
|
|
22
|
-
type ColumnRow = {
|
|
23
|
-
table_name: string;
|
|
24
|
-
cid: number;
|
|
25
|
-
column_name: string;
|
|
26
|
-
type: string;
|
|
27
|
-
notnull: 0 | 1 | number;
|
|
28
|
-
dflt_value: string | null;
|
|
29
|
-
pk: number;
|
|
30
|
-
};
|
|
31
|
-
type ForeignKeyRow = {
|
|
32
|
-
table_name: string;
|
|
33
|
-
fk_id: number;
|
|
34
|
-
seq: number;
|
|
35
|
-
referenced_table: string;
|
|
36
|
-
column_name: string;
|
|
37
|
-
referenced_column: string | null;
|
|
38
|
-
on_update: string | null;
|
|
39
|
-
on_delete: string | null;
|
|
40
|
-
};
|
|
41
|
-
type IndexListRow = {
|
|
42
|
-
table_name: string;
|
|
43
|
-
index_name: string;
|
|
44
|
-
is_unique: 0 | 1 | number;
|
|
45
|
-
origin: "c" | "u" | "pk" | string;
|
|
46
|
-
};
|
|
47
|
-
type IndexInfoRow = {
|
|
48
|
-
table_name: string;
|
|
49
|
-
index_name: string;
|
|
50
|
-
seqno: number;
|
|
51
|
-
cid: number;
|
|
52
|
-
column_name: string;
|
|
10
|
+
readonly objects: string;
|
|
11
|
+
readonly columns: string;
|
|
12
|
+
readonly foreign_keys: string;
|
|
13
|
+
readonly index_list: string;
|
|
14
|
+
readonly index_info: string;
|
|
53
15
|
};
|
|
54
16
|
export declare function describeSqlite(input: DescribeSqliteInput): Promise<IntrospectionResult>;
|
|
55
|
-
type FoldInput = {
|
|
56
|
-
schemaId: string;
|
|
57
|
-
tableFilter: ReturnType<typeof compileTableFilters>;
|
|
58
|
-
objectRows: ObjectRow[];
|
|
59
|
-
columnRows: ColumnRow[];
|
|
60
|
-
fkRows: ForeignKeyRow[];
|
|
61
|
-
indexListRows: IndexListRow[];
|
|
62
|
-
indexInfoRows: IndexInfoRow[];
|
|
63
|
-
declaredFilters: ReadonlyArray<string>;
|
|
64
|
-
};
|
|
65
|
-
export declare function foldSqliteResult(input: FoldInput): IntrospectionResult;
|
|
66
|
-
export {};
|
|
67
17
|
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/connector/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/connector/describe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EAUpB,MAAM,mBAAmB,CAAC;AAoB3B,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiEF,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AAsCX,wBAAsB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAwB7F"}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { makeColumnId, makeTableId } from "
|
|
1
|
+
import { SINGLE_NAMESPACE_LABEL } from "@askdb/core";
|
|
2
|
+
import { ambiguousFilterWarnings, buildOrderedGroups, byName, compileTableFilters, groupBy, makeColumnId, makeTableId, mapFkAction, rowsToRecords, } from "@askdb/introspect/kit";
|
|
3
3
|
/**
|
|
4
4
|
* SQLite has a single namespace per database file. We emit it as `"public"`
|
|
5
5
|
* to match `@askdb/prisma`'s convention and keep table ids cross-engine stable.
|
|
6
6
|
*/
|
|
7
|
-
const NAMESPACE =
|
|
7
|
+
const NAMESPACE = SINGLE_NAMESPACE_LABEL;
|
|
8
8
|
// SQLite catalog SQL — relies on the table-valued PRAGMA functions
|
|
9
9
|
// (`pragma_table_info`, `pragma_foreign_key_list`, `pragma_index_list`,
|
|
10
|
-
// `pragma_index_info`) available since SQLite 3.16.
|
|
11
|
-
//
|
|
10
|
+
// `pragma_index_info`) available since SQLite 3.16.
|
|
11
|
+
//
|
|
12
|
+
// Internal objects (`sqlite_sequence`, `sqlite_stat1`, `sqlite_autoindex_*`)
|
|
13
|
+
// all start with the literal, lowercase prefix `sqlite_`. We match it with
|
|
14
|
+
// `substr(name, 1, 7) <> 'sqlite_'` rather than `NOT LIKE 'sqlite_%'`: in LIKE
|
|
15
|
+
// the `_` is a single-char wildcard and matching is ASCII case-insensitive, so
|
|
16
|
+
// `NOT LIKE 'sqlite_%'` silently drops user tables such as `SqliteUsers`.
|
|
17
|
+
const NOT_INTERNAL = (col) => `substr(${col}, 1, 7) <> 'sqlite_'`;
|
|
12
18
|
const SQL_OBJECTS = `SELECT
|
|
13
19
|
name AS name,
|
|
14
20
|
type AS type,
|
|
15
21
|
sql AS sql
|
|
16
22
|
FROM sqlite_master
|
|
17
|
-
WHERE type IN ('table', 'view') AND name
|
|
23
|
+
WHERE type IN ('table', 'view') AND ${NOT_INTERNAL("name")}
|
|
18
24
|
ORDER BY name`;
|
|
19
25
|
const SQL_COLUMNS = `SELECT
|
|
20
26
|
m.name AS table_name,
|
|
@@ -25,7 +31,7 @@ const SQL_COLUMNS = `SELECT
|
|
|
25
31
|
p.dflt_value AS dflt_value,
|
|
26
32
|
p.pk AS pk
|
|
27
33
|
FROM sqlite_master m, pragma_table_info(m.name) p
|
|
28
|
-
WHERE m.type IN ('table', 'view') AND m.name
|
|
34
|
+
WHERE m.type IN ('table', 'view') AND ${NOT_INTERNAL("m.name")}
|
|
29
35
|
ORDER BY m.name, p.cid`;
|
|
30
36
|
const SQL_FOREIGN_KEYS = `SELECT
|
|
31
37
|
m.name AS table_name,
|
|
@@ -37,7 +43,7 @@ const SQL_FOREIGN_KEYS = `SELECT
|
|
|
37
43
|
fk.on_update AS on_update,
|
|
38
44
|
fk.on_delete AS on_delete
|
|
39
45
|
FROM sqlite_master m, pragma_foreign_key_list(m.name) fk
|
|
40
|
-
WHERE m.type = 'table' AND m.name
|
|
46
|
+
WHERE m.type = 'table' AND ${NOT_INTERNAL("m.name")}
|
|
41
47
|
ORDER BY m.name, fk.id, fk.seq`;
|
|
42
48
|
const SQL_INDEX_LIST = `SELECT
|
|
43
49
|
m.name AS table_name,
|
|
@@ -45,7 +51,7 @@ const SQL_INDEX_LIST = `SELECT
|
|
|
45
51
|
il."unique" AS is_unique,
|
|
46
52
|
il.origin AS origin
|
|
47
53
|
FROM sqlite_master m, pragma_index_list(m.name) il
|
|
48
|
-
WHERE m.type = 'table' AND m.name
|
|
54
|
+
WHERE m.type = 'table' AND ${NOT_INTERNAL("m.name")}
|
|
49
55
|
ORDER BY m.name, il.seq`;
|
|
50
56
|
const SQL_INDEX_INFO = `SELECT
|
|
51
57
|
m.name AS table_name,
|
|
@@ -54,7 +60,7 @@ const SQL_INDEX_INFO = `SELECT
|
|
|
54
60
|
ii.cid AS cid,
|
|
55
61
|
ii.name AS column_name
|
|
56
62
|
FROM sqlite_master m, pragma_index_list(m.name) il, pragma_index_info(il.name) ii
|
|
57
|
-
WHERE m.type = 'table' AND m.name
|
|
63
|
+
WHERE m.type = 'table' AND ${NOT_INTERNAL("m.name")}
|
|
58
64
|
ORDER BY m.name, il.name, ii.seqno`;
|
|
59
65
|
/** Internal: the catalog SQL strings, exposed for snapshot-based tests. */
|
|
60
66
|
export const SQLITE_CATALOG_SQL = {
|
|
@@ -67,20 +73,7 @@ export const SQLITE_CATALOG_SQL = {
|
|
|
67
73
|
export async function describeSqlite(input) {
|
|
68
74
|
const runner = input.runner;
|
|
69
75
|
const tableFilter = compileTableFilters(input.filters?.tables);
|
|
70
|
-
const run = async (sql) =>
|
|
71
|
-
const result = await runner(sql);
|
|
72
|
-
if (result.rows.length === 0)
|
|
73
|
-
return [];
|
|
74
|
-
const idx = new Map();
|
|
75
|
-
for (let i = 0; i < result.columns.length; i++)
|
|
76
|
-
idx.set(result.columns[i], i);
|
|
77
|
-
return result.rows.map((row) => {
|
|
78
|
-
const record = {};
|
|
79
|
-
for (const [name, i] of idx)
|
|
80
|
-
record[name] = row[i];
|
|
81
|
-
return record;
|
|
82
|
-
});
|
|
83
|
-
};
|
|
76
|
+
const run = async (sql) => rowsToRecords(await runner(sql));
|
|
84
77
|
const [objectRows, columnRows, fkRows, indexListRows, indexInfoRows] = await Promise.all([
|
|
85
78
|
run(SQL_OBJECTS),
|
|
86
79
|
run(SQL_COLUMNS),
|
|
@@ -99,19 +92,14 @@ export async function describeSqlite(input) {
|
|
|
99
92
|
declaredFilters: input.filters?.tables ?? [],
|
|
100
93
|
});
|
|
101
94
|
}
|
|
102
|
-
|
|
95
|
+
function foldSqliteResult(input) {
|
|
103
96
|
const warnings = [];
|
|
104
97
|
const columnsByTable = groupBy(input.columnRows, (r) => r.table_name);
|
|
105
98
|
const fksByTable = groupBy(input.fkRows, (r) => r.table_name);
|
|
106
99
|
const indexListByTable = groupBy(input.indexListRows, (r) => r.table_name);
|
|
107
100
|
// index info is keyed by `(table_name, index_name)` so we group per index.
|
|
108
|
-
const indexInfoByIndex =
|
|
109
|
-
|
|
110
|
-
const key = `${r.table_name}::${r.index_name}`;
|
|
111
|
-
const list = indexInfoByIndex.get(key) ?? [];
|
|
112
|
-
list.push(r);
|
|
113
|
-
indexInfoByIndex.set(key, list);
|
|
114
|
-
}
|
|
101
|
+
const indexInfoByIndex = groupBy(input.indexInfoRows, (r) => `${r.table_name}::${r.index_name}`);
|
|
102
|
+
const tableRefs = buildTableRefIndex(input.objectRows, columnsByTable);
|
|
115
103
|
const tables = [];
|
|
116
104
|
const views = [];
|
|
117
105
|
const viewDefinitions = {};
|
|
@@ -150,7 +138,7 @@ export function foldSqliteResult(input) {
|
|
|
150
138
|
comment: undefined,
|
|
151
139
|
columns,
|
|
152
140
|
primaryKey: pkColumns.length > 0 ? { columns: pkColumns } : undefined,
|
|
153
|
-
foreignKeys: buildForeignKeys(fksByTable.get(obj.name) ?? []),
|
|
141
|
+
foreignKeys: buildForeignKeys(fksByTable.get(obj.name) ?? [], tableRefs),
|
|
154
142
|
uniqueConstraints,
|
|
155
143
|
indexes,
|
|
156
144
|
checkConstraints: [],
|
|
@@ -166,12 +154,7 @@ export function foldSqliteResult(input) {
|
|
|
166
154
|
sequences: [],
|
|
167
155
|
};
|
|
168
156
|
const isEmpty = tables.length === 0 && views.length === 0;
|
|
169
|
-
|
|
170
|
-
const matched = tables.some((t) => compileTableFilters([pattern])(`${NAMESPACE}.${t.name}`)) ||
|
|
171
|
-
views.some((v) => compileTableFilters([pattern])(`${NAMESPACE}.${v.name}`));
|
|
172
|
-
if (!matched)
|
|
173
|
-
warnings.push({ code: "ambiguous_filter", filter: pattern });
|
|
174
|
-
}
|
|
157
|
+
warnings.push(...ambiguousFilterWarnings(input.declaredFilters, [...tables, ...views].map((t) => `${NAMESPACE}.${t.name}`)));
|
|
175
158
|
const schema = {
|
|
176
159
|
schemaId: input.schemaId,
|
|
177
160
|
schemas: isEmpty ? [] : [namespace],
|
|
@@ -193,36 +176,53 @@ function buildColumn(table, c, pkSet) {
|
|
|
193
176
|
comment: undefined,
|
|
194
177
|
};
|
|
195
178
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
179
|
+
/**
|
|
180
|
+
* Case-insensitive index of every table's canonical name and ordered PK
|
|
181
|
+
* columns. SQLite identifiers are case-insensitive for ASCII letters only, so
|
|
182
|
+
* `REFERENCES Authors` resolves to a table created as `authors`, while `Ä` and
|
|
183
|
+
* `ä` stay two tables.
|
|
184
|
+
*/
|
|
185
|
+
function buildTableRefIndex(objectRows, columnsByTable) {
|
|
186
|
+
const refs = new Map();
|
|
187
|
+
for (const obj of objectRows) {
|
|
188
|
+
if (obj.type !== "table")
|
|
189
|
+
continue;
|
|
190
|
+
const pkColumns = (columnsByTable.get(obj.name) ?? [])
|
|
191
|
+
.filter((c) => c.pk > 0)
|
|
192
|
+
.sort((a, b) => a.pk - b.pk)
|
|
193
|
+
.map((c) => c.column_name);
|
|
194
|
+
refs.set(foldIdentifier(obj.name), { name: obj.name, pkColumns });
|
|
203
195
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
196
|
+
return refs;
|
|
197
|
+
}
|
|
198
|
+
/** SQLite's identifier case folding: ASCII `A`–`Z` only. */
|
|
199
|
+
function foldIdentifier(name) {
|
|
200
|
+
return name.replace(/[A-Z]/g, (c) => c.toLowerCase());
|
|
201
|
+
}
|
|
202
|
+
function buildForeignKeys(rows, tableRefs) {
|
|
203
|
+
// `fk_id` is unique per table; rows with the same id form one multi-column FK.
|
|
204
|
+
return buildOrderedGroups(rows, (r) => r.fk_id, (r) => r.seq, (_fkId, ordered) => {
|
|
207
205
|
const sample = ordered[0];
|
|
206
|
+
const target = tableRefs.get(foldIdentifier(sample.referenced_table));
|
|
208
207
|
// SQLite doesn't name foreign keys; synthesize a stable name.
|
|
209
208
|
const name = `${sample.table_name}_${ordered.map((r) => r.column_name).join("_")}_fkey`;
|
|
210
|
-
|
|
209
|
+
return {
|
|
211
210
|
name,
|
|
212
211
|
columns: ordered.map((r) => r.column_name),
|
|
213
212
|
references: {
|
|
214
213
|
schema: NAMESPACE,
|
|
215
|
-
table: sample.referenced_table,
|
|
216
|
-
//
|
|
217
|
-
//
|
|
218
|
-
//
|
|
219
|
-
|
|
214
|
+
table: target?.name ?? sample.referenced_table,
|
|
215
|
+
// `REFERENCES parent` without a column list targets the parent's
|
|
216
|
+
// PRIMARY KEY; pragma_foreign_key_list reports `to` as NULL then.
|
|
217
|
+
// Resolve it to the parent's PK column at the same position (PK
|
|
218
|
+
// ordinal order). Only when the parent's PK is unknown (e.g. a
|
|
219
|
+
// dangling reference) do we fall back to the child column name.
|
|
220
|
+
columns: ordered.map((r, i) => r.referenced_column ?? target?.pkColumns[i] ?? r.column_name),
|
|
220
221
|
},
|
|
221
|
-
onDelete:
|
|
222
|
-
onUpdate:
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return fks.sort((a, b) => a.name.localeCompare(b.name));
|
|
222
|
+
onDelete: mapFkAction(sample.on_delete),
|
|
223
|
+
onUpdate: mapFkAction(sample.on_update),
|
|
224
|
+
};
|
|
225
|
+
});
|
|
226
226
|
}
|
|
227
227
|
function buildIndexesAndUniques(tableName, indexList, indexInfoByIndex) {
|
|
228
228
|
const uniqueConstraints = [];
|
|
@@ -246,37 +246,8 @@ function buildIndexesAndUniques(tableName, indexList, indexInfoByIndex) {
|
|
|
246
246
|
method: "btree",
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
uniqueConstraints.sort(
|
|
250
|
-
indexes.sort(
|
|
249
|
+
uniqueConstraints.sort(byName);
|
|
250
|
+
indexes.sort(byName);
|
|
251
251
|
return { uniqueConstraints, indexes };
|
|
252
252
|
}
|
|
253
|
-
function mapAction(rule) {
|
|
254
|
-
if (!rule)
|
|
255
|
-
return undefined;
|
|
256
|
-
const r = rule.toLowerCase();
|
|
257
|
-
if (r === "cascade")
|
|
258
|
-
return "cascade";
|
|
259
|
-
if (r === "restrict")
|
|
260
|
-
return "restrict";
|
|
261
|
-
if (r === "set null")
|
|
262
|
-
return "set null";
|
|
263
|
-
if (r === "set default")
|
|
264
|
-
return "set default";
|
|
265
|
-
if (r === "no action")
|
|
266
|
-
return "no action";
|
|
267
|
-
return undefined;
|
|
268
|
-
}
|
|
269
|
-
function groupBy(rows, key) {
|
|
270
|
-
const out = new Map();
|
|
271
|
-
for (const row of rows) {
|
|
272
|
-
const k = key(row);
|
|
273
|
-
const list = out.get(k) ?? [];
|
|
274
|
-
list.push(row);
|
|
275
|
-
out.set(k, list);
|
|
276
|
-
}
|
|
277
|
-
return out;
|
|
278
|
-
}
|
|
279
|
-
function byName(a, b) {
|
|
280
|
-
return a.name.localeCompare(b.name);
|
|
281
|
-
}
|
|
282
253
|
//# sourceMappingURL=describe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/connector/describe.ts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AAE,OAAO,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The configured file path is passed to `better-sqlite3` unchanged, so a
|
|
3
|
+
* relative path resolves against the process cwd — the project root for the
|
|
4
|
+
* `askdb` CLI and Studio, which discover `askdb.config.*` in the cwd.
|
|
5
|
+
*/
|
|
6
|
+
export declare const sqliteConnectorProvider: import("@askdb/introspect").ConnectorProviderAdapter;
|
|
3
7
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/connector/provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/connector/provider.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,sDAalC,CAAC"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
+
import { defineLiveConnectorProvider } from "@askdb/introspect/kit";
|
|
1
2
|
import { createSqliteConnector } from "./index.js";
|
|
2
3
|
import { createSqliteCatalogQueryRunner } from "../exec/sqlite.js";
|
|
3
|
-
|
|
4
|
+
import { parseSqliteConnection } from "../label.js";
|
|
5
|
+
/**
|
|
6
|
+
* The configured file path is passed to `better-sqlite3` unchanged, so a
|
|
7
|
+
* relative path resolves against the process cwd — the project root for the
|
|
8
|
+
* `askdb` CLI and Studio, which discover `askdb.config.*` in the cwd.
|
|
9
|
+
*/
|
|
10
|
+
export const sqliteConnectorProvider = defineLiveConnectorProvider({
|
|
4
11
|
provider: "sqlite",
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
input: {
|
|
12
|
-
mode: "live",
|
|
13
|
-
runner: createSqliteCatalogQueryRunner(config.url),
|
|
14
|
-
filters: config.filters,
|
|
15
|
-
},
|
|
16
|
-
connector: createSqliteConnector(),
|
|
17
|
-
};
|
|
12
|
+
displayName: "SQLite",
|
|
13
|
+
runtimeKey: "sqliteFile",
|
|
14
|
+
connectionNoun: "a file path",
|
|
15
|
+
missingConnection: {
|
|
16
|
+
cli: "Provide --url <path-to-sqlite-file> (or set introspection.providerConfig.sqlite.file / ASKDB_INTROSPECT_SQLITE_FILE).",
|
|
17
|
+
config: "No SQLite file configured. Set introspection.providerConfig.sqlite.file in askdb.config.ts.",
|
|
18
18
|
},
|
|
19
|
-
|
|
19
|
+
fromExportUnsupported: "--from-export is currently supported only for --engine postgres (got sqlite).",
|
|
20
|
+
createConnector: createSqliteConnector,
|
|
21
|
+
createRunner: (file) => createSqliteCatalogQueryRunner(file),
|
|
22
|
+
connectionLabelParts: parseSqliteConnection,
|
|
23
|
+
});
|
|
20
24
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/connector/provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/connector/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;IACjE,QAAQ,EAAE,QAAQ;IAClB,WAAW,EAAE,QAAQ;IACrB,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE,aAAa;IAC7B,iBAAiB,EAAE;QACjB,GAAG,EAAE,uHAAuH;QAC5H,MAAM,EAAE,6FAA6F;KACtG;IACD,qBAAqB,EAAE,+EAA+E;IACtG,eAAe,EAAE,qBAAqB;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,8BAA8B,CAAC,IAAI,CAAC;IAC5D,oBAAoB,EAAE,qBAAqB;CAC5C,CAAC,CAAC"}
|
package/dist/exec/sqlite.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { CatalogQueryRunner } from "@askdb/introspect";
|
|
2
|
+
import { type DriverLoadOptions } from "@askdb/introspect/kit";
|
|
2
3
|
import type DatabaseCtor from "better-sqlite3";
|
|
3
4
|
export type { CatalogQueryResult, CatalogQueryRunner } from "@askdb/introspect";
|
|
4
5
|
type Bs3Namespace = {
|
|
5
6
|
default: typeof DatabaseCtor;
|
|
6
7
|
};
|
|
7
8
|
export type { Bs3Namespace };
|
|
8
|
-
type DriverLoadOptions = {
|
|
9
|
-
resolveFrom?: string;
|
|
10
|
-
};
|
|
11
|
-
/** @internal exposed for tests that need to reset the lazy `better-sqlite3` cache. */
|
|
12
|
-
export declare function __resetBetterSqlite3ModuleCacheForTests(): void;
|
|
13
9
|
/**
|
|
14
10
|
* Resolve and cache the optional `better-sqlite3` peer driver, with the same
|
|
15
11
|
* lazy-import + project-root fallback behavior as the catalog runner.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/exec/sqlite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAsB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/exec/sqlite.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAsB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,KAAK,YAAY,GAAG;IAAE,OAAO,EAAE,OAAO,YAAY,CAAA;CAAE,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,CAAC;AAQ7B;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAEhG;AAED,wBAAgB,8BAA8B,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAEnF;AA8BD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,kBAAkB,CAEpB"}
|
package/dist/exec/sqlite.js
CHANGED
|
@@ -1,78 +1,22 @@
|
|
|
1
1
|
import { AskDbError } from "@askdb/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return false;
|
|
9
|
-
const nestedCause = cause.cause;
|
|
10
|
-
if (nestedCause && nestedCause !== cause && isModuleResolutionFailure(nestedCause, packageName)) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
const code = cause.code;
|
|
14
|
-
if (code !== "ERR_MODULE_NOT_FOUND" && code !== "MODULE_NOT_FOUND")
|
|
15
|
-
return false;
|
|
16
|
-
return cause.message.includes(packageName);
|
|
17
|
-
}
|
|
18
|
-
async function importOptionalBetterSqlite3(opts) {
|
|
19
|
-
try {
|
|
20
|
-
return (await import("better-sqlite3"));
|
|
21
|
-
}
|
|
22
|
-
catch (cause) {
|
|
23
|
-
if (!isModuleResolutionFailure(cause, "better-sqlite3"))
|
|
24
|
-
throw cause;
|
|
25
|
-
const fromDir = opts?.resolveFrom ?? process.cwd();
|
|
26
|
-
const projectRequire = createRequire(join(fromDir, "package.json"));
|
|
27
|
-
try {
|
|
28
|
-
const resolved = projectRequire.resolve("better-sqlite3");
|
|
29
|
-
return (await import(pathToFileURL(resolved).href));
|
|
30
|
-
}
|
|
31
|
-
catch (projectCause) {
|
|
32
|
-
if (!isModuleResolutionFailure(projectCause, "better-sqlite3"))
|
|
33
|
-
throw projectCause;
|
|
34
|
-
throw new AggregateError([cause, projectCause], "Unable to resolve optional `better-sqlite3` peer dependency");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async function loadBetterSqlite3OrThrow(opts) {
|
|
39
|
-
const key = opts?.resolveFrom;
|
|
40
|
-
let promise = bs3ModulePromises.get(key);
|
|
41
|
-
if (!promise) {
|
|
42
|
-
promise = importOptionalBetterSqlite3(opts).catch((cause) => {
|
|
43
|
-
bs3ModulePromises.delete(key);
|
|
44
|
-
throw new AskDbError("The built-in SQLite catalog query runner requires the optional `better-sqlite3` peer dependency. " +
|
|
45
|
-
"Install it in your project (e.g. `pnpm add better-sqlite3`) or include it in the same one-off command " +
|
|
46
|
-
"(e.g. `pnpm dlx -p askdb -p better-sqlite3 askdb ...` or `npx -p askdb -p better-sqlite3 askdb ...`). " +
|
|
47
|
-
"You can also pass a custom catalog query runner to the SQLite connector.", cause);
|
|
48
|
-
});
|
|
49
|
-
bs3ModulePromises.set(key, promise);
|
|
50
|
-
}
|
|
51
|
-
return promise;
|
|
52
|
-
}
|
|
53
|
-
/** @internal exposed for tests that need to reset the lazy `better-sqlite3` cache. */
|
|
54
|
-
export function __resetBetterSqlite3ModuleCacheForTests() {
|
|
55
|
-
bs3ModulePromises.clear();
|
|
56
|
-
}
|
|
2
|
+
import { createOptionalDriverLoader, rethrowDriverImportError, isDriverInstalled, missingDriverMessage, } from "@askdb/introspect/kit";
|
|
3
|
+
const betterSqlite3Loader = createOptionalDriverLoader({
|
|
4
|
+
packageName: "better-sqlite3",
|
|
5
|
+
importDriver: () => import("better-sqlite3").catch(rethrowDriverImportError),
|
|
6
|
+
missingMessage: missingDriverMessage({ engine: "SQLite", packageName: "better-sqlite3" }),
|
|
7
|
+
});
|
|
57
8
|
/**
|
|
58
9
|
* Resolve and cache the optional `better-sqlite3` peer driver, with the same
|
|
59
10
|
* lazy-import + project-root fallback behavior as the catalog runner.
|
|
60
11
|
*/
|
|
61
12
|
export async function loadBetterSqlite3Driver(options) {
|
|
62
|
-
return
|
|
13
|
+
return betterSqlite3Loader.load(options);
|
|
63
14
|
}
|
|
64
15
|
export function isBetterSqlite3DriverInstalled(options) {
|
|
65
|
-
|
|
66
|
-
const req = createRequire(join(options?.resolveFrom ?? process.cwd(), "package.json"));
|
|
67
|
-
req.resolve("better-sqlite3");
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
16
|
+
return isDriverInstalled("better-sqlite3", options);
|
|
73
17
|
}
|
|
74
18
|
async function runSqliteCatalogQuery(filename, sql, params, options) {
|
|
75
|
-
const mod = await
|
|
19
|
+
const mod = await betterSqlite3Loader.load(options);
|
|
76
20
|
const Database = mod.default;
|
|
77
21
|
const db = new Database(filename, { readonly: true, fileMustExist: true });
|
|
78
22
|
try {
|
package/dist/exec/sqlite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../../src/exec/sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,
|
|
1
|
+
{"version":3,"file":"sqlite.js","sourceRoot":"","sources":["../../src/exec/sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAW/B,MAAM,mBAAmB,GAAG,0BAA0B,CAAe;IACnE,WAAW,EAAE,gBAAgB;IAC7B,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAqC;IAChH,cAAc,EAAE,oBAAoB,CAAC,EAAE,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AAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,UAAU;YAAE,MAAM,CAAC,CAAC;QACrC,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,IAAI,UAAU,CAAC,gCAAgC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAAgB,EAChB,OAA2B;IAE3B,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAChF,CAAC"}
|
package/dist/label.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ConnectionLabelParts } from "@askdb/introspect/kit";
|
|
2
|
+
/**
|
|
3
|
+
* The display-safe part of a SQLite "connection string": the file path. A
|
|
4
|
+
* plain path (or `:memory:`) is returned as-is; `formatConnectionLabel` then
|
|
5
|
+
* rejects one that contains `? # ; = @` or a control character. For a `file:`
|
|
6
|
+
* URI only the path is returned; its query string (where encryption keys live)
|
|
7
|
+
* is never read. Anything else returns `undefined`, so the registry labels it
|
|
8
|
+
* `configured sqlite connection`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseSqliteConnection(input: string): ConnectionLabelParts | undefined;
|
|
11
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../src/label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAgBrF"}
|
package/dist/label.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The display-safe part of a SQLite "connection string": the file path. A
|
|
3
|
+
* plain path (or `:memory:`) is returned as-is; `formatConnectionLabel` then
|
|
4
|
+
* rejects one that contains `? # ; = @` or a control character. For a `file:`
|
|
5
|
+
* URI only the path is returned; its query string (where encryption keys live)
|
|
6
|
+
* is never read. Anything else returns `undefined`, so the registry labels it
|
|
7
|
+
* `configured sqlite connection`.
|
|
8
|
+
*/
|
|
9
|
+
export function parseSqliteConnection(input) {
|
|
10
|
+
if (!/^file:/i.test(input)) {
|
|
11
|
+
return input.includes("://") ? undefined : { file: input };
|
|
12
|
+
}
|
|
13
|
+
const uri = input.slice("file:".length);
|
|
14
|
+
if (uri.includes("#"))
|
|
15
|
+
return undefined;
|
|
16
|
+
const query = uri.indexOf("?");
|
|
17
|
+
let path = query === -1 ? uri : uri.slice(0, query);
|
|
18
|
+
if (path.startsWith("//")) {
|
|
19
|
+
// file://[localhost]/path — any other authority is not a local file.
|
|
20
|
+
const slash = path.indexOf("/", 2);
|
|
21
|
+
const authority = slash === -1 ? path.slice(2) : path.slice(2, slash);
|
|
22
|
+
if (authority !== "" && authority.toLowerCase() !== "localhost")
|
|
23
|
+
return undefined;
|
|
24
|
+
path = slash === -1 ? "" : path.slice(slash);
|
|
25
|
+
}
|
|
26
|
+
return path === "" ? undefined : { file: path };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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CAAC;IAC/C,CAAC;IACD,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askdb/sqlite",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.19",
|
|
4
4
|
"description": "AskDB SQLite integration: introspection connector via sqlite_master + PRAGMA functions and a better-sqlite3-backed catalog query runner. Pairs with @askdb/core's SQLITE_DIALECT.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"askdb",
|
|
@@ -40,12 +40,11 @@
|
|
|
40
40
|
"NOTICE"
|
|
41
41
|
],
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=22.
|
|
43
|
+
"node": ">=22.23.4"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@askdb/
|
|
47
|
-
"@askdb/
|
|
48
|
-
"@askdb/introspect": "0.3.0-beta.17"
|
|
46
|
+
"@askdb/core": "1.0.0-beta.44",
|
|
47
|
+
"@askdb/introspect": "0.3.0-beta.18"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"better-sqlite3": ">=12"
|
|
@@ -57,9 +56,9 @@
|
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
58
|
"@types/better-sqlite3": "^7.6.13",
|
|
60
|
-
"better-sqlite3": "^12.
|
|
59
|
+
"better-sqlite3": "^12.11.1",
|
|
61
60
|
"typescript": "^6.0.3",
|
|
62
|
-
"vitest": "^5.0.
|
|
61
|
+
"vitest": "^5.0.5"
|
|
63
62
|
},
|
|
64
63
|
"scripts": {
|
|
65
64
|
"build": "tsc -p tsconfig.build.json",
|
package/dist/connector/glob.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/connector/glob.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,WAAW,GAAG,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC;AAE7D,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,GAC1C,WAAW,CAIb"}
|
package/dist/connector/glob.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal glob matcher for `IntrospectionFilters.tables`. Matches against
|
|
3
|
-
* `"<schema>.<name>"`; supports `*` (any run) and `?` (single char).
|
|
4
|
-
*/
|
|
5
|
-
function compileGlob(pattern) {
|
|
6
|
-
let out = "^";
|
|
7
|
-
for (const ch of pattern) {
|
|
8
|
-
if (ch === "*")
|
|
9
|
-
out += ".*";
|
|
10
|
-
else if (ch === "?")
|
|
11
|
-
out += ".";
|
|
12
|
-
else if (/[.+^${}()|[\]\\]/.test(ch))
|
|
13
|
-
out += "\\" + ch;
|
|
14
|
-
else
|
|
15
|
-
out += ch;
|
|
16
|
-
}
|
|
17
|
-
out += "$";
|
|
18
|
-
return new RegExp(out);
|
|
19
|
-
}
|
|
20
|
-
export function compileTableFilters(patterns) {
|
|
21
|
-
if (!patterns || patterns.length === 0)
|
|
22
|
-
return () => true;
|
|
23
|
-
const compiled = patterns.map(compileGlob);
|
|
24
|
-
return (qualifiedName) => compiled.some((re) => re.test(qualifiedName));
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=glob.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/connector/glob.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,SAAS,WAAW,CAAC,OAAe;IAClC,IAAI,GAAG,GAAG,GAAG,CAAC;IACd,KAAK,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC;QACzB,IAAI,EAAE,KAAK,GAAG;YAAE,GAAG,IAAI,IAAI,CAAC;aACvB,IAAI,EAAE,KAAK,GAAG;YAAE,GAAG,IAAI,GAAG,CAAC;aAC3B,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;YAAE,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC;;YAClD,GAAG,IAAI,EAAE,CAAC;IACjB,CAAC;IACD,GAAG,IAAI,GAAG,CAAC;IACX,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAID,MAAM,UAAU,mBAAmB,CACjC,QAA2C;IAE3C,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IAC1D,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/connector/ids.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Schema v2 ID conventions — kept aligned with the postgres / mysql connectors.
|
|
3
|
-
* SQLite has a single namespace per database; we emit `"public"` to match
|
|
4
|
-
* `@askdb/prisma`'s default and keep table ids cross-engine stable.
|
|
5
|
-
*/
|
|
6
|
-
export declare function makeTableId(schemaName: string, tableName: string): string;
|
|
7
|
-
export declare function makeColumnId(schemaName: string, tableName: string, columnName: string): string;
|
|
8
|
-
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/connector/ids.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,wBAAgB,YAAY,CAC1B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,MAAM,CAER"}
|
package/dist/connector/ids.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Schema v2 ID conventions — kept aligned with the postgres / mysql connectors.
|
|
3
|
-
* SQLite has a single namespace per database; we emit `"public"` to match
|
|
4
|
-
* `@askdb/prisma`'s default and keep table ids cross-engine stable.
|
|
5
|
-
*/
|
|
6
|
-
export function makeTableId(schemaName, tableName) {
|
|
7
|
-
return `table:${schemaName}.${tableName}`;
|
|
8
|
-
}
|
|
9
|
-
export function makeColumnId(schemaName, tableName, columnName) {
|
|
10
|
-
return `table:${schemaName}.${tableName}#${columnName}`;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=ids.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/connector/ids.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,UAAkB,EAAE,SAAiB;IAC/D,OAAO,SAAS,UAAU,IAAI,SAAS,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,UAAkB,EAClB,SAAiB,EACjB,UAAkB;IAElB,OAAO,SAAS,UAAU,IAAI,SAAS,IAAI,UAAU,EAAE,CAAC;AAC1D,CAAC"}
|