@prisma/orm-target-sqlite 8.0.0-rc.22-dev.3 → 8.0.0-rc.22-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{adapter-xs2nBMBo.d.mts → adapter-etFmhVd4.d.mts} +7 -7
- package/dist/{adapter-xs2nBMBo.d.mts.map → adapter-etFmhVd4.d.mts.map} +1 -1
- package/dist/{adapter-Cff01Cgi-C19Fhc2M.mjs → adapter-gpb0ICA2-DPjB1dMR.mjs} +21 -11
- package/dist/adapter-gpb0ICA2-DPjB1dMR.mjs.map +1 -0
- package/dist/{adapter-xFPDhkod-BsdLsy9N.d.mts → adapter-xFPDhkod-Cio6up_5.d.mts} +3 -3
- package/dist/{adapter-xFPDhkod-BsdLsy9N.d.mts.map → adapter-xFPDhkod-Cio6up_5.d.mts.map} +1 -1
- package/dist/adapter.d.mts +11 -11
- package/dist/adapter.mjs +6 -6
- package/dist/adapter__adapter.d.mts +2 -2
- package/dist/adapter__adapter.mjs +2 -2
- package/dist/adapter__codec-types.d.mts +3 -3
- package/dist/adapter__column-types.d.mts +1 -1
- package/dist/adapter__column-types.mjs +1 -1
- package/dist/adapter__control.d.mts +3 -3
- 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 +22 -13
- 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 +2 -2
- package/dist/{aggregates-DC8nyCjN.d.mts → aggregates-Bee9csBL.d.mts} +6 -6
- package/dist/{aggregates-DC8nyCjN.d.mts.map → aggregates-Bee9csBL.d.mts.map} +1 -1
- package/dist/{aggregates-D5fuFVMC.mjs → aggregates-DMvLJFlR.mjs} +9 -3
- package/dist/aggregates-DMvLJFlR.mjs.map +1 -0
- package/dist/codec-ids-9Fs9p6ST.d.mts +1 -0
- package/dist/codec-ids-BElbEYb_-CeWfv5bC.d.mts +21 -0
- package/dist/codec-ids-BElbEYb_-CeWfv5bC.d.mts.map +1 -0
- package/dist/codec-ids-BHBFCNsQ-C1Af_LGF.mjs +21 -0
- package/dist/codec-ids-BHBFCNsQ-C1Af_LGF.mjs.map +1 -0
- package/dist/codec-types-BQCSRfvR.d.mts +1 -0
- package/dist/{codec-types-COh75Bop-CUehAexc.d.mts → codec-types-CG5ZkqDU-DCx8ZvBg.d.mts} +10 -3
- package/dist/codec-types-CG5ZkqDU-DCx8ZvBg.d.mts.map +1 -0
- package/dist/codec-types-YpVaNlY0.d.mts +2 -0
- package/dist/{codecs-BJYruC-a-BKDGae3k.d.mts → codecs-BqOj4EKm-BaGeNd2m.d.mts} +127 -4
- package/dist/codecs-BqOj4EKm-BaGeNd2m.d.mts.map +1 -0
- package/dist/codecs-DzkRnjjE.d.mts +1 -0
- package/dist/{codecs-yZoH21Yj-lQXtGlEq.mjs → codecs-My4bmOU6-D4-b5qLd.mjs} +350 -22
- package/dist/codecs-My4bmOU6-D4-b5qLd.mjs.map +1 -0
- package/dist/{codecs-g-YI3BtK.mjs → codecs-R3kGRyq2.mjs} +2 -2
- package/dist/codecs-R3kGRyq2.mjs.map +1 -0
- package/dist/{column-types-Dxm0BpPv.d.mts → column-types-bTPNfz46.d.mts} +3 -3
- package/dist/{column-types-Dxm0BpPv.d.mts.map → column-types-bTPNfz46.d.mts.map} +1 -1
- package/dist/{column-types-DcbNOYVb.mjs → column-types-toYbR7mn.mjs} +2 -2
- package/dist/{column-types-DcbNOYVb.mjs.map → column-types-toYbR7mn.mjs.map} +1 -1
- package/dist/{contract-contributions-wweWdXMK-CN-d35Rj.mjs → contract-contributions-wweWdXMK-CwYZg4jC.mjs} +2 -2
- package/dist/{contract-contributions-wweWdXMK-CN-d35Rj.mjs.map → contract-contributions-wweWdXMK-CwYZg4jC.mjs.map} +1 -1
- package/dist/{contract-free-CYl1uzJ8.mjs → contract-free-BH73BZHy.mjs} +4 -4
- package/dist/{contract-free-CYl1uzJ8.mjs.map → contract-free-BH73BZHy.mjs.map} +1 -1
- package/dist/control-DGa_C2q6.d.mts +242 -0
- package/dist/control-DGa_C2q6.d.mts.map +1 -0
- package/dist/{control-VMpMSXk9.d.mts → control-DXzV_IVS.d.mts} +4 -4
- package/dist/{control-VMpMSXk9.d.mts.map → control-DXzV_IVS.d.mts.map} +1 -1
- package/dist/{data-type-entries-yQ-qYugg-C_NnX5WO.mjs → data-type-entries-Cp4hBeJB-DYer43by.mjs} +30 -3
- package/dist/data-type-entries-Cp4hBeJB-DYer43by.mjs.map +1 -0
- package/dist/{data-types-Dx3rHsbF.d.mts → data-types-CwpMoNK4.d.mts} +22 -2
- package/dist/data-types-CwpMoNK4.d.mts.map +1 -0
- package/dist/{data-types-coQrCWfS-yMCe4F52.mjs → data-types-DXMZNR8j-CWrJOA8C.mjs} +79 -4
- package/dist/data-types-DXMZNR8j-CWrJOA8C.mjs.map +1 -0
- package/dist/date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs +64 -0
- package/dist/date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs.map +1 -0
- package/dist/datetime-text-CbgLX4q3-BKp563Ja.mjs +32 -0
- package/dist/datetime-text-CbgLX4q3-BKp563Ja.mjs.map +1 -0
- package/dist/{ddl-BoTU7bCZ-CXNSFEtj.mjs → ddl-BvD-wVtg-BoEWa8CG.mjs} +3 -3
- package/dist/{ddl-BoTU7bCZ-CXNSFEtj.mjs.map → ddl-BvD-wVtg-BoEWa8CG.mjs.map} +1 -1
- package/dist/{default-normalizer-DGMXypHg-CPf7oyZA.mjs → default-normalizer-CsMhUEOe-CRieDElD.mjs} +23 -11
- package/dist/default-normalizer-CsMhUEOe-CRieDElD.mjs.map +1 -0
- package/dist/{default-normalizer-CkHy3JYk.d.mts → default-normalizer-CtNsZNRZ.d.mts} +3 -3
- package/dist/{default-normalizer-CkHy3JYk.d.mts.map → default-normalizer-CtNsZNRZ.d.mts.map} +1 -1
- package/dist/descriptor-meta-BwJWbIVt-B24ey04f.mjs +280 -0
- package/dist/descriptor-meta-BwJWbIVt-B24ey04f.mjs.map +1 -0
- package/dist/{descriptor-meta-DrNwC4vO-D7vuA6QK.mjs → descriptor-meta-DrNwC4vO-B9xeeDp9.mjs} +3 -3
- package/dist/{descriptor-meta-DrNwC4vO-D7vuA6QK.mjs.map → descriptor-meta-DrNwC4vO-B9xeeDp9.mjs.map} +1 -1
- package/dist/errors-D9vZNPSI-DoNmdfv7.mjs +105 -0
- package/dist/errors-D9vZNPSI-DoNmdfv7.mjs.map +1 -0
- package/dist/{migration-D0UlBTQw.mjs → migration-DYyfcQB_.mjs} +2 -2
- package/dist/{migration-D0UlBTQw.mjs.map → migration-DYyfcQB_.mjs.map} +1 -1
- package/dist/{op-factory-call-DADakw8V-yXzHuXlv.mjs → op-factory-call-BQYECylm-K7S_xgRS.mjs} +6 -6
- package/dist/{op-factory-call-DADakw8V-yXzHuXlv.mjs.map → op-factory-call-BQYECylm-K7S_xgRS.mjs.map} +1 -1
- package/dist/{pack-DqL_HWJX.d.mts → pack-CwFlRihn.d.mts} +179 -10
- package/dist/{pack-DqL_HWJX.d.mts.map → pack-CwFlRihn.d.mts.map} +1 -1
- package/dist/{planner-1zVd0jR2-mkF3bIWw.mjs → planner-DNwf8s8s-BoXZwpVs.mjs} +5 -5
- package/dist/{planner-1zVd0jR2-mkF3bIWw.mjs.map → planner-DNwf8s8s-BoXZwpVs.mjs.map} +1 -1
- package/dist/{planner-produced-sqlite-migration-Dgme3v9a-BzrIbSW_.mjs → planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs} +4 -4
- package/dist/{planner-produced-sqlite-migration-Dgme3v9a-BzrIbSW_.mjs.map → planner-produced-sqlite-migration-Z9OWyjQn-DGMHz6I1.mjs.map} +1 -1
- package/dist/{render-ops-CwuscSzF-D3hoxOT_.mjs → render-ops-CJXrOY63-1y0nLsb8.mjs} +4 -4
- package/dist/{render-ops-CwuscSzF-D3hoxOT_.mjs.map → render-ops-CJXrOY63-1y0nLsb8.mjs.map} +1 -1
- package/dist/require-temporal-qbyZfPgl-DGJhYwmE.mjs +16 -0
- package/dist/require-temporal-qbyZfPgl-DGJhYwmE.mjs.map +1 -0
- package/dist/{runtime-YfPIbtO6.d.mts → runtime-BQKQH94p.d.mts} +2 -2
- package/dist/{runtime-YfPIbtO6.d.mts.map → runtime-BQKQH94p.d.mts.map} +1 -1
- package/dist/{runtime-CjIoI3sa.d.mts → runtime-ZsuC__oX.d.mts} +33 -2
- package/dist/runtime-ZsuC__oX.d.mts.map +1 -0
- package/dist/sql-renderer-CgY2Sghp.d.mts +1 -0
- package/dist/{sql-utils-XGT5Esi2-Zr2mqJf8.mjs → sql-utils-C9blmi9x-B90QedVA.mjs} +3 -3
- package/dist/{sql-utils-XGT5Esi2-Zr2mqJf8.mjs.map → sql-utils-C9blmi9x-B90QedVA.mjs.map} +1 -1
- package/dist/sqlite-contract-view-DJhc7pI7-Db5l4qrA.mjs +51 -0
- package/dist/sqlite-contract-view-DJhc7pI7-Db5l4qrA.mjs.map +1 -0
- package/dist/{sqlite-migration-BLyz5GQr-BMImgGTB.mjs → sqlite-migration-BxQ65pKq-C7siJGuR.mjs} +13 -10
- package/dist/sqlite-migration-BxQ65pKq-C7siJGuR.mjs.map +1 -0
- package/dist/{sqlite-contract-view-CGfiGvKH-CT-JjNHd.mjs → sqlite-unbound-database-Df3Wf5ZA-B1QemRgb.mjs} +5 -49
- package/dist/sqlite-unbound-database-Df3Wf5ZA-B1QemRgb.mjs.map +1 -0
- package/dist/target.d.mts +14 -13
- package/dist/target.mjs +22 -20
- package/dist/target__aggregates.d.mts +1 -1
- package/dist/target__aggregates.mjs +1 -1
- package/dist/target__codec-ids.d.mts +3 -3
- package/dist/target__codec-ids.mjs +2 -2
- package/dist/target__codec-types.d.mts +3 -3
- package/dist/target__codecs.d.mts +3 -3
- package/dist/target__codecs.mjs +4 -4
- package/dist/target__contract-free.mjs +2 -2
- package/dist/target__control.d.mts +2 -2
- package/dist/target__control.mjs +42 -36
- package/dist/target__control.mjs.map +1 -1
- package/dist/target__data-types.d.mts +2 -2
- package/dist/target__data-types.mjs +3 -3
- package/dist/target__default-normalizer.d.mts +1 -1
- package/dist/target__default-normalizer.mjs +1 -1
- 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.d.mts +2 -2
- package/dist/target__runtime.mjs +3 -3
- package/dist/target__runtime.mjs.map +1 -1
- package/dist/target__sql-utils.mjs +1 -1
- package/dist/target__types.d.mts +2 -0
- package/dist/target__types.mjs +2 -0
- package/dist/types-COqCbSev.d.mts +56 -0
- package/dist/types-COqCbSev.d.mts.map +1 -0
- package/dist/{types-y5JlAv97.d.mts → types-DpDK9e9U.d.mts} +1 -1
- package/package.json +18 -12
- package/dist/adapter-Cff01Cgi-C19Fhc2M.mjs.map +0 -1
- package/dist/aggregates-D5fuFVMC.mjs.map +0 -1
- package/dist/codec-ids-CMbhYIsa.d.mts +0 -1
- package/dist/codec-ids-DuJYssXV-BPKbFNRL.d.mts +0 -14
- package/dist/codec-ids-DuJYssXV-BPKbFNRL.d.mts.map +0 -1
- package/dist/codec-ids-wgEvkCkg-WltuexMR.mjs +0 -14
- package/dist/codec-ids-wgEvkCkg-WltuexMR.mjs.map +0 -1
- package/dist/codec-types-COh75Bop-CUehAexc.d.mts.map +0 -1
- package/dist/codec-types-ELHfd82J.d.mts +0 -2
- package/dist/codec-types-PONhVn74.d.mts +0 -1
- package/dist/codecs-BJYruC-a-BKDGae3k.d.mts.map +0 -1
- package/dist/codecs-Dn0xoCuf.d.mts +0 -1
- package/dist/codecs-g-YI3BtK.mjs.map +0 -1
- package/dist/codecs-yZoH21Yj-lQXtGlEq.mjs.map +0 -1
- package/dist/control-jYLWcPv2.d.mts +0 -130
- package/dist/control-jYLWcPv2.d.mts.map +0 -1
- package/dist/data-type-entries-yQ-qYugg-C_NnX5WO.mjs.map +0 -1
- package/dist/data-types-Dx3rHsbF.d.mts.map +0 -1
- package/dist/data-types-coQrCWfS-yMCe4F52.mjs.map +0 -1
- package/dist/datetime-text-Bniwehv--BSQhnrdE.mjs +0 -9
- package/dist/datetime-text-Bniwehv--BSQhnrdE.mjs.map +0 -1
- package/dist/default-normalizer-DGMXypHg-CPf7oyZA.mjs.map +0 -1
- package/dist/descriptor-meta-BNuC8mOJ-BfS3KaDU.mjs +0 -105
- package/dist/descriptor-meta-BNuC8mOJ-BfS3KaDU.mjs.map +0 -1
- package/dist/descriptor-meta-runtime-DX2JfHWF-Dbsh5NP8.mjs +0 -15
- package/dist/descriptor-meta-runtime-DX2JfHWF-Dbsh5NP8.mjs.map +0 -1
- package/dist/errors-DnR-sMHS-D_gh214a.mjs +0 -38
- package/dist/errors-DnR-sMHS-D_gh214a.mjs.map +0 -1
- package/dist/runtime-CjIoI3sa.d.mts.map +0 -1
- package/dist/sql-renderer-brQ96quu.d.mts +0 -1
- package/dist/sqlite-contract-view-CGfiGvKH-CT-JjNHd.mjs.map +0 -1
- package/dist/sqlite-migration-BLyz5GQr-BMImgGTB.mjs.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { o as sqliteDataTypes } from "./data-types-DXMZNR8j-CWrJOA8C.mjs";
|
|
2
|
+
import { t as requireTemporal } from "./require-temporal-qbyZfPgl-DGJhYwmE.mjs";
|
|
3
|
+
import * as nowValues from "@prisma/orm-framework/type-implementations/now";
|
|
4
|
+
import { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from "@prisma/orm-framework/type-implementations/now";
|
|
5
|
+
//#region ../../../3-targets/sqlite/1-target/dist/date-time-now-generators-T8JO6gR6.mjs
|
|
6
|
+
const sqliteTargetDescriptorMetaRuntime = {
|
|
7
|
+
kind: "target",
|
|
8
|
+
familyId: "sql",
|
|
9
|
+
targetId: "sqlite",
|
|
10
|
+
id: "sqlite",
|
|
11
|
+
version: "0.0.1",
|
|
12
|
+
capabilities: {},
|
|
13
|
+
dataTypes: sqliteDataTypes
|
|
14
|
+
};
|
|
15
|
+
/** SQLite's date and time types hold milliseconds. */
|
|
16
|
+
const MILLISECOND_DIGITS = 3;
|
|
17
|
+
function instantNow() {
|
|
18
|
+
return nowValues.instantNow(requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);
|
|
19
|
+
}
|
|
20
|
+
function plainDateNow() {
|
|
21
|
+
return nowValues.plainDateNow(requireTemporal({ generatorId: PLAIN_DATE_NOW_GENERATOR_ID }));
|
|
22
|
+
}
|
|
23
|
+
function plainTimeNow() {
|
|
24
|
+
return nowValues.plainTimeNow(requireTemporal({ generatorId: PLAIN_TIME_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);
|
|
25
|
+
}
|
|
26
|
+
function instantStringNow() {
|
|
27
|
+
return nowValues.instantStringNow(MILLISECOND_DIGITS, "fixed");
|
|
28
|
+
}
|
|
29
|
+
function timeStringNow() {
|
|
30
|
+
return nowValues.timeStringNow(MILLISECOND_DIGITS, "fixed");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The SQLite "now" generators, one per date and time codec except `sqlite/datetime@1`, which uses the SQL family's `timestampNow`. All read the clock through `Date.now()`, write UTC and keep milliseconds, which every SQLite date and time type holds. The string generators write the text their type stores, with three fraction digits.
|
|
34
|
+
*/
|
|
35
|
+
const sqliteNowGenerators = [
|
|
36
|
+
{
|
|
37
|
+
id: INSTANT_NOW_GENERATOR_ID,
|
|
38
|
+
generate: instantNow
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: PLAIN_DATE_NOW_GENERATOR_ID,
|
|
42
|
+
generate: plainDateNow
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: PLAIN_TIME_NOW_GENERATOR_ID,
|
|
46
|
+
generate: plainTimeNow
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: INSTANT_STRING_NOW_GENERATOR_ID,
|
|
50
|
+
generate: instantStringNow
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: DATE_STRING_NOW_GENERATOR_ID,
|
|
54
|
+
generate: nowValues.dateStringNow
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: TIME_STRING_NOW_GENERATOR_ID,
|
|
58
|
+
generate: timeStringNow
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
//#endregion
|
|
62
|
+
export { sqliteTargetDescriptorMetaRuntime as n, sqliteNowGenerators as t };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/date-time-now-generators-T8JO6gR6.mjs"],"sourcesContent":["import { o as sqliteDataTypes } from \"./data-types-DXMZNR8j.mjs\";\nimport { t as requireTemporal } from \"./require-temporal-qbyZfPgl.mjs\";\nimport * as nowValues from \"@internal/type-implementations/now\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from \"@internal/type-implementations/now\";\nconst sqliteTargetDescriptorMetaRuntime = {\n\tkind: \"target\",\n\tfamilyId: \"sql\",\n\ttargetId: \"sqlite\",\n\tid: \"sqlite\",\n\tversion: \"0.0.1\",\n\tcapabilities: {},\n\tdataTypes: sqliteDataTypes\n};\n//#endregion\n//#region src/core/date-time-now-generators.ts\n/** SQLite's date and time types hold milliseconds. */\nconst MILLISECOND_DIGITS = 3;\nfunction instantNow() {\n\treturn nowValues.instantNow(requireTemporal({ generatorId: INSTANT_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);\n}\nfunction plainDateNow() {\n\treturn nowValues.plainDateNow(requireTemporal({ generatorId: PLAIN_DATE_NOW_GENERATOR_ID }));\n}\nfunction plainTimeNow() {\n\treturn nowValues.plainTimeNow(requireTemporal({ generatorId: PLAIN_TIME_NOW_GENERATOR_ID }), MILLISECOND_DIGITS);\n}\nfunction instantStringNow() {\n\treturn nowValues.instantStringNow(MILLISECOND_DIGITS, \"fixed\");\n}\nfunction timeStringNow() {\n\treturn nowValues.timeStringNow(MILLISECOND_DIGITS, \"fixed\");\n}\n/**\n* The SQLite \"now\" generators, one per date and time codec except `sqlite/datetime@1`, which uses the SQL family's `timestampNow`. All read the clock through `Date.now()`, write UTC and keep milliseconds, which every SQLite date and time type holds. The string generators write the text their type stores, with three fraction digits.\n*/\nconst sqliteNowGenerators = [\n\t{\n\t\tid: INSTANT_NOW_GENERATOR_ID,\n\t\tgenerate: instantNow\n\t},\n\t{\n\t\tid: PLAIN_DATE_NOW_GENERATOR_ID,\n\t\tgenerate: plainDateNow\n\t},\n\t{\n\t\tid: PLAIN_TIME_NOW_GENERATOR_ID,\n\t\tgenerate: plainTimeNow\n\t},\n\t{\n\t\tid: INSTANT_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: instantStringNow\n\t},\n\t{\n\t\tid: DATE_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: nowValues.dateStringNow\n\t},\n\t{\n\t\tid: TIME_STRING_NOW_GENERATOR_ID,\n\t\tgenerate: timeStringNow\n\t}\n];\n//#endregion\nexport { sqliteTargetDescriptorMetaRuntime as n, sqliteNowGenerators as t };\n\n//# sourceMappingURL=date-time-now-generators-T8JO6gR6.mjs.map"],"mappings":";;;;;AAIA,MAAM,oCAAoC;CACzC,MAAM;CACN,UAAU;CACV,UAAU;CACV,IAAI;CACJ,SAAS;CACT,cAAc,CAAC;CACf,WAAW;AACZ;;AAIA,MAAM,qBAAqB;AAC3B,SAAS,aAAa;CACrB,OAAO,UAAU,WAAW,gBAAgB,EAAE,aAAa,yBAAyB,CAAC,GAAG,kBAAkB;AAC3G;AACA,SAAS,eAAe;CACvB,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,CAAC;AAC5F;AACA,SAAS,eAAe;CACvB,OAAO,UAAU,aAAa,gBAAgB,EAAE,aAAa,4BAA4B,CAAC,GAAG,kBAAkB;AAChH;AACA,SAAS,mBAAmB;CAC3B,OAAO,UAAU,iBAAiB,oBAAoB,OAAO;AAC9D;AACA,SAAS,gBAAgB;CACxB,OAAO,UAAU,cAAc,oBAAoB,OAAO;AAC3D;;;;AAIA,MAAM,sBAAsB;CAC3B;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU;CACX;CACA;EACC,IAAI;EACJ,UAAU,UAAU;CACrB;CACA;EACC,IAAI;EACJ,UAAU;CACX;AACD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { _ as sqliteText, a as sqliteCharacterVarying, l as sqliteDatetime, r as sqliteCharacter, s as sqliteDate, y as sqliteTime } from "./data-types-DXMZNR8j-CWrJOA8C.mjs";
|
|
2
|
+
import { sqlRawDataType } from "@prisma/orm-family-sql/contract/data-type";
|
|
3
|
+
//#region ../../../3-targets/sqlite/1-target/dist/datetime-text-CbgLX4q3.mjs
|
|
4
|
+
/** The `strftime` format for the text `encodeSqliteDatetime` writes. */
|
|
5
|
+
const SQLITE_DATETIME_TEXT_FORMAT = "%Y-%m-%dT%H:%M:%fZ";
|
|
6
|
+
/** The SQLite expression for the current instant, as the text `encodeSqliteDatetime` writes. */
|
|
7
|
+
const SQLITE_NOW_EXPRESSION = `strftime('${SQLITE_DATETIME_TEXT_FORMAT}','now')`;
|
|
8
|
+
/** The SQLite expression for the current date in UTC, as `sqlite/date` stores it. */
|
|
9
|
+
const SQLITE_DATE_NOW_EXPRESSION = "date('now')";
|
|
10
|
+
/** The `strftime` format for the text `sqlite/time` stores. */
|
|
11
|
+
const SQLITE_TIME_TEXT_FORMAT = "%H:%M:%f";
|
|
12
|
+
/** The SQLite expression for the current time of day in UTC, as `sqlite/time` stores it. */
|
|
13
|
+
const SQLITE_TIME_NOW_EXPRESSION = `strftime('${SQLITE_TIME_TEXT_FORMAT}','now')`;
|
|
14
|
+
const NOW_EXPRESSION_BY_DATA_TYPE = /* @__PURE__ */ new Map([
|
|
15
|
+
[sqliteDatetime.id, SQLITE_NOW_EXPRESSION],
|
|
16
|
+
[sqliteDate.id, SQLITE_DATE_NOW_EXPRESSION],
|
|
17
|
+
[sqliteTime.id, SQLITE_TIME_NOW_EXPRESSION],
|
|
18
|
+
[sqliteText.id, SQLITE_NOW_EXPRESSION],
|
|
19
|
+
[sqliteCharacter.id, SQLITE_NOW_EXPRESSION],
|
|
20
|
+
[sqliteCharacterVarying.id, SQLITE_NOW_EXPRESSION],
|
|
21
|
+
[sqlRawDataType.id, SQLITE_NOW_EXPRESSION]
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* The expression a `now()` default is written as on a column of `dataTypeId`: the current date or time of day on `sqlite/date` and `sqlite/time`, the current instant on `sqlite/datetime`, on text, on a raw column, whose values Prisma does not read, and on a column of no known data type. `undefined` on a data type that stores no date or time, such as `sqlite/duration` or `sqlite/integer`, as PostgreSQL refuses `now()` on an `interval` or an `integer` column.
|
|
25
|
+
*/
|
|
26
|
+
function sqliteNowExpressionFor(dataTypeId) {
|
|
27
|
+
return dataTypeId === void 0 ? SQLITE_NOW_EXPRESSION : NOW_EXPRESSION_BY_DATA_TYPE.get(dataTypeId);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { SQLITE_TIME_TEXT_FORMAT as a, SQLITE_TIME_NOW_EXPRESSION as i, SQLITE_DATE_NOW_EXPRESSION as n, sqliteNowExpressionFor as o, SQLITE_NOW_EXPRESSION as r, SQLITE_DATETIME_TEXT_FORMAT as t };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=datetime-text-CbgLX4q3-BKp563Ja.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datetime-text-CbgLX4q3-BKp563Ja.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/datetime-text-CbgLX4q3.mjs"],"sourcesContent":["import { _ as sqliteText, a as sqliteCharacterVarying, l as sqliteDatetime, r as sqliteCharacter, s as sqliteDate, y as sqliteTime } from \"./data-types-DXMZNR8j.mjs\";\nimport { sqlRawDataType } from \"@internal/sql-contract/data-type\";\n//#region src/core/datetime-text.ts\n/** The `strftime` format for the text `encodeSqliteDatetime` writes. */\nconst SQLITE_DATETIME_TEXT_FORMAT = \"%Y-%m-%dT%H:%M:%fZ\";\n/** The SQLite expression for the current instant, as the text `encodeSqliteDatetime` writes. */\nconst SQLITE_NOW_EXPRESSION = `strftime('${SQLITE_DATETIME_TEXT_FORMAT}','now')`;\n/** The SQLite expression for the current date in UTC, as `sqlite/date` stores it. */\nconst SQLITE_DATE_NOW_EXPRESSION = \"date('now')\";\n/** The `strftime` format for the text `sqlite/time` stores. */\nconst SQLITE_TIME_TEXT_FORMAT = \"%H:%M:%f\";\n/** The SQLite expression for the current time of day in UTC, as `sqlite/time` stores it. */\nconst SQLITE_TIME_NOW_EXPRESSION = `strftime('${SQLITE_TIME_TEXT_FORMAT}','now')`;\nconst NOW_EXPRESSION_BY_DATA_TYPE = /* @__PURE__ */ new Map([\n\t[sqliteDatetime.id, SQLITE_NOW_EXPRESSION],\n\t[sqliteDate.id, SQLITE_DATE_NOW_EXPRESSION],\n\t[sqliteTime.id, SQLITE_TIME_NOW_EXPRESSION],\n\t[sqliteText.id, SQLITE_NOW_EXPRESSION],\n\t[sqliteCharacter.id, SQLITE_NOW_EXPRESSION],\n\t[sqliteCharacterVarying.id, SQLITE_NOW_EXPRESSION],\n\t[sqlRawDataType.id, SQLITE_NOW_EXPRESSION]\n]);\n/**\n* The expression a `now()` default is written as on a column of `dataTypeId`: the current date or time of day on `sqlite/date` and `sqlite/time`, the current instant on `sqlite/datetime`, on text, on a raw column, whose values Prisma does not read, and on a column of no known data type. `undefined` on a data type that stores no date or time, such as `sqlite/duration` or `sqlite/integer`, as PostgreSQL refuses `now()` on an `interval` or an `integer` column.\n*/\nfunction sqliteNowExpressionFor(dataTypeId) {\n\treturn dataTypeId === void 0 ? SQLITE_NOW_EXPRESSION : NOW_EXPRESSION_BY_DATA_TYPE.get(dataTypeId);\n}\n//#endregion\nexport { SQLITE_TIME_TEXT_FORMAT as a, SQLITE_TIME_NOW_EXPRESSION as i, SQLITE_DATE_NOW_EXPRESSION as n, sqliteNowExpressionFor as o, SQLITE_NOW_EXPRESSION as r, SQLITE_DATETIME_TEXT_FORMAT as t };\n\n//# sourceMappingURL=datetime-text-CbgLX4q3.mjs.map"],"mappings":";;;;AAIA,MAAM,8BAA8B;;AAEpC,MAAM,wBAAwB,aAAa,4BAA4B;;AAEvE,MAAM,6BAA6B;;AAEnC,MAAM,0BAA0B;;AAEhC,MAAM,6BAA6B,aAAa,wBAAwB;AACxE,MAAM,8CAA8C,IAAI,IAAI;CAC3D,CAAC,eAAe,IAAI,qBAAqB;CACzC,CAAC,WAAW,IAAI,0BAA0B;CAC1C,CAAC,WAAW,IAAI,0BAA0B;CAC1C,CAAC,WAAW,IAAI,qBAAqB;CACrC,CAAC,gBAAgB,IAAI,qBAAqB;CAC1C,CAAC,uBAAuB,IAAI,qBAAqB;CACjD,CAAC,eAAe,IAAI,qBAAqB;AAC1C,CAAC;;;;AAID,SAAS,uBAAuB,YAAY;CAC3C,OAAO,eAAe,KAAK,IAAI,wBAAwB,4BAA4B,IAAI,UAAU;AAClG"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as SQLITE_TEXT_CODEC_ID } from "./codec-ids-BHBFCNsQ-C1Af_LGF.mjs";
|
|
2
2
|
import { t as SqliteCreateTable } from "./nodes-DUZSdX86-DWyLY3OW.mjs";
|
|
3
3
|
import { FunctionSource } from "@prisma/orm-family-sql/relational-core/ast";
|
|
4
4
|
import { cfExpr, cfTable, exprSelect } from "@prisma/orm-family-sql/relational-core/contract-free";
|
|
5
|
-
//#region ../../../3-targets/sqlite/1-target/dist/ddl-
|
|
5
|
+
//#region ../../../3-targets/sqlite/1-target/dist/ddl-BvD-wVtg.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Typed builder for the migration planner's column-existence checks. Produces
|
|
8
8
|
* `SELECT COUNT(*) {=|>} 0 AS "result" FROM pragma_table_info(?1) WHERE "name" = ?2`
|
|
@@ -100,4 +100,4 @@ function createTable(options) {
|
|
|
100
100
|
//#endregion
|
|
101
101
|
export { tableExistsAst as a, indexExistsAst as i, columnNameTakenAst as n, tableNameTakenAst as o, createTable as r, columnExistsAst as t };
|
|
102
102
|
|
|
103
|
-
//# sourceMappingURL=ddl-
|
|
103
|
+
//# sourceMappingURL=ddl-BvD-wVtg-BoEWa8CG.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ddl-
|
|
1
|
+
{"version":3,"file":"ddl-BvD-wVtg-BoEWa8CG.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/ddl-BvD-wVtg.mjs"],"sourcesContent":["import { p as SQLITE_TEXT_CODEC_ID } from \"./codec-ids-BHBFCNsQ.mjs\";\nimport { t as SqliteCreateTable } from \"./nodes-DUZSdX86.mjs\";\nimport { FunctionSource } from \"@internal/sql-relational-core/ast\";\nimport { cfExpr, cfTable, exprSelect } from \"@internal/sql-relational-core/contract-free\";\n//#region src/contract-free/checks.ts\n/**\n* Typed builder for the migration planner's column-existence checks. Produces\n* `SELECT COUNT(*) {=|>} 0 AS \"result\" FROM pragma_table_info(?1) WHERE \"name\" = ?2`\n* ASTs with the table and column names bound as text parameters — never\n* inlined into the SQL.\n*/\nfunction columnExistsAst(table, column) {\n\tconst source = FunctionSource.of(\"pragma_table_info\", [cfExpr.param(table, SQLITE_TEXT_CODEC_ID).ast]);\n\tconst where = cfExpr.identifierRef(\"name\").eqParam(column, SQLITE_TEXT_CODEC_ID);\n\treturn {\n\t\tcolumnAbsent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build(),\n\t\tcolumnPresent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().gtLit(0)).where(where).build()\n\t};\n}\n/**\n* Typed builder for the check that no column of the table has a name SQLite takes for `column`.\n* Produces `SELECT COUNT(*) = 0 AS \"result\" FROM pragma_table_info(?1) WHERE \"name\" COLLATE NOCASE\n* = ?2`: SQLite compares column names without regard to the case of ASCII letters, as `NOCASE`\n* does.\n*/\nfunction columnNameTakenAst(table, column) {\n\tconst source = FunctionSource.of(\"pragma_table_info\", [cfExpr.param(table, SQLITE_TEXT_CODEC_ID).ast]);\n\tconst where = cfExpr.fn({\n\t\tmethod: \"collateNocase\",\n\t\ttemplate: \"{{self}} COLLATE NOCASE\",\n\t\tself: cfExpr.identifierRef(\"name\"),\n\t\treturns: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t}).eqParam(column, SQLITE_TEXT_CODEC_ID);\n\treturn { nameFree: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build() };\n}\n/**\n* Typed builder for table-existence checks over `sqlite_master`.\n* Produces `SELECT COUNT(*) {=|>} 0 AS \"result\" FROM \"sqlite_master\" WHERE \"type\" = ?1 AND \"name\" = ?2`\n* with the table name and the literal `'table'` bound as text parameters.\n*/\nfunction tableExistsAst(tableName) {\n\tconst source = cfTable(\"sqlite_master\");\n\tconst where = cfExpr.allOf([cfExpr.identifierRef(\"type\").eqParam(\"table\", SQLITE_TEXT_CODEC_ID), cfExpr.identifierRef(\"name\").eqParam(tableName, SQLITE_TEXT_CODEC_ID)]);\n\treturn {\n\t\ttableAbsent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build(),\n\t\ttablePresent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().gtLit(0)).where(where).build()\n\t};\n}\n/**\n* Typed builder for the check that no table, index or view has a name SQLite takes for `name`.\n* Produces `SELECT COUNT(*) = 0 AS \"result\" FROM \"sqlite_master\" WHERE \"name\" COLLATE NOCASE = ?1`:\n* tables, indexes and views share one set of names, which SQLite compares without regard to the\n* case of ASCII letters.\n*/\nfunction tableNameTakenAst(tableName) {\n\tconst where = cfExpr.fn({\n\t\tmethod: \"collateNocase\",\n\t\ttemplate: \"{{self}} COLLATE NOCASE\",\n\t\tself: cfExpr.identifierRef(\"name\"),\n\t\treturns: {\n\t\t\tcodecId: SQLITE_TEXT_CODEC_ID,\n\t\t\tnullable: false\n\t\t}\n\t}).eqParam(tableName, SQLITE_TEXT_CODEC_ID);\n\treturn { nameFree: () => exprSelect().from(cfTable(\"sqlite_master\")).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build() };\n}\n/**\n* Typed builder for index-existence checks over `sqlite_master`.\n* Produces `SELECT COUNT(*) {=|>} 0 AS \"result\" FROM \"sqlite_master\" WHERE \"type\" = ?1 AND \"name\" = ?2`\n* with the index name and the literal `'index'` bound as text parameters.\n*/\nfunction indexExistsAst(indexName) {\n\tconst source = cfTable(\"sqlite_master\");\n\tconst where = cfExpr.allOf([cfExpr.identifierRef(\"type\").eqParam(\"index\", SQLITE_TEXT_CODEC_ID), cfExpr.identifierRef(\"name\").eqParam(indexName, SQLITE_TEXT_CODEC_ID)]);\n\treturn {\n\t\tindexAbsent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().eqLit(0)).where(where).build(),\n\t\tindexPresent: () => exprSelect().from(source).project(\"result\", cfExpr.countStar().gtLit(0)).where(where).build()\n\t};\n}\n//#endregion\n//#region src/contract-free/ddl.ts\n/**\n* Build a SQLite `CREATE TABLE` query node.\n*\n* Pass `constraints` for table-level composite primary keys, foreign keys, and\n* unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},\n* and {@link UniqueConstraint} classes from `@internal/sql-relational-core/ast`.\n*\n* Precondition: identifiers (`table`, column names/types) are emitted to SQL\n* verbatim — they are not quoted or escaped, so callers must pass pre-trusted\n* values (e.g. fixed control-plane identifiers). String-literal default values,\n* by contrast, are single-quote-escaped (embedded `'` doubled) by the renderer.\n* Identifier quoting for untrusted identifiers is added when the migration\n* planner adopts this lowering path.\n*/\nfunction createTable(options) {\n\treturn new SqliteCreateTable(options);\n}\n//#endregion\nexport { tableExistsAst as a, indexExistsAst as i, columnExistsAst as n, tableNameTakenAst as o, columnNameTakenAst as r, createTable as t };\n\n//# sourceMappingURL=ddl-BvD-wVtg.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,gBAAgB,OAAO,QAAQ;CACvC,MAAM,SAAS,eAAe,GAAG,qBAAqB,CAAC,OAAO,MAAM,OAAO,oBAAoB,CAAC,CAAC,GAAG,CAAC;CACrG,MAAM,QAAQ,OAAO,cAAc,MAAM,CAAC,CAAC,QAAQ,QAAQ,oBAAoB;CAC/E,OAAO;EACN,oBAAoB,WAAW,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,QAAQ,UAAU,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;EAChH,qBAAqB,WAAW,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,QAAQ,UAAU,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CAClH;AACD;;;;;;;AAOA,SAAS,mBAAmB,OAAO,QAAQ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AC,CAAC,KAAK,QAAQ,eAAe,CAAC,CAAC,CAAC,QAAQ,UAAU,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;AAC1I;;;;;;AAMA,SAAS,eAAe,WAAW;CAClC,MAAM,SAAS,QAAQ,eAAe;CACtC,MAAM,QAAQ,OAAO,MAAM,CAAC,OAAO,cAAc,MAAM,CAAC,CAAC,QAAQ,SAAS,oBAAoB,GAAG,OAAO,cAAc,MAAM,CAAC,CAAC,QAAQ,WAAW,oBAAoB,CAAC,CAAC;CACvK,OAAO;EACN,mBAAmB,WAAW,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,QAAQ,UAAU,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;EAC/G,oBAAoB,WAAW,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,QAAQ,UAAU,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;CACjH;AACD;;;;;;;;;;;;;;;AAiBA,SAAS,YAAY,SAAS;CAC7B,OAAO,IAAI,kBAAkB,OAAO;AACrC"}
|
package/dist/{default-normalizer-DGMXypHg-CPf7oyZA.mjs → default-normalizer-CsMhUEOe-CRieDElD.mjs}
RENAMED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import { t as SQLITE_DATETIME_TEXT_FORMAT } from "./datetime-text-
|
|
2
|
-
//#region ../../../3-targets/sqlite/1-target/dist/default-normalizer-
|
|
1
|
+
import { a as SQLITE_TIME_TEXT_FORMAT, i as SQLITE_TIME_NOW_EXPRESSION, n as SQLITE_DATE_NOW_EXPRESSION, o as sqliteNowExpressionFor, t as SQLITE_DATETIME_TEXT_FORMAT } from "./datetime-text-CbgLX4q3-BKp563Ja.mjs";
|
|
2
|
+
//#region ../../../3-targets/sqlite/1-target/dist/default-normalizer-CsMhUEOe.mjs
|
|
3
3
|
const NULL_PATTERN = /^NULL$/i;
|
|
4
4
|
const INTEGER_PATTERN = /^[+-]?\d+$/;
|
|
5
5
|
const REAL_PATTERN = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/;
|
|
6
6
|
const STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'$/;
|
|
7
7
|
const STRFTIME_NOW_PATTERN = /^strftime\s*\(\s*(['"])([^'"]*)\1\s*,\s*(['"])now\3\s*\)$/i;
|
|
8
|
-
|
|
8
|
+
const DATE_NOW_PATTERN = /^date\s*\(\s*(['"])now\1\s*\)$/i;
|
|
9
|
+
/** The name of the current instant, as a contract writes it. */
|
|
10
|
+
const INSTANT_NOW = "now()";
|
|
11
|
+
/**
|
|
12
|
+
* The name of the current value `expression` writes: `now()` for the current instant, in any of the forms SQLite writes it, and the expression a `now()` default is written as for the current date and for the current time of day, since those hold different text. `undefined` for any other expression.
|
|
13
|
+
*/
|
|
14
|
+
function currentValueNamed(expression) {
|
|
9
15
|
const lower = expression.toLowerCase();
|
|
10
|
-
if (lower === "current_timestamp" || lower === "datetime('now')" || lower === "datetime(\"now\")") return
|
|
11
|
-
|
|
16
|
+
if (lower === "current_timestamp" || lower === "datetime('now')" || lower === "datetime(\"now\")") return INSTANT_NOW;
|
|
17
|
+
if (lower === "current_date" || DATE_NOW_PATTERN.test(expression)) return SQLITE_DATE_NOW_EXPRESSION;
|
|
18
|
+
switch (expression.match(STRFTIME_NOW_PATTERN)?.[2]) {
|
|
19
|
+
case SQLITE_DATETIME_TEXT_FORMAT: return INSTANT_NOW;
|
|
20
|
+
case SQLITE_TIME_TEXT_FORMAT: return SQLITE_TIME_NOW_EXPRESSION;
|
|
21
|
+
default: return;
|
|
22
|
+
}
|
|
12
23
|
}
|
|
13
24
|
/**
|
|
14
25
|
* Strips a single matched wrapping pair of outer parens from `s`. Conservative:
|
|
@@ -55,7 +66,7 @@ function bodyFor(literal, quoted, affinity) {
|
|
|
55
66
|
/** A blob literal: `X'` or `x'`, an even number of hexadecimal digits, `'`. */
|
|
56
67
|
const BLOB_LITERAL_PATTERN = /^[xX]'((?:[0-9a-fA-F]{2})*)'$/;
|
|
57
68
|
/**
|
|
58
|
-
* Reads a column's reported default. `CURRENT_TIMESTAMP`, `datetime('now')` and the expression a `now()` default is written as are `now()
|
|
69
|
+
* Reads a column's reported default. `CURRENT_TIMESTAMP`, `datetime('now')` and the expression a `now()` default is written as for an instant are `now()`; `date('now')` and `CURRENT_DATE`, which writes the same text, are read as `date('now')`, and the expression for the current time of day keeps its own name, so a default that writes a date is never read as one that writes an instant. `CURRENT_TIME` writes no fraction of a second, which is not the text `sqlite/time` stores, so it is kept as reported. A quoted string, a numeral or a blob literal (`X'6869'`, read as its bytes) is a literal; any other expression is a function default, kept as reported.
|
|
59
70
|
*/
|
|
60
71
|
function readSqliteDefault(rawDefault, declaredType) {
|
|
61
72
|
let trimmed = rawDefault.trim();
|
|
@@ -64,9 +75,10 @@ function readSqliteDefault(rawDefault, declaredType) {
|
|
|
64
75
|
if (stripped === trimmed) break;
|
|
65
76
|
trimmed = stripped;
|
|
66
77
|
}
|
|
67
|
-
|
|
78
|
+
const currentValue = currentValueNamed(trimmed);
|
|
79
|
+
if (currentValue !== void 0) return {
|
|
68
80
|
kind: "function",
|
|
69
|
-
expression:
|
|
81
|
+
expression: currentValue
|
|
70
82
|
};
|
|
71
83
|
if (NULL_PATTERN.test(trimmed)) return { kind: "null" };
|
|
72
84
|
const affinity = affinityOf(declaredType);
|
|
@@ -99,14 +111,14 @@ function readSqliteDefault(rawDefault, declaredType) {
|
|
|
99
111
|
};
|
|
100
112
|
}
|
|
101
113
|
/**
|
|
102
|
-
* Names a contract's expression default the way {@link readSqliteDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP` `` and the database's `datetime('now')` compare equal. A literal default, and an expression that writes a literal, pass through unchanged; introspection reads the latter's literal with the column's codec, and the diff compares the values.
|
|
114
|
+
* Names a contract's expression default the way {@link readSqliteDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP` `` and the database's `datetime('now')` compare equal. A `now()` default is named as the expression the column's data type writes it as, so a `now()` on a date column and one on a date and time column differ, as their stored text does. A literal default, and an expression that writes a literal, pass through unchanged; introspection reads the latter's literal with the column's codec, and the diff compares the values.
|
|
103
115
|
*/
|
|
104
116
|
function sqliteResolveDefault(def, column) {
|
|
105
117
|
if (def.kind !== "function") return def;
|
|
106
|
-
const read = readSqliteDefault(def.expression, column.typeText);
|
|
118
|
+
const read = readSqliteDefault(def.expression === INSTANT_NOW ? sqliteNowExpressionFor(column.dataTypeId) ?? def.expression : def.expression, column.typeText);
|
|
107
119
|
return read.kind === "function" ? read : def;
|
|
108
120
|
}
|
|
109
121
|
//#endregion
|
|
110
122
|
export { sqliteResolveDefault as n, stripOuterParens as r, readSqliteDefault as t };
|
|
111
123
|
|
|
112
|
-
//# sourceMappingURL=default-normalizer-
|
|
124
|
+
//# sourceMappingURL=default-normalizer-CsMhUEOe-CRieDElD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-normalizer-CsMhUEOe-CRieDElD.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/default-normalizer-CsMhUEOe.mjs"],"sourcesContent":["import { a as SQLITE_TIME_TEXT_FORMAT, i as SQLITE_TIME_NOW_EXPRESSION, n as SQLITE_DATE_NOW_EXPRESSION, o as sqliteNowExpressionFor, t as SQLITE_DATETIME_TEXT_FORMAT } from \"./datetime-text-CbgLX4q3.mjs\";\n//#region src/core/default-normalizer.ts\nconst NULL_PATTERN = /^NULL$/i;\nconst INTEGER_PATTERN = /^[+-]?\\d+$/;\nconst REAL_PATTERN = /^[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?$/;\nconst STRING_LITERAL_PATTERN = /^'((?:[^']|'')*)'$/;\nconst STRFTIME_NOW_PATTERN = /^strftime\\s*\\(\\s*(['\"])([^'\"]*)\\1\\s*,\\s*(['\"])now\\3\\s*\\)$/i;\nconst DATE_NOW_PATTERN = /^date\\s*\\(\\s*(['\"])now\\1\\s*\\)$/i;\n/** The name of the current instant, as a contract writes it. */\nconst INSTANT_NOW = \"now()\";\n/**\n* The name of the current value `expression` writes: `now()` for the current instant, in any of the forms SQLite writes it, and the expression a `now()` default is written as for the current date and for the current time of day, since those hold different text. `undefined` for any other expression.\n*/\nfunction currentValueNamed(expression) {\n\tconst lower = expression.toLowerCase();\n\tif (lower === \"current_timestamp\" || lower === \"datetime('now')\" || lower === \"datetime(\\\"now\\\")\") return INSTANT_NOW;\n\tif (lower === \"current_date\" || DATE_NOW_PATTERN.test(expression)) return SQLITE_DATE_NOW_EXPRESSION;\n\tswitch (expression.match(STRFTIME_NOW_PATTERN)?.[2]) {\n\t\tcase SQLITE_DATETIME_TEXT_FORMAT: return INSTANT_NOW;\n\t\tcase SQLITE_TIME_TEXT_FORMAT: return SQLITE_TIME_NOW_EXPRESSION;\n\t\tdefault: return;\n\t}\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 text.\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}\n/** The type affinity SQLite gives a column of `declaredType`, by its rules in order. */\nfunction affinityOf(declaredType) {\n\tconst upper = declaredType.toUpperCase();\n\tif (upper.includes(\"INT\")) return \"integer\";\n\tif (upper.includes(\"CHAR\") || upper.includes(\"CLOB\") || upper.includes(\"TEXT\")) return \"text\";\n\tif (upper.includes(\"BLOB\") || upper.trim() === \"\") return \"blob\";\n\tif (upper.includes(\"REAL\") || upper.includes(\"FLOA\") || upper.includes(\"DOUB\")) return \"real\";\n\treturn \"numeric\";\n}\n/** A numeral as the driver returns it: a number, or digit text for an integer no double holds exactly. */\nfunction numberBody(numeral) {\n\tif (INTEGER_PATTERN.test(numeral)) {\n\t\tconst integer = BigInt(numeral);\n\t\treturn Number.isSafeInteger(Number(integer)) ? Number(integer) : integer.toString();\n\t}\n\treturn Number(numeral);\n}\n/** What the column stores for a literal written as `text` (quoted) or as a numeral, by its affinity. */\nfunction bodyFor(literal, quoted, affinity) {\n\tconst numeral = INTEGER_PATTERN.test(literal) || REAL_PATTERN.test(literal);\n\tif (affinity === \"text\") return literal;\n\tif (affinity === \"blob\") return quoted || !numeral ? literal : numberBody(literal);\n\treturn numeral ? numberBody(literal) : literal;\n}\n/** A blob literal: `X'` or `x'`, an even number of hexadecimal digits, `'`. */\nconst BLOB_LITERAL_PATTERN = /^[xX]'((?:[0-9a-fA-F]{2})*)'$/;\n/**\n* Reads a column's reported default. `CURRENT_TIMESTAMP`, `datetime('now')` and the expression a `now()` default is written as for an instant are `now()`; `date('now')` and `CURRENT_DATE`, which writes the same text, are read as `date('now')`, and the expression for the current time of day keeps its own name, so a default that writes a date is never read as one that writes an instant. `CURRENT_TIME` writes no fraction of a second, which is not the text `sqlite/time` stores, so it is kept as reported. A quoted string, a numeral or a blob literal (`X'6869'`, read as its bytes) is a literal; any other expression is a function default, kept as reported.\n*/\nfunction readSqliteDefault(rawDefault, declaredType) {\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 currentValue = currentValueNamed(trimmed);\n\tif (currentValue !== void 0) return {\n\t\tkind: \"function\",\n\t\texpression: currentValue\n\t};\n\tif (NULL_PATTERN.test(trimmed)) return { kind: \"null\" };\n\tconst affinity = affinityOf(declaredType);\n\tconst quoted = STRING_LITERAL_PATTERN.exec(trimmed)?.[1];\n\tif (quoted !== void 0) return {\n\t\tkind: \"literal\",\n\t\tliteral: {\n\t\t\tkind: \"value\",\n\t\t\tbody: bodyFor(quoted.replace(/''/g, \"'\"), true, affinity)\n\t\t}\n\t};\n\tconst blobHex = BLOB_LITERAL_PATTERN.exec(trimmed)?.[1];\n\tif (blobHex !== void 0) return {\n\t\tkind: \"literal\",\n\t\tliteral: {\n\t\t\tkind: \"value\",\n\t\t\tbody: new Uint8Array(Buffer.from(blobHex, \"hex\"))\n\t\t}\n\t};\n\tif (INTEGER_PATTERN.test(trimmed) || REAL_PATTERN.test(trimmed)) return {\n\t\tkind: \"literal\",\n\t\tliteral: {\n\t\t\tkind: \"value\",\n\t\t\tbody: bodyFor(trimmed, false, affinity)\n\t\t}\n\t};\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: trimmed\n\t};\n}\n/**\n* Names a contract's expression default the way {@link readSqliteDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP` `` and the database's `datetime('now')` compare equal. A `now()` default is named as the expression the column's data type writes it as, so a `now()` on a date column and one on a date and time column differ, as their stored text does. A literal default, and an expression that writes a literal, pass through unchanged; introspection reads the latter's literal with the column's codec, and the diff compares the values.\n*/\nfunction sqliteResolveDefault(def, column) {\n\tif (def.kind !== \"function\") return def;\n\tconst read = readSqliteDefault(def.expression === INSTANT_NOW ? sqliteNowExpressionFor(column.dataTypeId) ?? def.expression : def.expression, column.typeText);\n\treturn read.kind === \"function\" ? read : def;\n}\n//#endregion\nexport { sqliteResolveDefault as n, stripOuterParens as r, readSqliteDefault as t };\n\n//# sourceMappingURL=default-normalizer-CsMhUEOe.mjs.map"],"mappings":";;AAEA,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,eAAe;AACrB,MAAM,yBAAyB;AAC/B,MAAM,uBAAuB;AAC7B,MAAM,mBAAmB;;AA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AACD;;;;AAIA,SAAS,qBAAqB,KAAK,QAAQ;CAC1C,IAAI,IAAI,SAAS,YAAY,OAAO;CACpC,MAAM,OAAO,kBAAkB,IAAI,eAAe,cAAc,uBAAuB,OAAO,UAAU,KAAK,IAAI,aAAa,IAAI,YAAY,OAAO,QAAQ;CAC7J,OAAO,KAAK,SAAS,aAAa,OAAO;AAC1C"}
|
|
@@ -13,13 +13,13 @@ type SqliteReportedDefault = {
|
|
|
13
13
|
readonly literal: ReportedLiteralDefault;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
* Reads a column's reported default. `CURRENT_TIMESTAMP`, `datetime('now')` and the expression a `now()` default is written as are `now()
|
|
16
|
+
* Reads a column's reported default. `CURRENT_TIMESTAMP`, `datetime('now')` and the expression a `now()` default is written as for an instant are `now()`; `date('now')` and `CURRENT_DATE`, which writes the same text, are read as `date('now')`, and the expression for the current time of day keeps its own name, so a default that writes a date is never read as one that writes an instant. `CURRENT_TIME` writes no fraction of a second, which is not the text `sqlite/time` stores, so it is kept as reported. A quoted string, a numeral or a blob literal (`X'6869'`, read as its bytes) is a literal; any other expression is a function default, kept as reported.
|
|
17
17
|
*/
|
|
18
18
|
declare function readSqliteDefault(rawDefault: string, declaredType: string): SqliteReportedDefault;
|
|
19
19
|
/**
|
|
20
|
-
* Names a contract's expression default the way {@link readSqliteDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP` `` and the database's `datetime('now')` compare equal. A literal default, and an expression that writes a literal, pass through unchanged; introspection reads the latter's literal with the column's codec, and the diff compares the values.
|
|
20
|
+
* Names a contract's expression default the way {@link readSqliteDefault} names the same function in the database, so `` sql`CURRENT_TIMESTAMP` `` and the database's `datetime('now')` compare equal. A `now()` default is named as the expression the column's data type writes it as, so a `now()` on a date column and one on a date and time column differ, as their stored text does. A literal default, and an expression that writes a literal, pass through unchanged; introspection reads the latter's literal with the column's codec, and the diff compares the values.
|
|
21
21
|
*/
|
|
22
22
|
declare function sqliteResolveDefault(def: ColumnDefault, column: DefaultResolverColumn): ColumnDefault;
|
|
23
23
|
//#endregion
|
|
24
24
|
export { readSqliteDefault as n, sqliteResolveDefault as r, SqliteReportedDefault as t };
|
|
25
|
-
//# sourceMappingURL=default-normalizer-
|
|
25
|
+
//# sourceMappingURL=default-normalizer-CtNsZNRZ.d.mts.map
|
package/dist/{default-normalizer-CkHy3JYk.d.mts.map → default-normalizer-CtNsZNRZ.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-normalizer-
|
|
1
|
+
{"version":3,"file":"default-normalizer-CtNsZNRZ.d.mts","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/default-normalizer.d.mts"],"mappings":";;;;;KAIK;WACM;WACA;;WAEA;;WAEA;WACA,SAAS;;;;;iBAKH,kBAAkB,oBAAoB,uBAAuB;;;;iBAI7D,qBAAqB,KAAK,eAAe,QAAQ,wBAAwB"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { a as SQLITE_DATETIME_STRING_CODEC_ID, c as SQLITE_DATE_TEMPORAL_CODEC_ID, d as SQLITE_JSON_CODEC_ID, f as SQLITE_REAL_CODEC_ID, h as SQLITE_TIME_TEMPORAL_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, l as SQLITE_DURATION_STRING_CODEC_ID, m as SQLITE_TIME_STRING_CODEC_ID, o as SQLITE_DATETIME_TEMPORAL_CODEC_ID, p as SQLITE_TEXT_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_DATE_STRING_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQLITE_INTEGER_CODEC_ID } from "./codec-ids-BHBFCNsQ-C1Af_LGF.mjs";
|
|
2
|
+
import { m as sqliteInteger, v as sqliteTextDataTypes } from "./data-types-DXMZNR8j-CWrJOA8C.mjs";
|
|
3
|
+
import { t as sqliteDataTypeEntries } from "./data-type-entries-Cp4hBeJB-DYer43by.mjs";
|
|
4
|
+
import { n as sqliteTargetDescriptorMetaRuntime, t as sqliteNowGenerators } from "./date-time-now-generators-T8JO6gR6-DBt5IyH5.mjs";
|
|
5
|
+
import { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from "@prisma/orm-framework/type-implementations/now";
|
|
6
|
+
import { UNBOUND_NAMESPACE_ID } from "@prisma/orm-framework/components/ir";
|
|
7
|
+
import { idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions, sqlTargetTypeConstructors } from "@prisma/orm-family-sql/family/pack";
|
|
8
|
+
import { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from "@prisma/orm-framework/components/authoring";
|
|
9
|
+
import { singleGeneratorBinding } from "@prisma/orm-framework/components/components";
|
|
10
|
+
//#region ../../../3-targets/sqlite/1-target/dist/descriptor-meta-BwJWbIVt.mjs
|
|
11
|
+
const sqliteAuthoringTypes = {
|
|
12
|
+
.../* @__PURE__ */ sqlTargetTypeConstructors({ sizeType: "sqlite/real" }),
|
|
13
|
+
BigIntNumber: {
|
|
14
|
+
kind: "typeConstructor",
|
|
15
|
+
documentation: "A SQLite integer represented as a JavaScript number within its safe integer range.",
|
|
16
|
+
output: { codecId: "sqlite/bigintnumber@1" }
|
|
17
|
+
},
|
|
18
|
+
temporal: /* @__PURE__ */ temporalTypeAliases({ codecId: "sqlite/datetime@1" }, "a JavaScript Date")
|
|
19
|
+
};
|
|
20
|
+
/** The "now" generator for each codec that has one. The `now` generator function binds it. */
|
|
21
|
+
const sqliteNowGeneratorIds = {
|
|
22
|
+
[SQLITE_DATETIME_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,
|
|
23
|
+
[SQLITE_DATETIME_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,
|
|
24
|
+
[SQLITE_DATETIME_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,
|
|
25
|
+
[SQLITE_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,
|
|
26
|
+
[SQLITE_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,
|
|
27
|
+
[SQLITE_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,
|
|
28
|
+
[SQLITE_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID
|
|
29
|
+
};
|
|
30
|
+
const sqliteGeneratorFunctions = [
|
|
31
|
+
...sqlIntegerArgumentGeneratorFunctions({ integer: sqliteInteger.id }),
|
|
32
|
+
{
|
|
33
|
+
name: "now",
|
|
34
|
+
bindings: Object.entries(sqliteNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({
|
|
35
|
+
codecIds: [codecId],
|
|
36
|
+
generatorId
|
|
37
|
+
}))
|
|
38
|
+
},
|
|
39
|
+
...idGeneratorFunctionBindings({ text: [SQLITE_TEXT_CODEC_ID] })
|
|
40
|
+
];
|
|
41
|
+
/** The `now` generators SQLite binds. The SQL family registers the identifier generators. */
|
|
42
|
+
const sqliteGeneratorDescriptors = [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...sqliteNowGenerators.map(({ id }) => ({ id }))];
|
|
43
|
+
/**
|
|
44
|
+
* The base PSL scalars as zero-arg type constructors in the unified authoring
|
|
45
|
+
* channel. Each names a codec; the column's database type is its data type's.
|
|
46
|
+
*
|
|
47
|
+
* The type position is the only storage decider: a mutation-default generator
|
|
48
|
+
* (`@onCreate(uuid())`) never re-picks a column's storage.
|
|
49
|
+
*
|
|
50
|
+
* The target contributes them, so PSL and the TypeScript builder's `type.*` see the same names.
|
|
51
|
+
*/
|
|
52
|
+
const sqliteScalarAuthoringTypes = {
|
|
53
|
+
String: {
|
|
54
|
+
kind: "typeConstructor",
|
|
55
|
+
documentation: "Variable-length text stored as SQLite text.",
|
|
56
|
+
output: { codecId: SQLITE_TEXT_CODEC_ID }
|
|
57
|
+
},
|
|
58
|
+
Int: {
|
|
59
|
+
kind: "typeConstructor",
|
|
60
|
+
documentation: "An integer stored as SQLite integer and represented as a JavaScript number.",
|
|
61
|
+
output: { codecId: SQLITE_INTEGER_CODEC_ID }
|
|
62
|
+
},
|
|
63
|
+
BigInt: {
|
|
64
|
+
kind: "typeConstructor",
|
|
65
|
+
documentation: "An integer stored as SQLite integer and represented as a JavaScript bigint.",
|
|
66
|
+
output: { codecId: SQLITE_BIGINT_CODEC_ID }
|
|
67
|
+
},
|
|
68
|
+
Float: {
|
|
69
|
+
kind: "typeConstructor",
|
|
70
|
+
documentation: "A floating-point number stored as SQLite real.",
|
|
71
|
+
output: { codecId: SQLITE_REAL_CODEC_ID }
|
|
72
|
+
},
|
|
73
|
+
Decimal: {
|
|
74
|
+
kind: "typeConstructor",
|
|
75
|
+
documentation: "A decimal value stored and represented as text to preserve precision.",
|
|
76
|
+
output: { codecId: SQLITE_TEXT_CODEC_ID }
|
|
77
|
+
},
|
|
78
|
+
Json: {
|
|
79
|
+
kind: "typeConstructor",
|
|
80
|
+
documentation: "A JSON value serialized to SQLite text.",
|
|
81
|
+
output: { codecId: SQLITE_JSON_CODEC_ID }
|
|
82
|
+
},
|
|
83
|
+
Bytes: {
|
|
84
|
+
kind: "typeConstructor",
|
|
85
|
+
documentation: "Binary data stored as a SQLite blob.",
|
|
86
|
+
output: { codecId: SQLITE_BLOB_CODEC_ID }
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* The explicit date and time types. SQLite has no date or time column type, so each is stored as text, in one form for each value, and its name says what the text holds and what the application reads. ADR 315.
|
|
91
|
+
*/
|
|
92
|
+
const sqliteDateTimeTypeConstructors = {
|
|
93
|
+
DatetimeJsDate: {
|
|
94
|
+
kind: "typeConstructor",
|
|
95
|
+
documentation: "An instant stored as SQLite text, 2024-01-01T00:00:00.000Z, and represented as a JavaScript Date.",
|
|
96
|
+
output: { codecId: SQLITE_DATETIME_CODEC_ID }
|
|
97
|
+
},
|
|
98
|
+
DatetimeTemporal: {
|
|
99
|
+
kind: "typeConstructor",
|
|
100
|
+
documentation: "An instant stored as SQLite text, 2024-01-01T00:00:00.000Z, and represented as Temporal.Instant.",
|
|
101
|
+
output: { codecId: SQLITE_DATETIME_TEMPORAL_CODEC_ID }
|
|
102
|
+
},
|
|
103
|
+
DatetimeString: {
|
|
104
|
+
kind: "typeConstructor",
|
|
105
|
+
documentation: "An instant stored as SQLite text and represented as that text, 2024-01-01T00:00:00.000Z, the instant in UTC.",
|
|
106
|
+
output: { codecId: SQLITE_DATETIME_STRING_CODEC_ID }
|
|
107
|
+
},
|
|
108
|
+
DateString: {
|
|
109
|
+
kind: "typeConstructor",
|
|
110
|
+
documentation: "A calendar date stored as SQLite text and represented as that text, 2024-02-29.",
|
|
111
|
+
output: { codecId: SQLITE_DATE_STRING_CODEC_ID }
|
|
112
|
+
},
|
|
113
|
+
DateTemporal: {
|
|
114
|
+
kind: "typeConstructor",
|
|
115
|
+
documentation: "A calendar date stored as SQLite text, 2024-02-29, and represented as Temporal.PlainDate.",
|
|
116
|
+
output: { codecId: SQLITE_DATE_TEMPORAL_CODEC_ID }
|
|
117
|
+
},
|
|
118
|
+
TimeString: {
|
|
119
|
+
kind: "typeConstructor",
|
|
120
|
+
documentation: "A time of day stored as SQLite text and represented as that text, 09:30:00.000, always with three fraction digits.",
|
|
121
|
+
output: { codecId: SQLITE_TIME_STRING_CODEC_ID }
|
|
122
|
+
},
|
|
123
|
+
TimeTemporal: {
|
|
124
|
+
kind: "typeConstructor",
|
|
125
|
+
documentation: "A time of day stored as SQLite text, 09:30:00.000, and represented as Temporal.PlainTime.",
|
|
126
|
+
output: { codecId: SQLITE_TIME_TEMPORAL_CODEC_ID }
|
|
127
|
+
},
|
|
128
|
+
DurationString: {
|
|
129
|
+
kind: "typeConstructor",
|
|
130
|
+
documentation: "A length of time stored as SQLite text and represented as the ISO 8601 duration it was written as, such as PT1H30M.",
|
|
131
|
+
output: { codecId: SQLITE_DURATION_STRING_CODEC_ID }
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const textStorage = {
|
|
135
|
+
kind: "option",
|
|
136
|
+
name: "storage",
|
|
137
|
+
values: ["text"],
|
|
138
|
+
default: "text",
|
|
139
|
+
optional: true
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* The convenience date and time types. Each is a type choice: its `as` argument chooses the explicit type it becomes. Every SQLite date and time type is stored as text, so `storage` is text only. ADR 279, ADR 315.
|
|
143
|
+
*/
|
|
144
|
+
const sqliteConvenienceDateTimeTypes = {
|
|
145
|
+
DateTime: {
|
|
146
|
+
kind: "typeChoice",
|
|
147
|
+
documentation: "A moment in time, stored as SQLite text. `as` is what the application reads: jsDate (a JavaScript Date), temporal (Temporal.Instant) or string, such as \"2024-01-01T00:00:00.000Z\".",
|
|
148
|
+
args: [{
|
|
149
|
+
kind: "option",
|
|
150
|
+
name: "as",
|
|
151
|
+
values: [
|
|
152
|
+
"jsDate",
|
|
153
|
+
"temporal",
|
|
154
|
+
"string"
|
|
155
|
+
],
|
|
156
|
+
default: "jsDate",
|
|
157
|
+
optional: true
|
|
158
|
+
}, textStorage],
|
|
159
|
+
choices: [
|
|
160
|
+
{
|
|
161
|
+
when: {
|
|
162
|
+
as: "jsDate",
|
|
163
|
+
storage: "text"
|
|
164
|
+
},
|
|
165
|
+
type: "DatetimeJsDate"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
when: {
|
|
169
|
+
as: "temporal",
|
|
170
|
+
storage: "text"
|
|
171
|
+
},
|
|
172
|
+
type: "DatetimeTemporal"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
when: {
|
|
176
|
+
as: "string",
|
|
177
|
+
storage: "text"
|
|
178
|
+
},
|
|
179
|
+
type: "DatetimeString"
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
Date: {
|
|
184
|
+
kind: "typeChoice",
|
|
185
|
+
documentation: "A calendar date, stored as SQLite text. `as` is what the application reads: string, such as \"2024-02-29\", or temporal (Temporal.PlainDate).",
|
|
186
|
+
args: [{
|
|
187
|
+
kind: "option",
|
|
188
|
+
name: "as",
|
|
189
|
+
values: ["string", "temporal"],
|
|
190
|
+
default: "string",
|
|
191
|
+
optional: true
|
|
192
|
+
}, textStorage],
|
|
193
|
+
choices: [{
|
|
194
|
+
when: {
|
|
195
|
+
as: "string",
|
|
196
|
+
storage: "text"
|
|
197
|
+
},
|
|
198
|
+
type: "DateString"
|
|
199
|
+
}, {
|
|
200
|
+
when: {
|
|
201
|
+
as: "temporal",
|
|
202
|
+
storage: "text"
|
|
203
|
+
},
|
|
204
|
+
type: "DateTemporal"
|
|
205
|
+
}]
|
|
206
|
+
},
|
|
207
|
+
Time: {
|
|
208
|
+
kind: "typeChoice",
|
|
209
|
+
documentation: "A time of day, stored as SQLite text. `as` is what the application reads: string, such as \"09:30:00.000\", or temporal (Temporal.PlainTime).",
|
|
210
|
+
args: [{
|
|
211
|
+
kind: "option",
|
|
212
|
+
name: "as",
|
|
213
|
+
values: ["string", "temporal"],
|
|
214
|
+
default: "string",
|
|
215
|
+
optional: true
|
|
216
|
+
}, textStorage],
|
|
217
|
+
choices: [{
|
|
218
|
+
when: {
|
|
219
|
+
as: "string",
|
|
220
|
+
storage: "text"
|
|
221
|
+
},
|
|
222
|
+
type: "TimeString"
|
|
223
|
+
}, {
|
|
224
|
+
when: {
|
|
225
|
+
as: "temporal",
|
|
226
|
+
storage: "text"
|
|
227
|
+
},
|
|
228
|
+
type: "TimeTemporal"
|
|
229
|
+
}]
|
|
230
|
+
},
|
|
231
|
+
Duration: {
|
|
232
|
+
kind: "typeChoice",
|
|
233
|
+
documentation: "A length of time, stored as SQLite text. `as` is what the application reads: string, an ISO 8601 duration such as \"PT1H30M\".",
|
|
234
|
+
args: [{
|
|
235
|
+
kind: "option",
|
|
236
|
+
name: "as",
|
|
237
|
+
values: ["string"],
|
|
238
|
+
default: "string",
|
|
239
|
+
optional: true
|
|
240
|
+
}, textStorage],
|
|
241
|
+
choices: [{
|
|
242
|
+
when: {
|
|
243
|
+
as: "string",
|
|
244
|
+
storage: "text"
|
|
245
|
+
},
|
|
246
|
+
type: "DurationString"
|
|
247
|
+
}]
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* The base scalars, the explicit date and time types and the convenience date and time types as type constructors. The target contributes them, so PSL and the TypeScript builder's `type.*` see the same names.
|
|
252
|
+
*/
|
|
253
|
+
const sqliteScalarTypeConstructors = {
|
|
254
|
+
...sqliteScalarAuthoringTypes,
|
|
255
|
+
...sqliteDateTimeTypeConstructors,
|
|
256
|
+
...sqliteConvenienceDateTimeTypes
|
|
257
|
+
};
|
|
258
|
+
const sqliteTargetDescriptorMeta = {
|
|
259
|
+
...sqliteTargetDescriptorMetaRuntime,
|
|
260
|
+
defaultNamespaceId: UNBOUND_NAMESPACE_ID,
|
|
261
|
+
supportsNamespaces: false,
|
|
262
|
+
displayName: "SQLite",
|
|
263
|
+
authoring: {
|
|
264
|
+
type: {
|
|
265
|
+
...sqliteScalarTypeConstructors,
|
|
266
|
+
...sqliteAuthoringTypes
|
|
267
|
+
},
|
|
268
|
+
dataTypes: sqliteDataTypeEntries(),
|
|
269
|
+
textDataTypes: sqliteTextDataTypes
|
|
270
|
+
},
|
|
271
|
+
generatorFunctions: sqliteGeneratorFunctions,
|
|
272
|
+
controlMutationDefaults: {
|
|
273
|
+
defaultFunctionRegistry: /* @__PURE__ */ new Map(),
|
|
274
|
+
generatorDescriptors: sqliteGeneratorDescriptors
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
//#endregion
|
|
278
|
+
export { sqliteTargetDescriptorMeta as n, sqliteScalarTypeConstructors as t };
|
|
279
|
+
|
|
280
|
+
//# sourceMappingURL=descriptor-meta-BwJWbIVt-B24ey04f.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor-meta-BwJWbIVt-B24ey04f.mjs","names":[],"sources":["../../../../3-targets/sqlite/1-target/dist/descriptor-meta-BwJWbIVt.mjs"],"sourcesContent":["import { a as SQLITE_DATETIME_STRING_CODEC_ID, c as SQLITE_DATE_TEMPORAL_CODEC_ID, d as SQLITE_JSON_CODEC_ID, f as SQLITE_REAL_CODEC_ID, h as SQLITE_TIME_TEMPORAL_CODEC_ID, i as SQLITE_DATETIME_CODEC_ID, l as SQLITE_DURATION_STRING_CODEC_ID, m as SQLITE_TIME_STRING_CODEC_ID, o as SQLITE_DATETIME_TEMPORAL_CODEC_ID, p as SQLITE_TEXT_CODEC_ID, r as SQLITE_BLOB_CODEC_ID, s as SQLITE_DATE_STRING_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQLITE_INTEGER_CODEC_ID } from \"./codec-ids-BHBFCNsQ.mjs\";\nimport { m as sqliteInteger, v as sqliteTextDataTypes } from \"./data-types-DXMZNR8j.mjs\";\nimport { t as sqliteDataTypeEntries } from \"./data-type-entries-Cp4hBeJB.mjs\";\nimport { n as sqliteTargetDescriptorMetaRuntime, t as sqliteNowGenerators } from \"./date-time-now-generators-T8JO6gR6.mjs\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { idGeneratorFunctionBindings, sqlIntegerArgumentGeneratorFunctions, sqlTargetTypeConstructors } from \"@internal/family-sql/pack\";\nimport { TIMESTAMP_NOW_GENERATOR_ID, temporalTypeAliases } from \"@internal/framework-components/authoring\";\nimport { singleGeneratorBinding } from \"@internal/framework-components/components\";\nimport { DATE_STRING_NOW_GENERATOR_ID, INSTANT_NOW_GENERATOR_ID, INSTANT_STRING_NOW_GENERATOR_ID, PLAIN_DATE_NOW_GENERATOR_ID, PLAIN_TIME_NOW_GENERATOR_ID, TIME_STRING_NOW_GENERATOR_ID } from \"@internal/type-implementations/now\";\n//#region src/core/authoring.ts\nconst sqliteAuthoringTypes = {\n\t.../* @__PURE__ */ sqlTargetTypeConstructors({ sizeType: \"sqlite/real\" }),\n\tBigIntNumber: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A SQLite integer represented as a JavaScript number within its safe integer range.\",\n\t\toutput: { codecId: \"sqlite/bigintnumber@1\" }\n\t},\n\ttemporal: /* @__PURE__ */ temporalTypeAliases({ codecId: \"sqlite/datetime@1\" }, \"a JavaScript Date\")\n};\n//#endregion\n//#region src/core/generator-functions.ts\n/** The \"now\" generator for each codec that has one. The `now` generator function binds it. */\nconst sqliteNowGeneratorIds = {\n\t[SQLITE_DATETIME_CODEC_ID]: TIMESTAMP_NOW_GENERATOR_ID,\n\t[SQLITE_DATETIME_TEMPORAL_CODEC_ID]: INSTANT_NOW_GENERATOR_ID,\n\t[SQLITE_DATETIME_STRING_CODEC_ID]: INSTANT_STRING_NOW_GENERATOR_ID,\n\t[SQLITE_DATE_STRING_CODEC_ID]: DATE_STRING_NOW_GENERATOR_ID,\n\t[SQLITE_DATE_TEMPORAL_CODEC_ID]: PLAIN_DATE_NOW_GENERATOR_ID,\n\t[SQLITE_TIME_STRING_CODEC_ID]: TIME_STRING_NOW_GENERATOR_ID,\n\t[SQLITE_TIME_TEMPORAL_CODEC_ID]: PLAIN_TIME_NOW_GENERATOR_ID\n};\nconst sqliteGeneratorFunctions = [\n\t...sqlIntegerArgumentGeneratorFunctions({ integer: sqliteInteger.id }),\n\t{\n\t\tname: \"now\",\n\t\tbindings: Object.entries(sqliteNowGeneratorIds).map(([codecId, generatorId]) => singleGeneratorBinding({\n\t\t\tcodecIds: [codecId],\n\t\t\tgeneratorId\n\t\t}))\n\t},\n\t...idGeneratorFunctionBindings({ text: [SQLITE_TEXT_CODEC_ID] })\n];\n/** The `now` generators SQLite binds. The SQL family registers the identifier generators. */\nconst sqliteGeneratorDescriptors = [{ id: TIMESTAMP_NOW_GENERATOR_ID }, ...sqliteNowGenerators.map(({ id }) => ({ id }))];\n//#endregion\n//#region src/core/type-constructors.ts\n/**\n* The base PSL scalars as zero-arg type constructors in the unified authoring\n* channel. Each names a codec; the column's database type is its data type's.\n*\n* The type position is the only storage decider: a mutation-default generator\n* (`@onCreate(uuid())`) never re-picks a column's storage.\n*\n* The target contributes them, so PSL and the TypeScript builder's `type.*` see the same names.\n*/\nconst sqliteScalarAuthoringTypes = {\n\tString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Variable-length text stored as SQLite text.\",\n\t\toutput: { codecId: SQLITE_TEXT_CODEC_ID }\n\t},\n\tInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An integer stored as SQLite integer and represented as a JavaScript number.\",\n\t\toutput: { codecId: SQLITE_INTEGER_CODEC_ID }\n\t},\n\tBigInt: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An integer stored as SQLite integer and represented as a JavaScript bigint.\",\n\t\toutput: { codecId: SQLITE_BIGINT_CODEC_ID }\n\t},\n\tFloat: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A floating-point number stored as SQLite real.\",\n\t\toutput: { codecId: SQLITE_REAL_CODEC_ID }\n\t},\n\tDecimal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A decimal value stored and represented as text to preserve precision.\",\n\t\toutput: { codecId: SQLITE_TEXT_CODEC_ID }\n\t},\n\tJson: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A JSON value serialized to SQLite text.\",\n\t\toutput: { codecId: SQLITE_JSON_CODEC_ID }\n\t},\n\tBytes: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"Binary data stored as a SQLite blob.\",\n\t\toutput: { codecId: SQLITE_BLOB_CODEC_ID }\n\t}\n};\n/**\n* The explicit date and time types. SQLite has no date or time column type, so each is stored as text, in one form for each value, and its name says what the text holds and what the application reads. ADR 315.\n*/\nconst sqliteDateTimeTypeConstructors = {\n\tDatetimeJsDate: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as SQLite text, 2024-01-01T00:00:00.000Z, and represented as a JavaScript Date.\",\n\t\toutput: { codecId: SQLITE_DATETIME_CODEC_ID }\n\t},\n\tDatetimeTemporal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as SQLite text, 2024-01-01T00:00:00.000Z, and represented as Temporal.Instant.\",\n\t\toutput: { codecId: SQLITE_DATETIME_TEMPORAL_CODEC_ID }\n\t},\n\tDatetimeString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"An instant stored as SQLite text and represented as that text, 2024-01-01T00:00:00.000Z, the instant in UTC.\",\n\t\toutput: { codecId: SQLITE_DATETIME_STRING_CODEC_ID }\n\t},\n\tDateString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date stored as SQLite text and represented as that text, 2024-02-29.\",\n\t\toutput: { codecId: SQLITE_DATE_STRING_CODEC_ID }\n\t},\n\tDateTemporal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A calendar date stored as SQLite text, 2024-02-29, and represented as Temporal.PlainDate.\",\n\t\toutput: { codecId: SQLITE_DATE_TEMPORAL_CODEC_ID }\n\t},\n\tTimeString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day stored as SQLite text and represented as that text, 09:30:00.000, always with three fraction digits.\",\n\t\toutput: { codecId: SQLITE_TIME_STRING_CODEC_ID }\n\t},\n\tTimeTemporal: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A time of day stored as SQLite text, 09:30:00.000, and represented as Temporal.PlainTime.\",\n\t\toutput: { codecId: SQLITE_TIME_TEMPORAL_CODEC_ID }\n\t},\n\tDurationString: {\n\t\tkind: \"typeConstructor\",\n\t\tdocumentation: \"A length of time stored as SQLite text and represented as the ISO 8601 duration it was written as, such as PT1H30M.\",\n\t\toutput: { codecId: SQLITE_DURATION_STRING_CODEC_ID }\n\t}\n};\nconst textStorage = {\n\tkind: \"option\",\n\tname: \"storage\",\n\tvalues: [\"text\"],\n\tdefault: \"text\",\n\toptional: true\n};\n/**\n* The convenience date and time types. Each is a type choice: its `as` argument chooses the explicit type it becomes. Every SQLite date and time type is stored as text, so `storage` is text only. ADR 279, ADR 315.\n*/\nconst sqliteConvenienceDateTimeTypes = {\n\tDateTime: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A moment in time, stored as SQLite text. `as` is what the application reads: jsDate (a JavaScript Date), temporal (Temporal.Instant) or string, such as \\\"2024-01-01T00:00:00.000Z\\\".\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\n\t\t\t\t\"jsDate\",\n\t\t\t\t\"temporal\",\n\t\t\t\t\"string\"\n\t\t\t],\n\t\t\tdefault: \"jsDate\",\n\t\t\toptional: true\n\t\t}, textStorage],\n\t\tchoices: [\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"jsDate\",\n\t\t\t\t\tstorage: \"text\"\n\t\t\t\t},\n\t\t\t\ttype: \"DatetimeJsDate\"\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"temporal\",\n\t\t\t\t\tstorage: \"text\"\n\t\t\t\t},\n\t\t\t\ttype: \"DatetimeTemporal\"\n\t\t\t},\n\t\t\t{\n\t\t\t\twhen: {\n\t\t\t\t\tas: \"string\",\n\t\t\t\t\tstorage: \"text\"\n\t\t\t\t},\n\t\t\t\ttype: \"DatetimeString\"\n\t\t\t}\n\t\t]\n\t},\n\tDate: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A calendar date, stored as SQLite text. `as` is what the application reads: string, such as \\\"2024-02-29\\\", or temporal (Temporal.PlainDate).\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\", \"temporal\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, textStorage],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"text\"\n\t\t\t},\n\t\t\ttype: \"DateString\"\n\t\t}, {\n\t\t\twhen: {\n\t\t\t\tas: \"temporal\",\n\t\t\t\tstorage: \"text\"\n\t\t\t},\n\t\t\ttype: \"DateTemporal\"\n\t\t}]\n\t},\n\tTime: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A time of day, stored as SQLite text. `as` is what the application reads: string, such as \\\"09:30:00.000\\\", or temporal (Temporal.PlainTime).\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\", \"temporal\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, textStorage],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"text\"\n\t\t\t},\n\t\t\ttype: \"TimeString\"\n\t\t}, {\n\t\t\twhen: {\n\t\t\t\tas: \"temporal\",\n\t\t\t\tstorage: \"text\"\n\t\t\t},\n\t\t\ttype: \"TimeTemporal\"\n\t\t}]\n\t},\n\tDuration: {\n\t\tkind: \"typeChoice\",\n\t\tdocumentation: \"A length of time, stored as SQLite text. `as` is what the application reads: string, an ISO 8601 duration such as \\\"PT1H30M\\\".\",\n\t\targs: [{\n\t\t\tkind: \"option\",\n\t\t\tname: \"as\",\n\t\t\tvalues: [\"string\"],\n\t\t\tdefault: \"string\",\n\t\t\toptional: true\n\t\t}, textStorage],\n\t\tchoices: [{\n\t\t\twhen: {\n\t\t\t\tas: \"string\",\n\t\t\t\tstorage: \"text\"\n\t\t\t},\n\t\t\ttype: \"DurationString\"\n\t\t}]\n\t}\n};\n/**\n* The base scalars, the explicit date and time types and the convenience date and time types as type constructors. The target contributes them, so PSL and the TypeScript builder's `type.*` see the same names.\n*/\nconst sqliteScalarTypeConstructors = {\n\t...sqliteScalarAuthoringTypes,\n\t...sqliteDateTimeTypeConstructors,\n\t...sqliteConvenienceDateTimeTypes\n};\nconst sqliteTargetDescriptorMeta = {\n\t...sqliteTargetDescriptorMetaRuntime,\n\tdefaultNamespaceId: UNBOUND_NAMESPACE_ID,\n\tsupportsNamespaces: false,\n\tdisplayName: \"SQLite\",\n\tauthoring: {\n\t\ttype: {\n\t\t\t...sqliteScalarTypeConstructors,\n\t\t\t...sqliteAuthoringTypes\n\t\t},\n\t\tdataTypes: sqliteDataTypeEntries(),\n\t\ttextDataTypes: sqliteTextDataTypes\n\t},\n\tgeneratorFunctions: sqliteGeneratorFunctions,\n\tcontrolMutationDefaults: {\n\t\tdefaultFunctionRegistry: /* @__PURE__ */ new Map(),\n\t\tgeneratorDescriptors: sqliteGeneratorDescriptors\n\t}\n};\n//#endregion\nexport { sqliteScalarTypeConstructors as n, sqliteTargetDescriptorMeta as t };\n\n//# sourceMappingURL=descriptor-meta-BwJWbIVt.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,uBAAuB;CAC5B,GAAmB,0CAA0B,EAAE,UAAU,cAAc,CAAC;CACxE,cAAc;EACb,MAAM;EACN,eAAe;EACf,QAAQ,EAAE,SAAS,wBAAwB;CAC5C;CACA,UAA0B,oCAAoB,EAAE,SAAS,oBAAoB,GAAG,mBAAmB;AACpG;;AAIA,MAAM,wBAAwB;EAC5B,2BAA2B;EAC3B,oCAAoC;EACpC,kCAAkC;EAClC,8BAA8B;EAC9B,gCAAgC;EAChC,8BAA8B;EAC9B,gCAAgC;AAClC;AACA,MAAM,2BAA2B;CAChC,GAAG,qCAAqC,EAAE,SAAS,cAAc,GAAG,CAAC;CACrE;EACC,MAAM;EACN,UAAU,OAAO,QAAQ,qBAAqB,CAAC,CAAC,KAAK,CAAC,SAAS,iBAAiB,uBAAuB;GACtG,UAAU,CAAC,OAAO;GAClB;EACD,CAAC,CAAC;CACH;CACA,GAAG,4BAA4B,EAAE,MAAM,CAAC,oBAAoB,EAAE,CAAC;AAChE;;AAEA,MAAM,6BAA6B,CAAC,EAAE,IAAI,2BAA2B,GAAG,GAAG,oBAAoB,KAAK,EAAE,UAAU,EAAE,GA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AAG;AACJ;AACA,MAAM,6BAA6B;CAClC,GAAG;CACH,oBAAoB;CACpB,oBAAoB;CACpB,aAAa;CACb,WAAW;EACV,MAAM;GACL,GAAG;GACH,GAAG;EACJ;EACA,WAAW,sBAAsB;EACjC,eAAe;CAChB;CACA,oBAAoB;CACpB,yBAAyB;EACxB,yCAAyC,IAAI,IAAI;EACjD,sBAAsB;CACvB;AACD"}
|
package/dist/{descriptor-meta-DrNwC4vO-D7vuA6QK.mjs → descriptor-meta-DrNwC4vO-B9xeeDp9.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as sqliteCodecRegistry } from "./codecs-
|
|
2
|
-
import { n as sqliteAdapterContractContributions } from "./contract-contributions-wweWdXMK-
|
|
1
|
+
import { a as sqliteCodecRegistry } from "./codecs-R3kGRyq2.mjs";
|
|
2
|
+
import { n as sqliteAdapterContractContributions } from "./contract-contributions-wweWdXMK-CwYZg4jC.mjs";
|
|
3
3
|
//#region ../../../3-targets/sqlite/2-adapter/dist/descriptor-meta-DrNwC4vO.mjs
|
|
4
4
|
const sqliteAdapterDescriptorMeta = {
|
|
5
5
|
kind: "adapter",
|
|
@@ -23,4 +23,4 @@ const sqliteAdapterDescriptorMeta = {
|
|
|
23
23
|
//#endregion
|
|
24
24
|
export { sqliteAdapterDescriptorMeta as t };
|
|
25
25
|
|
|
26
|
-
//# sourceMappingURL=descriptor-meta-DrNwC4vO-
|
|
26
|
+
//# sourceMappingURL=descriptor-meta-DrNwC4vO-B9xeeDp9.mjs.map
|