@prisma-next/adapter-sqlite 0.0.1 → 0.3.0-dev.163

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 reasonable and customary use in describing the
141
+ origin of the Work and 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 choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or 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] [Prisma Data, Inc]
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 implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,23 @@
1
+ import { n as SqliteContract, r as SqliteLoweredStatement, t as SqliteAdapterOptions } from "./types-gAqc4ucF.mjs";
2
+ import { Adapter, AdapterProfile, AnyQueryAst, CodecParamsDescriptor, LowererContext } from "@prisma-next/sql-relational-core/ast";
3
+
4
+ //#region src/core/adapter.d.ts
5
+ declare class SqliteAdapterImpl implements Adapter<AnyQueryAst, SqliteContract, SqliteLoweredStatement> {
6
+ readonly familyId: "sql";
7
+ readonly targetId: "sqlite";
8
+ readonly profile: AdapterProfile<'sqlite'>;
9
+ private readonly codecRegistry;
10
+ constructor(options?: SqliteAdapterOptions);
11
+ parameterizedCodecs(): ReadonlyArray<CodecParamsDescriptor>;
12
+ lower(ast: AnyQueryAst, context: LowererContext<SqliteContract>): Readonly<{
13
+ profileId: string;
14
+ body: Readonly<{
15
+ sql: string;
16
+ params: unknown[];
17
+ }>;
18
+ }>;
19
+ }
20
+ declare function createSqliteAdapter(options?: SqliteAdapterOptions): Readonly<SqliteAdapterImpl>;
21
+ //#endregion
22
+ export { createSqliteAdapter as t };
23
+ //# sourceMappingURL=adapter-CTYh7Njp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-CTYh7Njp.d.mts","names":[],"sources":["../src/core/adapter.ts"],"sourcesContent":[],"mappings":";;;;cA4CM,iBAAA,YAA6B,QAAQ,aAAa,gBAAgB;;EAAlE,SAAA,QAAA,EAAA,QAAkB;EAAmB,SAAA,OAAA,EAIvB,cAJuB,CAAA,QAAA,CAAA;EAAa,iBAAA,aAAA;EAAgB,WAAA,CAAA,OAAA,CAAA,EAahD,oBAbgD;EAIpD,mBAAA,CAAA,CAAA,EAsBK,aAtBL,CAsBmB,qBAtBnB,CAAA;EASI,KAAA,CAAA,GAAA,EAiBX,WAjBW,EAAA,OAAA,EAiBW,cAjBX,CAiB0B,cAjB1B,CAAA,CAAA,EAiByC,QAjBzC,CAAA;IAae,SAAA,EAAA,MAAA;IAAd,IAAA,UAAA,CAAA;MAIZ,GAAA,EAAA,MAAA;MAAqC,MAAA,EAAA,OAAA,EAAA;IAAf,CAAA,CAAA;;;AA9BA,iBAienB,mBAAA,CAjemB,OAAA,CAAA,EAieW,oBAjeX,CAAA,EAie+B,QAje/B,CAie+B,iBAje/B,CAAA"}
@@ -0,0 +1,337 @@
1
+ import { t as codecDefinitions } from "./codecs-Bhz0W5Xm.mjs";
2
+ import { createCodecRegistry } from "@prisma-next/sql-relational-core/ast";
3
+
4
+ //#region src/core/sql-utils.ts
5
+ var SqlEscapeError = class extends Error {
6
+ constructor(message, value, kind) {
7
+ super(message);
8
+ this.value = value;
9
+ this.kind = kind;
10
+ this.name = "SqlEscapeError";
11
+ }
12
+ };
13
+ function quoteIdentifier(identifier) {
14
+ if (identifier.length === 0) throw new SqlEscapeError("Identifier cannot be empty", identifier, "identifier");
15
+ if (identifier.includes("\0")) throw new SqlEscapeError("Identifier cannot contain null bytes", identifier.replace(/\0/g, "\\0"), "identifier");
16
+ return `"${identifier.replace(/"/g, "\"\"")}"`;
17
+ }
18
+ function escapeLiteral(value) {
19
+ if (value.includes("\0")) throw new SqlEscapeError("Literal value cannot contain null bytes", value.replace(/\0/g, "\\0"), "literal");
20
+ return value.replace(/'/g, "''");
21
+ }
22
+
23
+ //#endregion
24
+ //#region src/core/adapter.ts
25
+ const defaultCapabilities = Object.freeze({ sql: {
26
+ orderBy: true,
27
+ limit: true,
28
+ lateral: false,
29
+ jsonAgg: true,
30
+ returning: true,
31
+ enums: false
32
+ } });
33
+ var SqliteAdapterImpl = class {
34
+ familyId = "sql";
35
+ targetId = "sqlite";
36
+ profile;
37
+ codecRegistry = (() => {
38
+ const registry = createCodecRegistry();
39
+ for (const definition of Object.values(codecDefinitions)) registry.register(definition.codec);
40
+ return registry;
41
+ })();
42
+ constructor(options) {
43
+ this.profile = Object.freeze({
44
+ id: options?.profileId ?? "sqlite/default@1",
45
+ target: "sqlite",
46
+ capabilities: defaultCapabilities,
47
+ codecs: () => this.codecRegistry,
48
+ readMarkerStatement: () => ({
49
+ sql: "select core_hash, profile_hash, contract_json, canonical_version, updated_at, app_tag, meta from prisma_contract_marker where id = ?",
50
+ params: [1]
51
+ })
52
+ });
53
+ }
54
+ parameterizedCodecs() {
55
+ return [];
56
+ }
57
+ lower(ast, context) {
58
+ const collectedParamRefs = ast.collectParamRefs();
59
+ const params = [];
60
+ for (const ref of collectedParamRefs) params.push(ref.value);
61
+ let sql;
62
+ const node = ast;
63
+ switch (node.kind) {
64
+ case "select":
65
+ sql = renderSelect(node, context.contract);
66
+ break;
67
+ case "insert":
68
+ sql = renderInsert(node);
69
+ break;
70
+ case "update":
71
+ sql = renderUpdate(node, context.contract);
72
+ break;
73
+ case "delete":
74
+ sql = renderDelete(node);
75
+ break;
76
+ default: throw new Error(`Unsupported AST node kind: ${node.kind}`);
77
+ }
78
+ return Object.freeze({
79
+ profileId: this.profile.id,
80
+ body: Object.freeze({
81
+ sql,
82
+ params
83
+ })
84
+ });
85
+ }
86
+ };
87
+ function renderSelect(ast, contract) {
88
+ return [
89
+ `SELECT ${ast.distinct ? "DISTINCT " : ""}${renderProjection(ast.projection, contract)}`,
90
+ `FROM ${renderSource(ast.from, contract)}`,
91
+ ast.joins?.length ? ast.joins.map((join) => renderJoin(join, contract)).join(" ") : "",
92
+ ast.where ? `WHERE ${renderExpr(ast.where, contract)}` : "",
93
+ ast.groupBy?.length ? `GROUP BY ${ast.groupBy.map((expr) => renderExpr(expr, contract)).join(", ")}` : "",
94
+ ast.having ? `HAVING ${renderExpr(ast.having, contract)}` : "",
95
+ ast.orderBy?.length ? `ORDER BY ${ast.orderBy.map((order) => `${renderExpr(order.expr, contract)} ${order.dir.toUpperCase()}`).join(", ")}` : "",
96
+ typeof ast.limit === "number" ? `LIMIT ${ast.limit}` : "",
97
+ typeof ast.offset === "number" ? `OFFSET ${ast.offset}` : ""
98
+ ].filter((part) => part.length > 0).join(" ").trim();
99
+ }
100
+ function renderProjection(projection, contract) {
101
+ return projection.map((item) => {
102
+ const alias = quoteIdentifier(item.alias);
103
+ if (item.expr.kind === "literal") return `${renderLiteral(item.expr)} AS ${alias}`;
104
+ return `${renderExpr(item.expr, contract)} AS ${alias}`;
105
+ }).join(", ");
106
+ }
107
+ function renderSource(source, contract) {
108
+ const node = source;
109
+ switch (node.kind) {
110
+ case "table-source": {
111
+ const table = quoteIdentifier(node.name);
112
+ if (!node.alias) return table;
113
+ return `${table} AS ${quoteIdentifier(node.alias)}`;
114
+ }
115
+ case "derived-table-source": return `(${renderSelect(node.query, contract)}) AS ${quoteIdentifier(node.alias)}`;
116
+ default: throw new Error(`Unsupported source node kind: ${node.kind}`);
117
+ }
118
+ }
119
+ function renderExpr(expr, contract) {
120
+ const node = expr;
121
+ switch (node.kind) {
122
+ case "column-ref": return renderColumn(node);
123
+ case "identifier-ref": return quoteIdentifier(node.name);
124
+ case "operation": return renderOperation(node, contract);
125
+ case "subquery": return renderSubqueryExpr(node, contract);
126
+ case "aggregate": return renderAggregateExpr(node, contract);
127
+ case "json-object": return renderJsonObjectExpr(node, contract);
128
+ case "json-array-agg": return renderJsonArrayAggExpr(node, contract);
129
+ case "binary": return renderBinary(node, contract);
130
+ case "and":
131
+ if (node.exprs.length === 0) return "TRUE";
132
+ return `(${node.exprs.map((part) => renderExpr(part, contract)).join(" AND ")})`;
133
+ case "or":
134
+ if (node.exprs.length === 0) return "FALSE";
135
+ return `(${node.exprs.map((part) => renderExpr(part, contract)).join(" OR ")})`;
136
+ case "exists": return `${node.notExists ? "NOT " : ""}EXISTS (${renderSelect(node.subquery, contract)})`;
137
+ case "null-check": return renderNullCheck(node, contract);
138
+ case "not": return `NOT (${renderExpr(node.expr, contract)})`;
139
+ case "param-ref": return "?";
140
+ case "literal": return renderLiteral(node);
141
+ case "list": return renderListLiteral(node);
142
+ default: throw new Error(`Unsupported expression node kind: ${node.kind}`);
143
+ }
144
+ }
145
+ function renderColumn(ref) {
146
+ if (ref.table === "excluded") return `excluded.${quoteIdentifier(ref.column)}`;
147
+ return `${quoteIdentifier(ref.table)}.${quoteIdentifier(ref.column)}`;
148
+ }
149
+ function renderLiteral(expr) {
150
+ if (typeof expr.value === "string") return `'${escapeLiteral(expr.value)}'`;
151
+ if (typeof expr.value === "number" || typeof expr.value === "boolean") return String(expr.value);
152
+ if (typeof expr.value === "bigint") return String(expr.value);
153
+ if (expr.value === null || expr.value === void 0) return "NULL";
154
+ if (expr.value instanceof Date) return `'${escapeLiteral(expr.value.toISOString())}'`;
155
+ const json = JSON.stringify(expr.value);
156
+ if (json === void 0) return "NULL";
157
+ return `'${escapeLiteral(json)}'`;
158
+ }
159
+ function renderOperation(expr, contract) {
160
+ const self = renderExpr(expr.self, contract);
161
+ const args = expr.args.map((arg) => renderExpr(arg, contract));
162
+ let result = expr.lowering.template;
163
+ result = result.replace(/\{\{self\}\}/g, self);
164
+ for (let i = 0; i < args.length; i++) result = result.replace(new RegExp(`\\{\\{arg${i}\\}\\}`, "g"), args[i] ?? "");
165
+ return result;
166
+ }
167
+ function renderSubqueryExpr(expr, contract) {
168
+ if (expr.query.projection.length !== 1) throw new Error("Subquery expressions must project exactly one column");
169
+ return `(${renderSelect(expr.query, contract)})`;
170
+ }
171
+ function renderNullCheck(expr, contract) {
172
+ const rendered = renderExpr(expr.expr, contract);
173
+ const renderedExpr = expr.expr.kind === "operation" || expr.expr.kind === "subquery" ? `(${rendered})` : rendered;
174
+ return expr.isNull ? `${renderedExpr} IS NULL` : `${renderedExpr} IS NOT NULL`;
175
+ }
176
+ function renderBinary(expr, contract) {
177
+ if (expr.right.kind === "list" && expr.right.values.length === 0) {
178
+ if (expr.op === "in") return "FALSE";
179
+ if (expr.op === "notIn") return "TRUE";
180
+ }
181
+ const leftExpr = expr.left;
182
+ const left = renderExpr(leftExpr, contract);
183
+ const leftRendered = leftExpr.kind === "operation" || leftExpr.kind === "subquery" ? `(${left})` : left;
184
+ const rightNode = expr.right;
185
+ let right;
186
+ switch (rightNode.kind) {
187
+ case "list":
188
+ right = renderListLiteral(rightNode);
189
+ break;
190
+ case "literal":
191
+ right = renderLiteral(rightNode);
192
+ break;
193
+ case "column-ref":
194
+ right = renderColumn(rightNode);
195
+ break;
196
+ case "param-ref":
197
+ right = "?";
198
+ break;
199
+ default:
200
+ right = renderExpr(rightNode, contract);
201
+ break;
202
+ }
203
+ if (expr.op === "ilike") throw new Error("SQLite does not support ILIKE. Use LIKE for case-sensitive matching.");
204
+ return `${leftRendered} ${{
205
+ eq: "=",
206
+ neq: "!=",
207
+ gt: ">",
208
+ lt: "<",
209
+ gte: ">=",
210
+ lte: "<=",
211
+ like: "LIKE",
212
+ ilike: "LIKE",
213
+ in: "IN",
214
+ notIn: "NOT IN"
215
+ }[expr.op]} ${right}`;
216
+ }
217
+ function renderListLiteral(expr) {
218
+ if (expr.values.length === 0) return "(NULL)";
219
+ return `(${expr.values.map((v) => {
220
+ if (v.kind === "param-ref") return "?";
221
+ if (v.kind === "literal") return renderLiteral(v);
222
+ return renderExpr(v);
223
+ }).join(", ")})`;
224
+ }
225
+ function renderAggregateExpr(expr, contract) {
226
+ const fn = expr.fn.toUpperCase();
227
+ if (!expr.expr) return `${fn}(*)`;
228
+ return `${fn}(${renderExpr(expr.expr, contract)})`;
229
+ }
230
+ function renderJsonObjectExpr(expr, contract) {
231
+ return `json_object(${expr.entries.flatMap((entry) => {
232
+ const key = `'${escapeLiteral(entry.key)}'`;
233
+ if (entry.value.kind === "literal") return [key, renderLiteral(entry.value)];
234
+ return [key, renderExpr(entry.value, contract)];
235
+ }).join(", ")})`;
236
+ }
237
+ function renderOrderByItems(items, contract) {
238
+ return items.map((item) => `${renderExpr(item.expr, contract)} ${item.dir.toUpperCase()}`).join(", ");
239
+ }
240
+ function renderJsonArrayAggExpr(expr, contract) {
241
+ const aggregateOrderBy = expr.orderBy && expr.orderBy.length > 0 ? ` ORDER BY ${renderOrderByItems(expr.orderBy, contract)}` : "";
242
+ const aggregated = `json_group_array(${renderExpr(expr.expr, contract)}${aggregateOrderBy})`;
243
+ if (expr.onEmpty === "emptyArray") return `coalesce(${aggregated}, '[]')`;
244
+ return aggregated;
245
+ }
246
+ function renderJoin(join, contract) {
247
+ return `${join.joinType.toUpperCase()} JOIN ${renderSource(join.source, contract)} ON ${renderJoinOn(join.on, contract)}`;
248
+ }
249
+ function renderJoinOn(on, contract) {
250
+ if (on.kind === "eq-col-join-on") return `${renderColumn(on.left)} = ${renderColumn(on.right)}`;
251
+ return renderExpr(on, contract);
252
+ }
253
+ function renderInsertValue(value) {
254
+ switch (value.kind) {
255
+ case "param-ref": return "?";
256
+ case "column-ref": return renderColumn(value);
257
+ case "default-value": throw new Error("SQLite does not support DEFAULT as a value in INSERT ... VALUES");
258
+ default: throw new Error(`Unsupported value node in INSERT: ${value.kind}`);
259
+ }
260
+ }
261
+ function renderInsert(ast) {
262
+ const table = quoteIdentifier(ast.table.name);
263
+ const rows = ast.rows;
264
+ if (rows.length === 0) throw new Error("INSERT requires at least one row");
265
+ const firstRow = rows[0];
266
+ const columnOrder = Object.keys(firstRow);
267
+ let insertClause;
268
+ if (columnOrder.length === 0) insertClause = `INSERT INTO ${table} DEFAULT VALUES`;
269
+ else {
270
+ const columns = columnOrder.map((column) => quoteIdentifier(column));
271
+ const values = rows.map((row) => {
272
+ return `(${columnOrder.map((column) => {
273
+ const value = row[column];
274
+ if (value === void 0) throw new Error(`Missing value for column "${column}" in INSERT row`);
275
+ return renderInsertValue(value);
276
+ }).join(", ")})`;
277
+ }).join(", ");
278
+ insertClause = `INSERT INTO ${table} (${columns.join(", ")}) VALUES ${values}`;
279
+ }
280
+ let onConflictClause = "";
281
+ if (ast.onConflict) {
282
+ const conflictColumns = ast.onConflict.columns.map((col) => quoteIdentifier(col.column));
283
+ if (conflictColumns.length === 0) throw new Error("INSERT onConflict requires at least one conflict column");
284
+ const action = ast.onConflict.action;
285
+ switch (action.kind) {
286
+ case "do-nothing":
287
+ onConflictClause = ` ON CONFLICT (${conflictColumns.join(", ")}) DO NOTHING`;
288
+ break;
289
+ case "do-update-set": {
290
+ const updates = Object.entries(action.set).map(([colName, value]) => {
291
+ const target = quoteIdentifier(colName);
292
+ if (value.kind === "param-ref") return `${target} = ?`;
293
+ return `${target} = ${renderColumn(value)}`;
294
+ });
295
+ onConflictClause = ` ON CONFLICT (${conflictColumns.join(", ")}) DO UPDATE SET ${updates.join(", ")}`;
296
+ break;
297
+ }
298
+ default: throw new Error(`Unsupported onConflict action: ${action.kind}`);
299
+ }
300
+ }
301
+ const returningClause = renderReturning(ast.returning);
302
+ return `${insertClause}${onConflictClause}${returningClause}`;
303
+ }
304
+ function renderUpdate(ast, contract) {
305
+ const table = quoteIdentifier(ast.table.name);
306
+ const setClauses = Object.entries(ast.set).map(([col, val]) => {
307
+ const column = quoteIdentifier(col);
308
+ let value;
309
+ switch (val.kind) {
310
+ case "param-ref":
311
+ value = "?";
312
+ break;
313
+ case "column-ref":
314
+ value = renderColumn(val);
315
+ break;
316
+ default: throw new Error(`Unsupported value node in UPDATE: ${val.kind}`);
317
+ }
318
+ return `${column} = ${value}`;
319
+ });
320
+ const whereClause = ast.where ? ` WHERE ${renderExpr(ast.where, contract)}` : "";
321
+ const returningClause = renderReturning(ast.returning);
322
+ return `UPDATE ${table} SET ${setClauses.join(", ")}${whereClause}${returningClause}`;
323
+ }
324
+ function renderDelete(ast) {
325
+ return `DELETE FROM ${quoteIdentifier(ast.table.name)}${ast.where ? ` WHERE ${renderExpr(ast.where)}` : ""}${renderReturning(ast.returning)}`;
326
+ }
327
+ function renderReturning(returning) {
328
+ if (!returning?.length) return "";
329
+ return ` RETURNING ${returning.map((col) => `${quoteIdentifier(col.table)}.${quoteIdentifier(col.column)}`).join(", ")}`;
330
+ }
331
+ function createSqliteAdapter(options) {
332
+ return Object.freeze(new SqliteAdapterImpl(options));
333
+ }
334
+
335
+ //#endregion
336
+ export { createSqliteAdapter as t };
337
+ //# sourceMappingURL=adapter-DrU8lTP4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter-DrU8lTP4.mjs","names":["value: string","kind: 'identifier' | 'literal'","params: unknown[]","sql: string","right: string","insertClause: string","value: string"],"sources":["../src/core/sql-utils.ts","../src/core/adapter.ts"],"sourcesContent":["export class SqlEscapeError extends Error {\n constructor(\n message: string,\n public readonly value: string,\n public readonly kind: 'identifier' | 'literal',\n ) {\n super(message);\n this.name = 'SqlEscapeError';\n }\n}\n\nexport function quoteIdentifier(identifier: string): string {\n if (identifier.length === 0) {\n throw new SqlEscapeError('Identifier cannot be empty', identifier, 'identifier');\n }\n if (identifier.includes('\\0')) {\n throw new SqlEscapeError(\n 'Identifier cannot contain null bytes',\n identifier.replace(/\\0/g, '\\\\0'),\n 'identifier',\n );\n }\n return `\"${identifier.replace(/\"/g, '\"\"')}\"`;\n}\n\nexport function escapeLiteral(value: string): string {\n if (value.includes('\\0')) {\n throw new SqlEscapeError(\n 'Literal value cannot contain null bytes',\n value.replace(/\\0/g, '\\\\0'),\n 'literal',\n );\n }\n return value.replace(/'/g, \"''\");\n}\n","import {\n type Adapter,\n type AdapterProfile,\n type AggregateExpr,\n type AnyExpression,\n type AnyFromSource,\n type AnyQueryAst,\n type BinaryExpr,\n type CodecParamsDescriptor,\n type ColumnRef,\n createCodecRegistry,\n type DeleteAst,\n type InsertAst,\n type InsertValue,\n type JoinAst,\n type JoinOnExpr,\n type JsonArrayAggExpr,\n type JsonObjectExpr,\n type ListExpression,\n type LiteralExpr,\n type LowererContext,\n type NullCheckExpr,\n type OperationExpr,\n type OrderByItem,\n type ProjectionItem,\n type SelectAst,\n type SubqueryExpr,\n type UpdateAst,\n} from '@prisma-next/sql-relational-core/ast';\nimport { codecDefinitions } from './codecs';\nimport { escapeLiteral, quoteIdentifier } from './sql-utils';\nimport type { SqliteAdapterOptions, SqliteContract, SqliteLoweredStatement } from './types';\n\nconst defaultCapabilities = Object.freeze({\n sql: {\n orderBy: true,\n limit: true,\n lateral: false,\n jsonAgg: true,\n returning: true,\n enums: false,\n },\n});\n\nclass SqliteAdapterImpl implements Adapter<AnyQueryAst, SqliteContract, SqliteLoweredStatement> {\n readonly familyId = 'sql' as const;\n readonly targetId = 'sqlite' as const;\n\n readonly profile: AdapterProfile<'sqlite'>;\n private readonly codecRegistry = (() => {\n const registry = createCodecRegistry();\n for (const definition of Object.values(codecDefinitions)) {\n registry.register(definition.codec);\n }\n return registry;\n })();\n\n constructor(options?: SqliteAdapterOptions) {\n this.profile = Object.freeze({\n id: options?.profileId ?? 'sqlite/default@1',\n target: 'sqlite',\n capabilities: defaultCapabilities,\n codecs: () => this.codecRegistry,\n readMarkerStatement: () => ({\n sql: 'select core_hash, profile_hash, contract_json, canonical_version, updated_at, app_tag, meta from prisma_contract_marker where id = ?',\n params: [1],\n }),\n });\n }\n\n parameterizedCodecs(): ReadonlyArray<CodecParamsDescriptor> {\n return [];\n }\n\n lower(ast: AnyQueryAst, context: LowererContext<SqliteContract>) {\n const collectedParamRefs = ast.collectParamRefs();\n const params: unknown[] = [];\n for (const ref of collectedParamRefs) {\n params.push(ref.value);\n }\n\n let sql: string;\n\n const node = ast;\n switch (node.kind) {\n case 'select':\n sql = renderSelect(node, context.contract);\n break;\n case 'insert':\n sql = renderInsert(node);\n break;\n case 'update':\n sql = renderUpdate(node, context.contract);\n break;\n case 'delete':\n sql = renderDelete(node);\n break;\n default:\n throw new Error(`Unsupported AST node kind: ${(node as { kind: string }).kind}`);\n }\n\n return Object.freeze({\n profileId: this.profile.id,\n body: Object.freeze({ sql, params }),\n });\n }\n}\n\nfunction renderSelect(ast: SelectAst, contract?: SqliteContract): string {\n const distinctPrefix = ast.distinct ? 'DISTINCT ' : '';\n const selectClause = `SELECT ${distinctPrefix}${renderProjection(ast.projection, contract)}`;\n const fromClause = `FROM ${renderSource(ast.from, contract)}`;\n\n const joinsClause = ast.joins?.length\n ? ast.joins.map((join) => renderJoin(join, contract)).join(' ')\n : '';\n\n const whereClause = ast.where ? `WHERE ${renderExpr(ast.where, contract)}` : '';\n const groupByClause = ast.groupBy?.length\n ? `GROUP BY ${ast.groupBy.map((expr) => renderExpr(expr, contract)).join(', ')}`\n : '';\n const havingClause = ast.having ? `HAVING ${renderExpr(ast.having, contract)}` : '';\n const orderClause = ast.orderBy?.length\n ? `ORDER BY ${ast.orderBy\n .map((order) => `${renderExpr(order.expr, contract)} ${order.dir.toUpperCase()}`)\n .join(', ')}`\n : '';\n const limitClause = typeof ast.limit === 'number' ? `LIMIT ${ast.limit}` : '';\n const offsetClause = typeof ast.offset === 'number' ? `OFFSET ${ast.offset}` : '';\n\n return [\n selectClause,\n fromClause,\n joinsClause,\n whereClause,\n groupByClause,\n havingClause,\n orderClause,\n limitClause,\n offsetClause,\n ]\n .filter((part) => part.length > 0)\n .join(' ')\n .trim();\n}\n\nfunction renderProjection(\n projection: ReadonlyArray<ProjectionItem>,\n contract?: SqliteContract,\n): string {\n return projection\n .map((item) => {\n const alias = quoteIdentifier(item.alias);\n if (item.expr.kind === 'literal') {\n return `${renderLiteral(item.expr)} AS ${alias}`;\n }\n return `${renderExpr(item.expr, contract)} AS ${alias}`;\n })\n .join(', ');\n}\n\nfunction renderSource(source: AnyFromSource, contract?: SqliteContract): string {\n const node = source;\n switch (node.kind) {\n case 'table-source': {\n const table = quoteIdentifier(node.name);\n if (!node.alias) {\n return table;\n }\n return `${table} AS ${quoteIdentifier(node.alias)}`;\n }\n case 'derived-table-source':\n return `(${renderSelect(node.query, contract)}) AS ${quoteIdentifier(node.alias)}`;\n default:\n throw new Error(`Unsupported source node kind: ${(node as { kind: string }).kind}`);\n }\n}\n\nfunction renderExpr(expr: AnyExpression, contract?: SqliteContract): string {\n const node = expr;\n switch (node.kind) {\n case 'column-ref':\n return renderColumn(node);\n case 'identifier-ref':\n return quoteIdentifier(node.name);\n case 'operation':\n return renderOperation(node, contract);\n case 'subquery':\n return renderSubqueryExpr(node, contract);\n case 'aggregate':\n return renderAggregateExpr(node, contract);\n case 'json-object':\n return renderJsonObjectExpr(node, contract);\n case 'json-array-agg':\n return renderJsonArrayAggExpr(node, contract);\n case 'binary':\n return renderBinary(node, contract);\n case 'and':\n if (node.exprs.length === 0) {\n return 'TRUE';\n }\n return `(${node.exprs.map((part) => renderExpr(part, contract)).join(' AND ')})`;\n case 'or':\n if (node.exprs.length === 0) {\n return 'FALSE';\n }\n return `(${node.exprs.map((part) => renderExpr(part, contract)).join(' OR ')})`;\n case 'exists': {\n const notKeyword = node.notExists ? 'NOT ' : '';\n const subquery = renderSelect(node.subquery, contract);\n return `${notKeyword}EXISTS (${subquery})`;\n }\n case 'null-check':\n return renderNullCheck(node, contract);\n case 'not':\n return `NOT (${renderExpr(node.expr, contract)})`;\n case 'param-ref':\n return '?';\n case 'literal':\n return renderLiteral(node);\n case 'list':\n return renderListLiteral(node);\n default:\n throw new Error(`Unsupported expression node kind: ${(node as { kind: string }).kind}`);\n }\n}\n\n// `excluded` is a pseudo-table in ON CONFLICT DO UPDATE that references the\n// row proposed for insertion. It is not quoted because it's a keyword.\nfunction renderColumn(ref: ColumnRef): string {\n if (ref.table === 'excluded') {\n return `excluded.${quoteIdentifier(ref.column)}`;\n }\n return `${quoteIdentifier(ref.table)}.${quoteIdentifier(ref.column)}`;\n}\n\nfunction renderLiteral(expr: LiteralExpr): string {\n if (typeof expr.value === 'string') {\n return `'${escapeLiteral(expr.value)}'`;\n }\n if (typeof expr.value === 'number' || typeof expr.value === 'boolean') {\n return String(expr.value);\n }\n if (typeof expr.value === 'bigint') {\n return String(expr.value);\n }\n if (expr.value === null || expr.value === undefined) {\n return 'NULL';\n }\n if (expr.value instanceof Date) {\n return `'${escapeLiteral(expr.value.toISOString())}'`;\n }\n const json = JSON.stringify(expr.value);\n if (json === undefined) {\n return 'NULL';\n }\n return `'${escapeLiteral(json)}'`;\n}\n\nfunction renderOperation(expr: OperationExpr, contract?: SqliteContract): string {\n const self = renderExpr(expr.self, contract);\n const args = expr.args.map((arg) => renderExpr(arg, contract));\n\n let result = expr.lowering.template;\n result = result.replace(/\\{\\{self\\}\\}/g, self);\n for (let i = 0; i < args.length; i++) {\n result = result.replace(new RegExp(`\\\\{\\\\{arg${i}\\\\}\\\\}`, 'g'), args[i] ?? '');\n }\n\n return result;\n}\n\nfunction renderSubqueryExpr(expr: SubqueryExpr, contract?: SqliteContract): string {\n if (expr.query.projection.length !== 1) {\n throw new Error('Subquery expressions must project exactly one column');\n }\n return `(${renderSelect(expr.query, contract)})`;\n}\n\nfunction renderNullCheck(expr: NullCheckExpr, contract?: SqliteContract): string {\n const rendered = renderExpr(expr.expr, contract);\n const renderedExpr =\n expr.expr.kind === 'operation' || expr.expr.kind === 'subquery' ? `(${rendered})` : rendered;\n return expr.isNull ? `${renderedExpr} IS NULL` : `${renderedExpr} IS NOT NULL`;\n}\n\nfunction renderBinary(expr: BinaryExpr, contract?: SqliteContract): string {\n if (expr.right.kind === 'list' && expr.right.values.length === 0) {\n if (expr.op === 'in') {\n return 'FALSE';\n }\n if (expr.op === 'notIn') {\n return 'TRUE';\n }\n }\n\n const leftExpr = expr.left;\n const left = renderExpr(leftExpr, contract);\n const leftRendered =\n leftExpr.kind === 'operation' || leftExpr.kind === 'subquery' ? `(${left})` : left;\n\n const rightNode = expr.right;\n let right: string;\n switch (rightNode.kind) {\n case 'list':\n right = renderListLiteral(rightNode);\n break;\n case 'literal':\n right = renderLiteral(rightNode);\n break;\n case 'column-ref':\n right = renderColumn(rightNode);\n break;\n case 'param-ref':\n right = '?';\n break;\n default:\n right = renderExpr(rightNode, contract);\n break;\n }\n\n // ilike is not supported by SQLite — waiting for prisma/prisma-next#277\n // to move ilike into an extension so it can be properly capability-gated.\n if (expr.op === 'ilike') {\n throw new Error('SQLite does not support ILIKE. Use LIKE for case-sensitive matching.');\n }\n\n const operatorMap: Record<BinaryExpr['op'], string> = {\n eq: '=',\n neq: '!=',\n gt: '>',\n lt: '<',\n gte: '>=',\n lte: '<=',\n like: 'LIKE',\n ilike: 'LIKE', // unreachable — guarded above; kept to satisfy Record<op, string>\n in: 'IN',\n notIn: 'NOT IN',\n };\n\n return `${leftRendered} ${operatorMap[expr.op]} ${right}`;\n}\n\nfunction renderListLiteral(expr: ListExpression): string {\n if (expr.values.length === 0) {\n return '(NULL)';\n }\n const values = expr.values\n .map((v) => {\n if (v.kind === 'param-ref') return '?';\n if (v.kind === 'literal') return renderLiteral(v);\n return renderExpr(v);\n })\n .join(', ');\n return `(${values})`;\n}\n\nfunction renderAggregateExpr(expr: AggregateExpr, contract?: SqliteContract): string {\n const fn = expr.fn.toUpperCase();\n if (!expr.expr) {\n return `${fn}(*)`;\n }\n return `${fn}(${renderExpr(expr.expr, contract)})`;\n}\n\nfunction renderJsonObjectExpr(expr: JsonObjectExpr, contract?: SqliteContract): string {\n const args = expr.entries\n .flatMap((entry): [string, string] => {\n const key = `'${escapeLiteral(entry.key)}'`;\n if (entry.value.kind === 'literal') {\n return [key, renderLiteral(entry.value)];\n }\n return [key, renderExpr(entry.value, contract)];\n })\n .join(', ');\n return `json_object(${args})`;\n}\n\nfunction renderOrderByItems(items: ReadonlyArray<OrderByItem>, contract?: SqliteContract): string {\n return items\n .map((item) => `${renderExpr(item.expr, contract)} ${item.dir.toUpperCase()}`)\n .join(', ');\n}\n\nfunction renderJsonArrayAggExpr(expr: JsonArrayAggExpr, contract?: SqliteContract): string {\n const aggregateOrderBy =\n expr.orderBy && expr.orderBy.length > 0\n ? ` ORDER BY ${renderOrderByItems(expr.orderBy, contract)}`\n : '';\n const aggregated = `json_group_array(${renderExpr(expr.expr, contract)}${aggregateOrderBy})`;\n if (expr.onEmpty === 'emptyArray') {\n return `coalesce(${aggregated}, '[]')`;\n }\n return aggregated;\n}\n\nfunction renderJoin(join: JoinAst, contract?: SqliteContract): string {\n const joinType = join.joinType.toUpperCase();\n const source = renderSource(join.source, contract);\n const onClause = renderJoinOn(join.on, contract);\n return `${joinType} JOIN ${source} ON ${onClause}`;\n}\n\nfunction renderJoinOn(on: JoinOnExpr, contract?: SqliteContract): string {\n if (on.kind === 'eq-col-join-on') {\n return `${renderColumn(on.left)} = ${renderColumn(on.right)}`;\n }\n return renderExpr(on, contract);\n}\n\nfunction renderInsertValue(value: InsertValue): string {\n switch (value.kind) {\n case 'param-ref':\n return '?';\n case 'column-ref':\n return renderColumn(value);\n case 'default-value':\n throw new Error('SQLite does not support DEFAULT as a value in INSERT ... VALUES');\n default:\n throw new Error(`Unsupported value node in INSERT: ${(value as { kind: string }).kind}`);\n }\n}\n\nfunction renderInsert(ast: InsertAst): string {\n const table = quoteIdentifier(ast.table.name);\n const rows = ast.rows;\n if (rows.length === 0) {\n throw new Error('INSERT requires at least one row');\n }\n\n const firstRow = rows[0] as Readonly<Record<string, InsertValue>>;\n const columnOrder = Object.keys(firstRow);\n\n let insertClause: string;\n if (columnOrder.length === 0) {\n insertClause = `INSERT INTO ${table} DEFAULT VALUES`;\n } else {\n const columns = columnOrder.map((column) => quoteIdentifier(column));\n const values = rows\n .map((row) => {\n const renderedRow = columnOrder.map((column) => {\n const value = row[column];\n if (value === undefined) {\n throw new Error(`Missing value for column \"${column}\" in INSERT row`);\n }\n return renderInsertValue(value);\n });\n return `(${renderedRow.join(', ')})`;\n })\n .join(', ');\n insertClause = `INSERT INTO ${table} (${columns.join(', ')}) VALUES ${values}`;\n }\n\n let onConflictClause = '';\n if (ast.onConflict) {\n const conflictColumns = ast.onConflict.columns.map((col) => quoteIdentifier(col.column));\n if (conflictColumns.length === 0) {\n throw new Error('INSERT onConflict requires at least one conflict column');\n }\n\n const action = ast.onConflict.action;\n switch (action.kind) {\n case 'do-nothing':\n onConflictClause = ` ON CONFLICT (${conflictColumns.join(', ')}) DO NOTHING`;\n break;\n case 'do-update-set': {\n const updates = Object.entries(action.set).map(([colName, value]) => {\n const target = quoteIdentifier(colName);\n if (value.kind === 'param-ref') {\n return `${target} = ?`;\n }\n return `${target} = ${renderColumn(value)}`;\n });\n onConflictClause = ` ON CONFLICT (${conflictColumns.join(', ')}) DO UPDATE SET ${updates.join(', ')}`;\n break;\n }\n default:\n throw new Error(`Unsupported onConflict action: ${(action as { kind: string }).kind}`);\n }\n }\n\n const returningClause = renderReturning(ast.returning);\n\n return `${insertClause}${onConflictClause}${returningClause}`;\n}\n\nfunction renderUpdate(ast: UpdateAst, contract: SqliteContract): string {\n const table = quoteIdentifier(ast.table.name);\n const setClauses = Object.entries(ast.set).map(([col, val]) => {\n const column = quoteIdentifier(col);\n let value: string;\n switch (val.kind) {\n case 'param-ref':\n value = '?';\n break;\n case 'column-ref':\n value = renderColumn(val);\n break;\n default:\n throw new Error(`Unsupported value node in UPDATE: ${(val as { kind: string }).kind}`);\n }\n return `${column} = ${value}`;\n });\n\n const whereClause = ast.where ? ` WHERE ${renderExpr(ast.where, contract)}` : '';\n const returningClause = renderReturning(ast.returning);\n\n return `UPDATE ${table} SET ${setClauses.join(', ')}${whereClause}${returningClause}`;\n}\n\nfunction renderDelete(ast: DeleteAst): string {\n const table = quoteIdentifier(ast.table.name);\n const whereClause = ast.where ? ` WHERE ${renderExpr(ast.where)}` : '';\n const returningClause = renderReturning(ast.returning);\n\n return `DELETE FROM ${table}${whereClause}${returningClause}`;\n}\n\nfunction renderReturning(returning: ReadonlyArray<ColumnRef> | undefined): string {\n if (!returning?.length) {\n return '';\n }\n return ` RETURNING ${returning.map((col) => `${quoteIdentifier(col.table)}.${quoteIdentifier(col.column)}`).join(', ')}`;\n}\n\nexport function createSqliteAdapter(options?: SqliteAdapterOptions) {\n return Object.freeze(new SqliteAdapterImpl(options));\n}\n"],"mappings":";;;;AAAA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YACE,SACA,AAAgBA,OAChB,AAAgBC,MAChB;AACA,QAAM,QAAQ;EAHE;EACA;AAGhB,OAAK,OAAO;;;AAIhB,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AU,WAAW,IAAI,MAAM,KAAK,KAC5C,gBAAgB,IAAI,UAAU;;AAKxD,SAAS,gBAAgB,WAAyD;AAChF,KAAI,CAAC,WAAW,OACd,QAAO;AAET,QAAO,cAAc,UAAU,KAAK,QAAQ,GAAG,gBAAgB,IAAI,MAAM,CAAC,GAAG,gBAAgB,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK;;AAGxH,SAAgB,oBAAoB,SAAgC;AAClE,QAAO,OAAO,OAAO,IAAI,kBAAkB,QAAQ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import "./types-gAqc4ucF.mjs";
2
+ import { t as createSqliteAdapter } from "./adapter-CTYh7Njp.mjs";
3
+ export { createSqliteAdapter };
@@ -0,0 +1,4 @@
1
+ import "./codecs-Bhz0W5Xm.mjs";
2
+ import { t as createSqliteAdapter } from "./adapter-DrU8lTP4.mjs";
3
+
4
+ export { createSqliteAdapter };
@@ -0,0 +1,15 @@
1
+ import "@prisma-next/sql-relational-core/ast";
2
+
3
+ //#region src/core/codec-ids.ts
4
+ const SQLITE_TEXT_CODEC_ID = "sqlite/text@1";
5
+ const SQLITE_INTEGER_CODEC_ID = "sqlite/integer@1";
6
+ const SQLITE_REAL_CODEC_ID = "sqlite/real@1";
7
+ const SQLITE_BLOB_CODEC_ID = "sqlite/blob@1";
8
+ const SQLITE_BOOLEAN_CODEC_ID = "sqlite/boolean@1";
9
+ const SQLITE_DATETIME_CODEC_ID = "sqlite/datetime@1";
10
+ const SQLITE_JSON_CODEC_ID = "sqlite/json@1";
11
+ const SQLITE_BIGINT_CODEC_ID = "sqlite/bigint@1";
12
+
13
+ //#endregion
14
+ export { SQLITE_INTEGER_CODEC_ID as a, SQLITE_TEXT_CODEC_ID as c, SQLITE_DATETIME_CODEC_ID as i, SQLITE_BLOB_CODEC_ID as n, SQLITE_JSON_CODEC_ID as o, SQLITE_BOOLEAN_CODEC_ID as r, SQLITE_REAL_CODEC_ID as s, SQLITE_BIGINT_CODEC_ID as t };
15
+ //# sourceMappingURL=codec-ids-o_Z8i4nt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-ids-o_Z8i4nt.mjs","names":[],"sources":["../src/core/codec-ids.ts"],"sourcesContent":["export {\n SQL_CHAR_CODEC_ID,\n SQL_FLOAT_CODEC_ID,\n SQL_INT_CODEC_ID,\n SQL_VARCHAR_CODEC_ID,\n} from '@prisma-next/sql-relational-core/ast';\nexport const SQLITE_TEXT_CODEC_ID = 'sqlite/text@1' as const;\nexport const SQLITE_INTEGER_CODEC_ID = 'sqlite/integer@1' as const;\nexport const SQLITE_REAL_CODEC_ID = 'sqlite/real@1' as const;\nexport const SQLITE_BLOB_CODEC_ID = 'sqlite/blob@1' as const;\nexport const SQLITE_BOOLEAN_CODEC_ID = 'sqlite/boolean@1' as const;\nexport const SQLITE_DATETIME_CODEC_ID = 'sqlite/datetime@1' as const;\nexport const SQLITE_JSON_CODEC_ID = 'sqlite/json@1' as const;\nexport const SQLITE_BIGINT_CODEC_ID = 'sqlite/bigint@1' as const;\n"],"mappings":";;;AAMA,MAAa,uBAAuB;AACpC,MAAa,0BAA0B;AACvC,MAAa,uBAAuB;AACpC,MAAa,uBAAuB;AACpC,MAAa,0BAA0B;AACvC,MAAa,2BAA2B;AACxC,MAAa,uBAAuB;AACpC,MAAa,yBAAyB"}
@@ -0,0 +1,40 @@
1
+ import * as _prisma_next_sql_relational_core_ast0 from "@prisma-next/sql-relational-core/ast";
2
+
3
+ //#region src/core/codecs.d.ts
4
+ type JsonValue = string | number | boolean | null | {
5
+ readonly [key: string]: JsonValue;
6
+ } | readonly JsonValue[];
7
+ declare const codecs: _prisma_next_sql_relational_core_ast0.CodecDefBuilder<{
8
+ char: _prisma_next_sql_relational_core_ast0.Codec<"sql/char@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
9
+ varchar: _prisma_next_sql_relational_core_ast0.Codec<"sql/varchar@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
10
+ int: _prisma_next_sql_relational_core_ast0.Codec<"sql/int@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
11
+ float: _prisma_next_sql_relational_core_ast0.Codec<"sql/float@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
12
+ text: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/text@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
13
+ integer: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/integer@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
14
+ real: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/real@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
15
+ blob: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/blob@1", readonly ["equality"], Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, Record<string, unknown>, unknown>;
16
+ boolean: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/boolean@1", readonly ["equality", "boolean"], number, boolean, Record<string, unknown>, unknown>;
17
+ datetime: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/datetime@1", readonly ["equality", "order"], string, Date, Record<string, unknown>, unknown>;
18
+ json: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/json@1", readonly ["equality"], string, JsonValue, Record<string, unknown>, unknown>;
19
+ } & Record<"bigint", _prisma_next_sql_relational_core_ast0.Codec<"sqlite/bigint@1", readonly ["equality", "order", "numeric"], number | bigint, bigint, Record<string, unknown>, unknown>>>;
20
+ declare const dataTypes: {
21
+ readonly char: "sql/char@1";
22
+ readonly varchar: "sql/varchar@1";
23
+ readonly int: "sql/int@1";
24
+ readonly float: "sql/float@1";
25
+ readonly text: "sqlite/text@1";
26
+ readonly integer: "sqlite/integer@1";
27
+ readonly real: "sqlite/real@1";
28
+ readonly blob: "sqlite/blob@1";
29
+ readonly boolean: "sqlite/boolean@1";
30
+ readonly datetime: "sqlite/datetime@1";
31
+ readonly json: "sqlite/json@1";
32
+ readonly bigint: "sqlite/bigint@1";
33
+ };
34
+ type CodecTypes$1 = typeof codecs.CodecTypes;
35
+ //#endregion
36
+ //#region src/exports/codec-types.d.ts
37
+ type CodecTypes = CodecTypes$1;
38
+ //#endregion
39
+ export { CodecTypes, type JsonValue, dataTypes };
40
+ //# sourceMappingURL=codec-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-types.d.mts","names":[],"sources":["../src/core/codecs.ts","../src/exports/codec-types.ts"],"sourcesContent":[],"mappings":";;;KAiBY,SAAA;0BAKkB;aACjB;AANb,cAyEM,MAzEe,wCAyET,eAnEU,CAAA;EAmEhB,IAAA,6CAY6B,CAAA,YAAA,EAAA,SAAA,CAAA,UAAA,EAAA,OAAA,EAAA,SAAA,CAAA,EAAA,MAAA,EAAA,MAAA,QAAA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,CAAA;;;;;;;;;;;;cAGtB;;;;;;;;;;;;;;KAED,YAAA,UAAoB,MAAA,CAAO;;;KCzG3B,UAAA,GAAa"}
@@ -0,0 +1,3 @@
1
+ import { n as dataTypes } from "./codecs-Bhz0W5Xm.mjs";
2
+
3
+ export { dataTypes };
@@ -0,0 +1,87 @@
1
+ import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BOOLEAN_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-o_Z8i4nt.mjs";
2
+ import { codec, defineCodecs, sqlCodecDefinitions } from "@prisma-next/sql-relational-core/ast";
3
+
4
+ //#region src/core/codecs.ts
5
+ const sqlCharCodec = sqlCodecDefinitions.char.codec;
6
+ const sqlVarcharCodec = sqlCodecDefinitions.varchar.codec;
7
+ const sqlIntCodec = sqlCodecDefinitions.int.codec;
8
+ const sqlFloatCodec = sqlCodecDefinitions.float.codec;
9
+ const sqliteTextCodec = codec({
10
+ typeId: SQLITE_TEXT_CODEC_ID,
11
+ targetTypes: ["text"],
12
+ traits: [
13
+ "equality",
14
+ "order",
15
+ "textual"
16
+ ],
17
+ encode: (value) => value,
18
+ decode: (wire) => wire
19
+ });
20
+ const sqliteIntegerCodec = codec({
21
+ typeId: SQLITE_INTEGER_CODEC_ID,
22
+ targetTypes: ["integer"],
23
+ traits: [
24
+ "equality",
25
+ "order",
26
+ "numeric"
27
+ ],
28
+ encode: (value) => value,
29
+ decode: (wire) => wire
30
+ });
31
+ const sqliteRealCodec = codec({
32
+ typeId: SQLITE_REAL_CODEC_ID,
33
+ targetTypes: ["real"],
34
+ traits: [
35
+ "equality",
36
+ "order",
37
+ "numeric"
38
+ ],
39
+ encode: (value) => value,
40
+ decode: (wire) => wire
41
+ });
42
+ const sqliteBlobCodec = codec({
43
+ typeId: SQLITE_BLOB_CODEC_ID,
44
+ targetTypes: ["blob"],
45
+ traits: ["equality"],
46
+ encode: (value) => value,
47
+ decode: (wire) => wire
48
+ });
49
+ const sqliteBooleanCodec = codec({
50
+ typeId: SQLITE_BOOLEAN_CODEC_ID,
51
+ targetTypes: ["integer"],
52
+ traits: ["equality", "boolean"],
53
+ encode: (value) => value ? 1 : 0,
54
+ decode: (wire) => wire !== 0
55
+ });
56
+ const sqliteDatetimeCodec = codec({
57
+ typeId: SQLITE_DATETIME_CODEC_ID,
58
+ targetTypes: ["text"],
59
+ traits: ["equality", "order"],
60
+ encode: (value) => value.toISOString(),
61
+ decode: (wire) => new Date(wire)
62
+ });
63
+ const sqliteJsonCodec = codec({
64
+ typeId: SQLITE_JSON_CODEC_ID,
65
+ targetTypes: ["text"],
66
+ traits: ["equality"],
67
+ encode: (value) => JSON.stringify(value),
68
+ decode: (wire) => typeof wire === "string" ? JSON.parse(wire) : wire
69
+ });
70
+ const sqliteBigintCodec = codec({
71
+ typeId: SQLITE_BIGINT_CODEC_ID,
72
+ targetTypes: ["integer"],
73
+ traits: [
74
+ "equality",
75
+ "order",
76
+ "numeric"
77
+ ],
78
+ encode: (value) => value,
79
+ decode: (wire) => BigInt(wire)
80
+ });
81
+ const codecs = defineCodecs().add("char", sqlCharCodec).add("varchar", sqlVarcharCodec).add("int", sqlIntCodec).add("float", sqlFloatCodec).add("text", sqliteTextCodec).add("integer", sqliteIntegerCodec).add("real", sqliteRealCodec).add("blob", sqliteBlobCodec).add("boolean", sqliteBooleanCodec).add("datetime", sqliteDatetimeCodec).add("json", sqliteJsonCodec).add("bigint", sqliteBigintCodec);
82
+ const codecDefinitions = codecs.codecDefinitions;
83
+ const dataTypes = codecs.dataTypes;
84
+
85
+ //#endregion
86
+ export { dataTypes as n, codecDefinitions as t };
87
+ //# sourceMappingURL=codecs-Bhz0W5Xm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs-Bhz0W5Xm.mjs","names":[],"sources":["../src/core/codecs.ts"],"sourcesContent":["import { codec, defineCodecs, sqlCodecDefinitions } from '@prisma-next/sql-relational-core/ast';\nimport {\n SQLITE_BIGINT_CODEC_ID,\n SQLITE_BLOB_CODEC_ID,\n SQLITE_BOOLEAN_CODEC_ID,\n SQLITE_DATETIME_CODEC_ID,\n SQLITE_INTEGER_CODEC_ID,\n SQLITE_JSON_CODEC_ID,\n SQLITE_REAL_CODEC_ID,\n SQLITE_TEXT_CODEC_ID,\n} from './codec-ids';\n\nconst sqlCharCodec = sqlCodecDefinitions.char.codec;\nconst sqlVarcharCodec = sqlCodecDefinitions.varchar.codec;\nconst sqlIntCodec = sqlCodecDefinitions.int.codec;\nconst sqlFloatCodec = sqlCodecDefinitions.float.codec;\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | { readonly [key: string]: JsonValue }\n | readonly JsonValue[];\n\nconst sqliteTextCodec = codec({\n typeId: SQLITE_TEXT_CODEC_ID,\n targetTypes: ['text'],\n traits: ['equality', 'order', 'textual'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n});\n\nconst sqliteIntegerCodec = codec({\n typeId: SQLITE_INTEGER_CODEC_ID,\n targetTypes: ['integer'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n});\n\nconst sqliteRealCodec = codec({\n typeId: SQLITE_REAL_CODEC_ID,\n targetTypes: ['real'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n});\n\nconst sqliteBlobCodec = codec({\n typeId: SQLITE_BLOB_CODEC_ID,\n targetTypes: ['blob'],\n traits: ['equality'],\n encode: (value: Uint8Array): Uint8Array => value,\n decode: (wire: Uint8Array): Uint8Array => wire,\n});\n\nconst sqliteBooleanCodec = codec({\n typeId: SQLITE_BOOLEAN_CODEC_ID,\n targetTypes: ['integer'],\n traits: ['equality', 'boolean'],\n encode: (value: boolean): number => (value ? 1 : 0),\n decode: (wire: number): boolean => wire !== 0,\n});\n\nconst sqliteDatetimeCodec = codec({\n typeId: SQLITE_DATETIME_CODEC_ID,\n targetTypes: ['text'],\n traits: ['equality', 'order'],\n encode: (value: Date): string => value.toISOString(),\n decode: (wire: string): Date => new Date(wire),\n});\n\nconst sqliteJsonCodec = codec({\n typeId: SQLITE_JSON_CODEC_ID,\n targetTypes: ['text'],\n traits: ['equality'],\n encode: (value: JsonValue): string => JSON.stringify(value),\n decode: (wire: string | JsonValue): JsonValue =>\n typeof wire === 'string' ? (JSON.parse(wire) as JsonValue) : wire,\n});\n\nconst sqliteBigintCodec = codec({\n typeId: SQLITE_BIGINT_CODEC_ID,\n targetTypes: ['integer'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: bigint): number | bigint => value,\n decode: (wire: number | bigint): bigint => BigInt(wire),\n});\n\nconst codecs = defineCodecs()\n .add('char', sqlCharCodec)\n .add('varchar', sqlVarcharCodec)\n .add('int', sqlIntCodec)\n .add('float', sqlFloatCodec)\n .add('text', sqliteTextCodec)\n .add('integer', sqliteIntegerCodec)\n .add('real', sqliteRealCodec)\n .add('blob', sqliteBlobCodec)\n .add('boolean', sqliteBooleanCodec)\n .add('datetime', sqliteDatetimeCodec)\n .add('json', sqliteJsonCodec)\n .add('bigint', sqliteBigintCodec);\n\nexport const codecDefinitions = codecs.codecDefinitions;\nexport const dataTypes = codecs.dataTypes;\n\nexport type CodecTypes = typeof codecs.CodecTypes;\n"],"mappings":";;;;AAYA,MAAM,eAAe,oBAAoB,KAAK;AAC9C,MAAM,kBAAkB,oBAAoB,QAAQ;AACpD,MAAM,cAAc,oBAAoB,IAAI;AAC5C,MAAM,gBAAgB,oBAAoB,MAAM;AAUhD,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAA0B;CACnC,SAAS,SAAyB;CACnC,CAAC;AAEF,MAAM,qBAAqB,MAAM;CAC/B,QAAQ;CACR,aAAa,CAAC,UAAU;CACxB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAA0B;CACnC,SAAS,SAAyB;CACnC,CAAC;AAEF,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAA0B;CACnC,SAAS,SAAyB;CACnC,CAAC;AAEF,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ,CAAC,WAAW;CACpB,SAAS,UAAkC;CAC3C,SAAS,SAAiC;CAC3C,CAAC;AAEF,MAAM,qBAAqB,MAAM;CAC/B,QAAQ;CACR,aAAa,CAAC,UAAU;CACxB,QAAQ,CAAC,YAAY,UAAU;CAC/B,SAAS,UAA4B,QAAQ,IAAI;CACjD,SAAS,SAA0B,SAAS;CAC7C,CAAC;AAEF,MAAM,sBAAsB,MAAM;CAChC,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ,CAAC,YAAY,QAAQ;CAC7B,SAAS,UAAwB,MAAM,aAAa;CACpD,SAAS,SAAuB,IAAI,KAAK,KAAK;CAC/C,CAAC;AAEF,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ,CAAC,WAAW;CACpB,SAAS,UAA6B,KAAK,UAAU,MAAM;CAC3D,SAAS,SACP,OAAO,SAAS,WAAY,KAAK,MAAM,KAAK,GAAiB;CAChE,CAAC;AAEF,MAAM,oBAAoB,MAAM;CAC9B,QAAQ;CACR,aAAa,CAAC,UAAU;CACxB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAAmC;CAC5C,SAAS,SAAkC,OAAO,KAAK;CACxD,CAAC;AAEF,MAAM,SAAS,cAAc,CAC1B,IAAI,QAAQ,aAAa,CACzB,IAAI,WAAW,gBAAgB,CAC/B,IAAI,OAAO,YAAY,CACvB,IAAI,SAAS,cAAc,CAC3B,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,WAAW,mBAAmB,CAClC,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,WAAW,mBAAmB,CAClC,IAAI,YAAY,oBAAoB,CACpC,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,UAAU,kBAAkB;AAEnC,MAAa,mBAAmB,OAAO;AACvC,MAAa,YAAY,OAAO"}
@@ -0,0 +1,36 @@
1
+ //#region src/core/column-types.d.ts
2
+ declare const textColumn: {
3
+ readonly codecId: "sqlite/text@1";
4
+ readonly nativeType: "text";
5
+ };
6
+ declare const integerColumn: {
7
+ readonly codecId: "sqlite/integer@1";
8
+ readonly nativeType: "integer";
9
+ };
10
+ declare const realColumn: {
11
+ readonly codecId: "sqlite/real@1";
12
+ readonly nativeType: "real";
13
+ };
14
+ declare const blobColumn: {
15
+ readonly codecId: "sqlite/blob@1";
16
+ readonly nativeType: "blob";
17
+ };
18
+ declare const booleanColumn: {
19
+ readonly codecId: "sqlite/boolean@1";
20
+ readonly nativeType: "integer";
21
+ };
22
+ declare const datetimeColumn: {
23
+ readonly codecId: "sqlite/datetime@1";
24
+ readonly nativeType: "text";
25
+ };
26
+ declare const jsonColumn: {
27
+ readonly codecId: "sqlite/json@1";
28
+ readonly nativeType: "text";
29
+ };
30
+ declare const bigintColumn: {
31
+ readonly codecId: "sqlite/bigint@1";
32
+ readonly nativeType: "integer";
33
+ };
34
+ //#endregion
35
+ export { bigintColumn, blobColumn, booleanColumn, datetimeColumn, integerColumn, jsonColumn, realColumn, textColumn };
36
+ //# sourceMappingURL=column-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-types.d.mts","names":[],"sources":["../src/core/column-types.ts"],"sourcesContent":[],"mappings":";cAWa;EAAA,SAAA,OAGH,EAAA,eAAA;EAEG,SAAA,UAGH,EAAA,MAAA;AAEV,CAAA;AAKa,cAVA,aAaH,EAAA;EAEG,SAAA,OAGH,EAAA,kBAAA;EAEG,SAAA,UAGH,EAAA,SAAA;AAEV,CAAA;AAKa,cAzBA,UA4BH,EAAA;;;;cAvBG;;;;cAKA;;;;cAKA;;;;cAKA;;;;cAKA"}
@@ -0,0 +1,39 @@
1
+ import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BOOLEAN_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-o_Z8i4nt.mjs";
2
+
3
+ //#region src/core/column-types.ts
4
+ const textColumn = {
5
+ codecId: SQLITE_TEXT_CODEC_ID,
6
+ nativeType: "text"
7
+ };
8
+ const integerColumn = {
9
+ codecId: SQLITE_INTEGER_CODEC_ID,
10
+ nativeType: "integer"
11
+ };
12
+ const realColumn = {
13
+ codecId: SQLITE_REAL_CODEC_ID,
14
+ nativeType: "real"
15
+ };
16
+ const blobColumn = {
17
+ codecId: SQLITE_BLOB_CODEC_ID,
18
+ nativeType: "blob"
19
+ };
20
+ const booleanColumn = {
21
+ codecId: SQLITE_BOOLEAN_CODEC_ID,
22
+ nativeType: "integer"
23
+ };
24
+ const datetimeColumn = {
25
+ codecId: SQLITE_DATETIME_CODEC_ID,
26
+ nativeType: "text"
27
+ };
28
+ const jsonColumn = {
29
+ codecId: SQLITE_JSON_CODEC_ID,
30
+ nativeType: "text"
31
+ };
32
+ const bigintColumn = {
33
+ codecId: SQLITE_BIGINT_CODEC_ID,
34
+ nativeType: "integer"
35
+ };
36
+
37
+ //#endregion
38
+ export { bigintColumn, blobColumn, booleanColumn, datetimeColumn, integerColumn, jsonColumn, realColumn, textColumn };
39
+ //# sourceMappingURL=column-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-types.mjs","names":[],"sources":["../src/core/column-types.ts"],"sourcesContent":["import {\n SQLITE_BIGINT_CODEC_ID,\n SQLITE_BLOB_CODEC_ID,\n SQLITE_BOOLEAN_CODEC_ID,\n SQLITE_DATETIME_CODEC_ID,\n SQLITE_INTEGER_CODEC_ID,\n SQLITE_JSON_CODEC_ID,\n SQLITE_REAL_CODEC_ID,\n SQLITE_TEXT_CODEC_ID,\n} from './codec-ids';\n\nexport const textColumn = {\n codecId: SQLITE_TEXT_CODEC_ID,\n nativeType: 'text',\n} as const;\n\nexport const integerColumn = {\n codecId: SQLITE_INTEGER_CODEC_ID,\n nativeType: 'integer',\n} as const;\n\nexport const realColumn = {\n codecId: SQLITE_REAL_CODEC_ID,\n nativeType: 'real',\n} as const;\n\nexport const blobColumn = {\n codecId: SQLITE_BLOB_CODEC_ID,\n nativeType: 'blob',\n} as const;\n\nexport const booleanColumn = {\n codecId: SQLITE_BOOLEAN_CODEC_ID,\n nativeType: 'integer',\n} as const;\n\nexport const datetimeColumn = {\n codecId: SQLITE_DATETIME_CODEC_ID,\n nativeType: 'text',\n} as const;\n\nexport const jsonColumn = {\n codecId: SQLITE_JSON_CODEC_ID,\n nativeType: 'text',\n} as const;\n\nexport const bigintColumn = {\n codecId: SQLITE_BIGINT_CODEC_ID,\n nativeType: 'integer',\n} as const;\n"],"mappings":";;;AAWA,MAAa,aAAa;CACxB,SAAS;CACT,YAAY;CACb;AAED,MAAa,gBAAgB;CAC3B,SAAS;CACT,YAAY;CACb;AAED,MAAa,aAAa;CACxB,SAAS;CACT,YAAY;CACb;AAED,MAAa,aAAa;CACxB,SAAS;CACT,YAAY;CACb;AAED,MAAa,gBAAgB;CAC3B,SAAS;CACT,YAAY;CACb;AAED,MAAa,iBAAiB;CAC5B,SAAS;CACT,YAAY;CACb;AAED,MAAa,aAAa;CACxB,SAAS;CACT,YAAY;CACb;AAED,MAAa,eAAe;CAC1B,SAAS;CACT,YAAY;CACb"}
@@ -0,0 +1,7 @@
1
+ import { ControlAdapterDescriptor, ControlAdapterInstance } from "@prisma-next/framework-components/control";
2
+
3
+ //#region src/core/control-adapter.d.ts
4
+ declare const sqliteControlAdapterDescriptor: ControlAdapterDescriptor<'sql', 'sqlite', ControlAdapterInstance<'sql', 'sqlite'>>;
5
+ //#endregion
6
+ export { sqliteControlAdapterDescriptor as default };
7
+ //# sourceMappingURL=control.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-adapter.ts"],"sourcesContent":[],"mappings":";;;cAMM,gCAAgC,0CAGpC"}
@@ -0,0 +1,17 @@
1
+ import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-Bg-c1LmL.mjs";
2
+
3
+ //#region src/core/control-adapter.ts
4
+ const sqliteControlAdapterDescriptor = {
5
+ ...sqliteAdapterDescriptorMeta,
6
+ create() {
7
+ return {
8
+ familyId: "sql",
9
+ targetId: "sqlite"
10
+ };
11
+ }
12
+ };
13
+ var control_adapter_default = sqliteControlAdapterDescriptor;
14
+
15
+ //#endregion
16
+ export { control_adapter_default as default };
17
+ //# sourceMappingURL=control.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.mjs","names":["sqliteControlAdapterDescriptor: ControlAdapterDescriptor<\n 'sql',\n 'sqlite',\n ControlAdapterInstance<'sql', 'sqlite'>\n>"],"sources":["../src/core/control-adapter.ts"],"sourcesContent":["import type {\n ControlAdapterDescriptor,\n ControlAdapterInstance,\n} from '@prisma-next/framework-components/control';\nimport { sqliteAdapterDescriptorMeta } from './descriptor-meta';\n\nconst sqliteControlAdapterDescriptor: ControlAdapterDescriptor<\n 'sql',\n 'sqlite',\n ControlAdapterInstance<'sql', 'sqlite'>\n> = {\n ...sqliteAdapterDescriptorMeta,\n create(): ControlAdapterInstance<'sql', 'sqlite'> {\n return { familyId: 'sql', targetId: 'sqlite' };\n },\n};\n\nexport default sqliteControlAdapterDescriptor;\n"],"mappings":";;;AAMA,MAAMA,iCAIF;CACF,GAAG;CACH,SAAkD;AAChD,SAAO;GAAE,UAAU;GAAO,UAAU;GAAU;;CAEjD;AAED,8BAAe"}
@@ -0,0 +1,25 @@
1
+ //#region src/core/descriptor-meta.ts
2
+ const sqliteAdapterDescriptorMeta = {
3
+ kind: "adapter",
4
+ familyId: "sql",
5
+ targetId: "sqlite",
6
+ id: "sqlite",
7
+ version: "0.0.1",
8
+ capabilities: { sql: {
9
+ orderBy: true,
10
+ limit: true,
11
+ lateral: false,
12
+ jsonAgg: true,
13
+ returning: true,
14
+ enums: false
15
+ } },
16
+ types: { codecTypes: { import: {
17
+ package: "@prisma-next/adapter-sqlite/codec-types",
18
+ named: "CodecTypes",
19
+ alias: "SqliteTypes"
20
+ } } }
21
+ };
22
+
23
+ //#endregion
24
+ export { sqliteAdapterDescriptorMeta as t };
25
+ //# sourceMappingURL=descriptor-meta-Bg-c1LmL.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-meta-Bg-c1LmL.mjs","names":[],"sources":["../src/core/descriptor-meta.ts"],"sourcesContent":["export const sqliteAdapterDescriptorMeta = {\n kind: 'adapter',\n familyId: 'sql',\n targetId: 'sqlite',\n id: 'sqlite',\n version: '0.0.1',\n capabilities: {\n sql: {\n orderBy: true,\n limit: true,\n lateral: false,\n jsonAgg: true,\n returning: true,\n enums: false,\n },\n },\n types: {\n codecTypes: {\n import: {\n package: '@prisma-next/adapter-sqlite/codec-types',\n named: 'CodecTypes',\n alias: 'SqliteTypes',\n },\n },\n },\n} as const;\n"],"mappings":";AAAA,MAAa,8BAA8B;CACzC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,EACZ,KAAK;EACH,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,WAAW;EACX,OAAO;EACR,EACF;CACD,OAAO,EACL,YAAY,EACV,QAAQ;EACN,SAAS;EACT,OAAO;EACP,OAAO;EACR,EACF,EACF;CACF"}
@@ -0,0 +1,11 @@
1
+ import "./types-gAqc4ucF.mjs";
2
+ import { t as createSqliteAdapter } from "./adapter-CTYh7Njp.mjs";
3
+ import { RuntimeAdapterInstance } from "@prisma-next/framework-components/execution";
4
+ import { SqlRuntimeAdapterDescriptor } from "@prisma-next/sql-runtime";
5
+
6
+ //#region src/core/runtime-adapter.d.ts
7
+ type SqliteRuntimeAdapterInstance = RuntimeAdapterInstance<'sql', 'sqlite'> & ReturnType<typeof createSqliteAdapter>;
8
+ declare const sqliteRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<'sqlite', SqliteRuntimeAdapterInstance>;
9
+ //#endregion
10
+ export { type SqliteRuntimeAdapterInstance, sqliteRuntimeAdapterDescriptor as default };
11
+ //# sourceMappingURL=runtime.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/core/runtime-adapter.ts"],"sourcesContent":[],"mappings":";;;;;;KAQY,4BAAA,GAA+B,0CACzC,kBAAkB;cAUd,gCAAgC,sCAEpC"}
@@ -0,0 +1,25 @@
1
+ import { t as codecDefinitions } from "./codecs-Bhz0W5Xm.mjs";
2
+ import { t as createSqliteAdapter } from "./adapter-DrU8lTP4.mjs";
3
+ import { t as sqliteAdapterDescriptorMeta } from "./descriptor-meta-Bg-c1LmL.mjs";
4
+ import { createCodecRegistry } from "@prisma-next/sql-relational-core/ast";
5
+
6
+ //#region src/core/runtime-adapter.ts
7
+ function createSqliteCodecRegistry() {
8
+ const registry = createCodecRegistry();
9
+ for (const definition of Object.values(codecDefinitions)) registry.register(definition.codec);
10
+ return registry;
11
+ }
12
+ const sqliteRuntimeAdapterDescriptor = {
13
+ ...sqliteAdapterDescriptorMeta,
14
+ codecs: createSqliteCodecRegistry,
15
+ parameterizedCodecs: () => [],
16
+ mutationDefaultGenerators: () => [],
17
+ create() {
18
+ return createSqliteAdapter();
19
+ }
20
+ };
21
+ var runtime_adapter_default = sqliteRuntimeAdapterDescriptor;
22
+
23
+ //#endregion
24
+ export { runtime_adapter_default as default };
25
+ //# sourceMappingURL=runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.mjs","names":["sqliteRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<\n 'sqlite',\n SqliteRuntimeAdapterInstance\n>"],"sources":["../src/core/runtime-adapter.ts"],"sourcesContent":["import type { RuntimeAdapterInstance } from '@prisma-next/framework-components/execution';\nimport type { CodecRegistry } from '@prisma-next/sql-relational-core/ast';\nimport { createCodecRegistry } from '@prisma-next/sql-relational-core/ast';\nimport type { SqlRuntimeAdapterDescriptor } from '@prisma-next/sql-runtime';\nimport { createSqliteAdapter } from './adapter';\nimport { codecDefinitions } from './codecs';\nimport { sqliteAdapterDescriptorMeta } from './descriptor-meta';\n\nexport type SqliteRuntimeAdapterInstance = RuntimeAdapterInstance<'sql', 'sqlite'> &\n ReturnType<typeof createSqliteAdapter>;\n\nfunction createSqliteCodecRegistry(): CodecRegistry {\n const registry = createCodecRegistry();\n for (const definition of Object.values(codecDefinitions)) {\n registry.register(definition.codec);\n }\n return registry;\n}\n\nconst sqliteRuntimeAdapterDescriptor: SqlRuntimeAdapterDescriptor<\n 'sqlite',\n SqliteRuntimeAdapterInstance\n> = {\n ...sqliteAdapterDescriptorMeta,\n codecs: createSqliteCodecRegistry,\n parameterizedCodecs: () => [],\n mutationDefaultGenerators: () => [],\n create(): SqliteRuntimeAdapterInstance {\n return createSqliteAdapter();\n },\n};\n\nexport default sqliteRuntimeAdapterDescriptor;\n"],"mappings":";;;;;;AAWA,SAAS,4BAA2C;CAClD,MAAM,WAAW,qBAAqB;AACtC,MAAK,MAAM,cAAc,OAAO,OAAO,iBAAiB,CACtD,UAAS,SAAS,WAAW,MAAM;AAErC,QAAO;;AAGT,MAAMA,iCAGF;CACF,GAAG;CACH,QAAQ;CACR,2BAA2B,EAAE;CAC7B,iCAAiC,EAAE;CACnC,SAAuC;AACrC,SAAO,qBAAqB;;CAE/B;AAED,8BAAe"}
@@ -0,0 +1,15 @@
1
+ import { LoweredStatement } from "@prisma-next/sql-relational-core/ast";
2
+ import { Contract } from "@prisma-next/contract/types";
3
+ import { SqlStorage } from "@prisma-next/sql-contract/types";
4
+
5
+ //#region src/core/types.d.ts
6
+ interface SqliteAdapterOptions {
7
+ readonly profileId?: string;
8
+ }
9
+ type SqliteContract = Contract<SqlStorage> & {
10
+ readonly target: 'sqlite';
11
+ };
12
+ type SqliteLoweredStatement = LoweredStatement;
13
+ //#endregion
14
+ export { SqliteContract as n, SqliteLoweredStatement as r, SqliteAdapterOptions as t };
15
+ //# sourceMappingURL=types-gAqc4ucF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-gAqc4ucF.d.mts","names":[],"sources":["../src/core/types.ts"],"sourcesContent":[],"mappings":";;;;;UAIiB,oBAAA;;AAAjB;AAIY,KAAA,cAAA,GAAiB,QAAS,CAAA,UAAT,CAAA,GAAA;EAEjB,SAAA,MAAA,EAAA,QAAsB;;KAAtB,sBAAA,GAAyB"}
@@ -0,0 +1,2 @@
1
+ import { n as SqliteContract, r as SqliteLoweredStatement } from "./types-gAqc4ucF.mjs";
2
+ export { type SqliteContract, type SqliteLoweredStatement };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
package/package.json CHANGED
@@ -1,46 +1,36 @@
1
1
  {
2
2
  "name": "@prisma-next/adapter-sqlite",
3
- "version": "0.0.1",
3
+ "version": "0.3.0-dev.163",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [
7
7
  "dist",
8
8
  "src"
9
9
  ],
10
- "scripts": {
11
- "build": "tsdown",
12
- "test": "vitest run",
13
- "test:coverage": "vitest run --coverage",
14
- "typecheck": "tsc --project tsconfig.json --noEmit",
15
- "lint": "biome check . --error-on-warnings",
16
- "lint:fix": "biome check --write .",
17
- "lint:fix:unsafe": "biome check --write --unsafe .",
18
- "clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
19
- },
20
10
  "dependencies": {
21
- "@prisma-next/cli": "workspace:*",
22
- "@prisma-next/contract": "workspace:*",
23
- "@prisma-next/contract-authoring": "workspace:*",
24
- "@prisma-next/framework-components": "workspace:*",
25
- "@prisma-next/family-sql": "workspace:*",
26
- "@prisma-next/ids": "workspace:*",
27
- "@prisma-next/sql-contract": "workspace:*",
28
- "@prisma-next/sql-contract-psl": "workspace:*",
29
- "@prisma-next/sql-contract-ts": "workspace:*",
30
- "@prisma-next/sql-operations": "workspace:*",
31
- "@prisma-next/sql-relational-core": "workspace:*",
32
- "@prisma-next/sql-runtime": "workspace:*",
33
- "@prisma-next/sql-schema-ir": "workspace:*",
34
- "@prisma-next/utils": "workspace:*",
35
- "arktype": "^2.0.0"
11
+ "arktype": "^2.0.0",
12
+ "@prisma-next/contract": "0.3.0-dev.163",
13
+ "@prisma-next/framework-components": "0.3.0-dev.163",
14
+ "@prisma-next/contract-authoring": "0.3.0-dev.163",
15
+ "@prisma-next/family-sql": "0.3.0-dev.163",
16
+ "@prisma-next/ids": "0.3.0-dev.163",
17
+ "@prisma-next/sql-contract-psl": "0.3.0-dev.163",
18
+ "@prisma-next/cli": "0.3.0-dev.163",
19
+ "@prisma-next/sql-contract-ts": "0.3.0-dev.163",
20
+ "@prisma-next/sql-operations": "0.3.0-dev.163",
21
+ "@prisma-next/sql-relational-core": "0.3.0-dev.163",
22
+ "@prisma-next/sql-runtime": "0.3.0-dev.163",
23
+ "@prisma-next/sql-contract": "0.3.0-dev.163",
24
+ "@prisma-next/sql-schema-ir": "0.3.0-dev.163",
25
+ "@prisma-next/utils": "0.3.0-dev.163"
36
26
  },
37
27
  "devDependencies": {
38
- "@prisma-next/test-utils": "workspace:*",
39
- "@prisma-next/tsconfig": "workspace:*",
40
- "@prisma-next/tsdown": "workspace:*",
41
- "tsdown": "catalog:",
42
- "typescript": "catalog:",
43
- "vitest": "catalog:"
28
+ "tsdown": "0.18.4",
29
+ "typescript": "5.9.3",
30
+ "vitest": "4.0.17",
31
+ "@prisma-next/test-utils": "0.0.1",
32
+ "@prisma-next/tsdown": "0.0.0",
33
+ "@prisma-next/tsconfig": "0.0.0"
44
34
  },
45
35
  "exports": {
46
36
  "./adapter": "./dist/adapter.mjs",
@@ -55,5 +45,15 @@
55
45
  "type": "git",
56
46
  "url": "https://github.com/prisma/prisma-next.git",
57
47
  "directory": "packages/3-targets/6-adapters/sqlite"
48
+ },
49
+ "scripts": {
50
+ "build": "tsdown",
51
+ "test": "vitest run",
52
+ "test:coverage": "vitest run --coverage",
53
+ "typecheck": "tsc --project tsconfig.json --noEmit",
54
+ "lint": "biome check . --error-on-warnings",
55
+ "lint:fix": "biome check --write .",
56
+ "lint:fix:unsafe": "biome check --write --unsafe .",
57
+ "clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
58
58
  }
59
- }
59
+ }