@prisma-next/target-sqlite 0.5.0-dev.66 → 0.5.0-dev.68
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-DyLO2Rfx.d.mts → codec-ids-CYwMu3-4.d.mts} +1 -1
- package/dist/codec-ids-CYwMu3-4.d.mts.map +1 -0
- package/dist/{codec-ids-B1-OiN8Q.mjs → codec-ids-CuUxYcd0.mjs} +2 -3
- package/dist/{codec-ids-B1-OiN8Q.mjs.map → codec-ids-CuUxYcd0.mjs.map} +1 -1
- package/dist/codec-ids.d.mts +1 -1
- package/dist/codec-ids.mjs +2 -3
- package/dist/{codec-types-Bbzv7qCW.d.mts → codec-types-DNauB5UT.d.mts} +7 -8
- package/dist/codec-types-DNauB5UT.d.mts.map +1 -0
- package/dist/codec-types.d.mts +2 -3
- package/dist/codec-types.mjs +2 -3
- package/dist/{codecs-BqDitp2X.d.mts → codecs-BAlEiSeP.d.mts} +18 -19
- package/dist/codecs-BAlEiSeP.d.mts.map +1 -0
- package/dist/{codecs-CDcidsHL.mjs → codecs-DVnHtVWW.mjs} +3 -4
- package/dist/codecs-DVnHtVWW.mjs.map +1 -0
- package/dist/codecs.d.mts +1 -2
- package/dist/codecs.mjs +2 -3
- package/dist/codecs.mjs.map +1 -1
- package/dist/control.d.mts +1 -1
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +127 -61
- package/dist/control.mjs.map +1 -1
- package/dist/{default-normalizer-R-sQXAYt.mjs → default-normalizer-3Fccw7yw.mjs} +2 -2
- package/dist/{default-normalizer-R-sQXAYt.mjs.map → default-normalizer-3Fccw7yw.mjs.map} +1 -1
- package/dist/default-normalizer.d.mts +0 -1
- package/dist/default-normalizer.d.mts.map +1 -1
- package/dist/default-normalizer.mjs +2 -3
- package/dist/descriptor-meta-CE2Kbn9b.mjs +17 -0
- package/dist/descriptor-meta-CE2Kbn9b.mjs.map +1 -0
- package/dist/migration.d.mts +13 -4
- package/dist/migration.d.mts.map +1 -1
- package/dist/migration.mjs +17 -6
- package/dist/migration.mjs.map +1 -1
- package/dist/{native-type-normalizer-BMovohPm.mjs → native-type-normalizer-BlN5XfD-.mjs} +2 -2
- package/dist/{native-type-normalizer-BMovohPm.mjs.map → native-type-normalizer-BlN5XfD-.mjs.map} +1 -1
- package/dist/native-type-normalizer.d.mts.map +1 -1
- package/dist/native-type-normalizer.mjs +2 -3
- package/dist/{op-factory-call-BUVV-W9F.mjs → op-factory-call-DRKKURAO.mjs} +32 -5
- package/dist/{op-factory-call-BUVV-W9F.mjs.map → op-factory-call-DRKKURAO.mjs.map} +1 -1
- package/dist/{op-factory-call-dUIOao68.d.mts → op-factory-call-FrU2vXqw.d.mts} +23 -6
- package/dist/op-factory-call-FrU2vXqw.d.mts.map +1 -0
- package/dist/op-factory-call.d.mts +2 -3
- package/dist/op-factory-call.mjs +2 -3
- package/dist/pack.d.mts +1 -3
- package/dist/pack.d.mts.map +1 -1
- package/dist/pack.mjs +2 -3
- package/dist/{planner-DmOFOhoq.mjs → planner-C94LJeIM.mjs} +16 -13
- package/dist/planner-C94LJeIM.mjs.map +1 -0
- package/dist/{planner-produced-sqlite-migration-CJr8ATRH.d.mts → planner-produced-sqlite-migration-BblR19lI.d.mts} +4 -4
- package/dist/planner-produced-sqlite-migration-BblR19lI.d.mts.map +1 -0
- package/dist/{planner-produced-sqlite-migration-BANB82Pw.mjs → planner-produced-sqlite-migration-CH7YGZf6.mjs} +4 -6
- package/dist/planner-produced-sqlite-migration-CH7YGZf6.mjs.map +1 -0
- package/dist/planner-produced-sqlite-migration.d.mts +1 -4
- package/dist/planner-produced-sqlite-migration.mjs +2 -3
- package/dist/{planner-target-details-BQIWQlBu.mjs → planner-target-details-Bm71XPKb.mjs} +2 -3
- package/dist/{planner-target-details-BQIWQlBu.mjs.map → planner-target-details-Bm71XPKb.mjs.map} +1 -1
- package/dist/{planner-target-details-CtWRvse0.d.mts → planner-target-details-vhvZDWK1.d.mts} +1 -1
- package/dist/planner-target-details-vhvZDWK1.d.mts.map +1 -0
- package/dist/planner-target-details.d.mts +1 -1
- package/dist/planner-target-details.mjs +2 -3
- package/dist/planner.d.mts +2 -5
- package/dist/planner.d.mts.map +1 -1
- package/dist/planner.mjs +2 -3
- package/dist/{render-ops-CXOv7SRC.mjs → render-ops-CSRDT4YL.mjs} +2 -2
- package/dist/{render-ops-CXOv7SRC.mjs.map → render-ops-CSRDT4YL.mjs.map} +1 -1
- package/dist/render-ops.d.mts +2 -3
- package/dist/render-ops.d.mts.map +1 -1
- package/dist/render-ops.mjs +2 -3
- package/dist/runtime.d.mts.map +1 -1
- package/dist/runtime.mjs +3 -5
- package/dist/runtime.mjs.map +1 -1
- package/dist/{shared-D_1fFqLf.d.mts → shared-qLsgTOZs.d.mts} +2 -2
- package/dist/shared-qLsgTOZs.d.mts.map +1 -0
- package/dist/{sql-utils-D3SMPFDD.mjs → sql-utils-DhevMgef.mjs} +4 -2
- package/dist/sql-utils-DhevMgef.mjs.map +1 -0
- package/dist/sql-utils.d.mts.map +1 -1
- package/dist/sql-utils.mjs +2 -3
- package/dist/{sqlite-migration-CnLhIrJF.mjs → sqlite-migration-BBJktVVw.mjs} +2 -3
- package/dist/{sqlite-migration-CnLhIrJF.mjs.map → sqlite-migration-BBJktVVw.mjs.map} +1 -1
- package/dist/{sqlite-migration-BeR1cikr.d.mts → sqlite-migration-DAb2NEX6.d.mts} +2 -3
- package/dist/sqlite-migration-DAb2NEX6.d.mts.map +1 -0
- package/dist/{statement-builders-DobaAWnW.mjs → statement-builders-Dne-LkAV.mjs} +5 -6
- package/dist/statement-builders-Dne-LkAV.mjs.map +1 -0
- package/dist/statement-builders.d.mts.map +1 -1
- package/dist/statement-builders.mjs +2 -3
- package/dist/{tables-sKIg_lWE.mjs → tables-D84zfPZI.mjs} +5 -10
- package/dist/tables-D84zfPZI.mjs.map +1 -0
- package/package.json +19 -19
- package/src/core/migrations/op-factory-call.ts +38 -1
- package/src/core/migrations/operations/raw.ts +12 -0
- package/src/core/migrations/planner.ts +30 -2
- package/src/core/migrations/runner.ts +164 -75
- package/src/exports/migration.ts +1 -0
- package/src/exports/op-factory-call.ts +1 -0
- package/dist/codec-ids-DyLO2Rfx.d.mts.map +0 -1
- package/dist/codec-types-Bbzv7qCW.d.mts.map +0 -1
- package/dist/codecs-BqDitp2X.d.mts.map +0 -1
- package/dist/codecs-CDcidsHL.mjs.map +0 -1
- package/dist/descriptor-meta-BA2YAFQq.mjs +0 -24
- package/dist/descriptor-meta-BA2YAFQq.mjs.map +0 -1
- package/dist/op-factory-call-dUIOao68.d.mts.map +0 -1
- package/dist/planner-DmOFOhoq.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-BANB82Pw.mjs.map +0 -1
- package/dist/planner-produced-sqlite-migration-CJr8ATRH.d.mts.map +0 -1
- package/dist/planner-target-details-CtWRvse0.d.mts.map +0 -1
- package/dist/shared-D_1fFqLf.d.mts.map +0 -1
- package/dist/sql-utils-D3SMPFDD.mjs.map +0 -1
- package/dist/sqlite-migration-BeR1cikr.d.mts.map +0 -1
- package/dist/statement-builders-DobaAWnW.mjs.map +0 -1
- package/dist/tables-sKIg_lWE.mjs.map +0 -1
|
@@ -10,4 +10,4 @@ declare const SQLITE_JSON_CODEC_ID: "sqlite/json@1";
|
|
|
10
10
|
declare const SQLITE_BIGINT_CODEC_ID: "sqlite/bigint@1";
|
|
11
11
|
//#endregion
|
|
12
12
|
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 };
|
|
13
|
-
//# sourceMappingURL=codec-ids-
|
|
13
|
+
//# sourceMappingURL=codec-ids-CYwMu3-4.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-ids-CYwMu3-4.d.mts","names":[],"sources":["../src/core/codec-ids.ts"],"mappings":";;;cAMa,oBAAA;AAAA,cACA,uBAAA;AAAA,cACA,oBAAA;AAAA,cACA,oBAAA;AAAA,cACA,wBAAA;AAAA,cACA,oBAAA;AAAA,cACA,sBAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
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
2
|
//#region src/core/codec-ids.ts
|
|
4
3
|
const SQLITE_TEXT_CODEC_ID = "sqlite/text@1";
|
|
5
4
|
const SQLITE_INTEGER_CODEC_ID = "sqlite/integer@1";
|
|
@@ -8,7 +7,7 @@ const SQLITE_BLOB_CODEC_ID = "sqlite/blob@1";
|
|
|
8
7
|
const SQLITE_DATETIME_CODEC_ID = "sqlite/datetime@1";
|
|
9
8
|
const SQLITE_JSON_CODEC_ID = "sqlite/json@1";
|
|
10
9
|
const SQLITE_BIGINT_CODEC_ID = "sqlite/bigint@1";
|
|
11
|
-
|
|
12
10
|
//#endregion
|
|
13
11
|
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
|
-
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=codec-ids-CuUxYcd0.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-ids-
|
|
1
|
+
{"version":3,"file":"codec-ids-CuUxYcd0.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"}
|
package/dist/codec-ids.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-CYwMu3-4.mjs";
|
|
2
2
|
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 };
|
package/dist/codec-ids.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
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-
|
|
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 };
|
|
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-CuUxYcd0.mjs";
|
|
2
|
+
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 };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, i as SqliteDatetimeDescriptor, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, r as SqliteBlobDescriptor, s as SqliteRealDescriptor } from "./codecs-
|
|
2
|
-
import * as _prisma_next_sql_relational_core_ast0 from "@prisma-next/sql-relational-core/ast";
|
|
1
|
+
import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, i as SqliteDatetimeDescriptor, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, r as SqliteBlobDescriptor, s as SqliteRealDescriptor } from "./codecs-BAlEiSeP.mjs";
|
|
2
|
+
import * as _$_prisma_next_sql_relational_core_ast0 from "@prisma-next/sql-relational-core/ast";
|
|
3
3
|
import { ExtractCodecTypes } from "@prisma-next/sql-relational-core/ast";
|
|
4
4
|
|
|
5
5
|
//#region src/exports/codec-types.d.ts
|
|
6
|
-
|
|
7
6
|
declare const codecDescriptorMap: {
|
|
8
|
-
readonly char: _prisma_next_sql_relational_core_ast0.SqlCharDescriptor;
|
|
9
|
-
readonly varchar: _prisma_next_sql_relational_core_ast0.SqlVarcharDescriptor;
|
|
10
|
-
readonly int: _prisma_next_sql_relational_core_ast0.SqlIntDescriptor;
|
|
11
|
-
readonly float: _prisma_next_sql_relational_core_ast0.SqlFloatDescriptor;
|
|
7
|
+
readonly char: _$_prisma_next_sql_relational_core_ast0.SqlCharDescriptor;
|
|
8
|
+
readonly varchar: _$_prisma_next_sql_relational_core_ast0.SqlVarcharDescriptor;
|
|
9
|
+
readonly int: _$_prisma_next_sql_relational_core_ast0.SqlIntDescriptor;
|
|
10
|
+
readonly float: _$_prisma_next_sql_relational_core_ast0.SqlFloatDescriptor;
|
|
12
11
|
readonly text: SqliteTextDescriptor;
|
|
13
12
|
readonly integer: SqliteIntegerDescriptor;
|
|
14
13
|
readonly real: SqliteRealDescriptor;
|
|
@@ -21,4 +20,4 @@ type Resolve<T> = { readonly [K in keyof T]: { readonly [P in keyof T[K]]: T[K][
|
|
|
21
20
|
type CodecTypes = Resolve<ExtractCodecTypes<typeof codecDescriptorMap>>;
|
|
22
21
|
//#endregion
|
|
23
22
|
export { CodecTypes as t };
|
|
24
|
-
//# sourceMappingURL=codec-types-
|
|
23
|
+
//# sourceMappingURL=codec-types-DNauB5UT.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-types-DNauB5UT.d.mts","names":[],"sources":["../src/exports/codec-types.ts"],"mappings":";;;;;cAwBM,kBAAA;EAAA,eAYI,uCAAA,CAAA,iBAAA;EAAA;;;;;;;;;;;KAEL,OAAA,6BAAoC,CAAA,0BAA2B,CAAA,CAAE,CAAA,IAAK,CAAA,CAAE,CAAA,EAAG,CAAA;AAAA,KAEpE,UAAA,GAAa,OAAA,CAAQ,iBAAA,QAAyB,kBAAA"}
|
package/dist/codec-types.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import {
|
|
3
|
-
import { t as CodecTypes } from "./codec-types-Bbzv7qCW.mjs";
|
|
1
|
+
import { g as JsonValue } from "./codecs-BAlEiSeP.mjs";
|
|
2
|
+
import { t as CodecTypes } from "./codec-types-DNauB5UT.mjs";
|
|
4
3
|
export { CodecTypes, JsonValue };
|
package/dist/codec-types.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { };
|
|
1
|
+
import "@prisma-next/sql-relational-core/ast";
|
|
2
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
2
|
-
import * as _prisma_next_framework_components_codec0 from "@prisma-next/framework-components/codec";
|
|
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-CYwMu3-4.mjs";
|
|
2
|
+
import * as _$_prisma_next_framework_components_codec0 from "@prisma-next/framework-components/codec";
|
|
3
3
|
import { CodecCallContext, CodecDescriptorImpl, CodecImpl, CodecInstanceContext } from "@prisma-next/framework-components/codec";
|
|
4
|
-
import * as _standard_schema_spec0 from "@standard-schema/spec";
|
|
4
|
+
import * as _$_standard_schema_spec0 from "@standard-schema/spec";
|
|
5
5
|
import { JsonValue } from "@prisma-next/contract/types";
|
|
6
6
|
import { CodecDescriptorRegistry } from "@prisma-next/sql-relational-core/query-lane-context";
|
|
7
7
|
|
|
@@ -14,7 +14,6 @@ type JsonValue$1 = string | number | boolean | null | {
|
|
|
14
14
|
} | readonly JsonValue$1[];
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/core/codecs.d.ts
|
|
17
|
-
|
|
18
17
|
declare class SqliteTextCodec extends CodecImpl<typeof SQLITE_TEXT_CODEC_ID, readonly ['equality', 'order', 'textual'], string, string> {
|
|
19
18
|
encode(value: string, _ctx: CodecCallContext): Promise<string>;
|
|
20
19
|
decode(wire: string, _ctx: CodecCallContext): Promise<string>;
|
|
@@ -25,10 +24,10 @@ declare class SqliteTextDescriptor extends CodecDescriptorImpl<void> {
|
|
|
25
24
|
readonly codecId: "sqlite/text@1";
|
|
26
25
|
readonly traits: readonly ["equality", "order", "textual"];
|
|
27
26
|
readonly targetTypes: readonly ["text"];
|
|
28
|
-
readonly paramsSchema: _standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
27
|
+
readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
29
28
|
factory(): (ctx: CodecInstanceContext) => SqliteTextCodec;
|
|
30
29
|
}
|
|
31
|
-
declare const sqliteTextColumn: () => _prisma_next_framework_components_codec0.ColumnSpec<SqliteTextCodec, undefined>;
|
|
30
|
+
declare const sqliteTextColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteTextCodec, undefined>;
|
|
32
31
|
declare class SqliteIntegerCodec extends CodecImpl<typeof SQLITE_INTEGER_CODEC_ID, readonly ['equality', 'order', 'numeric'], number, number> {
|
|
33
32
|
encode(value: number, _ctx: CodecCallContext): Promise<number>;
|
|
34
33
|
decode(wire: number, _ctx: CodecCallContext): Promise<number>;
|
|
@@ -39,10 +38,10 @@ declare class SqliteIntegerDescriptor extends CodecDescriptorImpl<void> {
|
|
|
39
38
|
readonly codecId: "sqlite/integer@1";
|
|
40
39
|
readonly traits: readonly ["equality", "order", "numeric"];
|
|
41
40
|
readonly targetTypes: readonly ["integer"];
|
|
42
|
-
readonly paramsSchema: _standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
41
|
+
readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
43
42
|
factory(): (ctx: CodecInstanceContext) => SqliteIntegerCodec;
|
|
44
43
|
}
|
|
45
|
-
declare const sqliteIntegerColumn: () => _prisma_next_framework_components_codec0.ColumnSpec<SqliteIntegerCodec, undefined>;
|
|
44
|
+
declare const sqliteIntegerColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteIntegerCodec, undefined>;
|
|
46
45
|
declare class SqliteRealCodec extends CodecImpl<typeof SQLITE_REAL_CODEC_ID, readonly ['equality', 'order', 'numeric'], number, number> {
|
|
47
46
|
encode(value: number, _ctx: CodecCallContext): Promise<number>;
|
|
48
47
|
decode(wire: number, _ctx: CodecCallContext): Promise<number>;
|
|
@@ -53,10 +52,10 @@ declare class SqliteRealDescriptor extends CodecDescriptorImpl<void> {
|
|
|
53
52
|
readonly codecId: "sqlite/real@1";
|
|
54
53
|
readonly traits: readonly ["equality", "order", "numeric"];
|
|
55
54
|
readonly targetTypes: readonly ["real"];
|
|
56
|
-
readonly paramsSchema: _standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
55
|
+
readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
57
56
|
factory(): (ctx: CodecInstanceContext) => SqliteRealCodec;
|
|
58
57
|
}
|
|
59
|
-
declare const sqliteRealColumn: () => _prisma_next_framework_components_codec0.ColumnSpec<SqliteRealCodec, undefined>;
|
|
58
|
+
declare const sqliteRealColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteRealCodec, undefined>;
|
|
60
59
|
declare class SqliteBlobCodec extends CodecImpl<typeof SQLITE_BLOB_CODEC_ID, readonly ['equality'], Uint8Array, Uint8Array> {
|
|
61
60
|
encode(value: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array>;
|
|
62
61
|
decode(wire: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array>;
|
|
@@ -67,10 +66,10 @@ declare class SqliteBlobDescriptor extends CodecDescriptorImpl<void> {
|
|
|
67
66
|
readonly codecId: "sqlite/blob@1";
|
|
68
67
|
readonly traits: readonly ["equality"];
|
|
69
68
|
readonly targetTypes: readonly ["blob"];
|
|
70
|
-
readonly paramsSchema: _standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
69
|
+
readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
71
70
|
factory(): (ctx: CodecInstanceContext) => SqliteBlobCodec;
|
|
72
71
|
}
|
|
73
|
-
declare const sqliteBlobColumn: () => _prisma_next_framework_components_codec0.ColumnSpec<SqliteBlobCodec, undefined>;
|
|
72
|
+
declare const sqliteBlobColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteBlobCodec, undefined>;
|
|
74
73
|
declare class SqliteDatetimeCodec extends CodecImpl<typeof SQLITE_DATETIME_CODEC_ID, readonly ['equality', 'order'], string, Date> {
|
|
75
74
|
private parseDate;
|
|
76
75
|
encode(value: Date, _ctx: CodecCallContext): Promise<string>;
|
|
@@ -82,10 +81,10 @@ declare class SqliteDatetimeDescriptor extends CodecDescriptorImpl<void> {
|
|
|
82
81
|
readonly codecId: "sqlite/datetime@1";
|
|
83
82
|
readonly traits: readonly ["equality", "order"];
|
|
84
83
|
readonly targetTypes: readonly ["text"];
|
|
85
|
-
readonly paramsSchema: _standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
84
|
+
readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
86
85
|
factory(): (ctx: CodecInstanceContext) => SqliteDatetimeCodec;
|
|
87
86
|
}
|
|
88
|
-
declare const sqliteDatetimeColumn: () => _prisma_next_framework_components_codec0.ColumnSpec<SqliteDatetimeCodec, undefined>;
|
|
87
|
+
declare const sqliteDatetimeColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteDatetimeCodec, undefined>;
|
|
89
88
|
declare class SqliteJsonCodec extends CodecImpl<typeof SQLITE_JSON_CODEC_ID, readonly ['equality'], string | JsonValue, JsonValue> {
|
|
90
89
|
encode(value: JsonValue, _ctx: CodecCallContext): Promise<string>;
|
|
91
90
|
decode(wire: string | JsonValue, _ctx: CodecCallContext): Promise<JsonValue>;
|
|
@@ -96,10 +95,10 @@ declare class SqliteJsonDescriptor extends CodecDescriptorImpl<void> {
|
|
|
96
95
|
readonly codecId: "sqlite/json@1";
|
|
97
96
|
readonly traits: readonly ["equality"];
|
|
98
97
|
readonly targetTypes: readonly ["text"];
|
|
99
|
-
readonly paramsSchema: _standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
98
|
+
readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
100
99
|
factory(): (ctx: CodecInstanceContext) => SqliteJsonCodec;
|
|
101
100
|
}
|
|
102
|
-
declare const sqliteJsonColumn: () => _prisma_next_framework_components_codec0.ColumnSpec<SqliteJsonCodec, undefined>;
|
|
101
|
+
declare const sqliteJsonColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteJsonCodec, undefined>;
|
|
103
102
|
declare class SqliteBigintCodec extends CodecImpl<typeof SQLITE_BIGINT_CODEC_ID, readonly ['equality', 'order', 'numeric'], number | bigint, bigint> {
|
|
104
103
|
encode(value: bigint, _ctx: CodecCallContext): Promise<number | bigint>;
|
|
105
104
|
decode(wire: number | bigint, _ctx: CodecCallContext): Promise<bigint>;
|
|
@@ -110,10 +109,10 @@ declare class SqliteBigintDescriptor extends CodecDescriptorImpl<void> {
|
|
|
110
109
|
readonly codecId: "sqlite/bigint@1";
|
|
111
110
|
readonly traits: readonly ["equality", "order", "numeric"];
|
|
112
111
|
readonly targetTypes: readonly ["integer"];
|
|
113
|
-
readonly paramsSchema: _standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
112
|
+
readonly paramsSchema: _$_standard_schema_spec0.StandardSchemaV1<void, void>;
|
|
114
113
|
factory(): (ctx: CodecInstanceContext) => SqliteBigintCodec;
|
|
115
114
|
}
|
|
116
|
-
declare const sqliteBigintColumn: () => _prisma_next_framework_components_codec0.ColumnSpec<SqliteBigintCodec, undefined>;
|
|
115
|
+
declare const sqliteBigintColumn: () => _$_prisma_next_framework_components_codec0.ColumnSpec<SqliteBigintCodec, undefined>;
|
|
117
116
|
//#endregion
|
|
118
117
|
//#region src/core/registry.d.ts
|
|
119
118
|
/**
|
|
@@ -124,4 +123,4 @@ declare const sqliteBigintColumn: () => _prisma_next_framework_components_codec0
|
|
|
124
123
|
declare const sqliteCodecRegistry: CodecDescriptorRegistry;
|
|
125
124
|
//#endregion
|
|
126
125
|
export { SqliteIntegerDescriptor as a, SqliteTextDescriptor as c, sqliteDatetimeColumn as d, sqliteIntegerColumn as f, JsonValue$1 as g, sqliteTextColumn as h, SqliteDatetimeDescriptor as i, sqliteBigintColumn as l, sqliteRealColumn as m, SqliteBigintDescriptor as n, SqliteJsonDescriptor as o, sqliteJsonColumn as p, SqliteBlobDescriptor as r, SqliteRealDescriptor as s, sqliteCodecRegistry as t, sqliteBlobColumn as u };
|
|
127
|
-
//# sourceMappingURL=codecs-
|
|
126
|
+
//# sourceMappingURL=codecs-BAlEiSeP.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-BAlEiSeP.d.mts","names":[],"sources":["../src/core/codec-helpers.ts","../src/core/codecs.ts","../src/core/registry.ts"],"mappings":";;;;;;;;;;;KAIY,WAAA;EAAA,UAKI,GAAA,WAAc,WAAA;AAAA,aACjB,WAAA;;;cC+BA,eAAA,SAAwB,SAAA,QAC5B,oBAAA;EAKD,MAAA,CAAO,KAAA,UAAe,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAG/C,MAAA,CAAO,IAAA,UAAc,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAGpD,UAAA,CAAW,KAAA,WAAgB,SAAA;EAG3B,UAAA,CAAW,IAAA,EAAM,SAAA;AAAA;AAAA,cAKN,oBAAA,SAA6B,mBAAA;EAAA,SACtB,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA,EAJc,wBAAA,CAIF,gBAAA;EACrB,OAAA,CAAA,IAAY,GAAA,EAAK,oBAAA,KAAyB,eAAA;AAAA;AAAA,cAOxC,gBAAA,QAAgB,0CAAA,CAAA,UAAA,CAAA,eAAA;AAAA,cAMhB,kBAAA,SAA2B,SAAA,QAC/B,uBAAA;EAKD,MAAA,CAAO,KAAA,UAAe,IAAA,EAAM,gBAA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KlB,oBAAA,SAA6B,mBAAA;EAAA,SACtB,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA,EAJc,wBAAA,CAIF,gBAAA;EACrB,OAAA,CAAA,IAAY,GAAA,EAAK,oBAAA,KAAyB,eAAA;AAAA;AAAA,cAOxC,gBAAA,QAAgB,0CAAA,CAAA,UAAA,CAAA,eAAA;AAAA,cAMhB,iBAAA,SAA0B,SAAA,QAC9B,sBAAA;EAKD,MAAA,CAAO,KAAA,UAAe,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAG/C,MAAA,CAAO,IAAA,mBAAuB,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAG7D,UAAA,CAAW,KAAA,WAAgB,SAAA;EAG3B,UAAA,CAAW,IAAA,EAAM,SAAA;AAAA;AAAA,cAQN,sBAAA,SAA+B,mBAAA;EAAA,SACxB,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA,EAJgB,wBAAA,CAIJ,gBAAA;EACrB,OAAA,CAAA,IAAY,GAAA,EAAK,oBAAA,KAAyB,iBAAA;AAAA;AAAA,cAOxC,kBAAA,QAAkB,0CAAA,CAAA,UAAA,CAAA,iBAAA;;;;;;;;cCrTlB,mBAAA,EAAqB,uBAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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-
|
|
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-CuUxYcd0.mjs";
|
|
2
2
|
import { sqlCharDescriptor, sqlFloatDescriptor, sqlIntDescriptor, sqlVarcharDescriptor } from "@prisma-next/sql-relational-core/ast";
|
|
3
3
|
import { CodecDescriptorImpl, CodecImpl, column, voidParamsSchema } from "@prisma-next/framework-components/codec";
|
|
4
|
-
|
|
5
4
|
//#region src/core/codecs.ts
|
|
6
5
|
var SqliteTextCodec = class extends CodecImpl {
|
|
7
6
|
async encode(value, _ctx) {
|
|
@@ -215,7 +214,7 @@ const codecDescriptors = [
|
|
|
215
214
|
sqliteJsonDescriptor,
|
|
216
215
|
sqliteBigintDescriptor
|
|
217
216
|
];
|
|
218
|
-
|
|
219
217
|
//#endregion
|
|
220
218
|
export { sqliteIntegerColumn as a, sqliteTextColumn as c, sqliteDatetimeColumn as i, sqliteBigintColumn as n, sqliteJsonColumn as o, sqliteBlobColumn as r, sqliteRealColumn as s, codecDescriptors as t };
|
|
221
|
-
|
|
219
|
+
|
|
220
|
+
//# sourceMappingURL=codecs-DVnHtVWW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs-DVnHtVWW.mjs","names":[],"sources":["../src/core/codecs.ts"],"sourcesContent":["/**\n * Native SQLite target codecs (TML-2357). Mirrors the Postgres codec class form in `packages/3-targets/3-targets/postgres/src/core/codecs.ts`.\n *\n * Each codec ships as three artifacts:\n *\n * 1. A `SqliteXCodec` class extending {@link CodecImpl} that wraps the encode/decode/encodeJson/decodeJson conversions inline. SQLite's runtime conversions are simple enough that there is no shared helper module; the class bodies are the single source of truth. 2. A `SqliteXDescriptor` class extending {@link CodecDescriptorImpl} declaring the codec id, traits, target types, and params schema. SQLite codecs do not carry\n * `meta` (no per-target native-type meta today) and are all non-parameterized. 3. A per-codec column helper (`sqliteXColumn`) that calls `descriptor.factory()` directly and packages the result into a {@link ColumnSpec} via the framework {@link column} packager. The helper is tied to its descriptor with `satisfies ColumnHelperFor` + `ColumnHelperForStrict` (every SQLite codec's resolved type is well-defined).\n *\n * After TML-2357 this is the canonical source of SQLite codec metadata and runtime behaviour — the legacy `mkCodec` / `defineCodec` carriers (and the parallel `byScalar` / `codecDescriptorDefinitions` collection exports) retired with the deletion sweep.\n *\n * Audit: every SQLite codec is non-parameterized and parameter-stateless; `factory()` takes no params (`P = void`) and returns a fresh codec constructed solely from `this`.\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnHelperForStrict,\n column,\n voidParamsSchema,\n} from '@prisma-next/framework-components/codec';\nimport {\n sqlCharDescriptor,\n sqlFloatDescriptor,\n sqlIntDescriptor,\n sqlVarcharDescriptor,\n} 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\nexport class SqliteTextCodec extends CodecImpl<\n typeof SQLITE_TEXT_CODEC_ID,\n readonly ['equality', 'order', 'textual'],\n string,\n string\n> {\n async encode(value: string, _ctx: CodecCallContext): Promise<string> {\n return value;\n }\n async decode(wire: string, _ctx: CodecCallContext): Promise<string> {\n return wire;\n }\n encodeJson(value: string): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): string {\n return json as string;\n }\n}\n\nexport class SqliteTextDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_TEXT_CODEC_ID;\n override readonly traits = ['equality', 'order', 'textual'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteTextCodec {\n return () => new SqliteTextCodec(this);\n }\n}\n\nexport const sqliteTextDescriptor = new SqliteTextDescriptor();\n\nexport const sqliteTextColumn = () =>\n column(sqliteTextDescriptor.factory(), sqliteTextDescriptor.codecId, undefined, 'text');\n\nsqliteTextColumn satisfies ColumnHelperFor<SqliteTextDescriptor>;\nsqliteTextColumn satisfies ColumnHelperForStrict<SqliteTextDescriptor>;\n\nexport class SqliteIntegerCodec extends CodecImpl<\n typeof SQLITE_INTEGER_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number,\n number\n> {\n async encode(value: number, _ctx: CodecCallContext): Promise<number> {\n return value;\n }\n async decode(wire: number, _ctx: CodecCallContext): Promise<number> {\n return wire;\n }\n encodeJson(value: number): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): number {\n return json as number;\n }\n}\n\nexport class SqliteIntegerDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_INTEGER_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['integer'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteIntegerCodec {\n return () => new SqliteIntegerCodec(this);\n }\n}\n\nexport const sqliteIntegerDescriptor = new SqliteIntegerDescriptor();\n\nexport const sqliteIntegerColumn = () =>\n column(sqliteIntegerDescriptor.factory(), sqliteIntegerDescriptor.codecId, undefined, 'integer');\n\nsqliteIntegerColumn satisfies ColumnHelperFor<SqliteIntegerDescriptor>;\nsqliteIntegerColumn satisfies ColumnHelperForStrict<SqliteIntegerDescriptor>;\n\nexport class SqliteRealCodec extends CodecImpl<\n typeof SQLITE_REAL_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number,\n number\n> {\n async encode(value: number, _ctx: CodecCallContext): Promise<number> {\n return value;\n }\n async decode(wire: number, _ctx: CodecCallContext): Promise<number> {\n return wire;\n }\n encodeJson(value: number): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): number {\n return json as number;\n }\n}\n\nexport class SqliteRealDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_REAL_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['real'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteRealCodec {\n return () => new SqliteRealCodec(this);\n }\n}\n\nexport const sqliteRealDescriptor = new SqliteRealDescriptor();\n\nexport const sqliteRealColumn = () =>\n column(sqliteRealDescriptor.factory(), sqliteRealDescriptor.codecId, undefined, 'real');\n\nsqliteRealColumn satisfies ColumnHelperFor<SqliteRealDescriptor>;\nsqliteRealColumn satisfies ColumnHelperForStrict<SqliteRealDescriptor>;\n\nexport class SqliteBlobCodec extends CodecImpl<\n typeof SQLITE_BLOB_CODEC_ID,\n readonly ['equality'],\n Uint8Array,\n Uint8Array\n> {\n async encode(value: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array> {\n return value;\n }\n async decode(wire: Uint8Array, _ctx: CodecCallContext): Promise<Uint8Array> {\n return wire;\n }\n encodeJson(value: Uint8Array): JsonValue {\n return Buffer.from(value).toString('base64');\n }\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\nexport class SqliteBlobDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_BLOB_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['blob'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteBlobCodec {\n return () => new SqliteBlobCodec(this);\n }\n}\n\nexport const sqliteBlobDescriptor = new SqliteBlobDescriptor();\n\nexport const sqliteBlobColumn = () =>\n column(sqliteBlobDescriptor.factory(), sqliteBlobDescriptor.codecId, undefined, 'blob');\n\nsqliteBlobColumn satisfies ColumnHelperFor<SqliteBlobDescriptor>;\nsqliteBlobColumn satisfies ColumnHelperForStrict<SqliteBlobDescriptor>;\n\nexport class SqliteDatetimeCodec extends CodecImpl<\n typeof SQLITE_DATETIME_CODEC_ID,\n readonly ['equality', 'order'],\n string,\n Date\n> {\n // Reject `Invalid Date` (NaN-time) at every decode ingress so consumers never receive a Date object whose downstream operations silently produce NaN. Mirrors the stricter ISO-8601 validation on the postgres timestamp helpers.\n private parseDate(value: string): Date {\n const date = new Date(value);\n if (Number.isNaN(date.getTime())) {\n throw new TypeError(`sqlite/datetime@1 value must be a valid ISO-8601 string: ${value}`);\n }\n return date;\n }\n async encode(value: Date, _ctx: CodecCallContext): Promise<string> {\n return value.toISOString();\n }\n async decode(wire: string, _ctx: CodecCallContext): Promise<Date> {\n return this.parseDate(wire);\n }\n encodeJson(value: Date): JsonValue {\n return value.toISOString();\n }\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 this.parseDate(json);\n }\n}\n\nexport class SqliteDatetimeDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_DATETIME_CODEC_ID;\n override readonly traits = ['equality', 'order'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteDatetimeCodec {\n return () => new SqliteDatetimeCodec(this);\n }\n}\n\nexport const sqliteDatetimeDescriptor = new SqliteDatetimeDescriptor();\n\nexport const sqliteDatetimeColumn = () =>\n column(sqliteDatetimeDescriptor.factory(), sqliteDatetimeDescriptor.codecId, undefined, 'text');\n\nsqliteDatetimeColumn satisfies ColumnHelperFor<SqliteDatetimeDescriptor>;\nsqliteDatetimeColumn satisfies ColumnHelperForStrict<SqliteDatetimeDescriptor>;\n\nexport class SqliteJsonCodec extends CodecImpl<\n typeof SQLITE_JSON_CODEC_ID,\n readonly ['equality'],\n string | JsonValue,\n JsonValue\n> {\n async encode(value: JsonValue, _ctx: CodecCallContext): Promise<string> {\n return JSON.stringify(value);\n }\n async decode(wire: string | JsonValue, _ctx: CodecCallContext): Promise<JsonValue> {\n return typeof wire === 'string' ? (JSON.parse(wire) as JsonValue) : wire;\n }\n encodeJson(value: JsonValue): JsonValue {\n return value;\n }\n decodeJson(json: JsonValue): JsonValue {\n return json;\n }\n}\n\nexport class SqliteJsonDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_JSON_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = ['text'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteJsonCodec {\n return () => new SqliteJsonCodec(this);\n }\n}\n\nexport const sqliteJsonDescriptor = new SqliteJsonDescriptor();\n\nexport const sqliteJsonColumn = () =>\n column(sqliteJsonDescriptor.factory(), sqliteJsonDescriptor.codecId, undefined, 'text');\n\nsqliteJsonColumn satisfies ColumnHelperFor<SqliteJsonDescriptor>;\nsqliteJsonColumn satisfies ColumnHelperForStrict<SqliteJsonDescriptor>;\n\nexport class SqliteBigintCodec extends CodecImpl<\n typeof SQLITE_BIGINT_CODEC_ID,\n readonly ['equality', 'order', 'numeric'],\n number | bigint,\n bigint\n> {\n async encode(value: bigint, _ctx: CodecCallContext): Promise<number | bigint> {\n return value;\n }\n async decode(wire: number | bigint, _ctx: CodecCallContext): Promise<bigint> {\n return BigInt(wire);\n }\n encodeJson(value: bigint): JsonValue {\n return value.toString();\n }\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\nexport class SqliteBigintDescriptor extends CodecDescriptorImpl<void> {\n override readonly codecId = SQLITE_BIGINT_CODEC_ID;\n override readonly traits = ['equality', 'order', 'numeric'] as const;\n override readonly targetTypes = ['integer'] as const;\n override readonly paramsSchema = voidParamsSchema;\n override factory(): (ctx: CodecInstanceContext) => SqliteBigintCodec {\n return () => new SqliteBigintCodec(this);\n }\n}\n\nexport const sqliteBigintDescriptor = new SqliteBigintDescriptor();\n\nexport const sqliteBigintColumn = () =>\n column(sqliteBigintDescriptor.factory(), sqliteBigintDescriptor.codecId, undefined, 'integer');\n\nsqliteBigintColumn satisfies ColumnHelperFor<SqliteBigintDescriptor>;\nsqliteBigintColumn satisfies ColumnHelperForStrict<SqliteBigintDescriptor>;\n\nexport const codecDescriptors: readonly AnyCodecDescriptor[] = [\n sqlCharDescriptor,\n sqlVarcharDescriptor,\n sqlIntDescriptor,\n sqlFloatDescriptor,\n sqliteTextDescriptor,\n sqliteIntegerDescriptor,\n sqliteRealDescriptor,\n sqliteBlobDescriptor,\n sqliteDatetimeDescriptor,\n sqliteJsonDescriptor,\n sqliteBigintDescriptor,\n];\n"],"mappings":";;;;AAyCA,IAAa,kBAAb,cAAqC,UAKnC;CACA,MAAM,OAAO,OAAe,MAAyC;EACnE,OAAO;;CAET,MAAM,OAAO,MAAc,MAAyC;EAClE,OAAO;;CAET,WAAW,OAA0B;EACnC,OAAO;;CAET,WAAW,MAAyB;EAClC,OAAO;;;AAIX,IAAa,uBAAb,cAA0C,oBAA0B;CAClE,UAA4B;CAC5B,SAA2B;EAAC;EAAY;EAAS;EAAU;CAC3D,cAAgC,CAAC,OAAO;CACxC,eAAiC;CACjC,UAAmE;EACjE,aAAa,IAAI,gBAAgB,KAAK;;;AAI1C,MAAa,uBAAuB,IAAI,sBAAsB;AAE9D,MAAa,yBACX,OAAO,qBAAqB,SAAS,EAAE,qBAAqB,SAAS,KAAA,GAAW,OAAO;AAKzF,IAAa,qBAAb,cAAwC,UAKtC;CACA,MAAM,OAAO,OAAe,MAAyC;EACnE,OAAO;;CAET,MAAM,OAAO,MAAc,MAAyC;EAClE,OAAO;;CAET,WAAW,OAA0B;EACnC,OAAO;;CAET,WAAW,MAAyB;EAClC,OAAO;;;AAIX,IAAa,0BAAb,cAA6C,oBAA0B;CACrE,UAA4B;CAC5B,SAA2B;EAAC;EAAY;EAAS;EAAU;CAC3D,cAAgC,CAAC,UAAU;CAC3C,eAAiC;CACjC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AAqB,SAAS,EAAE,qBAAqB,SAAS,KAAA,GAAW,OAAO;AAKzF,IAAa,oBAAb,cAAuC,UAKrC;CACA,MAAM,OAAO,OAAe,MAAkD;EAC5E,OAAO;;CAET,MAAM,OAAO,MAAuB,MAAyC;EAC3E,OAAO,OAAO,KAAK;;CAErB,WAAW,OAA0B;EACnC,OAAO,MAAM,UAAU;;CAEzB,WAAW,MAAyB;EAClC,IAAI,OAAO,SAAS,YAAY,OAAO,SAAS,UAC9C,MAAM,IAAI,UAAU,4DAA4D;EAElF,OAAO,OAAO,KAAK;;;AAIvB,IAAa,yBAAb,cAA4C,oBAA0B;CACpE,UAA4B;CAC5B,SAA2B;EAAC;EAAY;EAAS;EAAU;CAC3D,cAAgC,CAAC,UAAU;CAC3C,eAAiC;CACjC,UAAqE;EACnE,aAAa,IAAI,kBAAkB,KAAK;;;AAI5C,MAAa,yBAAyB,IAAI,wBAAwB;AAElE,MAAa,2BACX,OAAO,uBAAuB,SAAS,EAAE,uBAAuB,SAAS,KAAA,GAAW,UAAU;AAKhG,MAAa,mBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
package/dist/codecs.d.mts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, d as sqliteDatetimeColumn, f as sqliteIntegerColumn, g as JsonValue, h as sqliteTextColumn, i as SqliteDatetimeDescriptor, l as sqliteBigintColumn, m as sqliteRealColumn, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, p as sqliteJsonColumn, r as SqliteBlobDescriptor, s as SqliteRealDescriptor, t as sqliteCodecRegistry, u as sqliteBlobColumn } from "./codecs-BqDitp2X.mjs";
|
|
1
|
+
import { a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, d as sqliteDatetimeColumn, f as sqliteIntegerColumn, g as JsonValue, h as sqliteTextColumn, i as SqliteDatetimeDescriptor, l as sqliteBigintColumn, m as sqliteRealColumn, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, p as sqliteJsonColumn, r as SqliteBlobDescriptor, s as SqliteRealDescriptor, t as sqliteCodecRegistry, u as sqliteBlobColumn } from "./codecs-BAlEiSeP.mjs";
|
|
3
2
|
export { JsonValue, SqliteBigintDescriptor, SqliteBlobDescriptor, SqliteDatetimeDescriptor, SqliteIntegerDescriptor, SqliteJsonDescriptor, SqliteRealDescriptor, SqliteTextDescriptor, sqliteBigintColumn, sqliteBlobColumn, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };
|
package/dist/codecs.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as sqliteIntegerColumn, c as sqliteTextColumn, i as sqliteDatetimeColumn, n as sqliteBigintColumn, o as sqliteJsonColumn, r as sqliteBlobColumn, s as sqliteRealColumn, t as codecDescriptors } from "./codecs-
|
|
1
|
+
import { a as sqliteIntegerColumn, c as sqliteTextColumn, i as sqliteDatetimeColumn, n as sqliteBigintColumn, o as sqliteJsonColumn, r as sqliteBlobColumn, s as sqliteRealColumn, t as codecDescriptors } from "./codecs-DVnHtVWW.mjs";
|
|
2
2
|
import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/codec-descriptor-registry";
|
|
3
|
-
|
|
4
3
|
//#region src/core/registry.ts
|
|
5
4
|
/**
|
|
6
5
|
* Registry of every codec descriptor shipped by `@prisma-next/target-sqlite`.
|
|
@@ -8,7 +7,7 @@ import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/c
|
|
|
8
7
|
* Public consumer surface for the sqlite codec set: the sqlite adapter and any other consumer that needs to enumerate or look up a sqlite codec by id consumes this rather than the raw descriptor array. See ADR 208.
|
|
9
8
|
*/
|
|
10
9
|
const sqliteCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);
|
|
11
|
-
|
|
12
10
|
//#endregion
|
|
13
11
|
export { sqliteBigintColumn, sqliteBlobColumn, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };
|
|
12
|
+
|
|
14
13
|
//# sourceMappingURL=codecs.mjs.map
|
package/dist/codecs.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codecs.mjs","names":[
|
|
1
|
+
{"version":3,"file":"codecs.mjs","names":[],"sources":["../src/core/registry.ts"],"sourcesContent":["import { buildCodecDescriptorRegistry } from '@prisma-next/sql-relational-core/codec-descriptor-registry';\nimport type { CodecDescriptorRegistry } from '@prisma-next/sql-relational-core/query-lane-context';\nimport { codecDescriptors } from './codecs';\n\n/**\n * Registry of every codec descriptor shipped by `@prisma-next/target-sqlite`.\n *\n * Public consumer surface for the sqlite codec set: the sqlite adapter and any other consumer that needs to enumerate or look up a sqlite codec by id consumes this rather than the raw descriptor array. See ADR 208.\n */\nexport const sqliteCodecRegistry: CodecDescriptorRegistry =\n buildCodecDescriptorRegistry(codecDescriptors);\n"],"mappings":";;;;;;;;AASA,MAAa,sBACX,6BAA6B,iBAAiB"}
|
package/dist/control.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SqlitePlanTargetDetails } from "./planner-target-details-
|
|
1
|
+
import { t as SqlitePlanTargetDetails } from "./planner-target-details-vhvZDWK1.mjs";
|
|
2
2
|
import { SqlControlTargetDescriptor } from "@prisma-next/family-sql/control";
|
|
3
3
|
|
|
4
4
|
//#region src/core/control-target.d.ts
|
package/dist/control.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts"],"
|
|
1
|
+
{"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-target.ts"],"mappings":";;;;cA4BM,6BAAA,EAA+B,0BAAA,WAAqC,uBAAA"}
|
package/dist/control.mjs
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { t as sqliteTargetDescriptorMeta } from "./descriptor-meta-
|
|
2
|
-
import { t as parseSqliteDefault } from "./default-normalizer-
|
|
3
|
-
import { t as normalizeSqliteNativeType } from "./native-type-normalizer-
|
|
4
|
-
import { d as renderDefaultLiteral } from "./tables-
|
|
5
|
-
import { n as createSqliteMigrationPlanner } from "./planner-
|
|
6
|
-
import { a as buildLedgerInsertStatement, c as ensureMarkerTableStatement, i as MARKER_TABLE_NAME, l as readMarkerStatement, o as buildWriteMarkerStatements, s as ensureLedgerTableStatement } from "./statement-builders-
|
|
1
|
+
import { t as sqliteTargetDescriptorMeta } from "./descriptor-meta-CE2Kbn9b.mjs";
|
|
2
|
+
import { t as parseSqliteDefault } from "./default-normalizer-3Fccw7yw.mjs";
|
|
3
|
+
import { t as normalizeSqliteNativeType } from "./native-type-normalizer-BlN5XfD-.mjs";
|
|
4
|
+
import { d as renderDefaultLiteral } from "./tables-D84zfPZI.mjs";
|
|
5
|
+
import { n as createSqliteMigrationPlanner } from "./planner-C94LJeIM.mjs";
|
|
6
|
+
import { a as buildLedgerInsertStatement, c as ensureMarkerTableStatement, i as MARKER_TABLE_NAME, l as readMarkerStatement, o as buildWriteMarkerStatements, s as ensureLedgerTableStatement } from "./statement-builders-Dne-LkAV.mjs";
|
|
7
7
|
import { contractToSchemaIR, runnerFailure, runnerSuccess } from "@prisma-next/family-sql/control";
|
|
8
8
|
import { verifySqlSchema } from "@prisma-next/family-sql/schema-verify";
|
|
9
|
-
import { ok, okVoid } from "@prisma-next/utils/result";
|
|
9
|
+
import { notOk, ok, okVoid } from "@prisma-next/utils/result";
|
|
10
10
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
11
|
+
import { APP_SPACE_ID } from "@prisma-next/framework-components/control";
|
|
11
12
|
import { parseContractMarkerRow } from "@prisma-next/family-sql/verify";
|
|
12
|
-
|
|
13
13
|
//#region src/core/migrations/runner.ts
|
|
14
14
|
function createSqliteMigrationRunner(family) {
|
|
15
15
|
return new SqliteMigrationRunner(family);
|
|
16
16
|
}
|
|
17
17
|
var SqliteMigrationRunner = class {
|
|
18
|
+
family;
|
|
18
19
|
constructor(family) {
|
|
19
20
|
this.family = family;
|
|
20
21
|
}
|
|
@@ -30,60 +31,127 @@ var SqliteMigrationRunner = class {
|
|
|
30
31
|
await this.beginExclusiveTransaction(driver);
|
|
31
32
|
let committed = false;
|
|
32
33
|
try {
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);
|
|
39
|
-
const isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;
|
|
40
|
-
const skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;
|
|
41
|
-
let operationsExecuted;
|
|
42
|
-
let executedOperations;
|
|
43
|
-
if (skipOperations) {
|
|
44
|
-
operationsExecuted = 0;
|
|
45
|
-
executedOperations = [];
|
|
46
|
-
} else {
|
|
47
|
-
const applyResult = await this.applyPlan(driver, options);
|
|
48
|
-
if (!applyResult.ok) return applyResult;
|
|
49
|
-
operationsExecuted = applyResult.value.operationsExecuted;
|
|
50
|
-
executedOperations = applyResult.value.executedOperations;
|
|
34
|
+
const result = await this.executeOnConnection(options);
|
|
35
|
+
if (!result.ok) return result;
|
|
36
|
+
if (fkWasEnabled) {
|
|
37
|
+
const fkIntegrityCheck = await this.verifyForeignKeyIntegrity(driver);
|
|
38
|
+
if (!fkIntegrityCheck.ok) return fkIntegrityCheck;
|
|
51
39
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
40
|
+
await this.commitTransaction(driver);
|
|
41
|
+
committed = true;
|
|
42
|
+
return result;
|
|
43
|
+
} finally {
|
|
44
|
+
if (!committed) await this.rollbackTransaction(driver);
|
|
45
|
+
}
|
|
46
|
+
} finally {
|
|
47
|
+
if (fkWasEnabled) await driver.query("PRAGMA foreign_keys = ON");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Apply the plan against an already-open connection without managing
|
|
52
|
+
* the transaction lifecycle. The caller owns BEGIN/COMMIT/ROLLBACK
|
|
53
|
+
* and any connection-level setup (FK pragma toggle, FK integrity
|
|
54
|
+
* check). Used by the per-space runner orchestration to fan out
|
|
55
|
+
* across contract spaces inside one outer transaction.
|
|
56
|
+
*/
|
|
57
|
+
async executeOnConnection(options) {
|
|
58
|
+
const driver = options.driver;
|
|
59
|
+
if (options.space !== void 0 && options.space !== options.plan.spaceId) throw new Error(`SqlMigrationRunner: options.space (${options.space}) does not match plan.spaceId (${options.plan.spaceId})`);
|
|
60
|
+
const space = options.plan.spaceId;
|
|
61
|
+
const destinationCheck = this.ensurePlanMatchesDestinationContract(options.plan.destination, options.destinationContract);
|
|
62
|
+
if (!destinationCheck.ok) return destinationCheck;
|
|
63
|
+
const policyCheck = this.enforcePolicyCompatibility(options.policy, options.plan.operations);
|
|
64
|
+
if (!policyCheck.ok) return policyCheck;
|
|
65
|
+
const ensureResult = await this.ensureControlTables(driver);
|
|
66
|
+
if (!ensureResult.ok) return ensureResult;
|
|
67
|
+
const existingMarker = await this.readMarker(driver, space);
|
|
68
|
+
const markerCheck = this.ensureMarkerCompatibility(existingMarker, options.plan);
|
|
69
|
+
if (!markerCheck.ok) return markerCheck;
|
|
70
|
+
const markerAtDestination = this.markerMatchesDestination(existingMarker, options.plan);
|
|
71
|
+
const isSelfEdge = options.plan.origin?.storageHash === options.plan.destination.storageHash;
|
|
72
|
+
const skipOperations = markerAtDestination && options.plan.origin != null && !isSelfEdge;
|
|
73
|
+
let operationsExecuted;
|
|
74
|
+
let executedOperations;
|
|
75
|
+
if (skipOperations) {
|
|
76
|
+
operationsExecuted = 0;
|
|
77
|
+
executedOperations = [];
|
|
78
|
+
} else {
|
|
79
|
+
const applyResult = await this.applyPlan(driver, options);
|
|
80
|
+
if (!applyResult.ok) return applyResult;
|
|
81
|
+
operationsExecuted = applyResult.value.operationsExecuted;
|
|
82
|
+
executedOperations = applyResult.value.executedOperations;
|
|
83
|
+
}
|
|
84
|
+
if (space === APP_SPACE_ID) {
|
|
85
|
+
const schemaIR = await this.family.introspect({
|
|
86
|
+
driver,
|
|
87
|
+
contract: options.destinationContract
|
|
88
|
+
});
|
|
89
|
+
const schemaVerifyResult = verifySqlSchema({
|
|
90
|
+
contract: options.destinationContract,
|
|
91
|
+
schema: schemaIR,
|
|
92
|
+
strict: options.strictVerification ?? true,
|
|
93
|
+
context: options.context ?? {},
|
|
94
|
+
typeMetadataRegistry: this.family.typeMetadataRegistry,
|
|
95
|
+
frameworkComponents: options.frameworkComponents,
|
|
96
|
+
normalizeDefault: parseSqliteDefault,
|
|
97
|
+
normalizeNativeType: normalizeSqliteNativeType
|
|
98
|
+
});
|
|
99
|
+
if (!schemaVerifyResult.ok) return runnerFailure("SCHEMA_VERIFY_FAILED", schemaVerifyResult.summary, {
|
|
100
|
+
why: "The resulting database schema does not satisfy the destination contract.",
|
|
101
|
+
meta: { issues: schemaVerifyResult.schema.issues }
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const incomingInvariants = options.plan.providedInvariants;
|
|
105
|
+
const existingInvariants = new Set(existingMarker?.invariants ?? []);
|
|
106
|
+
const incomingIsSubsetOfExisting = incomingInvariants.every((id) => existingInvariants.has(id));
|
|
107
|
+
if (!(isSelfEdge && operationsExecuted === 0 && incomingIsSubsetOfExisting)) {
|
|
108
|
+
await this.upsertMarker(driver, options, existingMarker, space);
|
|
109
|
+
await this.recordLedgerEntry(driver, options, existingMarker, executedOperations);
|
|
110
|
+
}
|
|
111
|
+
return runnerSuccess({
|
|
112
|
+
operationsPlanned: options.plan.operations.length,
|
|
113
|
+
operationsExecuted
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
async executeAcrossSpaces(options) {
|
|
117
|
+
const driver = options.driver;
|
|
118
|
+
const perSpaceOptions = options.perSpaceOptions;
|
|
119
|
+
if (perSpaceOptions.length === 0) return ok({ perSpaceResults: [] });
|
|
120
|
+
const fkWasEnabled = await this.readForeignKeysEnabled(driver);
|
|
121
|
+
if (fkWasEnabled) await driver.query("PRAGMA foreign_keys = OFF");
|
|
122
|
+
try {
|
|
123
|
+
await this.beginExclusiveTransaction(driver);
|
|
124
|
+
let committed = false;
|
|
125
|
+
try {
|
|
126
|
+
const perSpaceResults = [];
|
|
127
|
+
let lastProcessedSpace;
|
|
128
|
+
for (const spaceOptions of perSpaceOptions) {
|
|
129
|
+
const space = spaceOptions.space ?? spaceOptions.plan.spaceId;
|
|
130
|
+
const result = await this.executeOnConnection({
|
|
131
|
+
...spaceOptions,
|
|
132
|
+
driver,
|
|
133
|
+
space
|
|
134
|
+
});
|
|
135
|
+
if (!result.ok) return notOk({
|
|
136
|
+
...result.failure,
|
|
137
|
+
failingSpace: space
|
|
138
|
+
});
|
|
139
|
+
perSpaceResults.push({
|
|
140
|
+
space,
|
|
141
|
+
value: result.value
|
|
142
|
+
});
|
|
143
|
+
lastProcessedSpace = space;
|
|
76
144
|
}
|
|
77
145
|
if (fkWasEnabled) {
|
|
78
146
|
const fkIntegrityCheck = await this.verifyForeignKeyIntegrity(driver);
|
|
79
|
-
if (!fkIntegrityCheck.ok) return
|
|
147
|
+
if (!fkIntegrityCheck.ok) return notOk({
|
|
148
|
+
...fkIntegrityCheck.failure,
|
|
149
|
+
failingSpace: lastProcessedSpace ?? APP_SPACE_ID
|
|
150
|
+
});
|
|
80
151
|
}
|
|
81
152
|
await this.commitTransaction(driver);
|
|
82
153
|
committed = true;
|
|
83
|
-
return
|
|
84
|
-
operationsPlanned: options.plan.operations.length,
|
|
85
|
-
operationsExecuted
|
|
86
|
-
});
|
|
154
|
+
return ok({ perSpaceResults });
|
|
87
155
|
} finally {
|
|
88
156
|
if (!committed) await this.rollbackTransaction(driver);
|
|
89
157
|
}
|
|
@@ -282,12 +350,12 @@ var SqliteMigrationRunner = class {
|
|
|
282
350
|
} });
|
|
283
351
|
return okVoid();
|
|
284
352
|
}
|
|
285
|
-
async upsertMarker(driver, options, existingMarker) {
|
|
353
|
+
async upsertMarker(driver, options, existingMarker, space) {
|
|
286
354
|
const merged = new Set(existingMarker?.invariants ?? []);
|
|
287
355
|
for (const inv of options.plan.providedInvariants) merged.add(inv);
|
|
288
356
|
const invariants = Array.from(merged).sort();
|
|
289
357
|
const writeStatements = buildWriteMarkerStatements({
|
|
290
|
-
space
|
|
358
|
+
space,
|
|
291
359
|
storageHash: options.plan.destination.storageHash,
|
|
292
360
|
profileHash: options.plan.destination.profileHash ?? options.destinationContract.profileHash ?? options.plan.destination.storageHash,
|
|
293
361
|
contractJson: options.destinationContract,
|
|
@@ -327,7 +395,6 @@ var SqliteMigrationRunner = class {
|
|
|
327
395
|
await driver.query(statement.sql);
|
|
328
396
|
}
|
|
329
397
|
};
|
|
330
|
-
|
|
331
398
|
//#endregion
|
|
332
399
|
//#region src/core/control-target.ts
|
|
333
400
|
function sqliteRenderDefault(def, _column) {
|
|
@@ -367,8 +434,7 @@ const sqliteControlTargetDescriptor = {
|
|
|
367
434
|
return createSqliteMigrationRunner(family);
|
|
368
435
|
}
|
|
369
436
|
};
|
|
370
|
-
var control_target_default = sqliteControlTargetDescriptor;
|
|
371
|
-
|
|
372
437
|
//#endregion
|
|
373
|
-
export {
|
|
438
|
+
export { sqliteControlTargetDescriptor as default };
|
|
439
|
+
|
|
374
440
|
//# sourceMappingURL=control.mjs.map
|