@prisma/orm-target-sqlite 8.0.0-rc.14-dev.5 → 8.0.0-rc.14-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter-BNyoBP5X.d.mts +2 -0
- package/dist/{adapter-Bp_4Bjff-e0IpIZ1b.d.mts → adapter-Bp_4Bjff-O8HHkgK9.d.mts} +6 -6
- package/dist/{adapter-Bp_4Bjff-e0IpIZ1b.d.mts.map → adapter-Bp_4Bjff-O8HHkgK9.d.mts.map} +1 -1
- package/dist/{adapter-DBvizrEP-SHMMlDkU.mjs → adapter-DOg9HerQ-BP_BKOlH.mjs} +41 -22
- package/dist/adapter-DOg9HerQ-BP_BKOlH.mjs.map +1 -0
- package/dist/adapter.d.mts +10 -10
- package/dist/adapter.mjs +3 -3
- package/dist/adapter__adapter.d.mts +3 -3
- package/dist/adapter__adapter.mjs +1 -1
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__control.d.mts +2 -2
- package/dist/adapter__control.mjs +5 -5
- package/dist/adapter__control.mjs.map +1 -1
- package/dist/adapter__runtime.d.mts +1 -1
- package/dist/adapter__runtime.mjs +3 -3
- package/dist/adapter__runtime.mjs.map +1 -1
- package/dist/adapter__sql-renderer.d.mts +2 -2
- package/dist/adapter__sql-renderer.mjs +1 -1
- package/dist/adapter__types.d.mts +3 -3
- package/dist/codec-descriptor-3-wupJWh.d.mts +2 -0
- package/dist/codec-descriptor-C6M9ScCy-BqG7e8Oz.d.mts +1 -0
- package/dist/{codec-descriptor-BNC9tDro-BPWBITSr.d.mts → codec-descriptor-CDLhtrcE-CloMgVh6.d.mts} +13 -7
- package/dist/codec-descriptor-CDLhtrcE-CloMgVh6.d.mts.map +1 -0
- package/dist/{codec-descriptor-DAmZuKvV-B2UsMrgX.mjs → codec-descriptor-CWJAw6Ck-BksOSxiO.mjs} +3 -3
- package/dist/codec-descriptor-CWJAw6Ck-BksOSxiO.mjs.map +1 -0
- package/dist/codec-types-BBWeZKHk.d.mts +1 -0
- package/dist/codec-types-CXtfACRK.d.mts +2 -0
- package/dist/{codec-types-Dm8kn3W4-BAWXUJJ8.d.mts → codec-types-DU8BIZeM-DPqt7bmT.d.mts} +5 -5
- package/dist/{codec-types-Dm8kn3W4-BAWXUJJ8.d.mts.map → codec-types-DU8BIZeM-DPqt7bmT.d.mts.map} +1 -1
- package/dist/{codecs-BzSfaf5F-gXK7Etj3.d.mts → codecs-BURC1flo-UiOzcif2.d.mts} +3 -3
- package/dist/{codecs-BzSfaf5F-gXK7Etj3.d.mts.map → codecs-BURC1flo-UiOzcif2.d.mts.map} +1 -1
- package/dist/{codecs-Bsf9bHq3.mjs → codecs-BXELYOY1.mjs} +3 -3
- package/dist/{codecs-Bsf9bHq3.mjs.map → codecs-BXELYOY1.mjs.map} +1 -1
- package/dist/codecs-CKWQYtFS.d.mts +1 -0
- package/dist/{codecs-CK___nqu-ByljcwNa.mjs → codecs-yYxIwGIT-BHW7sSHn.mjs} +60 -56
- package/dist/codecs-yYxIwGIT-BHW7sSHn.mjs.map +1 -0
- package/dist/{control-B16T9OoX.mjs → control-1rQ6mko7.mjs} +3 -3
- package/dist/control-1rQ6mko7.mjs.map +1 -0
- package/dist/{control-DG-hF-sF.d.mts → control-CfS8mDnj.d.mts} +6 -5
- package/dist/control-CfS8mDnj.d.mts.map +1 -0
- package/dist/{control--wMueaTg.d.mts → control-DAys3o_s.d.mts} +2 -2
- package/dist/{control--wMueaTg.d.mts.map → control-DAys3o_s.d.mts.map} +1 -1
- package/dist/{data-types-B6gWpyYW-CVM4AAZK.mjs → data-types-B6gYWauJ-DPJUc7_Z.mjs} +7 -4
- package/dist/data-types-B6gYWauJ-DPJUc7_Z.mjs.map +1 -0
- package/dist/{data-types-BxmHClMK.mjs → data-types-D9CwP8vB.mjs} +4 -5
- package/dist/data-types-D9CwP8vB.mjs.map +1 -0
- package/dist/{default-normalizer-D_kHnqz7-SRi-lBH0.mjs → default-normalizer-Bbo6WzxJ-MgaICRCQ.mjs} +7 -4
- package/dist/default-normalizer-Bbo6WzxJ-MgaICRCQ.mjs.map +1 -0
- package/dist/{descriptor-meta-CqCH7n4c-Btl4cIXf.mjs → descriptor-meta-CqCH7n4c-Bx_S6IIu.mjs} +3 -3
- package/dist/{descriptor-meta-CqCH7n4c-Btl4cIXf.mjs.map → descriptor-meta-CqCH7n4c-Bx_S6IIu.mjs.map} +1 -1
- package/dist/{descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs → descriptor-meta-cwy5CXTT-DSRaq_b-.mjs} +17 -3
- package/dist/descriptor-meta-cwy5CXTT-DSRaq_b-.mjs.map +1 -0
- package/dist/driver.mjs +1 -1
- package/dist/driver__control.mjs +1 -1
- package/dist/driver__runtime.mjs +4 -7
- package/dist/driver__runtime.mjs.map +1 -1
- package/dist/{migration-BNB89lIv.mjs → migration-Y6M_R3GK.mjs} +2 -2
- package/dist/{migration-BNB89lIv.mjs.map → migration-Y6M_R3GK.mjs.map} +1 -1
- package/dist/{migration-DSmUh0wk.d.mts → migration-dc58fySD.d.mts} +3 -3
- package/dist/{migration-DSmUh0wk.d.mts.map → migration-dc58fySD.d.mts.map} +1 -1
- package/dist/{op-factory-call-C8jSguMU.d.mts → op-factory-call-4FJxPMyx.d.mts} +5 -11
- package/dist/op-factory-call-4FJxPMyx.d.mts.map +1 -0
- package/dist/{op-factory-call-C8CNBvCb-DyXVtd7o.mjs → op-factory-call-Dv_ma_mw-BtLqNmZI.mjs} +99 -65
- package/dist/op-factory-call-Dv_ma_mw-BtLqNmZI.mjs.map +1 -0
- package/dist/{pack-B488MxTx.d.mts → pack-YBiEVfBB.d.mts} +2 -2
- package/dist/{pack-B488MxTx.d.mts.map → pack-YBiEVfBB.d.mts.map} +1 -1
- package/dist/{planner-B4FWi-jn.d.mts → planner-Bsjn1MTX.d.mts} +2 -2
- package/dist/{planner-B4FWi-jn.d.mts.map → planner-Bsjn1MTX.d.mts.map} +1 -1
- package/dist/{planner-BTKa_OaV-Bl9T8ftA.mjs → planner-CWfPzOwZ-DVj6Tm5a.mjs} +14 -25
- package/dist/planner-CWfPzOwZ-DVj6Tm5a.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-C0pHN3qf-D1QDsx7l.d.mts → planner-produced-sqlite-migration-BQ8vBitH-DlquRDZ4.d.mts} +4 -4
- package/dist/planner-produced-sqlite-migration-BQ8vBitH-DlquRDZ4.d.mts.map +1 -0
- package/dist/planner-produced-sqlite-migration-BfFAqrKj.d.mts +1 -0
- package/dist/{planner-produced-sqlite-migration-CAvJnzes-wf8WQ39U.mjs → planner-produced-sqlite-migration-D1iuFT1l-BSFCXgJD.mjs} +3 -3
- package/dist/{planner-produced-sqlite-migration-CAvJnzes-wf8WQ39U.mjs.map → planner-produced-sqlite-migration-D1iuFT1l-BSFCXgJD.mjs.map} +1 -1
- package/dist/{runtime-7ugF7qno.d.mts → runtime-KPhmnsVg.d.mts} +2 -2
- package/dist/{runtime-7ugF7qno.d.mts.map → runtime-KPhmnsVg.d.mts.map} +1 -1
- package/dist/sql-renderer-2I1xGT7D.d.mts +1 -0
- package/dist/{sqlite-migration-0qCGfq-S-wwKN7Zb3.d.mts → sqlite-migration-Du67NG7r-CqcA5XBz.d.mts} +5 -8
- package/dist/{sqlite-migration-0qCGfq-S-wwKN7Zb3.d.mts.map → sqlite-migration-Du67NG7r-CqcA5XBz.d.mts.map} +1 -1
- package/dist/{sqlite-migration-BKSuDis9-UHqFOBqU.mjs → sqlite-migration-DuQG9WLW-BqHx4fMJ.mjs} +3 -3
- package/dist/{sqlite-migration-BKSuDis9-UHqFOBqU.mjs.map → sqlite-migration-DuQG9WLW-BqHx4fMJ.mjs.map} +1 -1
- package/dist/{shared-AQqQ1hrb-3EPsz46S.d.mts → tables-CvLOKCiJ-Ca1eFkWN.d.mts} +27 -8
- package/dist/tables-CvLOKCiJ-Ca1eFkWN.d.mts.map +1 -0
- package/dist/target.d.mts +14 -14
- package/dist/target.mjs +11 -11
- package/dist/target__codec-descriptor.d.mts +2 -2
- package/dist/target__codec-descriptor.mjs +1 -1
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +2 -2
- package/dist/target__codecs.mjs +2 -2
- package/dist/target__control.d.mts +1 -1
- package/dist/target__control.mjs +3 -3
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.mjs +2 -2
- package/dist/target__default-normalizer.mjs +1 -1
- package/dist/target__migration.d.mts +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.d.mts +1 -1
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__planner-produced-sqlite-migration.d.mts +2 -2
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.d.mts +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/types-BXuhSSiR.d.mts +2 -0
- package/dist/{types-RJMd2PlL-DFJRCUUw.d.mts → types-RJMd2PlL-Dqp0xeHo.d.mts} +3 -3
- package/dist/{types-RJMd2PlL-DFJRCUUw.d.mts.map → types-RJMd2PlL-Dqp0xeHo.d.mts.map} +1 -1
- package/package.json +9 -9
- package/dist/adapter-DBvizrEP-SHMMlDkU.mjs.map +0 -1
- package/dist/adapter-_aaOdX79.d.mts +0 -2
- package/dist/codec-descriptor-4BIWMlhf-CjIjnr76.d.mts +0 -1
- package/dist/codec-descriptor-BNC9tDro-BPWBITSr.d.mts.map +0 -1
- package/dist/codec-descriptor-DAmZuKvV-B2UsMrgX.mjs.map +0 -1
- package/dist/codec-descriptor-ae4jEMJI.d.mts +0 -2
- package/dist/codec-types-2BtIaiN_.d.mts +0 -2
- package/dist/codec-types-Bo18WDYR.d.mts +0 -1
- package/dist/codecs-CK___nqu-ByljcwNa.mjs.map +0 -1
- package/dist/codecs-cfQqBb8r.d.mts +0 -1
- package/dist/control-B16T9OoX.mjs.map +0 -1
- package/dist/control-DG-hF-sF.d.mts.map +0 -1
- package/dist/data-types-B6gWpyYW-CVM4AAZK.mjs.map +0 -1
- package/dist/data-types-BxmHClMK.mjs.map +0 -1
- package/dist/default-normalizer-D_kHnqz7-SRi-lBH0.mjs.map +0 -1
- package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs.map +0 -1
- package/dist/op-factory-call-C8CNBvCb-DyXVtd7o.mjs.map +0 -1
- package/dist/op-factory-call-C8jSguMU.d.mts.map +0 -1
- package/dist/planner-BTKa_OaV-Bl9T8ftA.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-C0pHN3qf-D1QDsx7l.d.mts.map +0 -1
- package/dist/planner-produced-sqlite-migration-aw2sx-H-.d.mts +0 -1
- package/dist/shared-AQqQ1hrb-3EPsz46S.d.mts.map +0 -1
- package/dist/sql-renderer-CSKXHcaY.d.mts +0 -1
- package/dist/types-DIgSNaLb.d.mts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { canonicalDateTime, numeralText } from "@prisma/orm-family-sql/relational-core/ast";
|
|
1
|
+
import { canonicalDateTime, integerTextCanonicalForm, numeralText } from "@prisma/orm-family-sql/relational-core/ast";
|
|
2
2
|
import { dataType } from "@prisma/orm-framework/components/codec";
|
|
3
3
|
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
4
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/data-types-
|
|
4
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/data-types-B6gYWauJ.mjs
|
|
5
5
|
const unchanged = (value) => value;
|
|
6
6
|
function wrongShape(value, expected) {
|
|
7
7
|
throw structuredError("CONTRACT.CAST_REFUSED", `Expected ${expected}, got ${JSON.stringify(value)}.`, {
|
|
@@ -46,7 +46,10 @@ const sqliteDatetime = dataType("sqlite/datetime", {
|
|
|
46
46
|
casts: { [sqliteText.id]: datetimeCanonicalForm }
|
|
47
47
|
});
|
|
48
48
|
const sqliteBlob = dataType("sqlite/blob", { casts: { [sqliteText.id]: unchanged } });
|
|
49
|
-
const sqliteBigint = dataType("sqlite/bigint", {
|
|
49
|
+
const sqliteBigint = dataType("sqlite/bigint", {
|
|
50
|
+
toCanonicalForm: integerTextCanonicalForm,
|
|
51
|
+
casts: { [sqliteInteger.id]: asNumeralText }
|
|
52
|
+
});
|
|
50
53
|
const sqliteReal = dataType("sqlite/real", { casts: {
|
|
51
54
|
[sqliteInteger.id]: asReal,
|
|
52
55
|
[sqliteBigint.id]: asReal
|
|
@@ -64,4 +67,4 @@ const sqliteDataTypes = [
|
|
|
64
67
|
//#endregion
|
|
65
68
|
export { sqliteDatetimeCanonical as a, sqliteReal as c, sqliteDatetime as i, sqliteText as l, sqliteBlob as n, sqliteInteger as o, sqliteDataTypes as r, sqliteJson as s, sqliteBigint as t };
|
|
66
69
|
|
|
67
|
-
//# sourceMappingURL=data-types-
|
|
70
|
+
//# sourceMappingURL=data-types-B6gYWauJ-DPJUc7_Z.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-B6gYWauJ-DPJUc7_Z.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/data-types-B6gYWauJ.mjs"],"sourcesContent":["import { canonicalDateTime, integerTextCanonicalForm, numeralText } from \"@internal/sql-relational-core/ast\";\nimport { dataType } from \"@internal/framework-components/codec\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/core/data-types.ts\nconst unchanged = (value) => value;\nfunction wrongShape(value, expected) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `Expected ${expected}, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A cast reads the canonical form of the type it takes values of.\",\n\t\tfix: \"Hand the cast a value in the shape its source type stores.\"\n\t});\n}\nconst asNumeralText = (value) => typeof value === \"number\" ? numeralText(value) : wrongShape(value, \"a number\");\n/**\n* A number as `real` stores it. A magnitude past what a double holds is refused rather than\n* rounded, for the reason the target's other numeric casts give.\n*/\nconst asReal = (value) => {\n\tif (typeof value === \"number\") return value;\n\tif (typeof value !== \"string\") return wrongShape(value, \"a number or digit text\");\n\tconst converted = Number(value);\n\tif (Number.isFinite(converted)) return converted;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${value} is out of range: no double holds a number that large.`, {\n\t\twhy: \"A real stores a double, which holds magnitudes up to about 1.8e308.\",\n\t\tfix: \"Use a number a double holds.\"\n\t});\n};\nconst sqliteText = dataType(\"sqlite/text\", {});\nconst sqliteJson = dataType(\"sqlite/json\", {});\nconst sqliteInteger = dataType(\"sqlite/integer\", {});\n/**\n* The canonical form of `sqlite/datetime` (ADR 254), from ISO 8601 text with a UTC offset. The range\n* and the millisecond precision are those of a JavaScript `Date`, the codec's value.\n*/\nconst sqliteDatetimeCanonical = (text) => canonicalDateTime(text, {\n\tshape: \"instant\",\n\tdataTypeId: \"sqlite/datetime\",\n\tmaxFractionDigits: 3,\n\trange: {\n\t\tearliest: \"-271821-04-20T00:00:00Z\",\n\t\tlatest: \"+275760-09-13T00:00:00Z\"\n\t}\n});\nconst datetimeCanonicalForm = (value) => typeof value === \"string\" ? sqliteDatetimeCanonical(value) : wrongShape(value, \"text\");\nconst sqliteDatetime = dataType(\"sqlite/datetime\", {\n\ttoCanonicalForm: datetimeCanonicalForm,\n\tcasts: { [sqliteText.id]: datetimeCanonicalForm }\n});\nconst sqliteBlob = dataType(\"sqlite/blob\", { casts: { [sqliteText.id]: unchanged } });\nconst sqliteBigint = dataType(\"sqlite/bigint\", {\n\ttoCanonicalForm: integerTextCanonicalForm,\n\tcasts: { [sqliteInteger.id]: asNumeralText }\n});\nconst sqliteReal = dataType(\"sqlite/real\", { casts: {\n\t[sqliteInteger.id]: asReal,\n\t[sqliteBigint.id]: asReal\n} });\n/** Every data type this target registers. */\nconst sqliteDataTypes = [\n\tsqliteText,\n\tsqliteJson,\n\tsqliteInteger,\n\tsqliteDatetime,\n\tsqliteBlob,\n\tsqliteBigint,\n\tsqliteReal\n];\n//#endregion\nexport { sqliteDatetimeCanonical as a, sqliteReal as c, sqliteDatetime as i, sqliteText as l, sqliteBlob as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,cAAc,KAAK,cAAc;AAC5C,CAAC;AACD,MAAM,aAAa,SAAS,eAAe,EAAE,OAAO;EAClD,cAAc,KAAK;EACnB,aAAa,KAAK;AACpB,EAAE,CAAC;;AAEH,MAAM,kBAAkB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;AACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as sqliteReal, l as sqliteText, o as sqliteInteger, s as sqliteJson, t as sqliteBigint } from "./data-types-
|
|
1
|
+
import { c as sqliteReal, l as sqliteText, o as sqliteInteger, s as sqliteJson, t as sqliteBigint } from "./data-types-B6gYWauJ-DPJUc7_Z.mjs";
|
|
2
2
|
import { createNumberClassifier, numeralText, parseJsonBody, printJsonBody, signedRange } from "@prisma/orm-family-sql/relational-core/ast";
|
|
3
|
+
import { SAFE_INTEGER_BIGINT_RANGE } from "@prisma/orm-framework/components/codec";
|
|
3
4
|
//#region ../../../3-targets/3-targets/sqlite/dist/data-types.mjs
|
|
4
|
-
const SAFE_INTEGER = BigInt(Number.MAX_SAFE_INTEGER);
|
|
5
5
|
/**
|
|
6
6
|
* A whole number within the range a double holds exactly is an `integer`, a wider one up to 64 bits
|
|
7
7
|
* is a `bigint`, and a number with a fraction is a `real`. Anything else — a whole number past 64
|
|
@@ -11,8 +11,7 @@ const classifySqliteNumber = createNumberClassifier({
|
|
|
11
11
|
integers: [{
|
|
12
12
|
type: sqliteInteger.id,
|
|
13
13
|
form: "number",
|
|
14
|
-
|
|
15
|
-
max: SAFE_INTEGER
|
|
14
|
+
...SAFE_INTEGER_BIGINT_RANGE
|
|
16
15
|
}, {
|
|
17
16
|
type: sqliteBigint.id,
|
|
18
17
|
form: "text",
|
|
@@ -65,4 +64,4 @@ function sqliteDataTypeEntries() {
|
|
|
65
64
|
//#endregion
|
|
66
65
|
export { sqliteDataTypeEntries as t };
|
|
67
66
|
|
|
68
|
-
//# sourceMappingURL=data-types-
|
|
67
|
+
//# sourceMappingURL=data-types-D9CwP8vB.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types-D9CwP8vB.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/data-types.mjs"],"sourcesContent":["import { a as sqliteDatetimeCanonical, c as sqliteReal, i as sqliteDatetime, l as sqliteText, n as sqliteBlob, o as sqliteInteger, r as sqliteDataTypes, s as sqliteJson, t as sqliteBigint } from \"./data-types-B6gYWauJ.mjs\";\nimport { createNumberClassifier, numeralText, parseJsonBody, printJsonBody, signedRange } from \"@internal/sql-relational-core/ast\";\nimport { SAFE_INTEGER_BIGINT_RANGE } from \"@internal/framework-components/codec\";\n//#region src/core/data-type-entries.ts\n/**\n* A whole number within the range a double holds exactly is an `integer`, a wider one up to 64 bits\n* is a `bigint`, and a number with a fraction is a `real`. Anything else — a whole number past 64\n* bits, or one of the three words — has no SQLite type, so it is refused.\n*/\nconst classifySqliteNumber = createNumberClassifier({\n\tintegers: [{\n\t\ttype: sqliteInteger.id,\n\t\tform: \"number\",\n\t\t...SAFE_INTEGER_BIGINT_RANGE\n\t}, {\n\t\ttype: sqliteBigint.id,\n\t\tform: \"text\",\n\t\t...signedRange(64)\n\t}],\n\tfraction: {\n\t\ttype: sqliteReal.id,\n\t\tform: \"number\"\n\t}\n});\nfunction printNumber(value) {\n\treturn typeof value === \"number\" ? numeralText(value) : String(value);\n}\nfunction sqliteDataTypeEntries() {\n\treturn {\n\t\t[sqliteText.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"string\",\n\t\t\t\tparse: (text) => text\n\t\t\t},\n\t\t\tprint: (value) => String(value),\n\t\t\tdocumentation: \"Text.\"\n\t\t},\n\t\t[sqliteReal.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"plain\",\n\t\t\t\tsyntax: \"number\",\n\t\t\t\ttypes: [\n\t\t\t\t\tsqliteInteger.id,\n\t\t\t\t\tsqliteBigint.id,\n\t\t\t\t\tsqliteReal.id\n\t\t\t\t],\n\t\t\t\tclassify: classifySqliteNumber\n\t\t\t},\n\t\t\tprint: printNumber,\n\t\t\tdocumentation: \"A number, whose type comes from its own size and precision.\"\n\t\t},\n\t\t[sqliteJson.id]: {\n\t\t\twritten: {\n\t\t\t\tkind: \"tag\",\n\t\t\t\ttag: \"json\",\n\t\t\t\tparse: parseJsonBody\n\t\t\t},\n\t\t\tprint: printJsonBody,\n\t\t\tdocumentation: \"Reads the text as a JSON document and stores it as the default value.\"\n\t\t}\n\t};\n}\n//#endregion\nexport { sqliteBigint, sqliteBlob, sqliteDataTypeEntries, sqliteDataTypes, sqliteDatetime, sqliteDatetimeCanonical, sqliteInteger, sqliteJson, sqliteReal, sqliteText };\n\n//# sourceMappingURL=data-types.mjs.map"],"mappings":";;;;;;;;;AASA,MAAM,uBAAuB,uBAAuB;CACnD,UAAU,CAAC;EACV,MAAM,cAAc;EACpB,MAAM;EACN,GAAG;CACJ,GAAG;EACF,MAAM,aAAa;EACnB,MAAM;EACN,GAAG,YAAY,EAAE;CAClB,CAAC;CACD,UAAU;EACT,MAAM,WAAW;EACjB,MAAM;CACP;AACD,CAAC;AACD,SAAS,YAAY,OAAO;CAC3B,OAAO,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,OAAO,KAAK;AACrE;AACA,SAAS,wBAAwB;CAChC,OAAO;GACL,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,QAAQ,SAAS;GAClB;GACA,QAAQ,UAAU,OAAO,KAAK;GAC9B,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,QAAQ;IACR,OAAO;KACN,cAAc;KACd,aAAa;KACb,WAAW;IACZ;IACA,UAAU;GACX;GACA,OAAO;GACP,eAAe;EAChB;GACC,WAAW,KAAK;GAChB,SAAS;IACR,MAAM;IACN,KAAK;IACL,OAAO;GACR;GACA,OAAO;GACP,eAAe;EAChB;CACD;AACD"}
|
package/dist/{default-normalizer-D_kHnqz7-SRi-lBH0.mjs → default-normalizer-Bbo6WzxJ-MgaICRCQ.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/default-normalizer-
|
|
1
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/default-normalizer-Bbo6WzxJ.mjs
|
|
2
2
|
const NULL_PATTERN = /^NULL$/i;
|
|
3
3
|
const INTEGER_PATTERN = /^-?\d+$/;
|
|
4
|
-
const REAL_PATTERN = /^-?\d
|
|
4
|
+
const REAL_PATTERN = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
5
5
|
const HEX_PATTERN = /^0[xX][\dA-Fa-f]+$/;
|
|
6
6
|
const STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'$/;
|
|
7
7
|
function isNumericLiteral(value) {
|
|
@@ -43,7 +43,10 @@ function parseSqliteDefault(rawDefault, nativeType) {
|
|
|
43
43
|
};
|
|
44
44
|
if (isNumericLiteral(trimmed)) {
|
|
45
45
|
const num = Number(trimmed);
|
|
46
|
-
if (!Number.isFinite(num)) return
|
|
46
|
+
if (!Number.isFinite(num)) return {
|
|
47
|
+
kind: "literal",
|
|
48
|
+
value: num > 0 ? "Infinity" : "-Infinity"
|
|
49
|
+
};
|
|
47
50
|
if (nativeType?.toLowerCase() === "integer" && !Number.isSafeInteger(num)) return {
|
|
48
51
|
kind: "literal",
|
|
49
52
|
value: trimmed
|
|
@@ -76,4 +79,4 @@ function sqliteResolveDefault(def, resolvedNativeType) {
|
|
|
76
79
|
//#endregion
|
|
77
80
|
export { sqliteResolveDefault as n, stripOuterParens as r, parseSqliteDefault as t };
|
|
78
81
|
|
|
79
|
-
//# sourceMappingURL=default-normalizer-
|
|
82
|
+
//# sourceMappingURL=default-normalizer-Bbo6WzxJ-MgaICRCQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-normalizer-Bbo6WzxJ-MgaICRCQ.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/default-normalizer-Bbo6WzxJ.mjs"],"sourcesContent":["//#region src/core/default-normalizer.ts\nconst NULL_PATTERN = /^NULL$/i;\nconst INTEGER_PATTERN = /^-?\\d+$/;\nconst REAL_PATTERN = /^-?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$/;\nconst HEX_PATTERN = /^0[xX][\\dA-Fa-f]+$/;\nconst STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'$/;\nfunction isNumericLiteral(value) {\n\treturn INTEGER_PATTERN.test(value) || REAL_PATTERN.test(value) || HEX_PATTERN.test(value);\n}\n/**\n* Strips a single matched wrapping pair of outer parens from `s`. Conservative:\n* only strips when the leading `(` is matched by the trailing `)` (so\n* `(a) + (b)` is returned unchanged). Mirrors SQLite's own\n* `pragma_table_info.dflt_value` normalization for expression defaults, and\n* is shared with the recreate-table postcheck builder so both sides agree\n* on the canonical form.\n*/\nfunction stripOuterParens(s) {\n\tif (!s.startsWith(\"(\") || !s.endsWith(\")\")) return s;\n\tlet depth = 0;\n\tfor (let i = 0; i < s.length; i++) if (s[i] === \"(\") depth += 1;\n\telse if (s[i] === \")\") {\n\t\tdepth -= 1;\n\t\tif (depth === 0 && i < s.length - 1) return s;\n\t}\n\treturn s.slice(1, -1);\n}\nfunction parseSqliteDefault(rawDefault, nativeType) {\n\tlet trimmed = rawDefault.trim();\n\twhile (true) {\n\t\tconst stripped = stripOuterParens(trimmed).trim();\n\t\tif (stripped === trimmed) break;\n\t\ttrimmed = stripped;\n\t}\n\tconst lower = trimmed.toLowerCase();\n\tif (lower === \"current_timestamp\" || lower === \"datetime('now')\" || lower === \"datetime(\\\"now\\\")\") return {\n\t\tkind: \"function\",\n\t\texpression: \"now()\"\n\t};\n\tif (NULL_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tvalue: null\n\t};\n\tif (isNumericLiteral(trimmed)) {\n\t\tconst num = Number(trimmed);\n\t\tif (!Number.isFinite(num)) return {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: num > 0 ? \"Infinity\" : \"-Infinity\"\n\t\t};\n\t\tif (nativeType?.toLowerCase() === \"integer\" && !Number.isSafeInteger(num)) return {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: trimmed\n\t\t};\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue: num\n\t\t};\n\t}\n\tconst stringMatch = trimmed.match(STRING_LITERAL_PATTERN);\n\tif (stringMatch?.[1] !== void 0) return {\n\t\tkind: \"literal\",\n\t\tvalue: stringMatch[1].replace(/''/g, \"'\")\n\t};\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: trimmed\n\t};\n}\n/**\n* The contract-derived side of verify: an authored function default is read\n* through the same parser as an introspected one, so `` sql`CURRENT_TIMESTAMP` ``\n* and the database's `CURRENT_TIMESTAMP` compare equal. Mirrors Postgres's\n* `postgresResolveDefault`.\n*/\nfunction sqliteResolveDefault(def, resolvedNativeType) {\n\tif (def.kind !== \"function\") return def;\n\treturn parseSqliteDefault(def.expression, resolvedNativeType) ?? def;\n}\n//#endregion\nexport { sqliteResolveDefault as n, stripOuterParens as r, parseSqliteDefault as t };\n\n//# sourceMappingURL=default-normalizer-Bbo6WzxJ.mjs.map"],"mappings":";AACA,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,eAAe;AACrB,MAAM,cAAc;AACpB,MAAM,yBAAyB;AAC/B,SAAS,iBAAiB,OAAO;CAChC,OAAO,gBAAgB,KAAK,KAAK,KAAK,aAAa,KAAK,KAAK,KAAK,YAAY,KAAK,KAAK;AACzF;;;;;;;;;AASA,SAAS,iBAAiB,GAAG;CAC5B,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC,EAAE,SAAS,GAAG,GAAG,OAAO;CACnD,IAAI,QAAQ;CACZ,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK,IAAI,EAAE,OAAO,KAAK,SAAS;MACzD,IAAI,EAAE,OAAO,KAAK;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qliteAggregateDescriptors } from "./aggregates-CATLYJxc.mjs";
|
|
2
|
-
import { r as sqliteDataTypes } from "./data-types-
|
|
3
|
-
import { a as sqliteCodecRegistry } from "./codecs-
|
|
2
|
+
import { r as sqliteDataTypes } from "./data-types-B6gYWauJ-DPJUc7_Z.mjs";
|
|
3
|
+
import { a as sqliteCodecRegistry } from "./codecs-BXELYOY1.mjs";
|
|
4
4
|
//#region ../../../3-targets/6-adapters/sqlite/dist/descriptor-meta-CqCH7n4c.mjs
|
|
5
5
|
const sqliteAdapterDescriptorMeta = {
|
|
6
6
|
kind: "adapter",
|
|
@@ -35,4 +35,4 @@ const sqliteAdapterDescriptorMeta = {
|
|
|
35
35
|
//#endregion
|
|
36
36
|
export { sqliteAdapterDescriptorMeta as t };
|
|
37
37
|
|
|
38
|
-
//# sourceMappingURL=descriptor-meta-CqCH7n4c-
|
|
38
|
+
//# sourceMappingURL=descriptor-meta-CqCH7n4c-Bx_S6IIu.mjs.map
|
package/dist/{descriptor-meta-CqCH7n4c-Btl4cIXf.mjs.map → descriptor-meta-CqCH7n4c-Bx_S6IIu.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor-meta-CqCH7n4c-
|
|
1
|
+
{"version":3,"file":"descriptor-meta-CqCH7n4c-Bx_S6IIu.mjs","names":[],"sources":["../../../../3-targets/6-adapters/sqlite/dist/descriptor-meta-CqCH7n4c.mjs"],"sourcesContent":["import { sqliteCodecRegistry } from \"@internal/target-sqlite/codecs\";\nimport { sqliteDataTypes } from \"@internal/target-sqlite/data-types\";\nimport { sqliteAggregateDescriptors } from \"@internal/target-sqlite/aggregates\";\nconst sqliteAdapterDescriptorMeta = {\n\tkind: \"adapter\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: { sql: {\n\t\torderBy: true,\n\t\tlimit: true,\n\t\tlateral: false,\n\t\tjsonAgg: true,\n\t\treturning: true,\n\t\tforeignKeys: true,\n\t\tenums: false,\n\t\tinsertOnConflictSkip: true,\n\t\tinsertOnConflictWithoutTarget: true\n\t} },\n\tdataTypes: sqliteDataTypes,\n\ttypes: {\n\t\taggregateDescriptors: sqliteAggregateDescriptors,\n\t\tcodecTypes: {\n\t\t\tcodecDescriptors: Array.from(sqliteCodecRegistry.values()).filter((d) => d.renderOutputType === void 0),\n\t\t\timport: {\n\t\t\t\tpackage: \"@internal/adapter-sqlite/codec-types\",\n\t\t\t\tnamed: \"CodecTypes\",\n\t\t\t\talias: \"SqliteTypes\"\n\t\t\t}\n\t\t}\n\t}\n};\n//#endregion\nexport { sqliteAdapterDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-CqCH7n4c.mjs.map"],"mappings":";;;;AAGA,MAAM,8BAA8B;CACnC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,EAAE,KAAK;EACpB,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,WAAW;EACX,aAAa;EACb,OAAO;EACP,sBAAsB;EACtB,+BAA+B;CAChC,EAAE;CACF,WAAW;CACX,OAAO;EACN,sBAAsB;EACtB,YAAY;GACX,kBAAkB,MAAM,KAAK,oBAAoB,OAAO,CAAC,CAAC,CAAC,QAAQ,MAAM,EAAE,qBAAqB,KAAK,CAAC;GACtG,QAAQ;IACP,SAAS;IACT,OAAO;IACP,OAAO;GACR;EACD;CACD;AACD"}
|
package/dist/{descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs → descriptor-meta-cwy5CXTT-DSRaq_b-.mjs}
RENAMED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { structuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
2
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
1
3
|
import { SqlConnectionError, SqlQueryError } from "@prisma/orm-family-sql/errors";
|
|
2
|
-
//#region ../../../3-targets/7-drivers/sqlite/dist/descriptor-meta-
|
|
4
|
+
//#region ../../../3-targets/7-drivers/sqlite/dist/descriptor-meta-cwy5CXTT.mjs
|
|
3
5
|
const SQLITE_CONSTRAINT_BASE = 19;
|
|
4
6
|
const SQLITE_CONSTRAINT_UNIQUE = 2067;
|
|
5
7
|
const SQLITE_CONSTRAINT_PRIMARYKEY = 1555;
|
|
@@ -56,6 +58,18 @@ function normalizeSqliteError(error) {
|
|
|
56
58
|
});
|
|
57
59
|
return error;
|
|
58
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* The parameters to bind to a SQLite statement. SQLite cannot store NaN and binds it as NULL. The float codecs refuse NaN when they encode, naming the codec; this refuses a NaN no codec encoded, such as a raw SQL parameter, with the same code and `meta.received`, and `meta.paramIndex` in place of `meta.codecId`.
|
|
63
|
+
*/
|
|
64
|
+
function sqliteParams(params) {
|
|
65
|
+
const values = params ?? [];
|
|
66
|
+
const nanIndex = values.findIndex((value) => Number.isNaN(value));
|
|
67
|
+
if (nanIndex !== -1) throw structuredError("RUNTIME.ENCODE_FAILED", `Parameter ${nanIndex + 1} is NaN, which SQLite cannot store: it would bind it as NULL. Pass null to store no value.`, { meta: {
|
|
68
|
+
paramIndex: nanIndex,
|
|
69
|
+
received: "NaN"
|
|
70
|
+
} });
|
|
71
|
+
return blindCast(values);
|
|
72
|
+
}
|
|
59
73
|
const sqliteDriverDescriptorMeta = {
|
|
60
74
|
kind: "driver",
|
|
61
75
|
familyId: "sql",
|
|
@@ -65,6 +79,6 @@ const sqliteDriverDescriptorMeta = {
|
|
|
65
79
|
capabilities: {}
|
|
66
80
|
};
|
|
67
81
|
//#endregion
|
|
68
|
-
export { sqliteDriverDescriptorMeta as n, normalizeSqliteError as t };
|
|
82
|
+
export { sqliteDriverDescriptorMeta as n, sqliteParams as r, normalizeSqliteError as t };
|
|
69
83
|
|
|
70
|
-
//# sourceMappingURL=descriptor-meta-
|
|
84
|
+
//# sourceMappingURL=descriptor-meta-cwy5CXTT-DSRaq_b-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-cwy5CXTT-DSRaq_b-.mjs","names":[],"sources":["../../../../3-targets/7-drivers/sqlite/dist/descriptor-meta-cwy5CXTT.mjs"],"sourcesContent":["import { SqlConnectionError, SqlQueryError } from \"@internal/sql-errors\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { structuredError } from \"@internal/utils/structured-error\";\n//#region src/normalize-error.ts\nconst SQLITE_CONSTRAINT_BASE = 19;\nconst SQLITE_CONSTRAINT_UNIQUE = 2067;\nconst SQLITE_CONSTRAINT_PRIMARYKEY = 1555;\nconst SQLITE_CONSTRAINT_FOREIGNKEY = 787;\nconst SQLITE_CONSTRAINT_NOTNULL = 1299;\nconst SQLITE_CONSTRAINT_CHECK = 275;\nconst SQLITE_BUSY = 5;\nconst SQLITE_LOCKED = 6;\nfunction isConstraintError(errcode) {\n\treturn (errcode & 255) === SQLITE_CONSTRAINT_BASE;\n}\nfunction isBusyOrLocked(errcode) {\n\tconst base = errcode & 255;\n\treturn base === SQLITE_BUSY || base === SQLITE_LOCKED;\n}\nfunction isSqliteError(error) {\n\tif (!(error instanceof Error)) return false;\n\treturn error.code === \"ERR_SQLITE_ERROR\";\n}\nfunction constraintNameFromMessage(message) {\n\treturn /constraint failed: (.+)/.exec(message)?.[1];\n}\nfunction mapErrCodeToSqlState(errcode) {\n\tswitch (errcode) {\n\t\tcase SQLITE_CONSTRAINT_UNIQUE:\n\t\tcase SQLITE_CONSTRAINT_PRIMARYKEY: return \"23505\";\n\t\tcase SQLITE_CONSTRAINT_FOREIGNKEY: return \"23503\";\n\t\tcase SQLITE_CONSTRAINT_NOTNULL: return \"23502\";\n\t\tcase SQLITE_CONSTRAINT_CHECK: return \"23514\";\n\t\tdefault:\n\t\t\tif (isConstraintError(errcode)) return \"23000\";\n\t\t\treturn \"HY000\";\n\t}\n}\nfunction normalizeSqliteError(error) {\n\tif (!(error instanceof Error)) return new Error(String(error));\n\tif (isSqliteError(error)) {\n\t\tconst errcode = error.errcode ?? 0;\n\t\tif (isBusyOrLocked(errcode)) return new SqlConnectionError(error.message, {\n\t\t\tcause: error,\n\t\t\ttransient: true\n\t\t});\n\t\tconst sqlState = mapErrCodeToSqlState(errcode);\n\t\tconst constraint = constraintNameFromMessage(error.message);\n\t\treturn new SqlQueryError(error.message, {\n\t\t\tcause: error,\n\t\t\tsqlState,\n\t\t\t...constraint !== void 0 ? { constraint } : {}\n\t\t});\n\t}\n\tif (error.message.includes(\"database is locked\") || error.message.includes(\"unable to open database\")) return new SqlConnectionError(error.message, {\n\t\tcause: error,\n\t\ttransient: false\n\t});\n\treturn error;\n}\n//#endregion\n//#region src/sqlite-params.ts\n/**\n* The parameters to bind to a SQLite statement. SQLite cannot store NaN and binds it as NULL. The float codecs refuse NaN when they encode, naming the codec; this refuses a NaN no codec encoded, such as a raw SQL parameter, with the same code and `meta.received`, and `meta.paramIndex` in place of `meta.codecId`.\n*/\nfunction sqliteParams(params) {\n\tconst values = params ?? [];\n\tconst nanIndex = values.findIndex((value) => Number.isNaN(value));\n\tif (nanIndex !== -1) throw structuredError(\"RUNTIME.ENCODE_FAILED\", `Parameter ${nanIndex + 1} is NaN, which SQLite cannot store: it would bind it as NULL. Pass null to store no value.`, { meta: {\n\t\tparamIndex: nanIndex,\n\t\treceived: \"NaN\"\n\t} });\n\treturn blindCast(values);\n}\n//#endregion\n//#region src/core/descriptor-meta.ts\nconst sqliteDriverDescriptorMeta = {\n\tkind: \"driver\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: {}\n};\n//#endregion\nexport { sqliteParams as n, normalizeSqliteError as r, sqliteDriverDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-cwy5CXTT.mjs.map"],"mappings":";;;;AAIA,MAAM,yBAAyB;AAC/B,MAAM,2BAA2B;AACjC,MAAM,+BAA+B;AACrC,MAAM,+BAA+B;AACrC,MAAM,4BAA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AAa,QAAQ;CAC7B,MAAM,SAAS,UAAU,CAAC;CAC1B,MAAM,WAAW,OAAO,WAAW,UAAU,OAAO,MAAM,KAAK,CAAC;CAChE,IAAI,aAAa,IAAI,MAAM,gBAAgB,yBAAyB,aAAa,WAAW,EAAE,6FAA6F,EAAE,MAAM;EAClM,YAAY;EACZ,UAAU;CACX,EAAE,CAAC;CACH,OAAO,UAAU,MAAM;AACxB;AAGA,MAAM,6BAA6B;CAClC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;AAChB"}
|
package/dist/driver.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SqliteControlDriver } from "./control-
|
|
1
|
+
import { t as SqliteControlDriver } from "./control-1rQ6mko7.mjs";
|
|
2
2
|
export { SqliteControlDriver };
|
package/dist/driver__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as sqliteDriverDescriptor, t as SqliteControlDriver } from "./control-
|
|
1
|
+
import { n as sqliteDriverDescriptor, t as SqliteControlDriver } from "./control-1rQ6mko7.mjs";
|
|
2
2
|
export { SqliteControlDriver, sqliteDriverDescriptor as default };
|
package/dist/driver__runtime.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as sqliteDriverDescriptorMeta, t as normalizeSqliteError } from "./descriptor-meta-
|
|
1
|
+
import { n as sqliteDriverDescriptorMeta, r as sqliteParams, t as normalizeSqliteError } from "./descriptor-meta-cwy5CXTT-DSRaq_b-.mjs";
|
|
2
2
|
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
3
3
|
import { DatabaseSync } from "node:sqlite";
|
|
4
4
|
//#region ../../../3-targets/7-drivers/sqlite/dist/runtime.mjs
|
|
@@ -18,9 +18,6 @@ function driverError(code, message, details) {
|
|
|
18
18
|
}
|
|
19
19
|
const NOT_CONNECTED_MESSAGE = "SQLite driver not connected. Call connect(binding) before acquireConnection or execute.";
|
|
20
20
|
const ALREADY_CONNECTED_MESSAGE = "SQLite driver already connected. Call close() before reconnecting with a new binding.";
|
|
21
|
-
function toSqliteParams(params) {
|
|
22
|
-
return params ?? [];
|
|
23
|
-
}
|
|
24
21
|
function openConnection(path) {
|
|
25
22
|
try {
|
|
26
23
|
const db = new DatabaseSync(path);
|
|
@@ -39,7 +36,7 @@ var SqliteQueryable = class {
|
|
|
39
36
|
async *query(request) {
|
|
40
37
|
try {
|
|
41
38
|
const stmt = this.db.prepare(request.sql);
|
|
42
|
-
for (const row of stmt.iterate(...
|
|
39
|
+
for (const row of stmt.iterate(...sqliteParams(request.params))) yield row;
|
|
43
40
|
} catch (error) {
|
|
44
41
|
throw normalizeSqliteError(error);
|
|
45
42
|
}
|
|
@@ -48,14 +45,14 @@ var SqliteQueryable = class {
|
|
|
48
45
|
try {
|
|
49
46
|
const stmt = this.db.prepare(request.sql);
|
|
50
47
|
if (stmt.columns().length !== 0) throw new InternalError("SQLite cannot execute statements that return rows.");
|
|
51
|
-
return { affectedRows: Number(stmt.run(...
|
|
48
|
+
return { affectedRows: Number(stmt.run(...sqliteParams(request.params)).changes) };
|
|
52
49
|
} catch (error) {
|
|
53
50
|
throw normalizeSqliteError(error);
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
53
|
async explain(request) {
|
|
57
54
|
try {
|
|
58
|
-
return { rows: this.db.prepare(`EXPLAIN QUERY PLAN ${request.sql}`).all(...
|
|
55
|
+
return { rows: this.db.prepare(`EXPLAIN QUERY PLAN ${request.sql}`).all(...sqliteParams(request.params)) };
|
|
59
56
|
} catch (error) {
|
|
60
57
|
throw normalizeSqliteError(error);
|
|
61
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver__runtime.mjs","names":["#state","#requireConnected"],"sources":["../../../../3-targets/7-drivers/sqlite/dist/runtime.mjs"],"sourcesContent":["import { n as normalizeSqliteError, t as sqliteDriverDescriptorMeta } from \"./descriptor-meta-
|
|
1
|
+
{"version":3,"file":"driver__runtime.mjs","names":["#state","#requireConnected"],"sources":["../../../../3-targets/7-drivers/sqlite/dist/runtime.mjs"],"sourcesContent":["import { n as sqliteParams, r as normalizeSqliteError, t as sqliteDriverDescriptorMeta } from \"./descriptor-meta-cwy5CXTT.mjs\";\nimport { DatabaseSync } from \"node:sqlite\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/sqlite-driver.ts\nfunction driverError(code, message, details) {\n\tconst error = new Error(message);\n\tObject.defineProperty(error, \"name\", {\n\t\tvalue: \"RuntimeError\",\n\t\tconfigurable: true\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\tcategory: \"DRIVER\",\n\t\tseverity: \"error\",\n\t\tmessage,\n\t\tdetails\n\t});\n}\nconst NOT_CONNECTED_MESSAGE = \"SQLite driver not connected. Call connect(binding) before acquireConnection or execute.\";\nconst ALREADY_CONNECTED_MESSAGE = \"SQLite driver already connected. Call close() before reconnecting with a new binding.\";\nfunction openConnection(path) {\n\ttry {\n\t\tconst db = new DatabaseSync(path);\n\t\tdb.exec(\"PRAGMA foreign_keys = ON\");\n\t\tdb.exec(\"PRAGMA busy_timeout = 5000\");\n\t\treturn db;\n\t} catch (error) {\n\t\tthrow normalizeSqliteError(error);\n\t}\n}\nvar SqliteQueryable = class {\n\tdb;\n\tconstructor(db) {\n\t\tthis.db = db;\n\t}\n\tasync *query(request) {\n\t\ttry {\n\t\t\tconst stmt = this.db.prepare(request.sql);\n\t\t\tfor (const row of stmt.iterate(...sqliteParams(request.params))) yield row;\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n\tasync execute(request) {\n\t\ttry {\n\t\t\tconst stmt = this.db.prepare(request.sql);\n\t\t\tif (stmt.columns().length !== 0) throw new InternalError(\"SQLite cannot execute statements that return rows.\");\n\t\t\treturn { affectedRows: Number(stmt.run(...sqliteParams(request.params)).changes) };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n\tasync explain(request) {\n\t\ttry {\n\t\t\treturn { rows: this.db.prepare(`EXPLAIN QUERY PLAN ${request.sql}`).all(...sqliteParams(request.params)) };\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n};\nvar SqliteConnectionImpl = class extends SqliteQueryable {\n\tasync beginTransaction() {\n\t\ttry {\n\t\t\tthis.db.exec(\"BEGIN\");\n\t\t\treturn new SqliteTransactionImpl(this.db);\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n\tasync release() {\n\t\treturn this.destroy();\n\t}\n\tasync destroy(_reason) {\n\t\ttry {\n\t\t\tthis.db.close();\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n};\nvar SqliteTransactionImpl = class extends SqliteQueryable {\n\tasync commit() {\n\t\ttry {\n\t\t\tthis.db.exec(\"COMMIT\");\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n\tasync rollback() {\n\t\ttry {\n\t\t\tthis.db.exec(\"ROLLBACK\");\n\t\t} catch (error) {\n\t\t\tthrow normalizeSqliteError(error);\n\t\t}\n\t}\n};\nfunction unboundQuery() {\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn { async next() {\n\t\t\tthrow driverError(\"DRIVER.NOT_CONNECTED\", NOT_CONNECTED_MESSAGE);\n\t\t} };\n\t} };\n}\nvar SqliteDriver = class {\n\tfamilyId = \"sql\";\n\ttargetId = \"sqlite\";\n\t#state;\n\tconstructor(initialState) {\n\t\tthis.#state = initialState ?? { kind: \"unbound\" };\n\t}\n\t#requireConnected() {\n\t\tif (this.#state.kind !== \"connected\") throw driverError(\"DRIVER.NOT_CONNECTED\", NOT_CONNECTED_MESSAGE);\n\t\treturn this.#state;\n\t}\n\tget state() {\n\t\treturn this.#state.kind;\n\t}\n\tasync connect(binding) {\n\t\tif (this.#state.kind === \"connected\") throw driverError(\"DRIVER.ALREADY_CONNECTED\", ALREADY_CONNECTED_MESSAGE, { bindingKind: binding.kind });\n\t\tthis.#state = {\n\t\t\tkind: \"connected\",\n\t\t\tpath: binding.path,\n\t\t\tconn: new SqliteConnectionImpl(openConnection(binding.path))\n\t\t};\n\t}\n\tasync acquireConnection() {\n\t\tconst { path } = this.#requireConnected();\n\t\treturn new SqliteConnectionImpl(openConnection(path));\n\t}\n\tasync close() {\n\t\tif (this.#state.kind !== \"connected\") return;\n\t\tconst { conn } = this.#state;\n\t\tthis.#state = { kind: \"closed\" };\n\t\tawait conn.release();\n\t}\n\tquery(request) {\n\t\tif (this.#state.kind !== \"connected\") return unboundQuery();\n\t\treturn this.#state.conn.query(request);\n\t}\n\tasync execute(request) {\n\t\treturn this.#requireConnected().conn.execute(request);\n\t}\n\tasync explain(request) {\n\t\treturn this.#requireConnected().conn.explain(request);\n\t}\n};\n//#endregion\n//#region src/core/runtime-driver.ts\nconst sqliteRuntimeDriverDescriptor = {\n\t...sqliteDriverDescriptorMeta,\n\tcreate() {\n\t\treturn new SqliteDriver();\n\t}\n};\n//#endregion\nexport { sqliteRuntimeDriverDescriptor as default };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;AAIA,SAAS,YAAY,MAAM,SAAS,SAAS;CAC5C,MAAM,QAAQ,IAAI,MAAM,OAAO;CAC/B,OAAO,eAAe,OAAO,QAAQ;EACpC,OAAO;EACP,cAAc;CACf,CAAC;CACD,OAAO,OAAO,OAAO,OAAO;EAC3B;EACA,UAAU;EACV,UAAU;EACV;EACA;CACD,CAAC;AACF;AACA,MAAM,wBAAwB;AAC9B,MAAM,4BAA4B;AAClC,SAAS,eAAe,MAAM;CAC7B,IAAI;EACH,MAAM,KAAK,IAAI,aAAa,IAAI;EAChC,GAAG,KAAK,0BAA0B;EAClC,GAAG,KAAK,4BAA4B;EACpC,OAAO;CACR,SAAS,OAAO;EACf,MAAM,qBAAqB,KAAK;CACjC;AACD;AACA,IAAI,kBAAkB,MAAM;CAC3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B,OAAO,KAAKC,kBAAkB,CAAC,CAAC,KAAK,QAAQ,OAAO;CACrD;CACA,MAAM,QAAQ,SAAS;EACtB,OAAO,KAAKA,kBAAkB,CAAC,CAAC,KAAK,QAAQ,OAAO;CACrD;AACD;AAGA,MAAM,gCAAgC;CACrC,GAAG;CACH,SAAS;EACR,OAAO,IAAI,aAAa;CACzB;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as buildTargetDetails } from "./planner-target-details-CIQ789Gc-C5U4yVY9.mjs";
|
|
2
|
-
import { h as step } from "./op-factory-call-
|
|
2
|
+
import { h as step } from "./op-factory-call-Dv_ma_mw-BtLqNmZI.mjs";
|
|
3
3
|
import { col as col$1, fn as fn$1, foreignKey, lit as lit$1, primaryKey, unique } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
4
4
|
import { placeholder } from "@prisma/orm-framework/errors/migration";
|
|
5
5
|
import { MigrationCLI } from "@prisma/orm-toolchain/cli/migration-cli";
|
|
@@ -44,4 +44,4 @@ function rawSql(op) {
|
|
|
44
44
|
//#endregion
|
|
45
45
|
export { foreignKey as a, primaryKey as c, fn$1 as i, rawSql as l, col$1 as n, lit$1 as o, dataTransform as r, placeholder as s, MigrationCLI as t, unique as u };
|
|
46
46
|
|
|
47
|
-
//# sourceMappingURL=migration-
|
|
47
|
+
//# sourceMappingURL=migration-Y6M_R3GK.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-Y6M_R3GK.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/migration.mjs"],"sourcesContent":["import { p as step } from \"./op-factory-call-Dv_ma_mw.mjs\";\nimport { t as buildTargetDetails } from \"./planner-target-details-CIQ789Gc.mjs\";\nimport { t as SqliteMigration } from \"./sqlite-migration-DuQG9WLW.mjs\";\nimport { placeholder } from \"@internal/errors/migration\";\nimport { col, fn, foreignKey, lit, primaryKey, unique } from \"@internal/sql-relational-core/contract-free\";\nimport { MigrationCLI } from \"@internal/cli/migration-cli\";\n//#region src/core/migrations/operations/data-transform.ts\n/**\n* User-facing `dataTransform` factory for the SQLite migration authoring\n* surface. Invoked directly inside a `migration.ts` file to supply a\n* user-authored SQL statement that runs with operation class `'data'`.\n*\n* Typical use: the planner emits a `DataTransformCall` stub when a NOT NULL\n* tightening requires a backfill. The rendered `migration.ts` exposes the\n* backfill as a `placeholder(\"…\")` slot the user fills in with an\n* `UPDATE … WHERE col IS NULL` statement. The filled-in `dataTransform(...)`\n* invocation returns a runnable operation the runner executes before the\n* subsequent recreate-table op copies data into the tightened schema.\n*/\nfunction dataTransform(opts) {\n\treturn {\n\t\tid: opts.id,\n\t\tlabel: opts.label,\n\t\tsummary: opts.description,\n\t\toperationClass: \"data\",\n\t\ttarget: {\n\t\t\tid: \"sqlite\",\n\t\t\tdetails: buildTargetDetails(\"table\", opts.table)\n\t\t},\n\t\tprecheck: [],\n\t\texecute: [step(opts.description, opts.run())],\n\t\tpostcheck: []\n\t};\n}\n//#endregion\n//#region src/core/migrations/operations/raw.ts\n/**\n* Identity factory for an already-materialized\n* `SqlMigrationPlanOperation<SqlitePlanTargetDetails>`. Mirrors the Postgres\n* `rawSql` factory: the planner uses this to carry ops produced by SQL-family\n* paths (codec lifecycle hooks, raw-SQL escape hatches) alongside structured\n* call IR without reverse-engineering their shape.\n*/\nfunction rawSql(op) {\n\treturn op;\n}\n//#endregion\nexport { SqliteMigration as Migration, MigrationCLI, col, dataTransform, fn, foreignKey, lit, placeholder, primaryKey, rawSql, unique };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,SAAS,cAAc,MAAM;CAC5B,OAAO;EACN,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,SAAS,KAAK;EACd,gBAAgB;EAChB,QAAQ;GACP,IAAI;GACJ,SAAS,mBAAmB,SAAS,KAAK,KAAK;EAChD;EACA,UAAU,CAAC;EACX,SAAS,CAAC,KAAK,KAAK,aAAa,KAAK,IAAI,CAAC,CAAC;EAC5C,WAAW,CAAC;CACb;AACD;;;;;;;;AAUA,SAAS,OAAO,IAAI;CACnB,OAAO;AACR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Op } from "./
|
|
2
|
-
import "./sqlite-migration-
|
|
1
|
+
import { t as Op } from "./tables-CvLOKCiJ-Ca1eFkWN.mjs";
|
|
2
|
+
import "./sqlite-migration-Du67NG7r-CqcA5XBz.mjs";
|
|
3
3
|
import { col as col$1, fn as fn$1, foreignKey, lit as lit$1, primaryKey, unique } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
4
4
|
import { placeholder } from "@prisma/orm-framework/errors/migration";
|
|
5
5
|
import { MigrationCLI } from "@prisma/orm-toolchain/cli/migration-cli";
|
|
@@ -40,4 +40,4 @@ declare function dataTransform(opts: DataTransformOptions): Op;
|
|
|
40
40
|
declare function rawSql(op: Op): Op;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { fn$1 as a, placeholder as c, unique as d, dataTransform as i, primaryKey as l, MigrationCLI as n, foreignKey as o, col$1 as r, lit$1 as s, DataTransformOptions as t, rawSql as u };
|
|
43
|
-
//# sourceMappingURL=migration-
|
|
43
|
+
//# sourceMappingURL=migration-dc58fySD.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-dc58fySD.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/migration.d.mts"],"mappings":";;;;;;;UAMU;;WAEC;;WAEA;;WAEA;;;;;WAKA;;;;;;;;;WASA;;iBAEM,cAAc,MAAM,uBAAuB;;;;;;;;;;iBAU3C,OAAO,IAAI,KAAK"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz-CMahymzq.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { a as SqliteTableSpec, i as SqliteIndexSpec, n as RecreatePostcheck, r as SqliteColumnSpec } from "./tables-CvLOKCiJ-Ca1eFkWN.mjs";
|
|
3
3
|
import { DdlColumn, DdlTableConstraint } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { OpFactoryCall } from "@prisma/orm-framework/components/control";
|
|
5
|
-
import { MigrationOperationClass, SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
|
|
6
5
|
import { ImportRequirement, TsExpression } from "@prisma/orm-framework/ts-render";
|
|
6
|
+
import { MigrationOperationClass, SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
|
|
7
7
|
import { ExecuteRequestLowerer, Lowerer } from "@prisma/orm-family-sql/family/control-adapter";
|
|
8
8
|
//#region ../../../3-targets/3-targets/sqlite/dist/op-factory-call.d.mts
|
|
9
9
|
//#region src/core/migrations/op-factory-call.d.ts
|
|
@@ -46,10 +46,7 @@ declare class RecreateTableCall extends SqliteOpFactoryCallNode {
|
|
|
46
46
|
readonly schemaColumnNames: readonly string[];
|
|
47
47
|
readonly indexes: readonly SqliteIndexSpec[];
|
|
48
48
|
readonly summary: string;
|
|
49
|
-
readonly postchecks: readonly
|
|
50
|
-
readonly description: string;
|
|
51
|
-
readonly sql: string;
|
|
52
|
-
}[];
|
|
49
|
+
readonly postchecks: readonly RecreatePostcheck[];
|
|
53
50
|
readonly label: string;
|
|
54
51
|
constructor(args: {
|
|
55
52
|
tableName: string;
|
|
@@ -57,10 +54,7 @@ declare class RecreateTableCall extends SqliteOpFactoryCallNode {
|
|
|
57
54
|
schemaColumnNames: readonly string[];
|
|
58
55
|
indexes: readonly SqliteIndexSpec[];
|
|
59
56
|
summary: string;
|
|
60
|
-
postchecks: readonly
|
|
61
|
-
readonly description: string;
|
|
62
|
-
readonly sql: string;
|
|
63
|
-
}[];
|
|
57
|
+
postchecks: readonly RecreatePostcheck[];
|
|
64
58
|
operationClass: MigrationOperationClass;
|
|
65
59
|
});
|
|
66
60
|
toOp(lowerer?: ExecuteRequestLowerer): Promise<Op>;
|
|
@@ -158,4 +152,4 @@ declare class RawSqlCall extends SqliteOpFactoryCallNode {
|
|
|
158
152
|
type SqliteOpFactoryCall = CreateTableCall | DropTableCall | RecreateTableCall | AddColumnCall | DropColumnCall | CreateIndexCall | DropIndexCall | DataTransformCall | RawSqlCall;
|
|
159
153
|
//#endregion
|
|
160
154
|
export { DropColumnCall as a, RawSqlCall as c, DataTransformCall as i, RecreateTableCall as l, CreateIndexCall as n, DropIndexCall as o, CreateTableCall as r, DropTableCall as s, AddColumnCall as t, SqliteOpFactoryCall as u };
|
|
161
|
-
//# sourceMappingURL=op-factory-call-
|
|
155
|
+
//# sourceMappingURL=op-factory-call-4FJxPMyx.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"op-factory-call-4FJxPMyx.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/op-factory-call.d.mts"],"mappings":";;;;;;;;;KAQK,KAAK,0BAA0B;uBACb,gCAAgC,wBAAwB;oBAC3D;oBACA,gBAAgB;oBAChB;WACT,KAAK,UAAU,UAAU,KAAK,QAAQ;EAC/C,+BAA+B;YACrB;;cAEE,wBAAwB;WAC3B;WACA;WACA;WACA,kBAAkB;WAClB,sBAAsB;WACtB;EACT,YAAY,mBAAmB,kBAAkB,aAAa,uBAAuB;EACrF,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,sBAAsB;WACzB;WACA;WACA;WACA;EACT,YAAY;EACZ,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,0BAA0B;WAC7B;WACA,gBAAgB;WAChB;WACA,eAAe;WACf;WACA,kBAAkB;WAClB;WACA,qBAAqB;WACrB;EACT,YAAY;IACV;IACA,eAAe;IACf;IACA,kBAAkB;IAClB;IACA,qBAAqB;IACrB,gBAAgB;;EAElB,KAAK,UAAU,wBAAwB,QAAQ;EAC/C;EACA,+BAA+B;;cAEnB,sBAAsB;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