@prisma-next/target-sqlite 0.5.0-dev.6 → 0.5.0-dev.60
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/codec-ids-B1-OiN8Q.mjs +14 -0
- package/dist/codec-ids-B1-OiN8Q.mjs.map +1 -0
- package/dist/codec-ids.d.mts +13 -0
- package/dist/codec-ids.d.mts.map +1 -0
- package/dist/codec-ids.mjs +3 -0
- package/dist/codec-types.d.mts +7 -0
- package/dist/codec-types.d.mts.map +1 -0
- package/dist/codec-types.mjs +3 -0
- package/dist/codecs-5GJysiEg.mjs +95 -0
- package/dist/codecs-5GJysiEg.mjs.map +1 -0
- package/dist/codecs-D4jgBM6T.d.mts +139 -0
- package/dist/codecs-D4jgBM6T.d.mts.map +1 -0
- package/dist/codecs.d.mts +2 -0
- package/dist/codecs.mjs +3 -0
- package/dist/control.d.mts +4 -3
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +343 -1
- package/dist/control.mjs.map +1 -1
- package/dist/default-normalizer-R-sQXAYt.mjs +69 -0
- package/dist/default-normalizer-R-sQXAYt.mjs.map +1 -0
- package/dist/default-normalizer.d.mts +8 -0
- package/dist/default-normalizer.d.mts.map +1 -0
- package/dist/default-normalizer.mjs +3 -0
- package/dist/descriptor-meta-BA2YAFQq.mjs +24 -0
- package/dist/descriptor-meta-BA2YAFQq.mjs.map +1 -0
- package/dist/migration.d.mts +76 -0
- package/dist/migration.d.mts.map +1 -0
- package/dist/migration.mjs +38 -0
- package/dist/migration.mjs.map +1 -0
- package/dist/native-type-normalizer-BMovohPm.mjs +14 -0
- package/dist/native-type-normalizer-BMovohPm.mjs.map +1 -0
- package/dist/native-type-normalizer.d.mts +11 -0
- package/dist/native-type-normalizer.d.mts.map +1 -0
- package/dist/native-type-normalizer.mjs +3 -0
- package/dist/op-factory-call-BPPSCdTB.d.mts +134 -0
- package/dist/op-factory-call-BPPSCdTB.d.mts.map +1 -0
- package/dist/op-factory-call-BUVV-W9F.mjs +252 -0
- package/dist/op-factory-call-BUVV-W9F.mjs.map +1 -0
- package/dist/op-factory-call.d.mts +3 -0
- package/dist/op-factory-call.mjs +3 -0
- package/dist/pack.d.mts +35 -1
- package/dist/pack.d.mts.map +1 -1
- package/dist/pack.mjs +1 -1
- package/dist/planner-CuchCrpN.mjs +522 -0
- package/dist/planner-CuchCrpN.mjs.map +1 -0
- package/dist/planner-produced-sqlite-migration-C3AAaQoW.mjs +107 -0
- package/dist/planner-produced-sqlite-migration-C3AAaQoW.mjs.map +1 -0
- package/dist/planner-produced-sqlite-migration-RVneETNy.d.mts +24 -0
- package/dist/planner-produced-sqlite-migration-RVneETNy.d.mts.map +1 -0
- package/dist/planner-produced-sqlite-migration.d.mts +5 -0
- package/dist/planner-produced-sqlite-migration.mjs +3 -0
- package/dist/planner-target-details-BQIWQlBu.mjs +16 -0
- package/dist/planner-target-details-BQIWQlBu.mjs.map +1 -0
- package/dist/planner-target-details-DTIFFx4L.d.mts +12 -0
- package/dist/planner-target-details-DTIFFx4L.d.mts.map +1 -0
- package/dist/planner-target-details.d.mts +2 -0
- package/dist/planner-target-details.mjs +3 -0
- package/dist/planner.d.mts +56 -0
- package/dist/planner.d.mts.map +1 -0
- package/dist/planner.mjs +3 -0
- package/dist/render-ops-CXOv7SRC.mjs +8 -0
- package/dist/render-ops-CXOv7SRC.mjs.map +1 -0
- package/dist/render-ops.d.mts +11 -0
- package/dist/render-ops.d.mts.map +1 -0
- package/dist/render-ops.mjs +3 -0
- package/dist/runtime.mjs +1 -1
- package/dist/shared-BNtoZqdo.d.mts +69 -0
- package/dist/shared-BNtoZqdo.d.mts.map +1 -0
- package/dist/sql-utils-D3SMPFDD.mjs +33 -0
- package/dist/sql-utils-D3SMPFDD.mjs.map +1 -0
- package/dist/sql-utils.d.mts +22 -0
- package/dist/sql-utils.d.mts.map +1 -0
- package/dist/sql-utils.mjs +3 -0
- package/dist/sqlite-migration-BYgrMZdR.d.mts +18 -0
- package/dist/sqlite-migration-BYgrMZdR.d.mts.map +1 -0
- package/dist/sqlite-migration-CnLhIrJF.mjs +17 -0
- package/dist/sqlite-migration-CnLhIrJF.mjs.map +1 -0
- package/dist/statement-builders-B3OGOp7n.mjs +148 -0
- package/dist/statement-builders-B3OGOp7n.mjs.map +1 -0
- package/dist/statement-builders.d.mts +48 -0
- package/dist/statement-builders.d.mts.map +1 -0
- package/dist/statement-builders.mjs +3 -0
- package/dist/tables-sKIg_lWE.mjs +408 -0
- package/dist/tables-sKIg_lWE.mjs.map +1 -0
- package/package.json +29 -7
- package/src/core/authoring.ts +9 -0
- package/src/core/codec-ids.ts +13 -0
- package/src/core/codecs.ts +119 -0
- package/src/core/control-target.ts +54 -11
- package/src/core/default-normalizer.ts +92 -0
- package/src/core/descriptor-meta.ts +5 -1
- package/src/core/migrations/issue-planner.ts +586 -0
- package/src/core/migrations/op-factory-call.ts +332 -0
- package/src/core/migrations/operations/columns.ts +62 -0
- package/src/core/migrations/operations/data-transform.ts +51 -0
- package/src/core/migrations/operations/indexes.ts +52 -0
- package/src/core/migrations/operations/shared.ts +120 -0
- package/src/core/migrations/operations/tables.ts +388 -0
- package/src/core/migrations/planner-ddl-builders.ts +142 -0
- package/src/core/migrations/planner-produced-sqlite-migration.ts +56 -0
- package/src/core/migrations/planner-strategies.ts +231 -0
- package/src/core/migrations/planner-target-details.ts +33 -0
- package/src/core/migrations/planner.ts +149 -0
- package/src/core/migrations/render-ops.ts +9 -0
- package/src/core/migrations/render-typescript.ts +91 -0
- package/src/core/migrations/runner.ts +593 -0
- package/src/core/migrations/sqlite-migration.ts +13 -0
- package/src/core/migrations/statement-builders.ts +190 -0
- package/src/core/native-type-normalizer.ts +9 -0
- package/src/core/sql-utils.ts +47 -0
- package/src/exports/codec-ids.ts +13 -0
- package/src/exports/codec-types.ts +6 -0
- package/src/exports/codecs.ts +1 -0
- package/src/exports/control.ts +1 -0
- package/src/exports/default-normalizer.ts +1 -0
- package/src/exports/migration.ts +23 -0
- package/src/exports/native-type-normalizer.ts +1 -0
- package/src/exports/op-factory-call.ts +11 -0
- package/src/exports/planner-produced-sqlite-migration.ts +4 -0
- package/src/exports/planner-target-details.ts +2 -0
- package/src/exports/planner.ts +2 -0
- package/src/exports/render-ops.ts +1 -0
- package/src/exports/sql-utils.ts +1 -0
- package/src/exports/statement-builders.ts +11 -0
- package/dist/descriptor-meta-DbuuziYA.mjs +0 -14
- package/dist/descriptor-meta-DbuuziYA.mjs.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma-next/sql-relational-core/ast";
|
|
2
|
+
|
|
3
|
+
//#region src/core/codec-ids.ts
|
|
4
|
+
const SQLITE_TEXT_CODEC_ID = "sqlite/text@1";
|
|
5
|
+
const SQLITE_INTEGER_CODEC_ID = "sqlite/integer@1";
|
|
6
|
+
const SQLITE_REAL_CODEC_ID = "sqlite/real@1";
|
|
7
|
+
const SQLITE_BLOB_CODEC_ID = "sqlite/blob@1";
|
|
8
|
+
const SQLITE_DATETIME_CODEC_ID = "sqlite/datetime@1";
|
|
9
|
+
const SQLITE_JSON_CODEC_ID = "sqlite/json@1";
|
|
10
|
+
const SQLITE_BIGINT_CODEC_ID = "sqlite/bigint@1";
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { SQLITE_JSON_CODEC_ID as a, SQL_CHAR_CODEC_ID as c, SQL_VARCHAR_CODEC_ID as d, SQLITE_INTEGER_CODEC_ID as i, SQL_FLOAT_CODEC_ID as l, SQLITE_BLOB_CODEC_ID as n, SQLITE_REAL_CODEC_ID as o, SQLITE_DATETIME_CODEC_ID as r, SQLITE_TEXT_CODEC_ID as s, SQLITE_BIGINT_CODEC_ID as t, SQL_INT_CODEC_ID as u };
|
|
14
|
+
//# sourceMappingURL=codec-ids-B1-OiN8Q.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-B1-OiN8Q.mjs","names":[],"sources":["../src/core/codec-ids.ts"],"sourcesContent":["export {\n SQL_CHAR_CODEC_ID,\n SQL_FLOAT_CODEC_ID,\n SQL_INT_CODEC_ID,\n SQL_VARCHAR_CODEC_ID,\n} from '@prisma-next/sql-relational-core/ast';\nexport const SQLITE_TEXT_CODEC_ID = 'sqlite/text@1' as const;\nexport const SQLITE_INTEGER_CODEC_ID = 'sqlite/integer@1' as const;\nexport const SQLITE_REAL_CODEC_ID = 'sqlite/real@1' as const;\nexport const SQLITE_BLOB_CODEC_ID = 'sqlite/blob@1' as const;\nexport const SQLITE_DATETIME_CODEC_ID = 'sqlite/datetime@1' as const;\nexport const SQLITE_JSON_CODEC_ID = 'sqlite/json@1' as const;\nexport const SQLITE_BIGINT_CODEC_ID = 'sqlite/bigint@1' as const;\n"],"mappings":";;;AAMA,MAAa,uBAAuB;AACpC,MAAa,0BAA0B;AACvC,MAAa,uBAAuB;AACpC,MAAa,uBAAuB;AACpC,MAAa,2BAA2B;AACxC,MAAa,uBAAuB;AACpC,MAAa,yBAAyB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_VARCHAR_CODEC_ID } from "@prisma-next/sql-relational-core/ast";
|
|
2
|
+
|
|
3
|
+
//#region src/core/codec-ids.d.ts
|
|
4
|
+
declare const SQLITE_TEXT_CODEC_ID: "sqlite/text@1";
|
|
5
|
+
declare const SQLITE_INTEGER_CODEC_ID: "sqlite/integer@1";
|
|
6
|
+
declare const SQLITE_REAL_CODEC_ID: "sqlite/real@1";
|
|
7
|
+
declare const SQLITE_BLOB_CODEC_ID: "sqlite/blob@1";
|
|
8
|
+
declare const SQLITE_DATETIME_CODEC_ID: "sqlite/datetime@1";
|
|
9
|
+
declare const SQLITE_JSON_CODEC_ID: "sqlite/json@1";
|
|
10
|
+
declare const SQLITE_BIGINT_CODEC_ID: "sqlite/bigint@1";
|
|
11
|
+
//#endregion
|
|
12
|
+
export { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_VARCHAR_CODEC_ID };
|
|
13
|
+
//# sourceMappingURL=codec-ids.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids.d.mts","names":[],"sources":["../src/core/codec-ids.ts"],"sourcesContent":[],"mappings":";;;cAMa;cACA;AADA,cAEA,oBAF+C,EAAA,eAAA;AAC/C,cAEA,oBAFqD,EAAA,eAAA;AACrD,cAEA,wBAF+C,EAAA,mBAAA;AAC/C,cAEA,oBAF+C,EAAA,eAAA;AAC/C,cAEA,sBAFuD,EAAA,iBAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as SQLITE_JSON_CODEC_ID, c as SQL_CHAR_CODEC_ID, d as SQL_VARCHAR_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, l as SQL_FLOAT_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID, u as SQL_INT_CODEC_ID } from "./codec-ids-B1-OiN8Q.mjs";
|
|
2
|
+
|
|
3
|
+
export { SQLITE_BIGINT_CODEC_ID, SQLITE_BLOB_CODEC_ID, SQLITE_DATETIME_CODEC_ID, SQLITE_INTEGER_CODEC_ID, SQLITE_JSON_CODEC_ID, SQLITE_REAL_CODEC_ID, SQLITE_TEXT_CODEC_ID, SQL_CHAR_CODEC_ID, SQL_FLOAT_CODEC_ID, SQL_INT_CODEC_ID, SQL_VARCHAR_CODEC_ID };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { i as dataTypes, n as JsonValue, t as CodecTypes$1 } from "./codecs-D4jgBM6T.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/exports/codec-types.d.ts
|
|
4
|
+
type CodecTypes = CodecTypes$1;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { CodecTypes, type JsonValue, dataTypes };
|
|
7
|
+
//# sourceMappingURL=codec-types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types.d.mts","names":[],"sources":["../src/exports/codec-types.ts"],"sourcesContent":[],"mappings":";;;KAEY,UAAA,GAAa"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { a as SQLITE_JSON_CODEC_ID, i as SQLITE_INTEGER_CODEC_ID, n as SQLITE_BLOB_CODEC_ID, o as SQLITE_REAL_CODEC_ID, r as SQLITE_DATETIME_CODEC_ID, s as SQLITE_TEXT_CODEC_ID, t as SQLITE_BIGINT_CODEC_ID } from "./codec-ids-B1-OiN8Q.mjs";
|
|
2
|
+
import { codec, defineCodecs, sqlCodecDefinitions } from "@prisma-next/sql-relational-core/ast";
|
|
3
|
+
|
|
4
|
+
//#region src/core/codecs.ts
|
|
5
|
+
const sqlCharCodec = sqlCodecDefinitions.char.codec;
|
|
6
|
+
const sqlVarcharCodec = sqlCodecDefinitions.varchar.codec;
|
|
7
|
+
const sqlIntCodec = sqlCodecDefinitions.int.codec;
|
|
8
|
+
const sqlFloatCodec = sqlCodecDefinitions.float.codec;
|
|
9
|
+
const sqliteTextCodec = codec({
|
|
10
|
+
typeId: SQLITE_TEXT_CODEC_ID,
|
|
11
|
+
targetTypes: ["text"],
|
|
12
|
+
traits: [
|
|
13
|
+
"equality",
|
|
14
|
+
"order",
|
|
15
|
+
"textual"
|
|
16
|
+
],
|
|
17
|
+
encode: (value) => value,
|
|
18
|
+
decode: (wire) => wire
|
|
19
|
+
});
|
|
20
|
+
const sqliteIntegerCodec = codec({
|
|
21
|
+
typeId: SQLITE_INTEGER_CODEC_ID,
|
|
22
|
+
targetTypes: ["integer"],
|
|
23
|
+
traits: [
|
|
24
|
+
"equality",
|
|
25
|
+
"order",
|
|
26
|
+
"numeric"
|
|
27
|
+
],
|
|
28
|
+
encode: (value) => value,
|
|
29
|
+
decode: (wire) => wire
|
|
30
|
+
});
|
|
31
|
+
const sqliteRealCodec = codec({
|
|
32
|
+
typeId: SQLITE_REAL_CODEC_ID,
|
|
33
|
+
targetTypes: ["real"],
|
|
34
|
+
traits: [
|
|
35
|
+
"equality",
|
|
36
|
+
"order",
|
|
37
|
+
"numeric"
|
|
38
|
+
],
|
|
39
|
+
encode: (value) => value,
|
|
40
|
+
decode: (wire) => wire
|
|
41
|
+
});
|
|
42
|
+
const sqliteBlobCodec = codec({
|
|
43
|
+
typeId: SQLITE_BLOB_CODEC_ID,
|
|
44
|
+
targetTypes: ["blob"],
|
|
45
|
+
traits: ["equality"],
|
|
46
|
+
encode: (value) => value,
|
|
47
|
+
decode: (wire) => wire,
|
|
48
|
+
encodeJson: (value) => Buffer.from(value).toString("base64"),
|
|
49
|
+
decodeJson: (json) => {
|
|
50
|
+
if (typeof json !== "string") throw new TypeError("sqlite/blob@1 contract value must be a base64 string");
|
|
51
|
+
return new Uint8Array(Buffer.from(json, "base64"));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const sqliteDatetimeCodec = codec({
|
|
55
|
+
typeId: SQLITE_DATETIME_CODEC_ID,
|
|
56
|
+
targetTypes: ["text"],
|
|
57
|
+
traits: ["equality", "order"],
|
|
58
|
+
encode: (value) => value.toISOString(),
|
|
59
|
+
decode: (wire) => new Date(wire),
|
|
60
|
+
encodeJson: (value) => value.toISOString(),
|
|
61
|
+
decodeJson: (json) => {
|
|
62
|
+
if (typeof json !== "string") throw new TypeError("sqlite/datetime@1 contract value must be an ISO-8601 string");
|
|
63
|
+
return new Date(json);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const sqliteJsonCodec = codec({
|
|
67
|
+
typeId: SQLITE_JSON_CODEC_ID,
|
|
68
|
+
targetTypes: ["text"],
|
|
69
|
+
traits: ["equality"],
|
|
70
|
+
encode: (value) => JSON.stringify(value),
|
|
71
|
+
decode: (wire) => typeof wire === "string" ? JSON.parse(wire) : wire
|
|
72
|
+
});
|
|
73
|
+
const sqliteBigintCodec = codec({
|
|
74
|
+
typeId: SQLITE_BIGINT_CODEC_ID,
|
|
75
|
+
targetTypes: ["integer"],
|
|
76
|
+
traits: [
|
|
77
|
+
"equality",
|
|
78
|
+
"order",
|
|
79
|
+
"numeric"
|
|
80
|
+
],
|
|
81
|
+
encode: (value) => value,
|
|
82
|
+
decode: (wire) => BigInt(wire),
|
|
83
|
+
encodeJson: (value) => value.toString(),
|
|
84
|
+
decodeJson: (json) => {
|
|
85
|
+
if (typeof json !== "string" && typeof json !== "number") throw new TypeError("sqlite/bigint@1 contract value must be a string or number");
|
|
86
|
+
return BigInt(json);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const codecs = defineCodecs().add("char", sqlCharCodec).add("varchar", sqlVarcharCodec).add("int", sqlIntCodec).add("float", sqlFloatCodec).add("text", sqliteTextCodec).add("integer", sqliteIntegerCodec).add("real", sqliteRealCodec).add("blob", sqliteBlobCodec).add("datetime", sqliteDatetimeCodec).add("json", sqliteJsonCodec).add("bigint", sqliteBigintCodec);
|
|
90
|
+
const codecDefinitions = codecs.codecDefinitions;
|
|
91
|
+
const dataTypes = codecs.dataTypes;
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
export { dataTypes as n, codecDefinitions as t };
|
|
95
|
+
//# sourceMappingURL=codecs-5GJysiEg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-5GJysiEg.mjs","names":[],"sources":["../src/core/codecs.ts"],"sourcesContent":["import { codec, defineCodecs, sqlCodecDefinitions } from '@prisma-next/sql-relational-core/ast';\nimport {\n SQLITE_BIGINT_CODEC_ID,\n SQLITE_BLOB_CODEC_ID,\n SQLITE_DATETIME_CODEC_ID,\n SQLITE_INTEGER_CODEC_ID,\n SQLITE_JSON_CODEC_ID,\n SQLITE_REAL_CODEC_ID,\n SQLITE_TEXT_CODEC_ID,\n} from './codec-ids';\n\nconst sqlCharCodec = sqlCodecDefinitions.char.codec;\nconst sqlVarcharCodec = sqlCodecDefinitions.varchar.codec;\nconst sqlIntCodec = sqlCodecDefinitions.int.codec;\nconst sqlFloatCodec = sqlCodecDefinitions.float.codec;\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | { readonly [key: string]: JsonValue }\n | readonly JsonValue[];\n\nconst sqliteTextCodec = codec({\n typeId: SQLITE_TEXT_CODEC_ID,\n targetTypes: ['text'],\n traits: ['equality', 'order', 'textual'],\n encode: (value: string): string => value,\n decode: (wire: string): string => wire,\n});\n\nconst sqliteIntegerCodec = codec({\n typeId: SQLITE_INTEGER_CODEC_ID,\n targetTypes: ['integer'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n});\n\nconst sqliteRealCodec = codec({\n typeId: SQLITE_REAL_CODEC_ID,\n targetTypes: ['real'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: number): number => value,\n decode: (wire: number): number => wire,\n});\n\nconst sqliteBlobCodec = codec({\n typeId: SQLITE_BLOB_CODEC_ID,\n targetTypes: ['blob'],\n traits: ['equality'],\n encode: (value: Uint8Array): Uint8Array => value,\n decode: (wire: Uint8Array): Uint8Array => wire,\n encodeJson: (value: Uint8Array): string => Buffer.from(value).toString('base64'),\n decodeJson: (json: JsonValue): Uint8Array => {\n if (typeof json !== 'string') {\n throw new TypeError('sqlite/blob@1 contract value must be a base64 string');\n }\n return new Uint8Array(Buffer.from(json, 'base64'));\n },\n});\n\nconst sqliteDatetimeCodec = codec({\n typeId: SQLITE_DATETIME_CODEC_ID,\n targetTypes: ['text'],\n traits: ['equality', 'order'],\n encode: (value: Date): string => value.toISOString(),\n decode: (wire: string): Date => new Date(wire),\n encodeJson: (value: Date): string => value.toISOString(),\n decodeJson: (json: JsonValue): Date => {\n if (typeof json !== 'string') {\n throw new TypeError('sqlite/datetime@1 contract value must be an ISO-8601 string');\n }\n return new Date(json);\n },\n});\n\nconst sqliteJsonCodec = codec({\n typeId: SQLITE_JSON_CODEC_ID,\n targetTypes: ['text'],\n traits: ['equality'],\n encode: (value: JsonValue): string => JSON.stringify(value),\n decode: (wire: string | JsonValue): JsonValue =>\n typeof wire === 'string' ? (JSON.parse(wire) as JsonValue) : wire,\n});\n\nconst sqliteBigintCodec = codec({\n typeId: SQLITE_BIGINT_CODEC_ID,\n targetTypes: ['integer'],\n traits: ['equality', 'order', 'numeric'],\n encode: (value: bigint): number | bigint => value,\n decode: (wire: number | bigint): bigint => BigInt(wire),\n encodeJson: (value: bigint): string => value.toString(),\n decodeJson: (json: JsonValue): bigint => {\n if (typeof json !== 'string' && typeof json !== 'number') {\n throw new TypeError('sqlite/bigint@1 contract value must be a string or number');\n }\n return BigInt(json);\n },\n});\n\nconst codecs = defineCodecs()\n .add('char', sqlCharCodec)\n .add('varchar', sqlVarcharCodec)\n .add('int', sqlIntCodec)\n .add('float', sqlFloatCodec)\n .add('text', sqliteTextCodec)\n .add('integer', sqliteIntegerCodec)\n .add('real', sqliteRealCodec)\n .add('blob', sqliteBlobCodec)\n .add('datetime', sqliteDatetimeCodec)\n .add('json', sqliteJsonCodec)\n .add('bigint', sqliteBigintCodec);\n\nexport const codecDefinitions = codecs.codecDefinitions;\nexport const dataTypes = codecs.dataTypes;\n\nexport type CodecTypes = typeof codecs.CodecTypes;\n"],"mappings":";;;;AAWA,MAAM,eAAe,oBAAoB,KAAK;AAC9C,MAAM,kBAAkB,oBAAoB,QAAQ;AACpD,MAAM,cAAc,oBAAoB,IAAI;AAC5C,MAAM,gBAAgB,oBAAoB,MAAM;AAUhD,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAA0B;CACnC,SAAS,SAAyB;CACnC,CAAC;AAEF,MAAM,qBAAqB,MAAM;CAC/B,QAAQ;CACR,aAAa,CAAC,UAAU;CACxB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAA0B;CACnC,SAAS,SAAyB;CACnC,CAAC;AAEF,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAA0B;CACnC,SAAS,SAAyB;CACnC,CAAC;AAEF,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ,CAAC,WAAW;CACpB,SAAS,UAAkC;CAC3C,SAAS,SAAiC;CAC1C,aAAa,UAA8B,OAAO,KAAK,MAAM,CAAC,SAAS,SAAS;CAChF,aAAa,SAAgC;AAC3C,MAAI,OAAO,SAAS,SAClB,OAAM,IAAI,UAAU,uDAAuD;AAE7E,SAAO,IAAI,WAAW,OAAO,KAAK,MAAM,SAAS,CAAC;;CAErD,CAAC;AAEF,MAAM,sBAAsB,MAAM;CAChC,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ,CAAC,YAAY,QAAQ;CAC7B,SAAS,UAAwB,MAAM,aAAa;CACpD,SAAS,SAAuB,IAAI,KAAK,KAAK;CAC9C,aAAa,UAAwB,MAAM,aAAa;CACxD,aAAa,SAA0B;AACrC,MAAI,OAAO,SAAS,SAClB,OAAM,IAAI,UAAU,8DAA8D;AAEpF,SAAO,IAAI,KAAK,KAAK;;CAExB,CAAC;AAEF,MAAM,kBAAkB,MAAM;CAC5B,QAAQ;CACR,aAAa,CAAC,OAAO;CACrB,QAAQ,CAAC,WAAW;CACpB,SAAS,UAA6B,KAAK,UAAU,MAAM;CAC3D,SAAS,SACP,OAAO,SAAS,WAAY,KAAK,MAAM,KAAK,GAAiB;CAChE,CAAC;AAEF,MAAM,oBAAoB,MAAM;CAC9B,QAAQ;CACR,aAAa,CAAC,UAAU;CACxB,QAAQ;EAAC;EAAY;EAAS;EAAU;CACxC,SAAS,UAAmC;CAC5C,SAAS,SAAkC,OAAO,KAAK;CACvD,aAAa,UAA0B,MAAM,UAAU;CACvD,aAAa,SAA4B;AACvC,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,SAC9C,OAAM,IAAI,UAAU,4DAA4D;AAElF,SAAO,OAAO,KAAK;;CAEtB,CAAC;AAEF,MAAM,SAAS,cAAc,CAC1B,IAAI,QAAQ,aAAa,CACzB,IAAI,WAAW,gBAAgB,CAC/B,IAAI,OAAO,YAAY,CACvB,IAAI,SAAS,cAAc,CAC3B,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,WAAW,mBAAmB,CAClC,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,YAAY,oBAAoB,CACpC,IAAI,QAAQ,gBAAgB,CAC5B,IAAI,UAAU,kBAAkB;AAEnC,MAAa,mBAAmB,OAAO;AACvC,MAAa,YAAY,OAAO"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as _prisma_next_sql_relational_core_ast0 from "@prisma-next/sql-relational-core/ast";
|
|
2
|
+
|
|
3
|
+
//#region src/core/codecs.d.ts
|
|
4
|
+
type JsonValue = string | number | boolean | null | {
|
|
5
|
+
readonly [key: string]: JsonValue;
|
|
6
|
+
} | readonly JsonValue[];
|
|
7
|
+
declare const codecs: _prisma_next_sql_relational_core_ast0.CodecDefBuilder<{
|
|
8
|
+
char: _prisma_next_sql_relational_core_ast0.Codec<"sql/char@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
|
|
9
|
+
varchar: _prisma_next_sql_relational_core_ast0.Codec<"sql/varchar@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
|
|
10
|
+
int: _prisma_next_sql_relational_core_ast0.Codec<"sql/int@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
11
|
+
float: _prisma_next_sql_relational_core_ast0.Codec<"sql/float@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
12
|
+
text: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/text@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
|
|
13
|
+
integer: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/integer@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
14
|
+
real: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/real@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
15
|
+
blob: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/blob@1", readonly ["equality"], Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, Record<string, unknown>, unknown>;
|
|
16
|
+
datetime: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/datetime@1", readonly ["equality", "order"], string, Date, Record<string, unknown>, unknown>;
|
|
17
|
+
json: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/json@1", readonly ["equality"], string | number | boolean | {
|
|
18
|
+
readonly [key: string]: JsonValue;
|
|
19
|
+
} | readonly JsonValue[] | null, string | number | boolean | {
|
|
20
|
+
readonly [key: string]: JsonValue;
|
|
21
|
+
} | readonly JsonValue[] | null, Record<string, unknown>, unknown>;
|
|
22
|
+
} & Record<"bigint", _prisma_next_sql_relational_core_ast0.Codec<"sqlite/bigint@1", readonly ["equality", "order", "numeric"], number | bigint, bigint, Record<string, unknown>, unknown>>>;
|
|
23
|
+
declare const codecDefinitions: {
|
|
24
|
+
readonly char: {
|
|
25
|
+
readonly typeId: "sql/char@1";
|
|
26
|
+
readonly scalar: "char";
|
|
27
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sql/char@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
|
|
28
|
+
readonly input: string;
|
|
29
|
+
readonly output: string;
|
|
30
|
+
readonly jsType: string;
|
|
31
|
+
};
|
|
32
|
+
readonly varchar: {
|
|
33
|
+
readonly typeId: "sql/varchar@1";
|
|
34
|
+
readonly scalar: "varchar";
|
|
35
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sql/varchar@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
|
|
36
|
+
readonly input: string;
|
|
37
|
+
readonly output: string;
|
|
38
|
+
readonly jsType: string;
|
|
39
|
+
};
|
|
40
|
+
readonly int: {
|
|
41
|
+
readonly typeId: "sql/int@1";
|
|
42
|
+
readonly scalar: "int";
|
|
43
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sql/int@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
44
|
+
readonly input: number;
|
|
45
|
+
readonly output: number;
|
|
46
|
+
readonly jsType: number;
|
|
47
|
+
};
|
|
48
|
+
readonly float: {
|
|
49
|
+
readonly typeId: "sql/float@1";
|
|
50
|
+
readonly scalar: "float";
|
|
51
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sql/float@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
52
|
+
readonly input: number;
|
|
53
|
+
readonly output: number;
|
|
54
|
+
readonly jsType: number;
|
|
55
|
+
};
|
|
56
|
+
readonly text: {
|
|
57
|
+
readonly typeId: "sqlite/text@1";
|
|
58
|
+
readonly scalar: "text";
|
|
59
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/text@1", readonly ["equality", "order", "textual"], string, string, Record<string, unknown>, unknown>;
|
|
60
|
+
readonly input: string;
|
|
61
|
+
readonly output: string;
|
|
62
|
+
readonly jsType: string;
|
|
63
|
+
};
|
|
64
|
+
readonly integer: {
|
|
65
|
+
readonly typeId: "sqlite/integer@1";
|
|
66
|
+
readonly scalar: "integer";
|
|
67
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/integer@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
68
|
+
readonly input: number;
|
|
69
|
+
readonly output: number;
|
|
70
|
+
readonly jsType: number;
|
|
71
|
+
};
|
|
72
|
+
readonly real: {
|
|
73
|
+
readonly typeId: "sqlite/real@1";
|
|
74
|
+
readonly scalar: "real";
|
|
75
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/real@1", readonly ["equality", "order", "numeric"], number, number, Record<string, unknown>, unknown>;
|
|
76
|
+
readonly input: number;
|
|
77
|
+
readonly output: number;
|
|
78
|
+
readonly jsType: number;
|
|
79
|
+
};
|
|
80
|
+
readonly blob: {
|
|
81
|
+
readonly typeId: "sqlite/blob@1";
|
|
82
|
+
readonly scalar: "blob";
|
|
83
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/blob@1", readonly ["equality"], Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>, Record<string, unknown>, unknown>;
|
|
84
|
+
readonly input: Uint8Array<ArrayBufferLike>;
|
|
85
|
+
readonly output: Uint8Array<ArrayBufferLike>;
|
|
86
|
+
readonly jsType: Uint8Array<ArrayBufferLike>;
|
|
87
|
+
};
|
|
88
|
+
readonly datetime: {
|
|
89
|
+
readonly typeId: "sqlite/datetime@1";
|
|
90
|
+
readonly scalar: "datetime";
|
|
91
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/datetime@1", readonly ["equality", "order"], string, Date, Record<string, unknown>, unknown>;
|
|
92
|
+
readonly input: Date;
|
|
93
|
+
readonly output: Date;
|
|
94
|
+
readonly jsType: Date;
|
|
95
|
+
};
|
|
96
|
+
readonly json: {
|
|
97
|
+
readonly typeId: "sqlite/json@1";
|
|
98
|
+
readonly scalar: "json";
|
|
99
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/json@1", readonly ["equality"], string | number | boolean | {
|
|
100
|
+
readonly [key: string]: JsonValue;
|
|
101
|
+
} | readonly JsonValue[] | null, string | number | boolean | {
|
|
102
|
+
readonly [key: string]: JsonValue;
|
|
103
|
+
} | readonly JsonValue[] | null, Record<string, unknown>, unknown>;
|
|
104
|
+
readonly input: string | number | boolean | {
|
|
105
|
+
readonly [key: string]: JsonValue;
|
|
106
|
+
} | readonly JsonValue[] | null;
|
|
107
|
+
readonly output: string | number | boolean | {
|
|
108
|
+
readonly [key: string]: JsonValue;
|
|
109
|
+
} | readonly JsonValue[] | null;
|
|
110
|
+
readonly jsType: string | number | boolean | {
|
|
111
|
+
readonly [key: string]: JsonValue;
|
|
112
|
+
} | readonly JsonValue[] | null;
|
|
113
|
+
};
|
|
114
|
+
readonly bigint: {
|
|
115
|
+
readonly typeId: "sqlite/bigint@1";
|
|
116
|
+
readonly scalar: "bigint";
|
|
117
|
+
readonly codec: _prisma_next_sql_relational_core_ast0.Codec<"sqlite/bigint@1", readonly ["equality", "order", "numeric"], number | bigint, bigint, Record<string, unknown>, unknown>;
|
|
118
|
+
readonly input: bigint;
|
|
119
|
+
readonly output: bigint;
|
|
120
|
+
readonly jsType: bigint;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
declare const dataTypes: {
|
|
124
|
+
readonly char: "sql/char@1";
|
|
125
|
+
readonly varchar: "sql/varchar@1";
|
|
126
|
+
readonly int: "sql/int@1";
|
|
127
|
+
readonly float: "sql/float@1";
|
|
128
|
+
readonly text: "sqlite/text@1";
|
|
129
|
+
readonly integer: "sqlite/integer@1";
|
|
130
|
+
readonly real: "sqlite/real@1";
|
|
131
|
+
readonly blob: "sqlite/blob@1";
|
|
132
|
+
readonly datetime: "sqlite/datetime@1";
|
|
133
|
+
readonly json: "sqlite/json@1";
|
|
134
|
+
readonly bigint: "sqlite/bigint@1";
|
|
135
|
+
};
|
|
136
|
+
type CodecTypes = typeof codecs.CodecTypes;
|
|
137
|
+
//#endregion
|
|
138
|
+
export { dataTypes as i, JsonValue as n, codecDefinitions as r, CodecTypes as t };
|
|
139
|
+
//# sourceMappingURL=codecs-D4jgBM6T.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-D4jgBM6T.d.mts","names":[],"sources":["../src/core/codecs.ts"],"sourcesContent":[],"mappings":";;;KAgBY,SAAA;0BAKkB;aACjB;AANb,cAsFM,MAtFe,wCAsFT,eAhFU,CAAA;EAgFhB,IAAA,6CAW6B,CAAA,YAAA,EAAA,SAAA,CAAA,UAAA,EAAA,OAAA,EAAA,SAAA,CAAA,EAAA,MAAA,EAAA,MAAA,QAAA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,CAAA;;;;;;;;;;;;;;;cAEtB;;;;;;;;;;;;;;;;;;;IAbD,SAAA,MAAA,EAAA,KAAA;IAaC,SAAA,KAAA,6CAA0C,CAAA,WAAA,EAAA,SAAA,CAAA,UAAA,EAAA,OAAA,EAAA,SAAA,CAAA,EAAA,MAAA,EAAA,MAAA,QAAA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAC1C,SAA4B,KAAA,6CAAA,CAAA,mBAAA,EAAA,SAAA,CAAA,UAAA,EAAA,OAAA,CAAA,EAAA,MAAA,MAAA,QAAA,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA,CAAA;IAE7B,SAAU,KAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAFT;;;;;;;;;;;;;KAED,UAAA,UAAoB,MAAA,CAAO"}
|
package/dist/codecs.mjs
ADDED
package/dist/control.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as SqlitePlanTargetDetails } from "./planner-target-details-DTIFFx4L.mjs";
|
|
2
|
+
import { SqlControlTargetDescriptor } from "@prisma-next/family-sql/control";
|
|
2
3
|
|
|
3
4
|
//#region src/core/control-target.d.ts
|
|
4
|
-
declare const sqliteControlTargetDescriptor:
|
|
5
|
+
declare const sqliteControlTargetDescriptor: SqlControlTargetDescriptor<'sqlite', SqlitePlanTargetDetails>;
|
|
5
6
|
//#endregion
|
|
6
|
-
export { sqliteControlTargetDescriptor as default };
|
|
7
|
+
export { type SqlitePlanTargetDetails, sqliteControlTargetDescriptor as default };
|
|
7
8
|
//# sourceMappingURL=control.d.mts.map
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts"],"sourcesContent":[],"mappings":";;;;cA4BM,+BAA+B,qCAAqC"}
|