@prisma/orm-target-sqlite 8.0.0-rc.18-dev.16 → 8.0.0-rc.18-dev.17
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-Bp_4Bjff-Cuo0_i6q.d.mts → adapter-Bp_4Bjff-BTxxClhZ.d.mts} +6 -6
- package/dist/{adapter-Bp_4Bjff-Cuo0_i6q.d.mts.map → adapter-Bp_4Bjff-BTxxClhZ.d.mts.map} +1 -1
- package/dist/{adapter-BxyK_xh_.d.mts → adapter-DCJwUEs1.d.mts} +5 -5
- package/dist/{adapter-BxyK_xh_.d.mts.map → adapter-DCJwUEs1.d.mts.map} +1 -1
- package/dist/{adapter-CsuIDFCl-VPvqA3aN.mjs → adapter-DDJTOmkz-oCaiFLLe.mjs} +33 -10
- package/dist/adapter-DDJTOmkz-oCaiFLLe.mjs.map +1 -0
- package/dist/adapter.d.mts +12 -12
- package/dist/adapter.mjs +5 -5
- package/dist/adapter__adapter.d.mts +3 -3
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__control.d.mts +4 -4
- package/dist/adapter__control.mjs +6 -6
- 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/{aggregates-C0639xga.d.mts → aggregates-D-yzAlbC.d.mts} +3 -3
- package/dist/{aggregates-C0639xga.d.mts.map → aggregates-D-yzAlbC.d.mts.map} +1 -1
- package/dist/{aggregates-PwypcEux.mjs → aggregates-uX0RsRV6.mjs} +3 -3
- package/dist/{aggregates-PwypcEux.mjs.map → aggregates-uX0RsRV6.mjs.map} +1 -1
- package/dist/codec-descriptor-BU0P0hxL.d.mts +2 -0
- package/dist/{codec-descriptor-gH7UB_pk-B_gmTZ17.mjs → codec-descriptor-CbMiyuVV-CiLsv8hg.mjs} +4 -6
- package/dist/codec-descriptor-CbMiyuVV-CiLsv8hg.mjs.map +1 -0
- package/dist/{codec-descriptor-DRF3mQZS-BfVwEGvo.d.mts → codec-descriptor-DT3GA29e-D9jjnVIM.d.mts} +4 -4
- package/dist/codec-descriptor-DT3GA29e-D9jjnVIM.d.mts.map +1 -0
- package/dist/codec-descriptor-EUFGq72N-BlLkoKCl.d.mts +1 -0
- package/dist/codec-types-B8qP9uEQ.d.mts +1 -0
- package/dist/{codec-types-RGpo5mg_-DwdllfRp.d.mts → codec-types-Dc0O4bw9-52horJp9.d.mts} +6 -17
- package/dist/codec-types-Dc0O4bw9-52horJp9.d.mts.map +1 -0
- package/dist/codec-types-F0PNhRRc.d.mts +2 -0
- package/dist/{codecs-Bpnc9OO2-3poDEyWO.d.mts → codecs-BRjmk9zL-CawaAxP9.d.mts} +63 -69
- package/dist/codecs-BRjmk9zL-CawaAxP9.d.mts.map +1 -0
- package/dist/codecs-Bkcbpy67.d.mts +1 -0
- package/dist/{codecs-C2B4QuOX.mjs → codecs-Pw5Rhv0j.mjs} +3 -3
- package/dist/{codecs-C2B4QuOX.mjs.map → codecs-Pw5Rhv0j.mjs.map} +1 -1
- package/dist/{codecs-Ea350Hl_-Bgfsxc8G.mjs → codecs-xH8Su5NY-BAQqL40w.mjs} +151 -171
- package/dist/codecs-xH8Su5NY-BAQqL40w.mjs.map +1 -0
- package/dist/{contract-contributions-wweWdXMK-D6CBejlZ.mjs → contract-contributions-wweWdXMK-CFknr0Fo.mjs} +2 -2
- package/dist/{contract-contributions-wweWdXMK-D6CBejlZ.mjs.map → contract-contributions-wweWdXMK-CFknr0Fo.mjs.map} +1 -1
- package/dist/{control-B36x0WJy.mjs → control-UHPONhXc.mjs} +6 -6
- package/dist/{control-B36x0WJy.mjs.map → control-UHPONhXc.mjs.map} +1 -1
- package/dist/{control-FYHqV1AN.d.mts → control-h8LnSYCx.d.mts} +9 -6
- package/dist/control-h8LnSYCx.d.mts.map +1 -0
- package/dist/{data-type-entries-B-DjiLVo-B9t48xaX.mjs → data-type-entries-DgF-SCh4-DiJECfQS.mjs} +23 -7
- package/dist/data-type-entries-DgF-SCh4-DiJECfQS.mjs.map +1 -0
- package/dist/{data-types-B_k5-Ohy.d.mts → data-types-BHaRTChJ.d.mts} +13 -2
- package/dist/data-types-BHaRTChJ.d.mts.map +1 -0
- package/dist/data-types-Ca0aw_9L-lsSoq_OT.mjs +154 -0
- package/dist/data-types-Ca0aw_9L-lsSoq_OT.mjs.map +1 -0
- package/dist/default-normalizer-DE4HLhYD.d.mts +25 -0
- package/dist/default-normalizer-DE4HLhYD.d.mts.map +1 -0
- package/dist/default-normalizer-Dqs9eDih-BbhEd5KC.mjs +112 -0
- package/dist/default-normalizer-Dqs9eDih-BbhEd5KC.mjs.map +1 -0
- package/dist/{descriptor-meta-CthMyZ9m-BJfUmecN.mjs → descriptor-meta-Doaqem4j-j08bxUcB.mjs} +5 -5
- package/dist/{descriptor-meta-CthMyZ9m-BJfUmecN.mjs.map → descriptor-meta-Doaqem4j-j08bxUcB.mjs.map} +1 -1
- package/dist/{descriptor-meta-DrNwC4vO-BHbHnBqu.mjs → descriptor-meta-DrNwC4vO-DKdG2JPw.mjs} +3 -3
- package/dist/{descriptor-meta-DrNwC4vO-BHbHnBqu.mjs.map → descriptor-meta-DrNwC4vO-DKdG2JPw.mjs.map} +1 -1
- package/dist/{descriptor-meta-runtime-Dqtz58eJ-BJ4UjLXW.mjs → descriptor-meta-runtime-CYn16fv9-BjDvboK_.mjs} +3 -3
- package/dist/{descriptor-meta-runtime-Dqtz58eJ-BJ4UjLXW.mjs.map → descriptor-meta-runtime-CYn16fv9-BjDvboK_.mjs.map} +1 -1
- package/dist/{migration-DCerLxfE.mjs → migration-BPuVvYy9.mjs} +2 -2
- package/dist/{migration-DCerLxfE.mjs.map → migration-BPuVvYy9.mjs.map} +1 -1
- package/dist/{op-factory-call-DOyJsczD-DbvU0p5_.mjs → op-factory-call-BSdtE9zX-DXX9SRyR.mjs} +39 -57
- package/dist/op-factory-call-BSdtE9zX-DXX9SRyR.mjs.map +1 -0
- package/dist/{pack-DChRrSsM.d.mts → pack-DwVxqZPz.d.mts} +2 -2
- package/dist/{pack-DChRrSsM.d.mts.map → pack-DwVxqZPz.d.mts.map} +1 -1
- package/dist/{planner-Dwty_fUe-D0-TzhkE.mjs → planner-BDEI0AnB-jdBSlpo0.mjs} +8 -7
- package/dist/planner-BDEI0AnB-jdBSlpo0.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-DC-1t9EA-CNp-PgLE.mjs → planner-produced-sqlite-migration-C5tDf9P4-CX2OeCsX.mjs} +4 -4
- package/dist/{planner-produced-sqlite-migration-DC-1t9EA-CNp-PgLE.mjs.map → planner-produced-sqlite-migration-C5tDf9P4-CX2OeCsX.mjs.map} +1 -1
- package/dist/{render-ops-Z0s3TTq--ifvvn9yX.mjs → render-ops-C0Ee6SlU--RWTd7yC.mjs} +3 -3
- package/dist/{render-ops-Z0s3TTq--ifvvn9yX.mjs.map → render-ops-C0Ee6SlU--RWTd7yC.mjs.map} +1 -1
- package/dist/{runtime-zwgkZ8R0.d.mts → runtime-6kTtFyhW.d.mts} +2 -2
- package/dist/{runtime-zwgkZ8R0.d.mts.map → runtime-6kTtFyhW.d.mts.map} +1 -1
- package/dist/sql-renderer-Bbmr-Y7n.d.mts +1 -0
- package/dist/{sqlite-contract-view-TELBWEt4-CVsdZnpX.mjs → sqlite-contract-view-BGy91QuK-DpVFoeDA.mjs} +5 -3
- package/dist/sqlite-contract-view-BGy91QuK-DpVFoeDA.mjs.map +1 -0
- package/dist/{sqlite-migration-DTN2snAw-DW3tNXzB.mjs → sqlite-migration-BVGmtT-T-DON6OaVa.mjs} +16 -39
- package/dist/sqlite-migration-BVGmtT-T-DON6OaVa.mjs.map +1 -0
- package/dist/target.d.mts +11 -11
- package/dist/target.mjs +16 -16
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__aggregates.mjs +1 -1
- 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.mjs +2 -2
- package/dist/target__data-types.d.mts +2 -2
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__default-normalizer.d.mts +2 -2
- package/dist/target__default-normalizer.mjs +2 -2
- package/dist/target__migration.mjs +2 -2
- package/dist/target__op-factory-call.mjs +1 -1
- package/dist/target__pack.d.mts +1 -1
- package/dist/target__pack.mjs +1 -1
- package/dist/target__planner-produced-sqlite-migration.mjs +1 -1
- package/dist/target__planner.mjs +1 -1
- package/dist/target__render-ops.mjs +1 -1
- package/dist/target__runtime.mjs +2 -2
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/types-Do0gYKCj.d.mts +2 -0
- package/dist/{types-RJMd2PlL-BpF9DGSQ.d.mts → types-RJMd2PlL-BT8T5Z6C.d.mts} +3 -3
- package/dist/{types-RJMd2PlL-BpF9DGSQ.d.mts.map → types-RJMd2PlL-BT8T5Z6C.d.mts.map} +1 -1
- package/package.json +9 -9
- package/dist/adapter-CsuIDFCl-VPvqA3aN.mjs.map +0 -1
- package/dist/codec-descriptor-BRAsa6-C-BgEz9r06.d.mts +0 -1
- package/dist/codec-descriptor-C_1o9b8y.d.mts +0 -2
- package/dist/codec-descriptor-DRF3mQZS-BfVwEGvo.d.mts.map +0 -1
- package/dist/codec-descriptor-gH7UB_pk-B_gmTZ17.mjs.map +0 -1
- package/dist/codec-types-Bq0ZnV7f.d.mts +0 -2
- package/dist/codec-types-Cm5wtfyY.d.mts +0 -1
- package/dist/codec-types-RGpo5mg_-DwdllfRp.d.mts.map +0 -1
- package/dist/codecs-Bpnc9OO2-3poDEyWO.d.mts.map +0 -1
- package/dist/codecs-DkmHzY5t.d.mts +0 -1
- package/dist/codecs-Ea350Hl_-Bgfsxc8G.mjs.map +0 -1
- package/dist/control-FYHqV1AN.d.mts.map +0 -1
- package/dist/data-type-entries-B-DjiLVo-B9t48xaX.mjs.map +0 -1
- package/dist/data-types-B_k5-Ohy.d.mts.map +0 -1
- package/dist/data-types-pFQMl37_-B-3aK_wd.mjs +0 -73
- package/dist/data-types-pFQMl37_-B-3aK_wd.mjs.map +0 -1
- package/dist/default-normalizer-B9V7TY5u.d.mts +0 -7
- package/dist/default-normalizer-B9V7TY5u.d.mts.map +0 -1
- package/dist/default-normalizer-Ch3VFnEH-C-h1XtlJ.mjs +0 -88
- package/dist/default-normalizer-Ch3VFnEH-C-h1XtlJ.mjs.map +0 -1
- package/dist/op-factory-call-DOyJsczD-DbvU0p5_.mjs.map +0 -1
- package/dist/planner-Dwty_fUe-D0-TzhkE.mjs.map +0 -1
- package/dist/sql-renderer-C9GzprOC.d.mts +0 -1
- package/dist/sqlite-contract-view-TELBWEt4-CVsdZnpX.mjs.map +0 -1
- package/dist/sqlite-migration-DTN2snAw-DW3tNXzB.mjs.map +0 -1
- package/dist/types-DMDJ_d9M.d.mts +0 -2
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BIGINT_NUMBER_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-KMliSCRp-BhTbmbGr.mjs";
|
|
2
|
-
import { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-
|
|
3
|
-
import {
|
|
2
|
+
import { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-CbMiyuVV-CiLsv8hg.mjs";
|
|
3
|
+
import { a as sqliteCharacterVarying, d as sqliteReal, f as sqliteText, l as sqliteInteger, r as sqliteCharacter, s as sqliteDatetime, t as sqliteBlob, u as sqliteJson } from "./data-types-Ca0aw_9L-lsSoq_OT.mjs";
|
|
4
4
|
import { n as sqliteError } from "./errors-DnR-sMHS-KkMLIP2U.mjs";
|
|
5
|
-
import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr,
|
|
6
|
-
import {
|
|
7
|
-
import { CodecImpl, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, column, decodeJsonFloat, decodeJsonIntegerText, decodeJsonMatching, decodeJsonString, encodeJsonFloat, refuseJsonValue } from "@prisma/orm-framework/components/codec";
|
|
5
|
+
import { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma/orm-family-sql/relational-core/ast";
|
|
6
|
+
import { CodecImpl, SAFE_INTEGER_BIGINT_RANGE, column, floatToJson, readJsonFloat, readJsonIntegerText, refuseJsonValue } from "@prisma/orm-framework/components/codec";
|
|
8
7
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
9
|
-
|
|
10
|
-
import { canonicalizeJson } from "@prisma/orm-framework/components/utils";
|
|
11
|
-
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-Ea350Hl_.mjs
|
|
8
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/codecs-xH8Su5NY.mjs
|
|
12
9
|
/**
|
|
13
10
|
* Projects the expression unchanged, for codecs whose canonical JSON is what
|
|
14
11
|
* SQLite's own JSON conversion already produces.
|
|
@@ -29,24 +26,19 @@ const identityJsonProjection = (expression) => expression;
|
|
|
29
26
|
*/
|
|
30
27
|
const decimalTextJsonProjection = (expression) => CastExpr.as(expression, "TEXT");
|
|
31
28
|
/**
|
|
32
|
-
* Projects a
|
|
29
|
+
* Projects a blob as a one-element array of its hexadecimal text.
|
|
33
30
|
*
|
|
34
|
-
* SQLite's JSON functions reject a BLOB argument outright, so the encoding has
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* `hex(NULL)` is `''` rather than NULL, and `''` is the hex of an empty blob —
|
|
40
|
-
* so without the NULL check an absent blob and an empty one would both project
|
|
41
|
-
* as `''`, and `decodeJson` accepts `''` because zero hex pairs is a valid
|
|
42
|
-
* empty blob. The check keeps the two distinguishable.
|
|
31
|
+
* SQLite's JSON functions reject a BLOB argument outright, so the encoding has to replace the native
|
|
32
|
+
* conversion rather than post-process it. `hex()` emits uppercase and never wraps. The array is what
|
|
33
|
+
* tells a blob from text: outside a STRICT table a BLOB column may hold text, which passes through as
|
|
34
|
+
* text, as a row carries it, and so does NULL and any other value.
|
|
43
35
|
*/
|
|
44
36
|
const hexJsonProjection = (expression) => CaseExpr.of([{
|
|
45
|
-
condition:
|
|
46
|
-
value:
|
|
47
|
-
}],
|
|
37
|
+
condition: BinaryExpr.eq(FunctionCallExpr.of("typeof", [expression]), LiteralExpr.of("blob")),
|
|
38
|
+
value: FunctionCallExpr.of("json_array", [FunctionCallExpr.of("hex", [expression])])
|
|
39
|
+
}], expression);
|
|
48
40
|
/**
|
|
49
|
-
* Projects a REAL as SQLite writes it in JSON, except an infinity, which SQLite writes as `9.0e+999` and which becomes the text `Infinity` or `-Infinity` that
|
|
41
|
+
* Projects a REAL as SQLite writes it in JSON, except an infinity, which SQLite writes as `9.0e+999` and which becomes the text `Infinity` or `-Infinity` that the codec stores. The test is equality with an infinity, so text or a blob that a REAL column holds outside a STRICT table passes through unchanged.
|
|
50
42
|
*/
|
|
51
43
|
const floatJsonProjection = (expression) => CaseExpr.of([{
|
|
52
44
|
condition: BinaryExpr.eq(expression, LiteralExpr.of(Number.POSITIVE_INFINITY)),
|
|
@@ -80,7 +72,6 @@ const jsonDocumentRetag = (expression) => isJsonRetag(expression) ? expression :
|
|
|
80
72
|
/** Whether an expression is already a retag, so applying one again would only nest. */
|
|
81
73
|
const isJsonRetag = (expression) => expression instanceof FunctionCallExpr && expression.fn === JSON_RETAG_FN && expression.args.length === 1;
|
|
82
74
|
const DECIMAL_INTEGER = /^-?\d+$/;
|
|
83
|
-
const UPPERCASE_HEX = /^(?:[0-9A-F]{2})*$/;
|
|
84
75
|
/** Renders the decimal text `sqlite/bigintnumber@1` carries, whose application type is `number`, as a number literal. */
|
|
85
76
|
const decimalTextNumberLiteral = (value) => typeof value === "string" && DECIMAL_INTEGER.test(value) ? value : void 0;
|
|
86
77
|
/**
|
|
@@ -94,21 +85,24 @@ function refuseNaN(codecId, value) {
|
|
|
94
85
|
return value;
|
|
95
86
|
}
|
|
96
87
|
/** Reads a float's JSON form, which on SQLite has no NaN. */
|
|
97
|
-
function
|
|
98
|
-
const value =
|
|
88
|
+
function readJsonFloatWithoutNaN(codecId, json) {
|
|
89
|
+
const value = readJsonFloat(codecId, json);
|
|
99
90
|
if (Number.isNaN(value)) return refuseJsonValue(codecId, "a finite number or the text Infinity or -Infinity; SQLite cannot store NaN", json);
|
|
100
91
|
return value;
|
|
101
92
|
}
|
|
102
93
|
/** `sql/float@1` as SQLite stores it: without NaN. */
|
|
103
94
|
var SqliteFloatCodec = class extends SqlFloatCodec {
|
|
104
|
-
async
|
|
105
|
-
return super.
|
|
95
|
+
async toWire(value, ctx) {
|
|
96
|
+
return super.toWire(refuseNaN(this.id, value), ctx);
|
|
97
|
+
}
|
|
98
|
+
async fromWire(wire, _ctx) {
|
|
99
|
+
return floatWire(this.id, wire);
|
|
106
100
|
}
|
|
107
|
-
|
|
108
|
-
return
|
|
101
|
+
fromDataTypeValue(value) {
|
|
102
|
+
return readJsonFloatWithoutNaN(this.id, value.value);
|
|
109
103
|
}
|
|
110
|
-
|
|
111
|
-
return
|
|
104
|
+
toDataTypeValue(input) {
|
|
105
|
+
return super.toDataTypeValue(refuseNaN(this.id, input));
|
|
112
106
|
}
|
|
113
107
|
};
|
|
114
108
|
/**
|
|
@@ -177,57 +171,83 @@ const safeIntegerFromBigint = (codecId, value) => {
|
|
|
177
171
|
} });
|
|
178
172
|
return Number(value);
|
|
179
173
|
};
|
|
180
|
-
/** `sqlite/integer`'s
|
|
181
|
-
const safeIntegerFromDigitText = (codecId, json) => Number(
|
|
182
|
-
/** A `number` written as `sqlite/integer`'s
|
|
174
|
+
/** `sqlite/integer`'s stored form, read into a `number`: digit text within the safe integer range. */
|
|
175
|
+
const safeIntegerFromDigitText = (codecId, json) => Number(readJsonIntegerText(codecId, json, SAFE_INTEGER_BIGINT_RANGE));
|
|
176
|
+
/** A `number` written as `sqlite/integer`'s stored form. */
|
|
183
177
|
const digitTextOfSafeInteger = (codecId, value) => String(encodableSafeInteger(codecId, value));
|
|
184
178
|
/**
|
|
179
|
+
* Reads an INTEGER's wire value into a `number`: the number the driver returns for a row, or the decimal text an include carries, because its projection casts the integer to text so that no digit is lost in JSON.
|
|
180
|
+
*/
|
|
181
|
+
function safeIntegerWire(codecId, wire) {
|
|
182
|
+
if (typeof wire === "number") return wire;
|
|
183
|
+
if (!DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", `${codecId} wire value must be an integer or its decimal text`, { meta: {
|
|
184
|
+
codecId,
|
|
185
|
+
received: wire
|
|
186
|
+
} });
|
|
187
|
+
return safeIntegerFromBigint(codecId, BigInt(wire));
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Reads a REAL's wire value: the number the driver returns for a row, or the text `Infinity` or `-Infinity` an include carries, because JSON has no infinity.
|
|
191
|
+
*/
|
|
192
|
+
function floatWire(codecId, wire) {
|
|
193
|
+
if (typeof wire === "number") return wire;
|
|
194
|
+
if (wire === "Infinity") return Number.POSITIVE_INFINITY;
|
|
195
|
+
if (wire === "-Infinity") return Number.NEGATIVE_INFINITY;
|
|
196
|
+
throw sqliteError("RUNTIME.DECODE_FAILED", `${codecId} wire value must be a number, or the text Infinity or -Infinity`, { meta: {
|
|
197
|
+
codecId,
|
|
198
|
+
received: wire
|
|
199
|
+
} });
|
|
200
|
+
}
|
|
201
|
+
/** The hex text SQLite's `hex()` writes: two uppercase digits for each byte. */
|
|
202
|
+
const BLOB_HEX_TEXT = /^(?:[0-9A-F]{2})*$/;
|
|
203
|
+
/**
|
|
185
204
|
* Projects a `sql/char@1` value without trailing spaces, as its `decode` reads it on a flat read, so an include reads the same value. SQLite does not pad the value; the rule is the family codec's.
|
|
186
205
|
*/
|
|
187
206
|
const unpaddedCharJsonProjection = (expression) => FunctionCallExpr.of("rtrim", [expression, LiteralExpr.of(" ")]);
|
|
188
207
|
const sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {
|
|
189
208
|
dataType: sqliteCharacter,
|
|
190
|
-
jsonProjection: unpaddedCharJsonProjection
|
|
209
|
+
jsonProjection: unpaddedCharJsonProjection,
|
|
210
|
+
factory: (descriptor, dataType, params) => () => new SqlCharCodec(descriptor, dataType, params)
|
|
191
211
|
});
|
|
192
212
|
const sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {
|
|
193
213
|
dataType: sqliteCharacterVarying,
|
|
194
|
-
jsonProjection: identityJsonProjection
|
|
214
|
+
jsonProjection: identityJsonProjection,
|
|
215
|
+
factory: (descriptor, dataType, params) => () => new SqlVarcharCodec(descriptor, dataType, params)
|
|
195
216
|
});
|
|
196
|
-
/** `sql/int@1` as SQLite stores it: its
|
|
217
|
+
/** `sql/int@1` as SQLite stores it: its stored form is `sqlite/integer`'s digit text. */
|
|
197
218
|
var SqliteSqlIntCodec = class extends SqlIntCodec {
|
|
198
|
-
|
|
199
|
-
return
|
|
219
|
+
async fromWire(wire, _ctx) {
|
|
220
|
+
return safeIntegerWire(this.id, wire);
|
|
200
221
|
}
|
|
201
|
-
|
|
202
|
-
return safeIntegerFromDigitText(this.id,
|
|
222
|
+
fromDataTypeValue(value) {
|
|
223
|
+
return safeIntegerFromDigitText(this.id, value.value);
|
|
203
224
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
factory() {
|
|
207
|
-
return () => new SqliteSqlIntCodec(this);
|
|
225
|
+
toDataTypeValue(input) {
|
|
226
|
+
return this.dataTypeValueOf(digitTextOfSafeInteger(this.id, input));
|
|
208
227
|
}
|
|
209
228
|
};
|
|
210
|
-
const sqliteSqlIntDescriptor = sqliteCodec(
|
|
229
|
+
const sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, {
|
|
211
230
|
dataType: sqliteInteger,
|
|
212
|
-
jsonProjection: decimalTextJsonProjection
|
|
231
|
+
jsonProjection: decimalTextJsonProjection,
|
|
232
|
+
factory: (descriptor, dataType) => () => new SqliteSqlIntCodec(descriptor, dataType)
|
|
213
233
|
});
|
|
214
234
|
const sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {
|
|
215
235
|
dataType: sqliteReal,
|
|
216
236
|
jsonProjection: floatJsonProjection,
|
|
217
|
-
factory: (descriptor) => () => new SqliteFloatCodec(descriptor)
|
|
237
|
+
factory: (descriptor, dataType) => () => new SqliteFloatCodec(descriptor, dataType)
|
|
218
238
|
});
|
|
219
239
|
var SqliteTextCodec = class extends CodecImpl {
|
|
220
|
-
async
|
|
240
|
+
async toWire(value, _ctx) {
|
|
221
241
|
return value;
|
|
222
242
|
}
|
|
223
|
-
async
|
|
243
|
+
async fromWire(wire, _ctx) {
|
|
224
244
|
return wire;
|
|
225
245
|
}
|
|
226
|
-
|
|
227
|
-
return value;
|
|
246
|
+
fromDataTypeValue(value) {
|
|
247
|
+
return value.value;
|
|
228
248
|
}
|
|
229
|
-
|
|
230
|
-
return
|
|
249
|
+
toDataTypeValue(input) {
|
|
250
|
+
return this.dataTypeValueOf(input);
|
|
231
251
|
}
|
|
232
252
|
};
|
|
233
253
|
var SqliteTextDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -243,23 +263,23 @@ var SqliteTextDescriptor = class extends SqliteCodecDescriptor {
|
|
|
243
263
|
];
|
|
244
264
|
paramsSchema = void 0;
|
|
245
265
|
factory() {
|
|
246
|
-
return () => new SqliteTextCodec(this);
|
|
266
|
+
return () => new SqliteTextCodec(this, sqliteText);
|
|
247
267
|
}
|
|
248
268
|
};
|
|
249
269
|
const sqliteTextDescriptor = new SqliteTextDescriptor();
|
|
250
270
|
const sqliteTextColumn = () => column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, void 0);
|
|
251
271
|
var SqliteIntegerCodec = class extends CodecImpl {
|
|
252
|
-
async
|
|
272
|
+
async toWire(value, _ctx) {
|
|
253
273
|
return value;
|
|
254
274
|
}
|
|
255
|
-
async
|
|
256
|
-
return wire;
|
|
275
|
+
async fromWire(wire, _ctx) {
|
|
276
|
+
return safeIntegerWire(SQLITE_INTEGER_CODEC_ID, wire);
|
|
257
277
|
}
|
|
258
|
-
|
|
259
|
-
return
|
|
278
|
+
fromDataTypeValue(value) {
|
|
279
|
+
return safeIntegerFromDigitText(SQLITE_INTEGER_CODEC_ID, value.value);
|
|
260
280
|
}
|
|
261
|
-
|
|
262
|
-
return
|
|
281
|
+
toDataTypeValue(input) {
|
|
282
|
+
return this.dataTypeValueOf(digitTextOfSafeInteger(SQLITE_INTEGER_CODEC_ID, input));
|
|
263
283
|
}
|
|
264
284
|
};
|
|
265
285
|
var SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -275,23 +295,23 @@ var SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {
|
|
|
275
295
|
];
|
|
276
296
|
paramsSchema = void 0;
|
|
277
297
|
factory() {
|
|
278
|
-
return () => new SqliteIntegerCodec(this);
|
|
298
|
+
return () => new SqliteIntegerCodec(this, sqliteInteger);
|
|
279
299
|
}
|
|
280
300
|
};
|
|
281
301
|
const sqliteIntegerDescriptor = new SqliteIntegerDescriptor();
|
|
282
302
|
const sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0);
|
|
283
303
|
var SqliteRealCodec = class extends CodecImpl {
|
|
284
|
-
async
|
|
304
|
+
async toWire(value, _ctx) {
|
|
285
305
|
return refuseNaN(SQLITE_REAL_CODEC_ID, value);
|
|
286
306
|
}
|
|
287
|
-
async
|
|
288
|
-
return wire;
|
|
307
|
+
async fromWire(wire, _ctx) {
|
|
308
|
+
return floatWire(SQLITE_REAL_CODEC_ID, wire);
|
|
289
309
|
}
|
|
290
|
-
|
|
291
|
-
return
|
|
310
|
+
fromDataTypeValue(value) {
|
|
311
|
+
return readJsonFloatWithoutNaN(SQLITE_REAL_CODEC_ID, value.value);
|
|
292
312
|
}
|
|
293
|
-
|
|
294
|
-
return
|
|
313
|
+
toDataTypeValue(input) {
|
|
314
|
+
return this.dataTypeValueOf(floatToJson(refuseNaN(SQLITE_REAL_CODEC_ID, input)));
|
|
295
315
|
}
|
|
296
316
|
};
|
|
297
317
|
var SqliteRealDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -307,24 +327,30 @@ var SqliteRealDescriptor = class extends SqliteCodecDescriptor {
|
|
|
307
327
|
];
|
|
308
328
|
paramsSchema = void 0;
|
|
309
329
|
factory() {
|
|
310
|
-
return () => new SqliteRealCodec(this);
|
|
330
|
+
return () => new SqliteRealCodec(this, sqliteReal);
|
|
311
331
|
}
|
|
312
332
|
};
|
|
313
333
|
const sqliteRealDescriptor = new SqliteRealDescriptor();
|
|
314
334
|
const sqliteRealColumn = () => column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, void 0);
|
|
315
335
|
var SqliteBlobCodec = class extends CodecImpl {
|
|
316
|
-
async
|
|
336
|
+
async toWire(value, _ctx) {
|
|
317
337
|
return value;
|
|
318
338
|
}
|
|
319
|
-
|
|
320
|
-
|
|
339
|
+
/** A row carries the blob's bytes; an include carries the array of their hex text that its projection writes, because SQLite's JSON functions refuse a blob. Anything else a BLOB column holds is refused. */
|
|
340
|
+
async fromWire(wire, _ctx) {
|
|
341
|
+
if (wire instanceof Uint8Array) return wire;
|
|
342
|
+
const [hex] = Array.isArray(wire) && wire.length === 1 ? wire : [];
|
|
343
|
+
if (typeof hex !== "string" || !BLOB_HEX_TEXT.test(hex)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/blob@1 wire value must be bytes, or the array of their hex text an include carries", { meta: {
|
|
344
|
+
codecId: SQLITE_BLOB_CODEC_ID,
|
|
345
|
+
received: String(wire)
|
|
346
|
+
} });
|
|
347
|
+
return new Uint8Array(Buffer.from(hex, "hex"));
|
|
321
348
|
}
|
|
322
|
-
|
|
323
|
-
return Buffer.from(value
|
|
349
|
+
fromDataTypeValue(value) {
|
|
350
|
+
return new Uint8Array(Buffer.from(value.value, "hex"));
|
|
324
351
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
return new Uint8Array(Buffer.from(hex, "hex"));
|
|
352
|
+
toDataTypeValue(input) {
|
|
353
|
+
return this.dataTypeValueOf(Buffer.from(input).toString("hex").toUpperCase());
|
|
328
354
|
}
|
|
329
355
|
};
|
|
330
356
|
var SqliteBlobDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -336,142 +362,96 @@ var SqliteBlobDescriptor = class extends SqliteCodecDescriptor {
|
|
|
336
362
|
traits = ["equality"];
|
|
337
363
|
paramsSchema = void 0;
|
|
338
364
|
factory() {
|
|
339
|
-
return () => new SqliteBlobCodec(this);
|
|
365
|
+
return () => new SqliteBlobCodec(this, sqliteBlob);
|
|
340
366
|
}
|
|
341
367
|
};
|
|
342
368
|
const sqliteBlobDescriptor = new SqliteBlobDescriptor();
|
|
343
369
|
const sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0);
|
|
344
370
|
/**
|
|
345
|
-
*
|
|
346
|
-
* text with a UTC offset. The range and the millisecond precision are those of a JavaScript `Date`,
|
|
347
|
-
* the codec's value.
|
|
348
|
-
*/
|
|
349
|
-
const sqliteDatetimeCanonical = (text) => canonicalDateTime(text, {
|
|
350
|
-
shape: "instant",
|
|
351
|
-
ownerId: SQLITE_DATETIME_CODEC_ID,
|
|
352
|
-
maxFractionDigits: 3,
|
|
353
|
-
range: {
|
|
354
|
-
earliest: "-271821-04-20T00:00:00Z",
|
|
355
|
-
latest: "+275760-09-13T00:00:00Z"
|
|
356
|
-
}
|
|
357
|
-
});
|
|
358
|
-
/**
|
|
359
|
-
* Reads the text SQLite holds for an instant. Rejects `Invalid Date` (NaN-time) at every decode
|
|
360
|
-
* ingress so consumers never receive a Date whose downstream operations silently produce NaN.
|
|
371
|
+
* Reads what SQLite holds for an instant as `Date` reads it, with text without a UTC offset read as UTC, as SQLite's own date and time functions read it, never in the machine's time zone. A number is milliseconds since 1970, as the Prisma ORM query engine wrote a `DateTime`. Digits below a millisecond are cut, as `Date` cuts them.
|
|
361
372
|
*/
|
|
362
373
|
function decodeSqliteDatetime(value) {
|
|
363
|
-
const date = new Date(value);
|
|
364
|
-
if (Number.isNaN(date.getTime())) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/datetime@1 value must be a
|
|
374
|
+
const date = new Date(typeof value === "number" ? value : asUtcWhenUnmarked(value));
|
|
375
|
+
if (Number.isNaN(date.getTime())) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/datetime@1 wire value must be a date and time as text, or a number of milliseconds since 1970: ${String(value)}`, { meta: {
|
|
365
376
|
codecId: SQLITE_DATETIME_CODEC_ID,
|
|
366
|
-
received: value
|
|
377
|
+
received: String(value)
|
|
367
378
|
} });
|
|
368
379
|
return date;
|
|
369
380
|
}
|
|
381
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
382
|
+
const DATE_TIME_WITHOUT_OFFSET = /^(\d{4}-\d{2}-\d{2})[Tt ](\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)$/;
|
|
383
|
+
/** A date alone as its midnight in UTC, and a date and time without an offset as UTC. */
|
|
384
|
+
function asUtcWhenUnmarked(text) {
|
|
385
|
+
if (DATE_ONLY.test(text)) return `${text}T00:00:00Z`;
|
|
386
|
+
const unmarked = DATE_TIME_WITHOUT_OFFSET.exec(text);
|
|
387
|
+
return unmarked === null ? text : `${unmarked[1]}T${unmarked[2]}Z`;
|
|
388
|
+
}
|
|
370
389
|
/** The text SQLite holds for an instant: what the codec writes for every row, and for a default. */
|
|
371
390
|
function encodeSqliteDatetime(value) {
|
|
372
391
|
return value.toISOString();
|
|
373
392
|
}
|
|
374
393
|
var SqliteDatetimeCodec = class extends CodecImpl {
|
|
375
|
-
async
|
|
394
|
+
async toWire(value, _ctx) {
|
|
376
395
|
return encodeSqliteDatetime(value);
|
|
377
396
|
}
|
|
378
|
-
async
|
|
397
|
+
async fromWire(wire, _ctx) {
|
|
379
398
|
return decodeSqliteDatetime(wire);
|
|
380
399
|
}
|
|
381
|
-
|
|
382
|
-
return
|
|
400
|
+
fromDataTypeValue(value) {
|
|
401
|
+
return new Date(value.value);
|
|
383
402
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
if (Number.isNaN(date.getTime())) return refuseJsonValue(SQLITE_DATETIME_CODEC_ID, "a date and time string", json);
|
|
387
|
-
return date;
|
|
403
|
+
toDataTypeValue(input) {
|
|
404
|
+
return this.dataTypeValueOf(input.toISOString());
|
|
388
405
|
}
|
|
389
406
|
};
|
|
390
|
-
/**
|
|
391
|
-
* `sqlite/text` stores this codec's values as text and declares no canonical form for them, so the
|
|
392
|
-
* codec declares it: written text with a UTC offset becomes the instant in UTC.
|
|
393
|
-
*/
|
|
394
|
-
const datetimeCanonicalForm = (value) => {
|
|
395
|
-
if (typeof value === "string") return sqliteDatetimeCanonical(value);
|
|
396
|
-
throw structuredError("CONTRACT.CAST_REFUSED", `Expected text, got ${JSON.stringify(value)}.`, {
|
|
397
|
-
why: "A SQLite datetime is stored as text.",
|
|
398
|
-
fix: "Write the date and time as text with a UTC offset, as in \"2024-01-01T12:34:56Z\"."
|
|
399
|
-
});
|
|
400
|
-
};
|
|
401
407
|
var SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {
|
|
402
408
|
jsonProjection(expression) {
|
|
403
409
|
return expression;
|
|
404
410
|
}
|
|
405
|
-
|
|
406
|
-
dataType = sqliteText.id;
|
|
411
|
+
dataType = sqliteDatetime.id;
|
|
407
412
|
codecId = SQLITE_DATETIME_CODEC_ID;
|
|
408
413
|
traits = ["equality", "order"];
|
|
409
414
|
paramsSchema = void 0;
|
|
410
415
|
factory() {
|
|
411
|
-
return () => new SqliteDatetimeCodec(this);
|
|
416
|
+
return () => new SqliteDatetimeCodec(this, sqliteDatetime);
|
|
412
417
|
}
|
|
413
418
|
};
|
|
414
419
|
const sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();
|
|
415
420
|
const sqliteDatetimeColumn = () => column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, void 0);
|
|
416
421
|
var SqliteJsonCodec = class extends CodecImpl {
|
|
417
|
-
async
|
|
422
|
+
async toWire(value, _ctx) {
|
|
418
423
|
return JSON.stringify(value);
|
|
419
424
|
}
|
|
420
|
-
async
|
|
425
|
+
async fromWire(wire, _ctx) {
|
|
421
426
|
return typeof wire === "string" ? blindCast(JSON.parse(wire)) : wire;
|
|
422
427
|
}
|
|
423
|
-
|
|
424
|
-
return
|
|
425
|
-
}
|
|
426
|
-
decodeJson(json) {
|
|
427
|
-
const document = typeof json === "string" ? parseJsonText$1(json) : void 0;
|
|
428
|
-
if (document === void 0) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/json@1 contract value must be the JSON text of a document", { meta: {
|
|
429
|
-
codecId: SQLITE_JSON_CODEC_ID,
|
|
430
|
-
received: typeof json
|
|
431
|
-
} });
|
|
432
|
-
return document.value;
|
|
428
|
+
fromDataTypeValue(value) {
|
|
429
|
+
return blindCast(JSON.parse(value.value));
|
|
433
430
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
try {
|
|
437
|
-
return { value: JSON.parse(text) };
|
|
438
|
-
} catch {
|
|
439
|
-
return;
|
|
431
|
+
toDataTypeValue(input) {
|
|
432
|
+
return this.dataTypeValueOf(JSON.stringify(input));
|
|
440
433
|
}
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* `sqlite/text` declares no canonical form, so the codec declares the one of its values: the JSON
|
|
444
|
-
* text of the document, with sorted keys and no added whitespace.
|
|
445
|
-
*/
|
|
446
|
-
const jsonTextCanonicalForm = (value) => {
|
|
447
|
-
const document = typeof value === "string" ? parseJsonText$1(value) : void 0;
|
|
448
|
-
if (document === void 0) throw structuredError("CONTRACT.CAST_REFUSED", `Expected the JSON text of a document, got ${JSON.stringify(value)}.`, {
|
|
449
|
-
why: "A SQLite JSON column stores the JSON text of its document.",
|
|
450
|
-
fix: "Write the document as JSON text, as in {\"plan\": \"free\"}."
|
|
451
|
-
});
|
|
452
|
-
return canonicalizeJson(document.value);
|
|
453
434
|
};
|
|
454
435
|
/**
|
|
455
|
-
* The column stores the document's JSON text and the
|
|
436
|
+
* The column stores the document's JSON text and the stored form is that text, so the stored
|
|
456
437
|
* value is projected as it is: a string the enclosing JSON constructor embeds as a string.
|
|
457
438
|
*/
|
|
458
439
|
var SqliteJsonDescriptor = class extends SqliteCodecDescriptor {
|
|
459
440
|
jsonProjection(expression) {
|
|
460
441
|
return expression;
|
|
461
442
|
}
|
|
462
|
-
|
|
463
|
-
dataType = sqliteText.id;
|
|
443
|
+
dataType = sqliteJson.id;
|
|
464
444
|
codecId = SQLITE_JSON_CODEC_ID;
|
|
465
445
|
traits = ["equality"];
|
|
466
446
|
paramsSchema = void 0;
|
|
467
447
|
factory() {
|
|
468
|
-
return () => new SqliteJsonCodec(this);
|
|
448
|
+
return () => new SqliteJsonCodec(this, sqliteJson);
|
|
469
449
|
}
|
|
470
450
|
};
|
|
471
451
|
const sqliteJsonDescriptor = new SqliteJsonDescriptor();
|
|
472
452
|
const sqliteJsonColumn = () => column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, void 0);
|
|
473
453
|
var SqliteBigintCodec = class extends CodecImpl {
|
|
474
|
-
async
|
|
454
|
+
async toWire(value, _ctx) {
|
|
475
455
|
requireJsType(SQLITE_BIGINT_CODEC_ID, "bigint", value);
|
|
476
456
|
return value;
|
|
477
457
|
}
|
|
@@ -483,7 +463,7 @@ var SqliteBigintCodec = class extends CodecImpl {
|
|
|
483
463
|
* integer — past ±(2^53 − 1) it has already rounded, and converting it would
|
|
484
464
|
* mint a spuriously-exact `bigint` that need not equal the stored value.
|
|
485
465
|
*/
|
|
486
|
-
async
|
|
466
|
+
async fromWire(wire, _ctx) {
|
|
487
467
|
if (typeof wire === "number" && !Number.isSafeInteger(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", `sqlite/bigint@1 wire number must be an integer within the safe integer range, got ${String(wire)}`, { meta: {
|
|
488
468
|
codecId: SQLITE_BIGINT_CODEC_ID,
|
|
489
469
|
received: String(wire)
|
|
@@ -494,11 +474,11 @@ var SqliteBigintCodec = class extends CodecImpl {
|
|
|
494
474
|
} });
|
|
495
475
|
return BigInt(wire);
|
|
496
476
|
}
|
|
497
|
-
|
|
498
|
-
return
|
|
477
|
+
fromDataTypeValue(value) {
|
|
478
|
+
return BigInt(value.value);
|
|
499
479
|
}
|
|
500
|
-
|
|
501
|
-
return
|
|
480
|
+
toDataTypeValue(input) {
|
|
481
|
+
return this.dataTypeValueOf(bigintEncodeJson(SQLITE_BIGINT_CODEC_ID, input));
|
|
502
482
|
}
|
|
503
483
|
};
|
|
504
484
|
var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -514,7 +494,7 @@ var SqliteBigintDescriptor = class extends SqliteCodecDescriptor {
|
|
|
514
494
|
];
|
|
515
495
|
paramsSchema = void 0;
|
|
516
496
|
factory() {
|
|
517
|
-
return () => new SqliteBigintCodec(this);
|
|
497
|
+
return () => new SqliteBigintCodec(this, sqliteInteger);
|
|
518
498
|
}
|
|
519
499
|
};
|
|
520
500
|
const sqliteBigintDescriptor = new SqliteBigintDescriptor();
|
|
@@ -527,7 +507,7 @@ const sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqlite
|
|
|
527
507
|
* `sqlite/integer` carries, which every codec of that data type shares.
|
|
528
508
|
*/
|
|
529
509
|
var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
530
|
-
async
|
|
510
|
+
async toWire(value, _ctx) {
|
|
531
511
|
return encodableSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, value);
|
|
532
512
|
}
|
|
533
513
|
/**
|
|
@@ -535,7 +515,7 @@ var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
|
535
515
|
* `bigint`; a bigint (or decimal text) is range-checked exactly before any
|
|
536
516
|
* conversion to `number`, so an out-of-range value throws rather than rounds.
|
|
537
517
|
*/
|
|
538
|
-
async
|
|
518
|
+
async fromWire(wire, _ctx) {
|
|
539
519
|
if (typeof wire === "number") return safeIntegerNumber(SQLITE_BIGINT_NUMBER_CODEC_ID, wire, "RUNTIME.DECODE_FAILED");
|
|
540
520
|
if (typeof wire === "string" && !DECIMAL_INTEGER.test(wire)) throw sqliteError("RUNTIME.DECODE_FAILED", "sqlite/bigintnumber@1 wire value must be a decimal string", { meta: {
|
|
541
521
|
codecId: SQLITE_BIGINT_NUMBER_CODEC_ID,
|
|
@@ -543,11 +523,11 @@ var SqliteBigintNumberCodec = class extends CodecImpl {
|
|
|
543
523
|
} });
|
|
544
524
|
return safeIntegerFromBigint(SQLITE_BIGINT_NUMBER_CODEC_ID, BigInt(wire));
|
|
545
525
|
}
|
|
546
|
-
|
|
547
|
-
return
|
|
526
|
+
fromDataTypeValue(value) {
|
|
527
|
+
return safeIntegerFromDigitText(SQLITE_BIGINT_NUMBER_CODEC_ID, value.value);
|
|
548
528
|
}
|
|
549
|
-
|
|
550
|
-
return
|
|
529
|
+
toDataTypeValue(input) {
|
|
530
|
+
return this.dataTypeValueOf(digitTextOfSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, input));
|
|
551
531
|
}
|
|
552
532
|
};
|
|
553
533
|
var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
|
|
@@ -566,7 +546,7 @@ var SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {
|
|
|
566
546
|
return decimalTextNumberLiteral(value);
|
|
567
547
|
}
|
|
568
548
|
factory() {
|
|
569
|
-
return () => new SqliteBigintNumberCodec(this);
|
|
549
|
+
return () => new SqliteBigintNumberCodec(this, sqliteInteger);
|
|
570
550
|
}
|
|
571
551
|
};
|
|
572
552
|
const sqliteBigintNumberDescriptor = new SqliteBigintNumberDescriptor();
|
|
@@ -586,6 +566,6 @@ const codecDescriptors = defineSqliteCodecs([
|
|
|
586
566
|
sqliteBigintNumberDescriptor
|
|
587
567
|
]);
|
|
588
568
|
//#endregion
|
|
589
|
-
export {
|
|
569
|
+
export { sqliteBigintNumberColumn as a, sqliteIntegerColumn as c, sqliteTextColumn as d, sqliteBigintColumn as i, sqliteJsonColumn as l, encodeSqliteDatetime as n, sqliteBlobColumn as o, jsonDocumentRetag as r, sqliteDatetimeColumn as s, codecDescriptors as t, sqliteRealColumn as u };
|
|
590
570
|
|
|
591
|
-
//# sourceMappingURL=codecs-
|
|
571
|
+
//# sourceMappingURL=codecs-xH8Su5NY-BAQqL40w.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-xH8Su5NY-BAQqL40w.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/codecs-xH8Su5NY.mjs"],"sourcesContent":["import { a as SQLITE_INTEGER_CODEC_ID, c as SQLITE_TEXT_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, n as SQLITE_BIGINT_NUMBER_CODEC_ID, o as SQLITE_JSON_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_REAL_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from \"./codec-ids-KMliSCRp.mjs\";\nimport { a as sqliteCharacterVarying, d as sqliteReal, f as sqliteText, l as sqliteInteger, r as sqliteCharacter, s as sqliteDatetime, t as sqliteBlob, u as sqliteJson } from \"./data-types-Ca0aw_9L.mjs\";\nimport { a as sqliteCodec, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from \"./codec-descriptor-CbMiyuVV.mjs\";\nimport { n as sqliteError } from \"./errors-DnR-sMHS.mjs\";\nimport { BinaryExpr, CaseExpr, CastExpr, FunctionCallExpr, LiteralExpr, SqlCharCodec, SqlFloatCodec, SqlIntCodec, SqlVarcharCodec, sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from \"@internal/sql-relational-core/ast\";\nimport { CodecImpl, SAFE_INTEGER_BIGINT_RANGE, column, floatToJson, readJsonFloat, readJsonIntegerText, refuseJsonValue } from \"@internal/framework-components/codec\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/core/codecs.ts\n/**\n* Projects the expression unchanged, for codecs whose canonical JSON is what\n* SQLite's own JSON conversion already produces.\n*\n* Identity here is a claim about the target's behaviour, not an absence of one:\n* the codec's conformance cases are what test it, including at the boundaries\n* of the representation where a native conversion would be most likely to\n* diverge.\n*/\nconst identityJsonProjection = (expression) => expression;\n/**\n* Projects an integer-valued expression as decimal text.\n*\n* The cast is part of the projected expression, so it applies before the JSON\n* constructor sees the value: handed an INTEGER directly, the constructor emits\n* a JSON number, and SQLite's 64-bit range does not survive being read back as\n* a double. Casting the constructor's result would be too late.\n*/\nconst decimalTextJsonProjection = (expression) => CastExpr.as(expression, \"TEXT\");\n/**\n* Projects a blob as a one-element array of its hexadecimal text.\n*\n* SQLite's JSON functions reject a BLOB argument outright, so the encoding has to replace the native\n* conversion rather than post-process it. `hex()` emits uppercase and never wraps. The array is what\n* tells a blob from text: outside a STRICT table a BLOB column may hold text, which passes through as\n* text, as a row carries it, and so does NULL and any other value.\n*/\nconst hexJsonProjection = (expression) => CaseExpr.of([{\n\tcondition: BinaryExpr.eq(FunctionCallExpr.of(\"typeof\", [expression]), LiteralExpr.of(\"blob\")),\n\tvalue: FunctionCallExpr.of(\"json_array\", [FunctionCallExpr.of(\"hex\", [expression])])\n}], expression);\n/**\n* Projects a REAL as SQLite writes it in JSON, except an infinity, which SQLite writes as `9.0e+999` and which becomes the text `Infinity` or `-Infinity` that the codec stores. The test is equality with an infinity, so text or a blob that a REAL column holds outside a STRICT table passes through unchanged.\n*/\nconst floatJsonProjection = (expression) => CaseExpr.of([{\n\tcondition: BinaryExpr.eq(expression, LiteralExpr.of(Number.POSITIVE_INFINITY)),\n\tvalue: LiteralExpr.of(\"Infinity\")\n}, {\n\tcondition: BinaryExpr.eq(expression, LiteralExpr.of(Number.NEGATIVE_INFINITY)),\n\tvalue: LiteralExpr.of(\"-Infinity\")\n}], expression);\nconst JSON_RETAG_FN = \"json\";\n/**\n* Re-applies SQLite's JSON subtype to a document-valued expression.\n*\n* SQLite carries \"this text is JSON\" as a subtype on the value rather than in\n* its type, and the subtype does not survive a derived table: a document that\n* `json_object` produced arrives one level out as plain text, so the enclosing\n* constructor embeds it as a *string containing JSON* rather than as a\n* document. `json()` re-applies the subtype, which is what makes the value nest\n* as a document again.\n*\n* The loss happens at the first derived-table boundary and does not compound, so\n* a retag is needed where the document is consumed rather than at every level it\n* passes through.\n*\n* Applying this twice is a no-op — SQLite's `json()` is idempotent, and the\n* wrapper collapses rather than nesting so the rendered SQL says so too. It is\n* safe on any valid JSON text, including scalars, and on NULL; it raises\n* `malformed JSON` on text that is not JSON, which is the correct failure for a\n* value that was never a document.\n*/\nconst jsonDocumentRetag = (expression) => isJsonRetag(expression) ? expression : FunctionCallExpr.of(JSON_RETAG_FN, [expression]);\n/** Whether an expression is already a retag, so applying one again would only nest. */\nconst isJsonRetag = (expression) => expression instanceof FunctionCallExpr && expression.fn === JSON_RETAG_FN && expression.args.length === 1;\nconst DECIMAL_INTEGER = /^-?\\d+$/;\n/** Renders the decimal text `sqlite/bigintnumber@1` carries, whose application type is `number`, as a number literal. */\nconst decimalTextNumberLiteral = (value) => typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? value : void 0;\n/**\n* SQLite stores an infinity but not NaN, which it turns into NULL, so a float codec on SQLite refuses NaN wherever it writes a value: to a parameter, and to the contract.\n*/\nfunction refuseNaN(codecId, value) {\n\tif (Number.isNaN(value)) throw sqliteError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be a number other than NaN, which SQLite cannot store`, { meta: {\n\t\tcodecId,\n\t\treceived: \"NaN\"\n\t} });\n\treturn value;\n}\n/** Reads a float's JSON form, which on SQLite has no NaN. */\nfunction readJsonFloatWithoutNaN(codecId, json) {\n\tconst value = readJsonFloat(codecId, json);\n\tif (Number.isNaN(value)) return refuseJsonValue(codecId, \"a finite number or the text Infinity or -Infinity; SQLite cannot store NaN\", json);\n\treturn value;\n}\n/** `sql/float@1` as SQLite stores it: without NaN. */\nvar SqliteFloatCodec = class extends SqlFloatCodec {\n\tasync toWire(value, ctx) {\n\t\treturn super.toWire(refuseNaN(this.id, value), ctx);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn floatWire(this.id, wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn readJsonFloatWithoutNaN(this.id, value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn super.toDataTypeValue(refuseNaN(this.id, input));\n\t}\n};\n/**\n* Requires an application value to be of the JS type the codec reads.\n*\n* A range check reads a value of the wrong type as a value out of range, and\n* reports a number plainly inside the range as outside it — so the type is\n* established first and answered for on its own terms, naming what a caller\n* has to change.\n*/\nconst requireJsType = (codecId, expected, value) => {\n\tif (typeof value === expected) return;\n\tthrow sqliteError(\"RUNTIME.ENCODE_FAILED\", `${codecId} value must be a ${expected}, got ${typeof value} ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: typeof value\n\t} });\n};\n/**\n* Writes an application value as the decimal text `sqlite/bigint@1` carries as\n* its canonical JSON.\n*\n* A schema-written literal default (`BigInt @default(0)`) arrives here as a\n* `number`, since a number literal is the only integer a schema language\n* writes, and one that is a safe integer names its value exactly. Past that\n* range the literal was rounded before any of this ran, so the value written is\n* not the value meant — which this refuses rather than minting an exact-looking\n* value from it. A non-integral number is refused on the same terms.\n*/\nconst bigintEncodeJson = (codecId, value) => {\n\tif (typeof value !== \"number\") {\n\t\trequireJsType(codecId, \"bigint\", value);\n\t\treturn value.toString();\n\t}\n\tif (!Number.isSafeInteger(value)) throw sqliteError(\"RUNTIME.ENCODE_FAILED\", `${codecId} number literal must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(value)\n\t} });\n\treturn BigInt(value).toString();\n};\n/**\n* Requires an integer within ±(2^53 − 1), the range a JS `number` holds\n* exactly. The guard throws rather than rounding: past the boundary a `number`\n* silently loses digits, which is the failure mode these codecs exist to refuse.\n*/\nconst safeIntegerNumber = (codecId, value, code) => {\n\tif (!Number.isSafeInteger(value)) throw sqliteError(code, `${codecId} value must be an integer within the safe integer range, got ${String(value)}`, { meta: {\n\t\tcodecId,\n\t\treceived: String(value)\n\t} });\n\tif (Object.is(value, -0)) return 0;\n\treturn value;\n};\n/** The application value a number-flavoured integer codec writes: the JS type it reads, within the range that type holds exactly. */\nconst encodableSafeInteger = (codecId, value) => {\n\trequireJsType(codecId, \"number\", value);\n\treturn safeIntegerNumber(codecId, value, \"RUNTIME.ENCODE_FAILED\");\n};\n/**\n* Converts an exact `bigint` into a safe-range `number`, comparing before any\n* conversion so an out-of-range value throws rather than rounds.\n*/\nconst safeIntegerFromBigint = (codecId, value) => {\n\tif (value < SAFE_INTEGER_BIGINT_RANGE.min || value > SAFE_INTEGER_BIGINT_RANGE.max) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `${codecId} value must be an integer within the safe integer range, got ${value}`, { meta: {\n\t\tcodecId,\n\t\treceived: value.toString()\n\t} });\n\treturn Number(value);\n};\n/** `sqlite/integer`'s stored form, read into a `number`: digit text within the safe integer range. */\nconst safeIntegerFromDigitText = (codecId, json) => Number(readJsonIntegerText(codecId, json, SAFE_INTEGER_BIGINT_RANGE));\n/** A `number` written as `sqlite/integer`'s stored form. */\nconst digitTextOfSafeInteger = (codecId, value) => String(encodableSafeInteger(codecId, value));\n/**\n* Reads an INTEGER's wire value into a `number`: the number the driver returns for a row, or the decimal text an include carries, because its projection casts the integer to text so that no digit is lost in JSON.\n*/\nfunction safeIntegerWire(codecId, wire) {\n\tif (typeof wire === \"number\") return wire;\n\tif (!DECIMAL_INTEGER.test(wire)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `${codecId} wire value must be an integer or its decimal text`, { meta: {\n\t\tcodecId,\n\t\treceived: wire\n\t} });\n\treturn safeIntegerFromBigint(codecId, BigInt(wire));\n}\n/**\n* Reads a REAL's wire value: the number the driver returns for a row, or the text `Infinity` or `-Infinity` an include carries, because JSON has no infinity.\n*/\nfunction floatWire(codecId, wire) {\n\tif (typeof wire === \"number\") return wire;\n\tif (wire === \"Infinity\") return Number.POSITIVE_INFINITY;\n\tif (wire === \"-Infinity\") return Number.NEGATIVE_INFINITY;\n\tthrow sqliteError(\"RUNTIME.DECODE_FAILED\", `${codecId} wire value must be a number, or the text Infinity or -Infinity`, { meta: {\n\t\tcodecId,\n\t\treceived: wire\n\t} });\n}\n/** The hex text SQLite's `hex()` writes: two uppercase digits for each byte. */\nconst BLOB_HEX_TEXT = /^(?:[0-9A-F]{2})*$/;\n/**\n* Projects a `sql/char@1` value without trailing spaces, as its `decode` reads it on a flat read, so an include reads the same value. SQLite does not pad the value; the rule is the family codec's.\n*/\nconst unpaddedCharJsonProjection = (expression) => FunctionCallExpr.of(\"rtrim\", [expression, LiteralExpr.of(\" \")]);\nconst sqliteSqlCharDescriptor = sqliteCodec(sqlCharDescriptor, {\n\tdataType: sqliteCharacter,\n\tjsonProjection: unpaddedCharJsonProjection,\n\tfactory: (descriptor, dataType, params) => () => new SqlCharCodec(descriptor, dataType, params)\n});\nconst sqliteSqlVarcharDescriptor = sqliteCodec(sqlVarcharDescriptor, {\n\tdataType: sqliteCharacterVarying,\n\tjsonProjection: identityJsonProjection,\n\tfactory: (descriptor, dataType, params) => () => new SqlVarcharCodec(descriptor, dataType, params)\n});\n/** `sql/int@1` as SQLite stores it: its stored form is `sqlite/integer`'s digit text. */\nvar SqliteSqlIntCodec = class extends SqlIntCodec {\n\tasync fromWire(wire, _ctx) {\n\t\treturn safeIntegerWire(this.id, wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn safeIntegerFromDigitText(this.id, value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(digitTextOfSafeInteger(this.id, input));\n\t}\n};\nconst sqliteSqlIntDescriptor = sqliteCodec(sqlIntDescriptor, {\n\tdataType: sqliteInteger,\n\tjsonProjection: decimalTextJsonProjection,\n\tfactory: (descriptor, dataType) => () => new SqliteSqlIntCodec(descriptor, dataType)\n});\nconst sqliteSqlFloatDescriptor = sqliteCodec(sqlFloatDescriptor, {\n\tdataType: sqliteReal,\n\tjsonProjection: floatJsonProjection,\n\tfactory: (descriptor, dataType) => () => new SqliteFloatCodec(descriptor, dataType)\n});\nvar SqliteTextCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn wire;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn value.value;\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input);\n\t}\n};\nvar SqliteTextDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tdataType = sqliteText.id;\n\tcodecId = SQLITE_TEXT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"textual\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqliteTextCodec(this, sqliteText);\n\t}\n};\nconst sqliteTextDescriptor = new SqliteTextDescriptor();\nconst sqliteTextColumn = () => column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, void 0);\nvar SqliteIntegerCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn value;\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn safeIntegerWire(SQLITE_INTEGER_CODEC_ID, wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn safeIntegerFromDigitText(SQLITE_INTEGER_CODEC_ID, value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(digitTextOfSafeInteger(SQLITE_INTEGER_CODEC_ID, input));\n\t}\n};\nvar SqliteIntegerDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn decimalTextJsonProjection(expression);\n\t}\n\tdataType = sqliteInteger.id;\n\tcodecId = SQLITE_INTEGER_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqliteIntegerCodec(this, sqliteInteger);\n\t}\n};\nconst sqliteIntegerDescriptor = new SqliteIntegerDescriptor();\nconst sqliteIntegerColumn = () => column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, void 0);\nvar SqliteRealCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn refuseNaN(SQLITE_REAL_CODEC_ID, value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn floatWire(SQLITE_REAL_CODEC_ID, wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn readJsonFloatWithoutNaN(SQLITE_REAL_CODEC_ID, value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(floatToJson(refuseNaN(SQLITE_REAL_CODEC_ID, input)));\n\t}\n};\nvar SqliteRealDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn floatJsonProjection(expression);\n\t}\n\tdataType = sqliteReal.id;\n\tcodecId = SQLITE_REAL_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqliteRealCodec(this, sqliteReal);\n\t}\n};\nconst sqliteRealDescriptor = new SqliteRealDescriptor();\nconst sqliteRealColumn = () => column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, void 0);\nvar SqliteBlobCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn value;\n\t}\n\t/** A row carries the blob's bytes; an include carries the array of their hex text that its projection writes, because SQLite's JSON functions refuse a blob. Anything else a BLOB column holds is refused. */\n\tasync fromWire(wire, _ctx) {\n\t\tif (wire instanceof Uint8Array) return wire;\n\t\tconst [hex] = Array.isArray(wire) && wire.length === 1 ? wire : [];\n\t\tif (typeof hex !== \"string\" || !BLOB_HEX_TEXT.test(hex)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/blob@1 wire value must be bytes, or the array of their hex text an include carries\", { meta: {\n\t\t\tcodecId: SQLITE_BLOB_CODEC_ID,\n\t\t\treceived: String(wire)\n\t\t} });\n\t\treturn new Uint8Array(Buffer.from(hex, \"hex\"));\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn new Uint8Array(Buffer.from(value.value, \"hex\"));\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(Buffer.from(input).toString(\"hex\").toUpperCase());\n\t}\n};\nvar SqliteBlobDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn hexJsonProjection(expression);\n\t}\n\tdataType = sqliteBlob.id;\n\tcodecId = SQLITE_BLOB_CODEC_ID;\n\ttraits = [\"equality\"];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqliteBlobCodec(this, sqliteBlob);\n\t}\n};\nconst sqliteBlobDescriptor = new SqliteBlobDescriptor();\nconst sqliteBlobColumn = () => column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, void 0);\n/**\n* Reads what SQLite holds for an instant as `Date` reads it, with text without a UTC offset read as UTC, as SQLite's own date and time functions read it, never in the machine's time zone. A number is milliseconds since 1970, as the Prisma ORM query engine wrote a `DateTime`. Digits below a millisecond are cut, as `Date` cuts them.\n*/\nfunction decodeSqliteDatetime(value) {\n\tconst date = new Date(typeof value === \"number\" ? value : asUtcWhenUnmarked(value));\n\tif (Number.isNaN(date.getTime())) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `sqlite/datetime@1 wire value must be a date and time as text, or a number of milliseconds since 1970: ${String(value)}`, { meta: {\n\t\tcodecId: SQLITE_DATETIME_CODEC_ID,\n\t\treceived: String(value)\n\t} });\n\treturn date;\n}\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst DATE_TIME_WITHOUT_OFFSET = /^(\\d{4}-\\d{2}-\\d{2})[Tt ](\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d+)?)?)$/;\n/** A date alone as its midnight in UTC, and a date and time without an offset as UTC. */\nfunction asUtcWhenUnmarked(text) {\n\tif (DATE_ONLY.test(text)) return `${text}T00:00:00Z`;\n\tconst unmarked = DATE_TIME_WITHOUT_OFFSET.exec(text);\n\treturn unmarked === null ? text : `${unmarked[1]}T${unmarked[2]}Z`;\n}\n/** The text SQLite holds for an instant: what the codec writes for every row, and for a default. */\nfunction encodeSqliteDatetime(value) {\n\treturn value.toISOString();\n}\nvar SqliteDatetimeCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn encodeSqliteDatetime(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn decodeSqliteDatetime(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn new Date(value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(input.toISOString());\n\t}\n};\nvar SqliteDatetimeDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tdataType = sqliteDatetime.id;\n\tcodecId = SQLITE_DATETIME_CODEC_ID;\n\ttraits = [\"equality\", \"order\"];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqliteDatetimeCodec(this, sqliteDatetime);\n\t}\n};\nconst sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();\nconst sqliteDatetimeColumn = () => column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, void 0);\nvar SqliteJsonCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn JSON.stringify(value);\n\t}\n\tasync fromWire(wire, _ctx) {\n\t\treturn typeof wire === \"string\" ? blindCast(JSON.parse(wire)) : wire;\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn blindCast(JSON.parse(value.value));\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(JSON.stringify(input));\n\t}\n};\n/**\n* The column stores the document's JSON text and the stored form is that text, so the stored\n* value is projected as it is: a string the enclosing JSON constructor embeds as a string.\n*/\nvar SqliteJsonDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn expression;\n\t}\n\tdataType = sqliteJson.id;\n\tcodecId = SQLITE_JSON_CODEC_ID;\n\ttraits = [\"equality\"];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqliteJsonCodec(this, sqliteJson);\n\t}\n};\nconst sqliteJsonDescriptor = new SqliteJsonDescriptor();\nconst sqliteJsonColumn = () => column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, void 0);\nvar SqliteBigintCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\trequireJsType(SQLITE_BIGINT_CODEC_ID, \"bigint\", value);\n\t\treturn value;\n\t}\n\t/**\n\t* The wire value is text wherever the value could outrun a JS number: an\n\t* aggregate SQLite computes leaves the database through the descriptor's cast\n\t* to text, because the driver reads an integer no number can hold as an error\n\t* rather than a value. A number-typed wire value must therefore be a safe\n\t* integer — past ±(2^53 − 1) it has already rounded, and converting it would\n\t* mint a spuriously-exact `bigint` that need not equal the stored value.\n\t*/\n\tasync fromWire(wire, _ctx) {\n\t\tif (typeof wire === \"number\" && !Number.isSafeInteger(wire)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", `sqlite/bigint@1 wire number must be an integer within the safe integer range, got ${String(wire)}`, { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\treceived: String(wire)\n\t\t} });\n\t\tif (typeof wire === \"string\" && !DECIMAL_INTEGER.test(wire)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/bigint@1 wire value must be a decimal string\", { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_CODEC_ID,\n\t\t\treceived: wire\n\t\t} });\n\t\treturn BigInt(wire);\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn BigInt(value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(bigintEncodeJson(SQLITE_BIGINT_CODEC_ID, input));\n\t}\n};\nvar SqliteBigintDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn decimalTextJsonProjection(expression);\n\t}\n\tdataType = sqliteInteger.id;\n\tcodecId = SQLITE_BIGINT_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\tfactory() {\n\t\treturn () => new SqliteBigintCodec(this, sqliteInteger);\n\t}\n};\nconst sqliteBigintDescriptor = new SqliteBigintDescriptor();\nconst sqliteBigintColumn = () => column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, void 0);\n/**\n* A SQLite INTEGER decoded as a JS `number`, for columns whose values stay\n* within the safe integer range ±(2^53 − 1). Both directions guard rather than\n* round: decode (wire and JSON) and encode throw a structured error on\n* out-of-range or non-integral input. The canonical JSON is the decimal text\n* `sqlite/integer` carries, which every codec of that data type shares.\n*/\nvar SqliteBigintNumberCodec = class extends CodecImpl {\n\tasync toWire(value, _ctx) {\n\t\treturn encodableSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, value);\n\t}\n\t/**\n\t* The driver hands an INTEGER over as a `number` or, in safe-integer mode, a\n\t* `bigint`; a bigint (or decimal text) is range-checked exactly before any\n\t* conversion to `number`, so an out-of-range value throws rather than rounds.\n\t*/\n\tasync fromWire(wire, _ctx) {\n\t\tif (typeof wire === \"number\") return safeIntegerNumber(SQLITE_BIGINT_NUMBER_CODEC_ID, wire, \"RUNTIME.DECODE_FAILED\");\n\t\tif (typeof wire === \"string\" && !DECIMAL_INTEGER.test(wire)) throw sqliteError(\"RUNTIME.DECODE_FAILED\", \"sqlite/bigintnumber@1 wire value must be a decimal string\", { meta: {\n\t\t\tcodecId: SQLITE_BIGINT_NUMBER_CODEC_ID,\n\t\t\treceived: wire\n\t\t} });\n\t\treturn safeIntegerFromBigint(SQLITE_BIGINT_NUMBER_CODEC_ID, BigInt(wire));\n\t}\n\tfromDataTypeValue(value) {\n\t\treturn safeIntegerFromDigitText(SQLITE_BIGINT_NUMBER_CODEC_ID, value.value);\n\t}\n\ttoDataTypeValue(input) {\n\t\treturn this.dataTypeValueOf(digitTextOfSafeInteger(SQLITE_BIGINT_NUMBER_CODEC_ID, input));\n\t}\n};\nvar SqliteBigintNumberDescriptor = class extends SqliteCodecDescriptor {\n\tjsonProjection(expression) {\n\t\treturn decimalTextJsonProjection(expression);\n\t}\n\tdataType = sqliteInteger.id;\n\tcodecId = SQLITE_BIGINT_NUMBER_CODEC_ID;\n\ttraits = [\n\t\t\"equality\",\n\t\t\"order\",\n\t\t\"numeric\"\n\t];\n\tparamsSchema = void 0;\n\trenderValueLiteral(value) {\n\t\treturn decimalTextNumberLiteral(value);\n\t}\n\tfactory() {\n\t\treturn () => new SqliteBigintNumberCodec(this, sqliteInteger);\n\t}\n};\nconst sqliteBigintNumberDescriptor = new SqliteBigintNumberDescriptor();\nconst sqliteBigintNumberColumn = () => column(sqliteBigintNumberDescriptor.factory(), sqliteBigintNumberDescriptor.codecId, void 0);\nconst codecDescriptors = defineSqliteCodecs([\n\tsqliteSqlCharDescriptor,\n\tsqliteSqlVarcharDescriptor,\n\tsqliteSqlIntDescriptor,\n\tsqliteSqlFloatDescriptor,\n\tsqliteTextDescriptor,\n\tsqliteIntegerDescriptor,\n\tsqliteRealDescriptor,\n\tsqliteBlobDescriptor,\n\tsqliteDatetimeDescriptor,\n\tsqliteJsonDescriptor,\n\tsqliteBigintDescriptor,\n\tsqliteBigintNumberDescriptor\n]);\n//#endregion\nexport { sqliteBigintNumberColumn as a, sqliteIntegerColumn as c, sqliteTextColumn as d, sqliteBigintColumn as i, sqliteJsonColumn as l, encodeSqliteDatetime as n, sqliteBlobColumn as o, jsonDocumentRetag as r, sqliteDatetimeColumn as s, codecDescriptors as t, sqliteRealColumn as u };\n\n//# sourceMappingURL=codecs-xH8Su5NY.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,MAAM,0BAA0B,eAAe;;;;;;;;;AAS/C,MAAM,6BAA6B,eAAe,SAAS,GAAG,YAAY,MAAM;;;;;;;;;AAShF,MAAM,qBAAqB,eAAe,SAAS,GAAG,CAAC;CACtD,WAAW,WAAW,GAAG,iBAAiB,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG,YAAY,GAAG,MAAM,CAAC;CAC5F,OAAO,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AACpF,CAAC,GAAG,UAAU;;;;AAId,MAAM,uBAAuB,eAAe,SAAS,GAAG,CAAC;CACxD,WAAW,WAAW,GAAG,YAAY,YAAY,GAAG,OAAO,iBAAiB,CAAC;CAC7E,OAAO,YAAY,GAAG,UAAU;AACjC,GAAG;CACF,WAAW,WAAW,GAAG,YAAY,YAAY,GAAG,OAAO,iBAAiB,CAAC;CAC7E,OAAO,YAAY,GAAG,WAAW;AAClC,CAAC,GAAG,UAAU;AACd,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;AAqBtB,MAAM,qBAAqB,eAAe,YAAY,UAAU,IAAI,aAAa,iBAAiB,GAAG,eAAe,CAAC,UAAU,CAAC;;AAEhI,MAAM,eAAe,eAAe,sB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