@askdb/prisma 0.2.0-beta.1

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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may accept and charge a
167
+ fee for, the acceptance of support, warranty, indemnity, or
168
+ other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Yahya Gilany
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,10 @@
1
+ AskDB
2
+ Copyright 2026 Yahya Gilany
3
+
4
+ This product includes software developed by Yahya Gilany and contributors.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @askdb/prisma
2
+
3
+ Prisma schema-file introspection for AskDB.
4
+
5
+ `@askdb/prisma` reads one `schema.prisma` file or a directory of `.prisma` files and produces the same Schema v2 physical artifact used by the rest of AskDB. It does not connect to the database and does not execute generated SQL.
6
+
7
+ ```ts
8
+ import { introspect } from "@askdb/introspect";
9
+ import { createPrismaConnector } from "@askdb/prisma";
10
+
11
+ const result = await introspect(
12
+ { schemaPath: "./prisma", schemaId: "my-app" },
13
+ { outDir: "my-app.schema", schemaId: "my-app" },
14
+ { connector: createPrismaConnector() },
15
+ );
16
+ ```
17
+
18
+ CLI:
19
+
20
+ ```sh
21
+ askdb introspect --engine prisma --prisma-schema ./prisma --out my-app.schema
22
+ askdb introspect --engine prisma --prisma-schema ./prisma/schema.prisma --print
23
+ askdb introspect --engine prisma --prisma-schema ./prisma --diff my-app.schema
24
+ ```
25
+
26
+ Supported Prisma datasource providers are `postgresql`, `mysql`, `sqlite`, `sqlserver`, and `cockroachdb`. MongoDB is not supported because AskDB Schema v2 and SQL generation are relational.
@@ -0,0 +1,2 @@
1
+ export { createPrismaConnector, describePrismaSchema, type PrismaIntrospectionInput, type PrismaSchemaProvider, } from "./prisma.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,GAC1B,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { createPrismaConnector, describePrismaSchema, } from "./prisma.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GAGrB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Connector, IntrospectionFilters, IntrospectionResult } from "@askdb/introspect";
2
+ export type PrismaSchemaProvider = "postgresql" | "mysql" | "sqlite" | "sqlserver" | "cockroachdb";
3
+ export type PrismaIntrospectionInput = {
4
+ /** Path to a `schema.prisma` file or a directory containing one or more `.prisma` files. */
5
+ schemaPath: string;
6
+ /** Optional `schemaId` for the resulting `SqlSchema`. Defaults to `"introspected"`. */
7
+ schemaId?: string;
8
+ filters?: IntrospectionFilters;
9
+ };
10
+ export declare function createPrismaConnector(): Connector<PrismaIntrospectionInput>;
11
+ export declare function describePrismaSchema(input: PrismaIntrospectionInput): Promise<IntrospectionResult>;
12
+ //# sourceMappingURL=prisma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../src/prisma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EAWpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,WAAW,GACX,aAAa,CAAC;AAElB,MAAM,MAAM,wBAAwB,GAAG;IACrC,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,CAAC;AA4EF,wBAAgB,qBAAqB,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAM3E;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,mBAAmB,CAAC,CAuB9B"}
package/dist/prisma.js ADDED
@@ -0,0 +1,439 @@
1
+ import { readdirSync, readFileSync, statSync } from "node:fs";
2
+ import { join, resolve } from "node:path";
3
+ import prismaInternals from "@prisma/internals";
4
+ const SUPPORTED_PROVIDERS = new Set([
5
+ "postgresql",
6
+ "mysql",
7
+ "sqlite",
8
+ "sqlserver",
9
+ "cockroachdb",
10
+ ]);
11
+ const DEFAULT_SCHEMA = "public";
12
+ const { getConfig, getDMMF } = prismaInternals;
13
+ export function createPrismaConnector() {
14
+ return {
15
+ describe(input) {
16
+ return describePrismaSchema(input);
17
+ },
18
+ };
19
+ }
20
+ export async function describePrismaSchema(input) {
21
+ const datamodel = stripDatasourceConnectionUrls(readPrismaSchema(input.schemaPath));
22
+ const config = await getConfig({ datamodel });
23
+ const provider = config.datasources[0]?.provider;
24
+ assertSupportedProvider(provider);
25
+ const dmmf = (await getDMMF({ datamodel }));
26
+ const hints = extractSchemaHints(datamodel);
27
+ const warnings = [];
28
+ const schema = foldPrismaDmmf({
29
+ dmmf,
30
+ hints,
31
+ schemaId: input.schemaId ?? "introspected",
32
+ filters: input.filters,
33
+ warnings,
34
+ });
35
+ return {
36
+ schema,
37
+ warnings,
38
+ isEmpty: schema.schemas.every((ns) => ns.tables.length === 0),
39
+ viewDefinitions: {},
40
+ };
41
+ }
42
+ function readPrismaSchema(schemaPath) {
43
+ const absolute = resolve(schemaPath);
44
+ const stat = statSync(absolute);
45
+ if (stat.isFile()) {
46
+ if (!absolute.endsWith(".prisma")) {
47
+ throw new Error(`@askdb/prisma: expected a .prisma file, got ${schemaPath}`);
48
+ }
49
+ return readFileSync(absolute, "utf8");
50
+ }
51
+ if (!stat.isDirectory()) {
52
+ throw new Error(`@askdb/prisma: schema path is not a file or directory: ${schemaPath}`);
53
+ }
54
+ const files = listPrismaFiles(absolute);
55
+ if (files.length === 0) {
56
+ throw new Error(`@askdb/prisma: no .prisma files found in ${schemaPath}`);
57
+ }
58
+ return files.map((file) => [file, readFileSync(file, "utf8")]);
59
+ }
60
+ function listPrismaFiles(dir) {
61
+ const files = [];
62
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
63
+ const fullPath = join(dir, entry.name);
64
+ if (entry.isDirectory()) {
65
+ files.push(...listPrismaFiles(fullPath));
66
+ }
67
+ else if (entry.isFile() && entry.name.endsWith(".prisma")) {
68
+ files.push(fullPath);
69
+ }
70
+ }
71
+ return files.sort((a, b) => a.localeCompare(b));
72
+ }
73
+ function assertSupportedProvider(provider) {
74
+ if (!provider) {
75
+ throw new Error("@askdb/prisma: Prisma schema must declare a datasource provider.");
76
+ }
77
+ if (!SUPPORTED_PROVIDERS.has(provider)) {
78
+ throw new Error(`@askdb/prisma: unsupported Prisma datasource provider '${provider}'. ` +
79
+ "Supported relational providers are postgresql, mysql, sqlite, sqlserver, and cockroachdb.");
80
+ }
81
+ }
82
+ function foldPrismaDmmf(input) {
83
+ const tableFilter = compileTableFilters(input.filters?.tables);
84
+ const includeSchemas = input.filters?.schemas
85
+ ? new Set(input.filters.schemas)
86
+ : undefined;
87
+ const excludeSchemas = new Set(input.filters?.excludeSchemas ?? []);
88
+ const modelsByName = new Map(input.dmmf.datamodel.models.map((m) => [m.name, m]));
89
+ const tablesBySchema = new Map();
90
+ const matchedFilters = new Set();
91
+ for (const model of input.dmmf.datamodel.models) {
92
+ const schemaName = model.schema ?? DEFAULT_SCHEMA;
93
+ if (includeSchemas && !includeSchemas.has(schemaName))
94
+ continue;
95
+ if (excludeSchemas.has(schemaName))
96
+ continue;
97
+ const tableName = dbName(model);
98
+ const qualified = `${schemaName}.${tableName}`;
99
+ if (!tableFilter(qualified))
100
+ continue;
101
+ markMatchedFilters(qualified, input.filters?.tables, matchedFilters);
102
+ const table = buildTable({
103
+ model,
104
+ hints: input.hints,
105
+ modelsByName,
106
+ dmmfIndexes: input.dmmf.datamodel.indexes ?? [],
107
+ schemaName,
108
+ tableName,
109
+ warnings: input.warnings,
110
+ });
111
+ const list = tablesBySchema.get(schemaName) ?? [];
112
+ list.push(table);
113
+ tablesBySchema.set(schemaName, list);
114
+ }
115
+ for (const pattern of input.filters?.tables ?? []) {
116
+ if (!matchedFilters.has(pattern)) {
117
+ input.warnings.push({ code: "ambiguous_filter", filter: pattern });
118
+ }
119
+ }
120
+ const enumsBySchema = new Map();
121
+ const enumSchema = DEFAULT_SCHEMA;
122
+ if (!includeSchemas || includeSchemas.has(enumSchema)) {
123
+ for (const enumDef of input.dmmf.datamodel.enums) {
124
+ if (excludeSchemas.has(enumSchema))
125
+ continue;
126
+ const list = enumsBySchema.get(enumSchema) ?? [];
127
+ list.push({
128
+ schema: enumSchema,
129
+ name: enumDef.dbName ?? enumDef.name,
130
+ values: enumDef.values.map((value) => value.dbName ?? value.name),
131
+ });
132
+ enumsBySchema.set(enumSchema, list);
133
+ }
134
+ }
135
+ const schemaNames = sortedUnique([
136
+ ...tablesBySchema.keys(),
137
+ ...enumsBySchema.keys(),
138
+ ]);
139
+ const schemas = schemaNames.map((name) => ({
140
+ name,
141
+ tables: (tablesBySchema.get(name) ?? []).slice().sort(byName),
142
+ views: [],
143
+ enums: (enumsBySchema.get(name) ?? []).slice().sort(byName),
144
+ sequences: [],
145
+ }));
146
+ return { schemaId: input.schemaId, schemas };
147
+ }
148
+ function buildTable(input) {
149
+ const scalarFields = [
150
+ ...input.model.fields.filter((field) => field.kind !== "object"),
151
+ ...(input.hints.unsupportedByModel.get(input.model.name) ?? []),
152
+ ].sort((a, b) => fieldOrder(input.hints, input.model.name, a) -
153
+ fieldOrder(input.hints, input.model.name, b));
154
+ const physicalNameByField = new Map(scalarFields.map((field) => [field.name, dbName(field)]));
155
+ const pkColumns = primaryKeyFieldNames(input.model).map((name) => physicalNameByField.get(name) ?? name);
156
+ const pkSet = new Set(pkColumns);
157
+ const columns = scalarFields.map((field, idx) => {
158
+ const columnName = dbName(field);
159
+ if (field.kind === "unsupported") {
160
+ input.warnings.push({
161
+ code: "unsupported_type",
162
+ column: `${input.schemaName}.${input.tableName}.${columnName}`,
163
+ type: field.type,
164
+ });
165
+ }
166
+ return {
167
+ id: makeColumnId(input.schemaName, input.tableName, columnName),
168
+ name: columnName,
169
+ ordinalPosition: idx + 1,
170
+ dataType: renderFieldType(field),
171
+ udtName: field.type,
172
+ nullable: !field.isRequired,
173
+ primaryKey: pkSet.has(columnName),
174
+ defaultExpression: renderDefault(field),
175
+ comment: field.documentation,
176
+ };
177
+ });
178
+ return {
179
+ id: makeTableId(input.schemaName, input.tableName),
180
+ schema: input.schemaName,
181
+ name: input.tableName,
182
+ comment: input.model.documentation,
183
+ columns,
184
+ primaryKey: pkColumns.length > 0 ? { columns: pkColumns } : undefined,
185
+ foreignKeys: buildForeignKeys(input.model, input.modelsByName, physicalNameByField)
186
+ .sort((a, b) => a.name.localeCompare(b.name)),
187
+ uniqueConstraints: buildUniques(input.model, physicalNameByField, input.tableName),
188
+ indexes: buildIndexes(input.model, input.dmmfIndexes, physicalNameByField),
189
+ checkConstraints: [],
190
+ };
191
+ }
192
+ function fieldOrder(hints, modelName, field) {
193
+ if ("order" in field)
194
+ return field.order;
195
+ return hints.fieldOrderByModel.get(modelName)?.get(field.name) ?? Number.MAX_SAFE_INTEGER;
196
+ }
197
+ function primaryKeyFieldNames(model) {
198
+ if (model.primaryKey?.fields && model.primaryKey.fields.length > 0) {
199
+ return [...model.primaryKey.fields];
200
+ }
201
+ return model.fields.filter((field) => field.isId).map((field) => field.name);
202
+ }
203
+ function buildForeignKeys(model, modelsByName, physicalNameByField) {
204
+ const localSchema = model.schema ?? DEFAULT_SCHEMA;
205
+ const localTable = dbName(model);
206
+ const out = [];
207
+ for (const field of model.fields) {
208
+ if (field.kind !== "object")
209
+ continue;
210
+ if (!field.relationFromFields || field.relationFromFields.length === 0)
211
+ continue;
212
+ if (!field.relationToFields || field.relationToFields.length === 0)
213
+ continue;
214
+ const target = modelsByName.get(field.type);
215
+ if (!target)
216
+ continue;
217
+ const targetScalarFields = new Map(target.fields
218
+ .filter((targetField) => targetField.kind !== "object")
219
+ .map((targetField) => [targetField.name, dbName(targetField)]));
220
+ const columns = field.relationFromFields.map((name) => physicalNameByField.get(name) ?? name);
221
+ const referencedColumns = field.relationToFields.map((name) => targetScalarFields.get(name) ?? name);
222
+ out.push({
223
+ name: `${localTable}_${columns.join("_")}_fkey`,
224
+ columns,
225
+ references: {
226
+ schema: target.schema ?? DEFAULT_SCHEMA,
227
+ table: dbName(target),
228
+ columns: referencedColumns,
229
+ },
230
+ onDelete: mapReferentialAction(field.relationOnDelete),
231
+ onUpdate: mapReferentialAction(field.relationOnUpdate),
232
+ });
233
+ }
234
+ return out;
235
+ }
236
+ function buildUniques(model, physicalNameByField, tableName) {
237
+ const byColumns = new Map();
238
+ const add = (fields, name) => {
239
+ const columns = fields.map((field) => physicalNameByField.get(field) ?? field);
240
+ if (columns.length === 0)
241
+ return;
242
+ const key = columns.join("\0");
243
+ if (byColumns.has(key))
244
+ return;
245
+ byColumns.set(key, {
246
+ name: name || `${tableName}_${columns.join("_")}_key`,
247
+ columns,
248
+ });
249
+ };
250
+ for (const field of model.fields) {
251
+ if (field.kind !== "object" && field.isUnique)
252
+ add([field.name]);
253
+ }
254
+ for (const unique of model.uniqueIndexes)
255
+ add(unique.fields, unique.name);
256
+ for (const unique of model.uniqueFields)
257
+ add(unique);
258
+ return Array.from(byColumns.values()).sort((a, b) => a.name.localeCompare(b.name));
259
+ }
260
+ function buildIndexes(model, indexes, physicalNameByField) {
261
+ return indexes
262
+ .filter((index) => index.model === model.name && index.type !== "id")
263
+ .map((index) => {
264
+ const columns = index.fields.map((field) => physicalNameByField.get(field.name) ?? field.name);
265
+ return {
266
+ name: index.dbName ?? index.name ?? `${dbName(model)}_${columns.join("_")}_idx`,
267
+ columns,
268
+ unique: index.type === "unique",
269
+ method: index.algorithm ?? index.type,
270
+ };
271
+ })
272
+ .sort((a, b) => a.name.localeCompare(b.name));
273
+ }
274
+ function renderFieldType(field) {
275
+ const base = field.nativeType
276
+ ? `${field.nativeType[0]}${field.nativeType[1].length > 0 ? `(${field.nativeType[1].join(",")})` : ""}`
277
+ : field.type;
278
+ return field.isList ? `${base}[]` : base;
279
+ }
280
+ function renderDefault(field) {
281
+ if (!field.hasDefaultValue || field.default === undefined)
282
+ return undefined;
283
+ const value = field.default;
284
+ if (typeof value === "string")
285
+ return value;
286
+ if (typeof value === "number" || typeof value === "boolean")
287
+ return String(value);
288
+ if (Array.isArray(value))
289
+ return value.map(String).join(", ");
290
+ if (isRecord(value) && typeof value.name === "string") {
291
+ const args = Array.isArray(value.args) ? value.args.map(String).join(", ") : "";
292
+ return `${value.name}(${args})`;
293
+ }
294
+ return JSON.stringify(value);
295
+ }
296
+ function mapReferentialAction(action) {
297
+ switch (action?.toLowerCase()) {
298
+ case "cascade":
299
+ return "cascade";
300
+ case "restrict":
301
+ return "restrict";
302
+ case "setnull":
303
+ case "set null":
304
+ return "set null";
305
+ case "setdefault":
306
+ case "set default":
307
+ return "set default";
308
+ case "noaction":
309
+ case "no action":
310
+ return "no action";
311
+ default:
312
+ return undefined;
313
+ }
314
+ }
315
+ function dbName(value) {
316
+ return value.dbName ?? value.name;
317
+ }
318
+ function extractSchemaHints(datamodel) {
319
+ const body = schemaInputToText(datamodel);
320
+ const fieldOrderByModel = new Map();
321
+ const unsupportedByModel = new Map();
322
+ const modelPattern = /model\s+([A-Za-z_][A-Za-z0-9_]*)\s*\{([\s\S]*?)\n\}/g;
323
+ let modelMatch;
324
+ while ((modelMatch = modelPattern.exec(body)) !== null) {
325
+ const modelName = modelMatch[1];
326
+ const block = modelMatch[2];
327
+ const order = new Map();
328
+ const unsupported = [];
329
+ for (const rawLine of block.split("\n")) {
330
+ const line = rawLine.trim();
331
+ if (!line || line.startsWith("//") || line.startsWith("@@"))
332
+ continue;
333
+ const match = /^([A-Za-z_][A-Za-z0-9_]*)\s+(\S+)(?:\s+(.*))?$/.exec(line);
334
+ if (!match)
335
+ continue;
336
+ const [, fieldName, typeToken, attributes = ""] = match;
337
+ if (!fieldName || !typeToken)
338
+ continue;
339
+ const position = order.size + 1;
340
+ order.set(fieldName, position);
341
+ const unsupportedMatch = /^Unsupported\("([^"]+)"\)(\[\])?(\?)?$/.exec(typeToken);
342
+ if (!unsupportedMatch)
343
+ continue;
344
+ const mappedName = /@map\("([^"]+)"\)/.exec(attributes)?.[1] ?? null;
345
+ unsupported.push({
346
+ kind: "unsupported",
347
+ name: fieldName,
348
+ isRequired: unsupportedMatch[3] !== "?",
349
+ isList: unsupportedMatch[2] === "[]",
350
+ isUnique: attributes.includes("@unique"),
351
+ isId: attributes.includes("@id"),
352
+ type: unsupportedMatch[1],
353
+ dbName: mappedName,
354
+ hasDefaultValue: attributes.includes("@default("),
355
+ order: position,
356
+ });
357
+ }
358
+ fieldOrderByModel.set(modelName, order);
359
+ if (unsupported.length > 0)
360
+ unsupportedByModel.set(modelName, unsupported);
361
+ }
362
+ return { fieldOrderByModel, unsupportedByModel };
363
+ }
364
+ function schemaInputToText(datamodel) {
365
+ if (typeof datamodel === "string")
366
+ return datamodel;
367
+ return datamodel.map(([, content]) => content).join("\n");
368
+ }
369
+ function stripDatasourceConnectionUrls(datamodel) {
370
+ if (typeof datamodel === "string")
371
+ return stripDatasourceConnectionUrlsFromText(datamodel);
372
+ return datamodel.map(([filename, content]) => [
373
+ filename,
374
+ stripDatasourceConnectionUrlsFromText(content),
375
+ ]);
376
+ }
377
+ function stripDatasourceConnectionUrlsFromText(content) {
378
+ let inDatasource = false;
379
+ return content
380
+ .split("\n")
381
+ .filter((line) => {
382
+ const trimmed = line.trim();
383
+ if (/^datasource\s+[A-Za-z_][A-Za-z0-9_]*\s*\{/.test(trimmed)) {
384
+ inDatasource = true;
385
+ return true;
386
+ }
387
+ if (inDatasource && trimmed === "}") {
388
+ inDatasource = false;
389
+ return true;
390
+ }
391
+ if (inDatasource && /^(url|directUrl)\s*=/.test(trimmed)) {
392
+ return false;
393
+ }
394
+ return true;
395
+ })
396
+ .join("\n");
397
+ }
398
+ function makeTableId(schemaName, tableName) {
399
+ return `table:${schemaName}.${tableName}`;
400
+ }
401
+ function makeColumnId(schemaName, tableName, columnName) {
402
+ return `table:${schemaName}.${tableName}#${columnName}`;
403
+ }
404
+ function sortedUnique(values) {
405
+ return Array.from(new Set(values)).sort((a, b) => a.localeCompare(b));
406
+ }
407
+ function byName(a, b) {
408
+ return a.name.localeCompare(b.name);
409
+ }
410
+ function isRecord(value) {
411
+ return typeof value === "object" && value !== null && !Array.isArray(value);
412
+ }
413
+ function markMatchedFilters(qualified, patterns, matched) {
414
+ for (const pattern of patterns ?? []) {
415
+ if (compileGlob(pattern).test(qualified))
416
+ matched.add(pattern);
417
+ }
418
+ }
419
+ function compileTableFilters(patterns) {
420
+ if (!patterns || patterns.length === 0)
421
+ return () => true;
422
+ const compiled = patterns.map(compileGlob);
423
+ return (qualifiedName) => compiled.some((re) => re.test(qualifiedName));
424
+ }
425
+ function compileGlob(pattern) {
426
+ let out = "^";
427
+ for (const ch of pattern) {
428
+ if (ch === "*")
429
+ out += ".*";
430
+ else if (ch === "?")
431
+ out += ".";
432
+ else if (/[.+^${}()|[\]\\]/.test(ch))
433
+ out += `\\${ch}`;
434
+ else
435
+ out += ch;
436
+ }
437
+ return new RegExp(`${out}$`);
438
+ }
439
+ //# sourceMappingURL=prisma.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.js","sourceRoot":"","sources":["../src/prisma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,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QAAQ,IAAI,EAAE,EAAE,CAAC;QACrC,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAC1B,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;AAED,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,KAAK,EAAE,EAAE,CAAC;;YAClD,GAAG,IAAI,EAAE,CAAC;IACjB,CAAC;IACD,OAAO,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAC/B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@askdb/prisma",
3
+ "version": "0.2.0-beta.1",
4
+ "description": "AskDB Prisma integration: schema-file introspection connector for Prisma schemas.",
5
+ "keywords": [
6
+ "askdb",
7
+ "prisma",
8
+ "schema-v2",
9
+ "introspection",
10
+ "nl-to-sql"
11
+ ],
12
+ "homepage": "https://github.com/Ygilany/AskDB#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/Ygilany/AskDB/issues"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Ygilany/AskDB.git",
19
+ "directory": "packages/prisma"
20
+ },
21
+ "license": "Apache-2.0",
22
+ "author": "Yahya Gilany",
23
+ "type": "module",
24
+ "main": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js"
30
+ }
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "README.md",
35
+ "LICENSE",
36
+ "NOTICE"
37
+ ],
38
+ "engines": {
39
+ "node": ">=20"
40
+ },
41
+ "dependencies": {
42
+ "@prisma/internals": "^7.8.0",
43
+ "@askdb/introspect": "0.3.0-beta.1"
44
+ },
45
+ "devDependencies": {
46
+ "typescript": "^5.7.3",
47
+ "vitest": "^3.0.9"
48
+ },
49
+ "scripts": {
50
+ "build": "tsc -p tsconfig.build.json",
51
+ "lint": "tsc -p tsconfig.build.json --noEmit",
52
+ "test": "vitest run --config ../../vitest.config.ts"
53
+ }
54
+ }