@prisma/orm-target-sqlite 0.16.0-dev.36
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/LICENSE +201 -0
- package/README.md +23 -0
- package/dist/adapter-DizMsGCb-n4h4w8ms.d.mts +22 -0
- package/dist/adapter-DizMsGCb-n4h4w8ms.d.mts.map +1 -0
- package/dist/adapter-m_BtnNSn.d.mts +2 -0
- package/dist/adapter-wc9p_v2Z-y8pzqMfG.mjs +997 -0
- package/dist/adapter-wc9p_v2Z-y8pzqMfG.mjs.map +1 -0
- package/dist/adapter.d.mts +14 -0
- package/dist/adapter.mjs +6 -0
- package/dist/adapter__adapter.d.mts +4 -0
- package/dist/adapter__adapter.mjs +2 -0
- package/dist/adapter__codec-types.d.mts +4 -0
- package/dist/adapter__codec-types.mjs +1 -0
- package/dist/adapter__column-types.d.mts +2 -0
- package/dist/adapter__column-types.mjs +2 -0
- package/dist/adapter__control.d.mts +5 -0
- package/dist/adapter__control.mjs +261 -0
- package/dist/adapter__control.mjs.map +1 -0
- package/dist/adapter__runtime.d.mts +2 -0
- package/dist/adapter__runtime.mjs +32 -0
- package/dist/adapter__runtime.mjs.map +1 -0
- package/dist/adapter__types.d.mts +3 -0
- package/dist/adapter__types.mjs +1 -0
- package/dist/codec-descriptor-BcgD9f3L-BjEkn9Ob.d.mts +31 -0
- package/dist/codec-descriptor-BcgD9f3L-BjEkn9Ob.d.mts.map +1 -0
- package/dist/codec-descriptor-CyCQXvSl.d.mts +2 -0
- package/dist/codec-descriptor-kVCSW1OR-CPatZUPM.mjs +104 -0
- package/dist/codec-descriptor-kVCSW1OR-CPatZUPM.mjs.map +1 -0
- package/dist/codec-descriptor-rFuZ9DzY-DO0k8l6N.d.mts +1 -0
- package/dist/codec-ids-ChRBs2aB.d.mts +1 -0
- package/dist/codec-ids-DocGjhs--CHhP1jNZ.d.mts +13 -0
- package/dist/codec-ids-DocGjhs--CHhP1jNZ.d.mts.map +1 -0
- package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs +13 -0
- package/dist/codec-ids-xicqpuAa-DHnKqnIs.mjs.map +1 -0
- package/dist/codec-types-DKB--ltR-CIuvX0zx.d.mts +24 -0
- package/dist/codec-types-DKB--ltR-CIuvX0zx.d.mts.map +1 -0
- package/dist/codec-types-Tw3EFTjf.d.mts +1 -0
- package/dist/codec-types-wPDlPoD7.d.mts +2 -0
- package/dist/codecs-1-oOsTPG-Bv518Lbm.d.mts +155 -0
- package/dist/codecs-1-oOsTPG-Bv518Lbm.d.mts.map +1 -0
- package/dist/codecs-CM_2W3uA.mjs +345 -0
- package/dist/codecs-CM_2W3uA.mjs.map +1 -0
- package/dist/codecs-j-8RDkOt.d.mts +1 -0
- package/dist/column-types-StKUDF6A.mjs +34 -0
- package/dist/column-types-StKUDF6A.mjs.map +1 -0
- package/dist/column-types-iWGuW-0W.d.mts +33 -0
- package/dist/column-types-iWGuW-0W.d.mts.map +1 -0
- package/dist/contract-free-CCLAXZV2.d.mts +88 -0
- package/dist/contract-free-CCLAXZV2.d.mts.map +1 -0
- package/dist/contract-free-DElSXD0q.mjs +90 -0
- package/dist/contract-free-DElSXD0q.mjs.map +1 -0
- package/dist/control--wMueaTg.d.mts +61 -0
- package/dist/control--wMueaTg.d.mts.map +1 -0
- package/dist/control-8G9x72lw.mjs +42 -0
- package/dist/control-8G9x72lw.mjs.map +1 -0
- package/dist/control-DLO163u8.d.mts +19 -0
- package/dist/control-DLO163u8.d.mts.map +1 -0
- package/dist/control-cahq7u71.d.mts +117 -0
- package/dist/control-cahq7u71.d.mts.map +1 -0
- package/dist/control-tables-D_o8dKRB-BXi43noL.mjs +12 -0
- package/dist/control-tables-D_o8dKRB-BXi43noL.mjs.map +1 -0
- package/dist/control-tables-Dua-YcJL.d.mts +12 -0
- package/dist/control-tables-Dua-YcJL.d.mts.map +1 -0
- package/dist/ddl-CW34JvfE-rd1ZIxOn.mjs +66 -0
- package/dist/ddl-CW34JvfE-rd1ZIxOn.mjs.map +1 -0
- package/dist/ddl-CfSqNT0M.d.mts +1 -0
- package/dist/default-normalizer-B9V7TY5u.d.mts +7 -0
- package/dist/default-normalizer-B9V7TY5u.d.mts.map +1 -0
- package/dist/default-normalizer-DuoHj9-O-DsK7lJZn.mjs +69 -0
- package/dist/default-normalizer-DuoHj9-O-DsK7lJZn.mjs.map +1 -0
- package/dist/descriptor-meta-CbYkqTkO-DEJNrICG.mjs +30 -0
- package/dist/descriptor-meta-CbYkqTkO-DEJNrICG.mjs.map +1 -0
- package/dist/descriptor-meta-DnwDwnGg-D3f936hn.mjs +23 -0
- package/dist/descriptor-meta-DnwDwnGg-D3f936hn.mjs.map +1 -0
- package/dist/descriptor-meta-runtime-BkXK3OjD-CxZdKHCw.mjs +13 -0
- package/dist/descriptor-meta-runtime-BkXK3OjD-CxZdKHCw.mjs.map +1 -0
- package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs +70 -0
- package/dist/descriptor-meta-vjJkUDsn-Hz3rnAnk.mjs.map +1 -0
- package/dist/driver.d.mts +3 -0
- package/dist/driver.mjs +2 -0
- package/dist/driver__control.d.mts +2 -0
- package/dist/driver__control.mjs +2 -0
- package/dist/driver__runtime.d.mts +2 -0
- package/dist/driver__runtime.mjs +197 -0
- package/dist/driver__runtime.mjs.map +1 -0
- package/dist/errors-CKsaaSnD-BeB4JS8h.mjs +38 -0
- package/dist/errors-CKsaaSnD-BeB4JS8h.mjs.map +1 -0
- package/dist/migration-jsmNRI_8.mjs +47 -0
- package/dist/migration-jsmNRI_8.mjs.map +1 -0
- package/dist/migration-uylRe5MP.d.mts +43 -0
- package/dist/migration-uylRe5MP.d.mts.map +1 -0
- package/dist/native-type-normalizer-CO2wKGL6.d.mts +12 -0
- package/dist/native-type-normalizer-CO2wKGL6.d.mts.map +1 -0
- package/dist/native-type-normalizer-GpQMEyN5.mjs +14 -0
- package/dist/native-type-normalizer-GpQMEyN5.mjs.map +1 -0
- package/dist/nodes-D8EC1yCx-rpfpuJ4T.d.mts +29 -0
- package/dist/nodes-D8EC1yCx-rpfpuJ4T.d.mts.map +1 -0
- package/dist/nodes-DUZSdX86-BBEEaxXY.mjs +33 -0
- package/dist/nodes-DUZSdX86-BBEEaxXY.mjs.map +1 -0
- package/dist/op-factory-call-C_or6163-B_LDzC37.mjs +829 -0
- package/dist/op-factory-call-C_or6163-B_LDzC37.mjs.map +1 -0
- package/dist/op-factory-call-DoHN7Q7L.d.mts +161 -0
- package/dist/op-factory-call-DoHN7Q7L.d.mts.map +1 -0
- package/dist/pack-BfwyQ0b3.d.mts +93 -0
- package/dist/pack-BfwyQ0b3.d.mts.map +1 -0
- package/dist/planner-Bxdi7jZF.d.mts +104 -0
- package/dist/planner-Bxdi7jZF.d.mts.map +1 -0
- package/dist/planner-DiGcIjl1-QnNAhVmX.mjs +811 -0
- package/dist/planner-DiGcIjl1-QnNAhVmX.mjs.map +1 -0
- package/dist/planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.d.mts +31 -0
- package/dist/planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.d.mts.map +1 -0
- package/dist/planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs +150 -0
- package/dist/planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs.map +1 -0
- package/dist/planner-produced-sqlite-migration-uySoqJO-.d.mts +1 -0
- package/dist/planner-target-details-CIQ789Gc-C5U4yVY9.mjs +15 -0
- package/dist/planner-target-details-CIQ789Gc-C5U4yVY9.mjs.map +1 -0
- package/dist/planner-target-details-xR6UfIcz-CMahymzq.d.mts +13 -0
- package/dist/planner-target-details-xR6UfIcz-CMahymzq.d.mts.map +1 -0
- package/dist/render-ops-B10yqmdG.d.mts +11 -0
- package/dist/render-ops-B10yqmdG.d.mts.map +1 -0
- package/dist/render-ops-DIOn_wOx-D33LOy3b.mjs +27 -0
- package/dist/render-ops-DIOn_wOx-D33LOy3b.mjs.map +1 -0
- package/dist/runtime-B1coahKC.d.mts +15 -0
- package/dist/runtime-B1coahKC.d.mts.map +1 -0
- package/dist/runtime-B99c4n56.d.mts +28 -0
- package/dist/runtime-B99c4n56.d.mts.map +1 -0
- package/dist/runtime-tbBYTw7Z.d.mts +10 -0
- package/dist/runtime-tbBYTw7Z.d.mts.map +1 -0
- package/dist/shared-BYAX0FaQ--VvRXVRC.d.mts +68 -0
- package/dist/shared-BYAX0FaQ--VvRXVRC.d.mts.map +1 -0
- package/dist/sql-utils-0SJZOd7Q.d.mts +18 -0
- package/dist/sql-utils-0SJZOd7Q.d.mts.map +1 -0
- package/dist/sql-utils-DqPXZBMA-Mm27NNjs.mjs +35 -0
- package/dist/sql-utils-DqPXZBMA-Mm27NNjs.mjs.map +1 -0
- package/dist/sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts +31 -0
- package/dist/sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts.map +1 -0
- package/dist/sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs +151 -0
- package/dist/sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs.map +1 -0
- package/dist/sqlite-migration-CV6LIqhx-D5eMTAbH.mjs +94 -0
- package/dist/sqlite-migration-CV6LIqhx-D5eMTAbH.mjs.map +1 -0
- package/dist/sqlite-migration-o23JHwzY-CwNJcqwl.d.mts +105 -0
- package/dist/sqlite-migration-o23JHwzY-CwNJcqwl.d.mts.map +1 -0
- package/dist/target.d.mts +28 -0
- package/dist/target.mjs +19 -0
- package/dist/target__codec-descriptor.d.mts +3 -0
- package/dist/target__codec-descriptor.mjs +2 -0
- package/dist/target__codec-ids.d.mts +3 -0
- package/dist/target__codec-ids.mjs +2 -0
- package/dist/target__codec-types.d.mts +4 -0
- package/dist/target__codec-types.mjs +1 -0
- package/dist/target__codecs.d.mts +3 -0
- package/dist/target__codecs.mjs +2 -0
- package/dist/target__contract-free.d.mts +2 -0
- package/dist/target__contract-free.mjs +3 -0
- package/dist/target__control-tables.d.mts +2 -0
- package/dist/target__control-tables.mjs +2 -0
- package/dist/target__control.d.mts +3 -0
- package/dist/target__control.mjs +432 -0
- package/dist/target__control.mjs.map +1 -0
- package/dist/target__ddl.d.mts +3 -0
- package/dist/target__ddl.mjs +2 -0
- package/dist/target__default-normalizer.d.mts +2 -0
- package/dist/target__default-normalizer.mjs +2 -0
- package/dist/target__migration.d.mts +3 -0
- package/dist/target__migration.mjs +3 -0
- package/dist/target__native-type-normalizer.d.mts +2 -0
- package/dist/target__native-type-normalizer.mjs +2 -0
- package/dist/target__op-factory-call.d.mts +2 -0
- package/dist/target__op-factory-call.mjs +2 -0
- package/dist/target__pack.d.mts +2 -0
- package/dist/target__pack.mjs +2 -0
- package/dist/target__planner-produced-sqlite-migration.d.mts +3 -0
- package/dist/target__planner-produced-sqlite-migration.mjs +2 -0
- package/dist/target__planner-target-details.d.mts +2 -0
- package/dist/target__planner-target-details.mjs +2 -0
- package/dist/target__planner.d.mts +2 -0
- package/dist/target__planner.mjs +2 -0
- package/dist/target__render-ops.d.mts +2 -0
- package/dist/target__render-ops.mjs +2 -0
- package/dist/target__runtime.d.mts +3 -0
- package/dist/target__runtime.mjs +17 -0
- package/dist/target__runtime.mjs.map +1 -0
- package/dist/target__sql-utils.d.mts +2 -0
- package/dist/target__sql-utils.mjs +2 -0
- package/dist/types-C5FSREvo-Bm6N5Kog.d.mts +25 -0
- package/dist/types-C5FSREvo-Bm6N5Kog.d.mts.map +1 -0
- package/dist/types-DiH2oWUJ.d.mts +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as sqliteError } from "./errors-CKsaaSnD-BeB4JS8h.mjs";
|
|
2
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/sql-utils-DqPXZBMA.mjs
|
|
3
|
+
/**
|
|
4
|
+
* Shared SQL utility functions for the SQLite target.
|
|
5
|
+
*
|
|
6
|
+
* These functions handle safe SQL identifier and literal escaping. They
|
|
7
|
+
* live in `target-sqlite` (mirroring `target-postgres/src/core/sql-utils.ts`)
|
|
8
|
+
* so both the control adapter (used at emit time) and the runtime adapter
|
|
9
|
+
* (used at execute time) can depend on them through a single one-way edge:
|
|
10
|
+
* `adapter-sqlite → target-sqlite`. Hosting them target-side avoids the
|
|
11
|
+
* cyclic workspace dependency that would arise if `target-sqlite` reached
|
|
12
|
+
* back into `adapter-sqlite` for these primitives.
|
|
13
|
+
*/
|
|
14
|
+
function quoteIdentifier(identifier) {
|
|
15
|
+
if (identifier.length === 0) throw sqliteError("CONTRACT.IDENTIFIER_INVALID", "Identifier cannot be empty", { meta: {
|
|
16
|
+
value: identifier,
|
|
17
|
+
context: "identifier"
|
|
18
|
+
} });
|
|
19
|
+
if (identifier.includes("\0")) throw sqliteError("CONTRACT.IDENTIFIER_INVALID", "Identifier cannot contain null bytes", { meta: {
|
|
20
|
+
value: identifier.replace(/\0/g, "\\0"),
|
|
21
|
+
context: "identifier"
|
|
22
|
+
} });
|
|
23
|
+
return `"${identifier.replace(/"/g, "\"\"")}"`;
|
|
24
|
+
}
|
|
25
|
+
function escapeLiteral(value) {
|
|
26
|
+
if (value.includes("\0")) throw sqliteError("CONTRACT.IDENTIFIER_INVALID", "Literal value cannot contain null bytes", { meta: {
|
|
27
|
+
value: value.replace(/\0/g, "\\0"),
|
|
28
|
+
context: "literal"
|
|
29
|
+
} });
|
|
30
|
+
return value.replace(/'/g, "''");
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { quoteIdentifier as n, escapeLiteral as t };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=sql-utils-DqPXZBMA-Mm27NNjs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sql-utils-DqPXZBMA-Mm27NNjs.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/sql-utils-DqPXZBMA.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-CKsaaSnD.mjs\";\n//#region src/core/sql-utils.ts\n/**\n* Shared SQL utility functions for the SQLite target.\n*\n* These functions handle safe SQL identifier and literal escaping. They\n* live in `target-sqlite` (mirroring `target-postgres/src/core/sql-utils.ts`)\n* so both the control adapter (used at emit time) and the runtime adapter\n* (used at execute time) can depend on them through a single one-way edge:\n* `adapter-sqlite → target-sqlite`. Hosting them target-side avoids the\n* cyclic workspace dependency that would arise if `target-sqlite` reached\n* back into `adapter-sqlite` for these primitives.\n*/\nfunction quoteIdentifier(identifier) {\n\tif (identifier.length === 0) throw sqliteError(\"CONTRACT.IDENTIFIER_INVALID\", \"Identifier cannot be empty\", { meta: {\n\t\tvalue: identifier,\n\t\tcontext: \"identifier\"\n\t} });\n\tif (identifier.includes(\"\\0\")) throw sqliteError(\"CONTRACT.IDENTIFIER_INVALID\", \"Identifier cannot contain null bytes\", { meta: {\n\t\tvalue: identifier.replace(/\\0/g, \"\\\\0\"),\n\t\tcontext: \"identifier\"\n\t} });\n\treturn `\"${identifier.replace(/\"/g, \"\\\"\\\"\")}\"`;\n}\nfunction escapeLiteral(value) {\n\tif (value.includes(\"\\0\")) throw sqliteError(\"CONTRACT.IDENTIFIER_INVALID\", \"Literal value cannot contain null bytes\", { meta: {\n\t\tvalue: value.replace(/\\0/g, \"\\\\0\"),\n\t\tcontext: \"literal\"\n\t} });\n\treturn value.replace(/'/g, \"''\");\n}\n//#endregion\nexport { quoteIdentifier as n, escapeLiteral as t };\n\n//# sourceMappingURL=sql-utils-DqPXZBMA.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,gBAAgB,YAAY;CACpC,IAAI,WAAW,WAAW,GAAG,MAAM,YAAY,+BAA+B,8BAA8B,EAAE,MAAM;EACnH,OAAO;EACP,SAAS;CACV,EAAE,CAAC;CACH,IAAI,WAAW,SAAS,IAAI,GAAG,MAAM,YAAY,+BAA+B,wCAAwC,EAAE,MAAM;EAC/H,OAAO,WAAW,QAAQ,OAAO,KAAK;EACtC,SAAS;CACV,EAAE,CAAC;CACH,OAAO,IAAI,WAAW,QAAQ,MAAM,MAAM,EAAE;AAC7C;AACA,SAAS,cAAc,OAAO;CAC7B,IAAI,MAAM,SAAS,IAAI,GAAG,MAAM,YAAY,+BAA+B,2CAA2C,EAAE,MAAM;EAC7H,OAAO,MAAM,QAAQ,OAAO,KAAK;EACjC,SAAS;CACV,EAAE,CAAC;CACH,OAAO,MAAM,QAAQ,MAAM,IAAI;AAChC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
|
|
2
|
+
import { SqlSingleNamespaceView } from "@prisma/orm-family-sql/contract/contract-view";
|
|
3
|
+
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
4
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/sqlite-contract-view-BpNMaU2m.d.mts
|
|
5
|
+
//#region src/core/sqlite-contract-view.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* A SQLite contract view: the deserialized contract intersected with by-name
|
|
8
|
+
* accessors. It is substitutable for `Contract` (carries `storage`, `domain`,
|
|
9
|
+
* …) and also exposes the single default namespace unwrapped with the SQL
|
|
10
|
+
* built-in kinds promoted:
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* const view = SqliteContractView.fromJson<Contract>(contractJson);
|
|
14
|
+
* view.table.users // typed table leaf
|
|
15
|
+
* view.entries.policy.X // pack-contributed kind (singular key)
|
|
16
|
+
* view.storage // the full contract is still present
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* SQLite has `sql.enums: false`, so it never emits `valueSet` entries; the
|
|
20
|
+
* `valueSet` slot is therefore an empty map.
|
|
21
|
+
*/
|
|
22
|
+
type SqliteContractView<TContract extends Contract<SqlStorage> = Contract<SqlStorage>> = SqlSingleNamespaceView<TContract>;
|
|
23
|
+
declare const SqliteContractView: {
|
|
24
|
+
/** Wrap an already-deserialized SQLite contract in a view. */
|
|
25
|
+
from<TContract extends Contract<SqlStorage>>(contract: TContract): SqliteContractView<TContract>;
|
|
26
|
+
/** Deserialize a SQLite contract JSON envelope and wrap it in a view. */
|
|
27
|
+
fromJson<TContract extends Contract<SqlStorage> = Contract<SqlStorage<string>>>(json: unknown): SqliteContractView<TContract>;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { SqliteContractView as t };
|
|
31
|
+
//# sourceMappingURL=sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-contract-view-BpNMaU2m-COMDaGaq.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/sqlite-contract-view-BpNMaU2m.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;;;KAoBK,mBAAmB,kBAAkB,SAAS,cAAc,SAAS,eAAe,uBAAuB;cAClG;;EAEZ,KAAK,kBAAkB,SAAS,aAAa,UAAU,YAAY,mBAAmB;;EAEtF,SAAS,kBAAkB,SAAS,cAAc,SAAS,qBAAqB,gBAAgB,mBAAmB"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { n as sqliteError } from "./errors-CKsaaSnD-BeB4JS8h.mjs";
|
|
2
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
3
|
+
import { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from "@prisma/orm-framework/components/ir";
|
|
4
|
+
import { SqlNamespaceBase } from "@prisma/orm-family-sql/contract/types";
|
|
5
|
+
import { buildSqlSingleNamespaceView } from "@prisma/orm-family-sql/contract/contract-view";
|
|
6
|
+
import { SqlContractSerializerBase } from "@prisma/orm-family-sql/family/ir";
|
|
7
|
+
import { tableEntityKind } from "@prisma/orm-family-sql/contract/entity-kinds";
|
|
8
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/sqlite-contract-view-CnDITHEE.mjs
|
|
9
|
+
const SQLITE_NAMESPACE_KIND = "sqlite-namespace";
|
|
10
|
+
/**
|
|
11
|
+
* SQLite namespace concretion carrying table metadata under
|
|
12
|
+
* `entries.table` and unqualified `qualifyTable()` emission for runtime
|
|
13
|
+
* SQL rendering.
|
|
14
|
+
*/
|
|
15
|
+
var SqliteDatabase = class extends SqlNamespaceBase {
|
|
16
|
+
id;
|
|
17
|
+
entries;
|
|
18
|
+
constructor(input) {
|
|
19
|
+
super();
|
|
20
|
+
this.id = input.id;
|
|
21
|
+
const dispatched = hydrateNamespaceEntities(input.entries, /* @__PURE__ */ new Map([["table", tableEntityKind]]), "carry");
|
|
22
|
+
this.entries = Object.freeze(blindCast(dispatched));
|
|
23
|
+
Object.defineProperty(this, "kind", {
|
|
24
|
+
value: SQLITE_NAMESPACE_KIND,
|
|
25
|
+
writable: false,
|
|
26
|
+
enumerable: false,
|
|
27
|
+
configurable: true
|
|
28
|
+
});
|
|
29
|
+
freezeNode(this);
|
|
30
|
+
}
|
|
31
|
+
get table() {
|
|
32
|
+
return this.entries.table ?? Object.freeze({});
|
|
33
|
+
}
|
|
34
|
+
qualifier() {
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
37
|
+
qualifyTable(tableName) {
|
|
38
|
+
return `"${tableName}"`;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* SQLite target `Namespace` concretion. SQLite has no schema or
|
|
43
|
+
* database-namespacing concept at the SQL level — there is exactly one
|
|
44
|
+
* effective namespace per connection, so the target ships a single
|
|
45
|
+
* singleton bound to the framework's `UNBOUND_NAMESPACE_ID` slot.
|
|
46
|
+
*
|
|
47
|
+
* Qualifier emission elides the prefix entirely: rendered DDL and
|
|
48
|
+
* queries look unqualified (`CREATE TABLE "users" (...)`), matching
|
|
49
|
+
* SQLite's native dialect. Call sites stay polymorphic — they ask the
|
|
50
|
+
* namespace for its qualifier and consume the empty/unqualified result
|
|
51
|
+
* the same way Postgres consumes a `"schema"` prefix.
|
|
52
|
+
*
|
|
53
|
+
* The SQLite PSL interpreter rejects every explicit `namespace { … }`
|
|
54
|
+
* block with a diagnostic naming SQLite; only the implicit
|
|
55
|
+
* `__unspecified__` AST bucket reaches the SQLite interpreter, which
|
|
56
|
+
* lowers it to this singleton.
|
|
57
|
+
*/
|
|
58
|
+
var SqliteUnboundDatabase = class SqliteUnboundDatabase extends SqliteDatabase {
|
|
59
|
+
static instance = new SqliteUnboundDatabase();
|
|
60
|
+
constructor() {
|
|
61
|
+
super({
|
|
62
|
+
id: UNBOUND_NAMESPACE_ID,
|
|
63
|
+
entries: { table: {} }
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The SQLite target's rejection of expression and partial indexes: the
|
|
69
|
+
* family-shared authoring surfaces parse `expression:`/`where:` for every
|
|
70
|
+
* SQL target, but SQLite neither renders nor introspects them (project
|
|
71
|
+
* non-goal) — a contract carrying one must fail loudly at lowering instead
|
|
72
|
+
* of silently producing an unverifiable index. Target-owned so no family
|
|
73
|
+
* code branches on the target.
|
|
74
|
+
*/
|
|
75
|
+
function rejectSqlBodyIndexes(input) {
|
|
76
|
+
const tables = input.entries["table"];
|
|
77
|
+
if (tables === void 0) return;
|
|
78
|
+
for (const [tableName, table] of Object.entries(tables)) {
|
|
79
|
+
const indexes = blindCast(table).indexes;
|
|
80
|
+
for (const index of indexes ?? []) if (index.expression !== void 0 || index.where !== void 0) throw sqliteError("CONTRACT.ARGUMENT_INVALID", `SQLite does not support expression or partial indexes: index "${index.name ?? "<unnamed>"}" on table "${tableName}" declares ${index.expression !== void 0 ? "an expression" : "a where predicate"}. Use a fields-only index, or author this index against a Postgres target.`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function buildSqliteNamespace(input) {
|
|
84
|
+
rejectSqlBodyIndexes(input);
|
|
85
|
+
if (input.id !== UNBOUND_NAMESPACE_ID) throw sqliteError("CONTRACT.NAMESPACE_INVALID", `buildSqliteNamespace: SQLite has no schema concept; the only valid namespace id is "${UNBOUND_NAMESPACE_ID}" (received "${input.id}").`, { meta: { received: input.id } });
|
|
86
|
+
const tableKind = input.entries["table"];
|
|
87
|
+
const tableCount = tableKind !== void 0 ? Object.keys(tableKind).length : 0;
|
|
88
|
+
const hasUnknownKinds = Object.keys(input.entries).some((kind) => kind !== "table");
|
|
89
|
+
if (tableCount === 0 && !hasUnknownKinds) return SqliteUnboundDatabase.instance;
|
|
90
|
+
return new SqliteDatabase({
|
|
91
|
+
id: input.id,
|
|
92
|
+
entries: input.entries
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Target-supplied `Namespace` factory the SQLite target plumbs through
|
|
97
|
+
* `defineContract({ createNamespace })`. SQLite has only one
|
|
98
|
+
* effective namespace slot — the framework `UNBOUND_NAMESPACE_ID`
|
|
99
|
+
* sentinel — so the factory always returns the singleton or a fresh
|
|
100
|
+
* `SqliteDatabase` for the unbound slot with tables. The SQL family's
|
|
101
|
+
* defensive validation in `defineContract` already rejects
|
|
102
|
+
* user-declared SQLite namespaces, so this throw is a structural
|
|
103
|
+
* safety net rather than a user-facing surface.
|
|
104
|
+
*/
|
|
105
|
+
function sqliteCreateNamespace(input) {
|
|
106
|
+
return buildSqliteNamespace(input);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* SQLite target `ContractSerializer` concretion. Mirrors the Postgres
|
|
110
|
+
* shape: inherits the full SQL-family deserialization pipeline and
|
|
111
|
+
* materialises namespace entries as SQLite database concretions that
|
|
112
|
+
* expose `qualifyTable()` for runtime SQL rendering.
|
|
113
|
+
*/
|
|
114
|
+
var SqliteContractSerializer = class extends SqlContractSerializerBase {
|
|
115
|
+
constructor() {
|
|
116
|
+
super(/* @__PURE__ */ new Map());
|
|
117
|
+
}
|
|
118
|
+
hydrateSqlNamespaceEntry(nsId, raw) {
|
|
119
|
+
return buildSqliteNamespace(blindCast(super.hydrateSqlNamespaceEntry(nsId, raw)));
|
|
120
|
+
}
|
|
121
|
+
serializeContract(contract) {
|
|
122
|
+
const { storage, ...rest } = contract;
|
|
123
|
+
const namespacesJson = {};
|
|
124
|
+
for (const [nsId, ns] of Object.entries(storage.namespaces)) namespacesJson[nsId] = {
|
|
125
|
+
id: ns.id,
|
|
126
|
+
entries: this.serializeNamespaceEntries(ns.entries)
|
|
127
|
+
};
|
|
128
|
+
return blindCast({
|
|
129
|
+
...rest,
|
|
130
|
+
storage: {
|
|
131
|
+
storageHash: String(storage.storageHash),
|
|
132
|
+
namespaces: namespacesJson,
|
|
133
|
+
...storage.types !== void 0 ? { types: this.serializeJsonObject(storage.types) } : {}
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const SqliteContractView = {
|
|
139
|
+
/** Wrap an already-deserialized SQLite contract in a view. */
|
|
140
|
+
from(contract) {
|
|
141
|
+
return buildSqlSingleNamespaceView(contract);
|
|
142
|
+
},
|
|
143
|
+
/** Deserialize a SQLite contract JSON envelope and wrap it in a view. */
|
|
144
|
+
fromJson(json) {
|
|
145
|
+
return buildSqlSingleNamespaceView(new SqliteContractSerializer().deserializeContract(json));
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { sqliteCreateNamespace as i, SqliteContractView as n, SqliteUnboundDatabase as r, SqliteContractSerializer as t };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/sqlite-contract-view-CnDITHEE.mjs"],"sourcesContent":["import { n as sqliteError } from \"./errors-CKsaaSnD.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { SqlNamespaceBase } from \"@internal/sql-contract/types\";\nimport { UNBOUND_NAMESPACE_ID, freezeNode, hydrateNamespaceEntities } from \"@internal/framework-components/ir\";\nimport { buildSqlSingleNamespaceView } from \"@internal/sql-contract/contract-view\";\nimport { SqlContractSerializerBase } from \"@internal/family-sql/ir\";\nimport { tableEntityKind } from \"@internal/sql-contract/entity-kinds\";\n//#region src/core/sqlite-unbound-database.ts\nconst SQLITE_NAMESPACE_KIND = \"sqlite-namespace\";\n/**\n* SQLite namespace concretion carrying table metadata under\n* `entries.table` and unqualified `qualifyTable()` emission for runtime\n* SQL rendering.\n*/\nvar SqliteDatabase = class extends SqlNamespaceBase {\n\tid;\n\tentries;\n\tconstructor(input) {\n\t\tsuper();\n\t\tthis.id = input.id;\n\t\tconst dispatched = hydrateNamespaceEntities(input.entries, /* @__PURE__ */ new Map([[\"table\", tableEntityKind]]), \"carry\");\n\t\tthis.entries = Object.freeze(blindCast(dispatched));\n\t\tObject.defineProperty(this, \"kind\", {\n\t\t\tvalue: SQLITE_NAMESPACE_KIND,\n\t\t\twritable: false,\n\t\t\tenumerable: false,\n\t\t\tconfigurable: true\n\t\t});\n\t\tfreezeNode(this);\n\t}\n\tget table() {\n\t\treturn this.entries.table ?? Object.freeze({});\n\t}\n\tqualifier() {\n\t\treturn \"\";\n\t}\n\tqualifyTable(tableName) {\n\t\treturn `\"${tableName}\"`;\n\t}\n};\n/**\n* SQLite target `Namespace` concretion. SQLite has no schema or\n* database-namespacing concept at the SQL level — there is exactly one\n* effective namespace per connection, so the target ships a single\n* singleton bound to the framework's `UNBOUND_NAMESPACE_ID` slot.\n*\n* Qualifier emission elides the prefix entirely: rendered DDL and\n* queries look unqualified (`CREATE TABLE \"users\" (...)`), matching\n* SQLite's native dialect. Call sites stay polymorphic — they ask the\n* namespace for its qualifier and consume the empty/unqualified result\n* the same way Postgres consumes a `\"schema\"` prefix.\n*\n* The SQLite PSL interpreter rejects every explicit `namespace { … }`\n* block with a diagnostic naming SQLite; only the implicit\n* `__unspecified__` AST bucket reaches the SQLite interpreter, which\n* lowers it to this singleton.\n*/\nvar SqliteUnboundDatabase = class SqliteUnboundDatabase extends SqliteDatabase {\n\tstatic instance = new SqliteUnboundDatabase();\n\tconstructor() {\n\t\tsuper({\n\t\t\tid: UNBOUND_NAMESPACE_ID,\n\t\t\tentries: { table: {} }\n\t\t});\n\t}\n};\n/**\n* The SQLite target's rejection of expression and partial indexes: the\n* family-shared authoring surfaces parse `expression:`/`where:` for every\n* SQL target, but SQLite neither renders nor introspects them (project\n* non-goal) — a contract carrying one must fail loudly at lowering instead\n* of silently producing an unverifiable index. Target-owned so no family\n* code branches on the target.\n*/\nfunction rejectSqlBodyIndexes(input) {\n\tconst tables = input.entries[\"table\"];\n\tif (tables === void 0) return;\n\tfor (const [tableName, table] of Object.entries(tables)) {\n\t\tconst indexes = blindCast(table).indexes;\n\t\tfor (const index of indexes ?? []) if (index.expression !== void 0 || index.where !== void 0) throw sqliteError(\"CONTRACT.ARGUMENT_INVALID\", `SQLite does not support expression or partial indexes: index \"${index.name ?? \"<unnamed>\"}\" on table \"${tableName}\" declares ${index.expression !== void 0 ? \"an expression\" : \"a where predicate\"}. Use a fields-only index, or author this index against a Postgres target.`);\n\t}\n}\nfunction buildSqliteNamespace(input) {\n\trejectSqlBodyIndexes(input);\n\tif (input.id !== UNBOUND_NAMESPACE_ID) throw sqliteError(\"CONTRACT.NAMESPACE_INVALID\", `buildSqliteNamespace: SQLite has no schema concept; the only valid namespace id is \"${UNBOUND_NAMESPACE_ID}\" (received \"${input.id}\").`, { meta: { received: input.id } });\n\tconst tableKind = input.entries[\"table\"];\n\tconst tableCount = tableKind !== void 0 ? Object.keys(tableKind).length : 0;\n\tconst hasUnknownKinds = Object.keys(input.entries).some((kind) => kind !== \"table\");\n\tif (tableCount === 0 && !hasUnknownKinds) return SqliteUnboundDatabase.instance;\n\treturn new SqliteDatabase({\n\t\tid: input.id,\n\t\tentries: input.entries\n\t});\n}\n/**\n* Target-supplied `Namespace` factory the SQLite target plumbs through\n* `defineContract({ createNamespace })`. SQLite has only one\n* effective namespace slot — the framework `UNBOUND_NAMESPACE_ID`\n* sentinel — so the factory always returns the singleton or a fresh\n* `SqliteDatabase` for the unbound slot with tables. The SQL family's\n* defensive validation in `defineContract` already rejects\n* user-declared SQLite namespaces, so this throw is a structural\n* safety net rather than a user-facing surface.\n*/\nfunction sqliteCreateNamespace(input) {\n\treturn buildSqliteNamespace(input);\n}\n//#endregion\n//#region src/core/sqlite-contract-serializer.ts\n/**\n* SQLite target `ContractSerializer` concretion. Mirrors the Postgres\n* shape: inherits the full SQL-family deserialization pipeline and\n* materialises namespace entries as SQLite database concretions that\n* expose `qualifyTable()` for runtime SQL rendering.\n*/\nvar SqliteContractSerializer = class extends SqlContractSerializerBase {\n\tconstructor() {\n\t\tsuper(/* @__PURE__ */ new Map());\n\t}\n\thydrateSqlNamespaceEntry(nsId, raw) {\n\t\treturn buildSqliteNamespace(blindCast(super.hydrateSqlNamespaceEntry(nsId, raw)));\n\t}\n\tserializeContract(contract) {\n\t\tconst { storage, ...rest } = contract;\n\t\tconst namespacesJson = {};\n\t\tfor (const [nsId, ns] of Object.entries(storage.namespaces)) namespacesJson[nsId] = {\n\t\t\tid: ns.id,\n\t\t\tentries: this.serializeNamespaceEntries(ns.entries)\n\t\t};\n\t\treturn blindCast({\n\t\t\t...rest,\n\t\t\tstorage: {\n\t\t\t\tstorageHash: String(storage.storageHash),\n\t\t\t\tnamespaces: namespacesJson,\n\t\t\t\t...storage.types !== void 0 ? { types: this.serializeJsonObject(storage.types) } : {}\n\t\t\t}\n\t\t});\n\t}\n};\n//#endregion\n//#region src/core/sqlite-contract-view.ts\nconst SqliteContractView = {\n\t/** Wrap an already-deserialized SQLite contract in a view. */\n\tfrom(contract) {\n\t\treturn buildSqlSingleNamespaceView(contract);\n\t},\n\t/** Deserialize a SQLite contract JSON envelope and wrap it in a view. */\n\tfromJson(json) {\n\t\treturn buildSqlSingleNamespaceView(new SqliteContractSerializer().deserializeContract(json));\n\t}\n};\n//#endregion\nexport { sqliteCreateNamespace as i, SqliteContractSerializer as n, SqliteUnboundDatabase as r, SqliteContractView as t };\n\n//# sourceMappingURL=sqlite-contract-view-CnDITHEE.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,wBAAwB;;;;;;AAM9B,IAAI,iBAAiB,cAAc,iBAAiB;CACnD;CACA;CACA,YAAY,OAAO;EAClB,MAAM;EACN,KAAK,KAAK,MAAM;EAChB,MAAM,aAAa,yBAAyB,MAAM,yBAAyB,IAAI,IAAI,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,GAAG,OAAO;EACzH,KAAK,UAAU,OAAO,OAAO,UAAU,UAAU,CAAC;EAClD,OAAO,eAAe,MAAM,QAAQ;GACnC,OAAO;GACP,UAAU;GACV,YAAY;GACZ,cAAc;EACf,CAAC;EACD,WAAW,IAAI;CAChB;CACA,IAAI,QAAQ;EACX,OAAO,KAAK,QAAQ,SAAS,OAAO,OAAO,CAAC,CAAC;CAC9C;CACA,YAAY;EACX,OAAO;CACR;CACA,aAAa,WAAW;EACvB,OAAO,IAAI,UAAU;CACtB;AACD;;;;;;;;;;;;;;;;;;AAkBA,IAAI,wBAAwB,MAAM,8BAA8B,eAAe;CAC9E,OAAO,WAAW,IAAI,sBAAsB;CAC5C,cAAc;EACb,MAAM;GACL,IAAI;GACJ,SAAS,EAAE,OAAO,CAAC,EAAE;EACtB,CAAC;CACF;AACD;;;;;;;;;AASA,SAAS,qBAAqB,OAAO;CACpC,MAAM,SAAS,MAAM,QAAQ;CAC7B,IAAI,WAAW,KAAK,GAAG;CACvB,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,MAAM,GAAG;EACxD,MAAM,UAAU,UAAU,KAAK,CAAC,CAAC;EACjC,KAAK,MAAM,SAAS,WAAW,CAAC,GAAG,IAAI,MAAM,eAAe,KAAK,KAAK,MAAM,UAAU,KAAK,GAAG,MAAM,YAAY,6BAA6B,iEAAiE,MAAM,QAAQ,YAAY,cAAc,UAAU,aAAa,MAAM,eAAe,KAAK,IAAI,kBAAkB,oBAAoB,2EAA2E;CAC7Z;AACD;AACA,SAAS,qBAAqB,OAAO;CACpC,qBAAqB,KAAK;CAC1B,IAAI,MAAM,OAAO,sBAAsB,MAAM,YAAY,8BAA8B,uFAAuF,qBAAqB,eAAe,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,UAAU,MAAM,GAAG,EAAE,CAAC;CACjQ,MAAM,YAAY,MAAM,QAAQ;CAChC,MAAM,aAAa,cAAc,KAAK,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,SAAS;CAC1E,MAAM,kBAAkB,OAAO,KAAK,MAAM,OAAO,CAAC,CAAC,MAAM,SAAS,SAAS,OAAO;CAClF,IAAI,eAAe,KAAK,CAAC,iBAAiB,OAAO,sBAAsB;CACvE,OAAO,IAAI,eAAe;EACzB,IAAI,MAAM;EACV,SAAS,MAAM;CAChB,CAAC;AACF;;;;;;;;;;;AAWA,SAAS,sBAAsB,OAAO;CACrC,OAAO,qBAAqB,KAAK;AAClC;;;;;;;AASA,IAAI,2BAA2B,cAAc,0BAA0B;CACtE,cAAc;EACb,sBAAsB,IAAI,IAAI,CAAC;CAChC;CACA,yBAAyB,MAAM,KAAK;EACnC,OAAO,qBAAqB,UAAU,MAAM,yBAAyB,MAAM,GAAG,CAAC,CAAC;CACjF;CACA,kBAAkB,UAAU;EAC3B,MAAM,EAAE,SAAS,GAAG,SAAS;EAC7B,MAAM,iBAAiB,CAAC;EACxB,KAAK,MAAM,CAAC,MAAM,OAAO,OAAO,QAAQ,QAAQ,UAAU,GAAG,eAAe,QAAQ;GACnF,IAAI,GAAG;GACP,SAAS,KAAK,0BAA0B,GAAG,OAAO;EACnD;EACA,OAAO,UAAU;GAChB,GAAG;GACH,SAAS;IACR,aAAa,OAAO,QAAQ,WAAW;IACvC,YAAY;IACZ,GAAG,QAAQ,UAAU,KAAK,IAAI,EAAE,OAAO,KAAK,oBAAoB,QAAQ,KAAK,EAAE,IAAI,CAAC;GACrF;EACD,CAAC;CACF;AACD;AAGA,MAAM,qBAAqB;;CAE1B,KAAK,UAAU;EACd,OAAO,4BAA4B,QAAQ;CAC5C;;CAEA,SAAS,MAAM;EACd,OAAO,4BAA4B,IAAI,yBAAyB,CAAC,CAAC,oBAAoB,IAAI,CAAC;CAC5F;AACD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { t as errorSqliteMigrationStackMissing } from "./errors-CKsaaSnD-BeB4JS8h.mjs";
|
|
2
|
+
import { a as DropColumnCall, l as RecreateTableCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall } from "./op-factory-call-C_or6163-B_LDzC37.mjs";
|
|
3
|
+
import { n as SqliteContractView } from "./sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs";
|
|
4
|
+
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
5
|
+
import { Migration } from "@prisma/orm-family-sql/family/migration";
|
|
6
|
+
import { MigrationContractViews } from "@prisma/orm-toolchain/migration-tools/migration";
|
|
7
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/sqlite-migration-CV6LIqhx.mjs
|
|
8
|
+
/**
|
|
9
|
+
* Target-owned base class for SQLite migrations. Fixes the `SqlMigration`
|
|
10
|
+
* generic to `SqlitePlanTargetDetails` and the abstract `targetId` to the
|
|
11
|
+
* SQLite literal, so both user-authored migrations and renderer-generated
|
|
12
|
+
* scaffolds can extend `SqliteMigration` directly without redeclaring
|
|
13
|
+
* target-local identity.
|
|
14
|
+
*
|
|
15
|
+
* The constructor materializes a single SQLite `SqlControlAdapter` from
|
|
16
|
+
* `stack.adapter.create(stack)` and stores it; the protected instance methods
|
|
17
|
+
* forward to the corresponding `*Call` with that stored adapter, so user
|
|
18
|
+
* migrations can write `this.createTable({...})` without threading the adapter
|
|
19
|
+
* through every call.
|
|
20
|
+
*
|
|
21
|
+
* Binds the framework base's `Start` / `End` contract generics so a subclass
|
|
22
|
+
* that assigns its snapshot-store `contract.json` imports to
|
|
23
|
+
* `startContractJson` / `endContractJson` gets fully-typed view accessors:
|
|
24
|
+
* `this.endContract` is a `SqliteContractView<End>`
|
|
25
|
+
* (sole namespace unwrapped to the root — `this.endContract.table.<name>`),
|
|
26
|
+
* built lazily from the JSON fields via the shared `MigrationContractViews`
|
|
27
|
+
* helper. Mirrors `MongoMigration`'s view getters; the framework base derives
|
|
28
|
+
* `describe()` from the same JSON.
|
|
29
|
+
*/
|
|
30
|
+
var SqliteMigration = class extends Migration {
|
|
31
|
+
targetId = "sqlite";
|
|
32
|
+
/**
|
|
33
|
+
* Materialized SQLite control adapter, created once per migration
|
|
34
|
+
* instance from the injected stack. `undefined` only when the migration
|
|
35
|
+
* was instantiated without a stack (test fixtures); `controlAdapterFor`
|
|
36
|
+
* throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING in that case to surface the misuse.
|
|
37
|
+
*/
|
|
38
|
+
controlAdapter;
|
|
39
|
+
#endView = new MigrationContractViews(this, "SqliteMigration", (json) => SqliteContractView.fromJson(json));
|
|
40
|
+
#startView = new MigrationContractViews(this, "SqliteMigration", (json) => SqliteContractView.fromJson(json));
|
|
41
|
+
constructor(stack) {
|
|
42
|
+
super(stack);
|
|
43
|
+
this.controlAdapter = stack?.adapter ? blindCast(stack.adapter.create(stack)) : void 0;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns the materialized control adapter, or throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING naming
|
|
47
|
+
* `operation` when the migration was constructed without a `ControlStack`.
|
|
48
|
+
* Single home for the null-check that every DDL/DML method shares.
|
|
49
|
+
*/
|
|
50
|
+
controlAdapterFor(operation) {
|
|
51
|
+
if (!this.controlAdapter) throw errorSqliteMigrationStackMissing(operation);
|
|
52
|
+
return this.controlAdapter;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The typed SQLite view over this migration's end-state contract — sole
|
|
56
|
+
* namespace unwrapped to the root, so `this.endContract.table.<name>` etc.
|
|
57
|
+
* Throws if no `endContractJson` was provided.
|
|
58
|
+
*/
|
|
59
|
+
get endContract() {
|
|
60
|
+
return this.#endView.endContract;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The typed SQLite view over this migration's start-state contract, or
|
|
64
|
+
* `null` for a baseline migration (no `startContractJson`).
|
|
65
|
+
*/
|
|
66
|
+
get startContract() {
|
|
67
|
+
return this.#startView.startContract;
|
|
68
|
+
}
|
|
69
|
+
createTable(options) {
|
|
70
|
+
return new CreateTableCall(options.table, options.columns, options.constraints).toOp(this.controlAdapterFor("createTable"));
|
|
71
|
+
}
|
|
72
|
+
dropTable(options) {
|
|
73
|
+
return new DropTableCall(options.table).toOp(this.controlAdapterFor("dropTable"));
|
|
74
|
+
}
|
|
75
|
+
addColumn(options) {
|
|
76
|
+
return new AddColumnCall(options.table, options.column).toOp(this.controlAdapterFor("addColumn"));
|
|
77
|
+
}
|
|
78
|
+
dropColumn(options) {
|
|
79
|
+
return new DropColumnCall(options.table, options.column).toOp(this.controlAdapterFor("dropColumn"));
|
|
80
|
+
}
|
|
81
|
+
createIndex(options) {
|
|
82
|
+
return new CreateIndexCall(options.table, options.index, options.columns).toOp(this.controlAdapterFor("createIndex"));
|
|
83
|
+
}
|
|
84
|
+
dropIndex(options) {
|
|
85
|
+
return new DropIndexCall(options.table, options.index).toOp(this.controlAdapterFor("dropIndex"));
|
|
86
|
+
}
|
|
87
|
+
recreateTable(options) {
|
|
88
|
+
return new RecreateTableCall(options).toOp(this.controlAdapterFor("recreateTable"));
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { SqliteMigration as t };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=sqlite-migration-CV6LIqhx-D5eMTAbH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-migration-CV6LIqhx-D5eMTAbH.mjs","names":["#endView","#startView"],"sources":["../../../../3-targets/3-targets/sqlite/dist/sqlite-migration-CV6LIqhx.mjs"],"sourcesContent":["import { t as errorSqliteMigrationStackMissing } from \"./errors-CKsaaSnD.mjs\";\nimport { a as DropColumnCall, l as RecreateTableCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall } from \"./op-factory-call-C_or6163.mjs\";\nimport { t as SqliteContractView } from \"./sqlite-contract-view-CnDITHEE.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { Migration } from \"@internal/family-sql/migration\";\nimport { MigrationContractViews } from \"@internal/migration-tools/migration\";\n//#region src/core/migrations/sqlite-migration.ts\n/**\n* Target-owned base class for SQLite migrations. Fixes the `SqlMigration`\n* generic to `SqlitePlanTargetDetails` and the abstract `targetId` to the\n* SQLite literal, so both user-authored migrations and renderer-generated\n* scaffolds can extend `SqliteMigration` directly without redeclaring\n* target-local identity.\n*\n* The constructor materializes a single SQLite `SqlControlAdapter` from\n* `stack.adapter.create(stack)` and stores it; the protected instance methods\n* forward to the corresponding `*Call` with that stored adapter, so user\n* migrations can write `this.createTable({...})` without threading the adapter\n* through every call.\n*\n* Binds the framework base's `Start` / `End` contract generics so a subclass\n* that assigns its snapshot-store `contract.json` imports to\n* `startContractJson` / `endContractJson` gets fully-typed view accessors:\n* `this.endContract` is a `SqliteContractView<End>`\n* (sole namespace unwrapped to the root — `this.endContract.table.<name>`),\n* built lazily from the JSON fields via the shared `MigrationContractViews`\n* helper. Mirrors `MongoMigration`'s view getters; the framework base derives\n* `describe()` from the same JSON.\n*/\nvar SqliteMigration = class extends Migration {\n\ttargetId = \"sqlite\";\n\t/**\n\t* Materialized SQLite control adapter, created once per migration\n\t* instance from the injected stack. `undefined` only when the migration\n\t* was instantiated without a stack (test fixtures); `controlAdapterFor`\n\t* throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING in that case to surface the misuse.\n\t*/\n\tcontrolAdapter;\n\t#endView = new MigrationContractViews(this, \"SqliteMigration\", (json) => SqliteContractView.fromJson(json));\n\t#startView = new MigrationContractViews(this, \"SqliteMigration\", (json) => SqliteContractView.fromJson(json));\n\tconstructor(stack) {\n\t\tsuper(stack);\n\t\tthis.controlAdapter = stack?.adapter ? blindCast(stack.adapter.create(stack)) : void 0;\n\t}\n\t/**\n\t* Returns the materialized control adapter, or throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING naming\n\t* `operation` when the migration was constructed without a `ControlStack`.\n\t* Single home for the null-check that every DDL/DML method shares.\n\t*/\n\tcontrolAdapterFor(operation) {\n\t\tif (!this.controlAdapter) throw errorSqliteMigrationStackMissing(operation);\n\t\treturn this.controlAdapter;\n\t}\n\t/**\n\t* The typed SQLite view over this migration's end-state contract — sole\n\t* namespace unwrapped to the root, so `this.endContract.table.<name>` etc.\n\t* Throws if no `endContractJson` was provided.\n\t*/\n\tget endContract() {\n\t\treturn this.#endView.endContract;\n\t}\n\t/**\n\t* The typed SQLite view over this migration's start-state contract, or\n\t* `null` for a baseline migration (no `startContractJson`).\n\t*/\n\tget startContract() {\n\t\treturn this.#startView.startContract;\n\t}\n\tcreateTable(options) {\n\t\treturn new CreateTableCall(options.table, options.columns, options.constraints).toOp(this.controlAdapterFor(\"createTable\"));\n\t}\n\tdropTable(options) {\n\t\treturn new DropTableCall(options.table).toOp(this.controlAdapterFor(\"dropTable\"));\n\t}\n\taddColumn(options) {\n\t\treturn new AddColumnCall(options.table, options.column).toOp(this.controlAdapterFor(\"addColumn\"));\n\t}\n\tdropColumn(options) {\n\t\treturn new DropColumnCall(options.table, options.column).toOp(this.controlAdapterFor(\"dropColumn\"));\n\t}\n\tcreateIndex(options) {\n\t\treturn new CreateIndexCall(options.table, options.index, options.columns).toOp(this.controlAdapterFor(\"createIndex\"));\n\t}\n\tdropIndex(options) {\n\t\treturn new DropIndexCall(options.table, options.index).toOp(this.controlAdapterFor(\"dropIndex\"));\n\t}\n\trecreateTable(options) {\n\t\treturn new RecreateTableCall(options).toOp(this.controlAdapterFor(\"recreateTable\"));\n\t}\n};\n//#endregion\nexport { SqliteMigration as t };\n\n//# sourceMappingURL=sqlite-migration-CV6LIqhx.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAI,kBAAkB,cAAc,UAAU;CAC7C,WAAW;;;;;;;CAOX;CACA,WAAW,IAAI,uBAAuB,MAAM,oBAAoB,SAAS,mBAAmB,SAAS,IAAI,CAAC;CAC1G,aAAa,IAAI,uBAAuB,MAAM,oBAAoB,SAAS,mBAAmB,SAAS,IAAI,CAAC;CAC5G,YAAY,OAAO;EAClB,MAAM,KAAK;EACX,KAAK,iBAAiB,OAAO,UAAU,UAAU,MAAM,QAAQ,OAAO,KAAK,CAAC,IAAI,KAAK;CACtF;;;;;;CAMA,kBAAkB,WAAW;EAC5B,IAAI,CAAC,KAAK,gBAAgB,MAAM,iCAAiC,SAAS;EAC1E,OAAO,KAAK;CACb;;;;;;CAMA,IAAI,cAAc;EACjB,OAAO,KAAKA,SAAS;CACtB;;;;;CAKA,IAAI,gBAAgB;EACnB,OAAO,KAAKC,WAAW;CACxB;CACA,YAAY,SAAS;EACpB,OAAO,IAAI,gBAAgB,QAAQ,OAAO,QAAQ,SAAS,QAAQ,WAAW,CAAC,CAAC,KAAK,KAAK,kBAAkB,aAAa,CAAC;CAC3H;CACA,UAAU,SAAS;EAClB,OAAO,IAAI,cAAc,QAAQ,KAAK,CAAC,CAAC,KAAK,KAAK,kBAAkB,WAAW,CAAC;CACjF;CACA,UAAU,SAAS;EAClB,OAAO,IAAI,cAAc,QAAQ,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,KAAK,kBAAkB,WAAW,CAAC;CACjG;CACA,WAAW,SAAS;EACnB,OAAO,IAAI,eAAe,QAAQ,OAAO,QAAQ,MAAM,CAAC,CAAC,KAAK,KAAK,kBAAkB,YAAY,CAAC;CACnG;CACA,YAAY,SAAS;EACpB,OAAO,IAAI,gBAAgB,QAAQ,OAAO,QAAQ,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,KAAK,kBAAkB,aAAa,CAAC;CACrH;CACA,UAAU,SAAS;EAClB,OAAO,IAAI,cAAc,QAAQ,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,KAAK,kBAAkB,WAAW,CAAC;CAChG;CACA,cAAc,SAAS;EACtB,OAAO,IAAI,kBAAkB,OAAO,CAAC,CAAC,KAAK,KAAK,kBAAkB,eAAe,CAAC;CACnF;AACD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz-CMahymzq.mjs";
|
|
2
|
+
import { i as SqliteTableSpec, n as SqliteColumnSpec, r as SqliteIndexSpec } from "./shared-BYAX0FaQ--VvRXVRC.mjs";
|
|
3
|
+
import { t as SqliteContractView } from "./sqlite-contract-view-BpNMaU2m-COMDaGaq.mjs";
|
|
4
|
+
import { DdlColumn, DdlTableConstraint } from "@prisma/orm-family-sql/relational-core/ast";
|
|
5
|
+
import { ControlStack } from "@prisma/orm-framework/components/control";
|
|
6
|
+
import { MigrationOperationClass, SqlMigrationPlanOperation } from "@prisma/orm-family-sql/family/control";
|
|
7
|
+
import { SqlStorage } from "@prisma/orm-family-sql/contract/types";
|
|
8
|
+
import { Migration } from "@prisma/orm-family-sql/family/migration";
|
|
9
|
+
import { Contract } from "@prisma/orm-framework/contract/types";
|
|
10
|
+
import { SqlControlAdapter } from "@prisma/orm-family-sql/family/control-adapter";
|
|
11
|
+
//#region ../../../3-targets/3-targets/sqlite/dist/sqlite-migration-o23JHwzY.d.mts
|
|
12
|
+
//#region src/core/migrations/sqlite-migration.d.ts
|
|
13
|
+
type Op = SqlMigrationPlanOperation<SqlitePlanTargetDetails>;
|
|
14
|
+
/**
|
|
15
|
+
* Target-owned base class for SQLite migrations. Fixes the `SqlMigration`
|
|
16
|
+
* generic to `SqlitePlanTargetDetails` and the abstract `targetId` to the
|
|
17
|
+
* SQLite literal, so both user-authored migrations and renderer-generated
|
|
18
|
+
* scaffolds can extend `SqliteMigration` directly without redeclaring
|
|
19
|
+
* target-local identity.
|
|
20
|
+
*
|
|
21
|
+
* The constructor materializes a single SQLite `SqlControlAdapter` from
|
|
22
|
+
* `stack.adapter.create(stack)` and stores it; the protected instance methods
|
|
23
|
+
* forward to the corresponding `*Call` with that stored adapter, so user
|
|
24
|
+
* migrations can write `this.createTable({...})` without threading the adapter
|
|
25
|
+
* through every call.
|
|
26
|
+
*
|
|
27
|
+
* Binds the framework base's `Start` / `End` contract generics so a subclass
|
|
28
|
+
* that assigns its snapshot-store `contract.json` imports to
|
|
29
|
+
* `startContractJson` / `endContractJson` gets fully-typed view accessors:
|
|
30
|
+
* `this.endContract` is a `SqliteContractView<End>`
|
|
31
|
+
* (sole namespace unwrapped to the root — `this.endContract.table.<name>`),
|
|
32
|
+
* built lazily from the JSON fields via the shared `MigrationContractViews`
|
|
33
|
+
* helper. Mirrors `MongoMigration`'s view getters; the framework base derives
|
|
34
|
+
* `describe()` from the same JSON.
|
|
35
|
+
*/
|
|
36
|
+
declare abstract class SqliteMigration<Start extends Contract<SqlStorage> = Contract<SqlStorage>, End extends Contract<SqlStorage> = Contract<SqlStorage>> extends Migration<SqlitePlanTargetDetails, 'sqlite', Start, End> {
|
|
37
|
+
#private;
|
|
38
|
+
readonly targetId: "sqlite";
|
|
39
|
+
/**
|
|
40
|
+
* Materialized SQLite control adapter, created once per migration
|
|
41
|
+
* instance from the injected stack. `undefined` only when the migration
|
|
42
|
+
* was instantiated without a stack (test fixtures); `controlAdapterFor`
|
|
43
|
+
* throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING in that case to surface the misuse.
|
|
44
|
+
*/
|
|
45
|
+
protected readonly controlAdapter: SqlControlAdapter<'sqlite'> | undefined;
|
|
46
|
+
constructor(stack?: ControlStack<'sql', 'sqlite'>);
|
|
47
|
+
/**
|
|
48
|
+
* Returns the materialized control adapter, or throws a MIGRATION.SQLITE_CONTROL_STACK_MISSING naming
|
|
49
|
+
* `operation` when the migration was constructed without a `ControlStack`.
|
|
50
|
+
* Single home for the null-check that every DDL/DML method shares.
|
|
51
|
+
*/
|
|
52
|
+
private controlAdapterFor;
|
|
53
|
+
/**
|
|
54
|
+
* The typed SQLite view over this migration's end-state contract — sole
|
|
55
|
+
* namespace unwrapped to the root, so `this.endContract.table.<name>` etc.
|
|
56
|
+
* Throws if no `endContractJson` was provided.
|
|
57
|
+
*/
|
|
58
|
+
get endContract(): SqliteContractView<End>;
|
|
59
|
+
/**
|
|
60
|
+
* The typed SQLite view over this migration's start-state contract, or
|
|
61
|
+
* `null` for a baseline migration (no `startContractJson`).
|
|
62
|
+
*/
|
|
63
|
+
get startContract(): SqliteContractView<Start> | null;
|
|
64
|
+
protected createTable(options: {
|
|
65
|
+
readonly table: string;
|
|
66
|
+
readonly ifNotExists?: boolean;
|
|
67
|
+
readonly columns: readonly DdlColumn[];
|
|
68
|
+
readonly constraints?: readonly DdlTableConstraint[];
|
|
69
|
+
}): Promise<Op>;
|
|
70
|
+
protected dropTable(options: {
|
|
71
|
+
readonly table: string;
|
|
72
|
+
}): Promise<Op>;
|
|
73
|
+
protected addColumn(options: {
|
|
74
|
+
readonly table: string;
|
|
75
|
+
readonly column: SqliteColumnSpec;
|
|
76
|
+
}): Promise<Op>;
|
|
77
|
+
protected dropColumn(options: {
|
|
78
|
+
readonly table: string;
|
|
79
|
+
readonly column: string;
|
|
80
|
+
}): Promise<Op>;
|
|
81
|
+
protected createIndex(options: {
|
|
82
|
+
readonly table: string;
|
|
83
|
+
readonly index: string;
|
|
84
|
+
readonly columns: readonly string[];
|
|
85
|
+
}): Promise<Op>;
|
|
86
|
+
protected dropIndex(options: {
|
|
87
|
+
readonly table: string;
|
|
88
|
+
readonly index: string;
|
|
89
|
+
}): Promise<Op>;
|
|
90
|
+
protected recreateTable(options: {
|
|
91
|
+
readonly tableName: string;
|
|
92
|
+
readonly contractTable: SqliteTableSpec;
|
|
93
|
+
readonly schemaColumnNames: readonly string[];
|
|
94
|
+
readonly indexes: readonly SqliteIndexSpec[];
|
|
95
|
+
readonly summary: string;
|
|
96
|
+
readonly postchecks: readonly {
|
|
97
|
+
readonly description: string;
|
|
98
|
+
readonly sql: string;
|
|
99
|
+
}[];
|
|
100
|
+
readonly operationClass: MigrationOperationClass;
|
|
101
|
+
}): Promise<Op>;
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { SqliteMigration as t };
|
|
105
|
+
//# sourceMappingURL=sqlite-migration-o23JHwzY-CwNJcqwl.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-migration-o23JHwzY-CwNJcqwl.d.mts","names":[],"sources":["../../../../3-targets/3-targets/sqlite/dist/sqlite-migration-o23JHwzY.d.mts"],"mappings":";;;;;;;;;;;;KAWK,KAAK,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;uBAuBb,gBAAgB,cAAc,SAAS,cAAc,SAAS,aAAa,YAAY,SAAS,cAAc,SAAS,qBAAqB,UAAU,mCAAmC,OAAO;;WAE5M;;;;;;;qBAOU,gBAAgB;EACnC,YAAY,QAAQ;;;;;;UAMZ;;;;;;MAMJ,eAAe,mBAAmB;;;;;MAKlC,iBAAiB,mBAAmB;YAC9B,YAAY;aACX;aACA;aACA,kBAAkB;aAClB,uBAAuB;MAC9B,QAAQ;YACF,UAAU;aACT;MACP,QAAQ;YACF,UAAU;aACT;aACA,QAAQ;MACf,QAAQ;YACF,WAAW;aACV;aACA;MACP,QAAQ;YACF,YAAY;aACX;aACA;aACA;MACP,QAAQ;YACF,UAAU;aACT;aACA;MACP,QAAQ;YACF,cAAc;aACb;aACA,eAAe;aACf;aACA,kBAAkB;aAClB;aACA;eACE;eACA;;aAEF,gBAAgB;MACvB,QAAQ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { a as SqliteCodecOptions, c as isSqliteCodecDescriptor, i as SqliteCodecDescriptorRegistry, l as sqliteCodec, n as AnySqliteCodecDescriptor, o as buildSqliteCodecDescriptorRegistry, r as SqliteCodecDescriptor, s as defineSqliteCodecs, t as AdaptedSqliteCodecDescriptor } from "./codec-descriptor-BcgD9f3L-BjEkn9Ob.mjs";
|
|
2
|
+
import "./codec-descriptor-CyCQXvSl.mjs";
|
|
3
|
+
import { i as SqliteDdlVisitor, n as SqliteCreateTable, r as SqliteDdlNode, t as AnySqliteDdlNode } from "./nodes-D8EC1yCx-rpfpuJ4T.mjs";
|
|
4
|
+
import "./ddl-CfSqNT0M.mjs";
|
|
5
|
+
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-DocGjhs--CHhP1jNZ.mjs";
|
|
6
|
+
import { _ as sqliteRealColumn, a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, d as sqliteBlobColumn, f as sqliteCodecDescriptorRegistry, g as sqliteJsonColumn, h as sqliteIntegerColumn, i as SqliteDatetimeDescriptor, l as jsonDocumentRetag, m as sqliteDatetimeColumn, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, p as sqliteCodecRegistry, r as SqliteBlobDescriptor, s as SqliteRealDescriptor, t as JsonValue$1, u as sqliteBigintColumn, v as sqliteTextColumn } from "./codecs-1-oOsTPG-Bv518Lbm.mjs";
|
|
7
|
+
import { t as CodecTypes } from "./codec-types-DKB--ltR-CIuvX0zx.mjs";
|
|
8
|
+
import "./codec-types-wPDlPoD7.mjs";
|
|
9
|
+
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-0SJZOd7Q.mjs";
|
|
10
|
+
import { t as parseSqliteDefault } from "./default-normalizer-B9V7TY5u.mjs";
|
|
11
|
+
import { t as normalizeSqliteNativeType } from "./native-type-normalizer-CO2wKGL6.mjs";
|
|
12
|
+
import "./codec-ids-ChRBs2aB.mjs";
|
|
13
|
+
import "./codecs-j-8RDkOt.mjs";
|
|
14
|
+
import { a as buildSignMarkerBootstrapQueries, c as datetime, d as jsonText, f as sqliteTable, i as buildControlTableBootstrapQueries, l as indexExistsAst, m as text, n as IndexExistsCheckBuilder, o as columnExistsAst, p as tableExistsAst, r as TableExistsCheckBuilder, s as createTable, t as ColumnExistsCheckBuilder, u as integer } from "./contract-free-CCLAXZV2.mjs";
|
|
15
|
+
import { n as buildTargetDetails, t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz-CMahymzq.mjs";
|
|
16
|
+
import { r as sqliteCreateNamespace, t as SqliteUnboundDatabase } from "./control--wMueaTg.mjs";
|
|
17
|
+
import { n as LEDGER_TABLE_NAME, r as MARKER_TABLE_NAME, t as CONTROL_TABLE_NAMES } from "./control-tables-Dua-YcJL.mjs";
|
|
18
|
+
import { t as SqliteContractView } from "./sqlite-contract-view-BpNMaU2m-COMDaGaq.mjs";
|
|
19
|
+
import { t as SqliteMigration } from "./sqlite-migration-o23JHwzY-CwNJcqwl.mjs";
|
|
20
|
+
import { a as fn, c as placeholder, d as unique, i as dataTransform, l as primaryKey, n as MigrationCLI, o as foreignKey, r as col, s as lit, t as DataTransformOptions, u as rawSql } from "./migration-uylRe5MP.mjs";
|
|
21
|
+
import { a as DropColumnCall, c as RawSqlCall, i as DataTransformCall, l as RecreateTableCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall, u as SqliteOpFactoryCall } from "./op-factory-call-DoHN7Q7L.mjs";
|
|
22
|
+
import "./pack-BfwyQ0b3.mjs";
|
|
23
|
+
import { n as TypeScriptRenderableSqliteMigration, t as SqliteMigrationDestinationInfo } from "./planner-produced-sqlite-migration-BuJysRxx-CaDUbNVx.mjs";
|
|
24
|
+
import { n as SqlitePlanResult, r as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-Bxdi7jZF.mjs";
|
|
25
|
+
import "./planner-produced-sqlite-migration-uySoqJO-.mjs";
|
|
26
|
+
import { t as renderOps } from "./render-ops-B10yqmdG.mjs";
|
|
27
|
+
import { n as SqliteRuntimeTargetInstance, t as SqliteContractSerializer } from "./runtime-B99c4n56.mjs";
|
|
28
|
+
export { type AdaptedSqliteCodecDescriptor, AddColumnCall, type AnySqliteCodecDescriptor, type AnySqliteDdlNode, CONTROL_TABLE_NAMES, CodecTypes, type ColumnExistsCheckBuilder, CreateIndexCall, CreateTableCall, DataTransformCall, type DataTransformOptions, DropColumnCall, DropIndexCall, DropTableCall, type IndexExistsCheckBuilder, type JsonValue$1 as JsonValue, LEDGER_TABLE_NAME, MARKER_TABLE_NAME, SqliteMigration as Migration, MigrationCLI, RawSqlCall, RecreateTableCall, 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, type SqliteBigintDescriptor, type SqliteBlobDescriptor, SqliteCodecDescriptor, type SqliteCodecDescriptorRegistry, type SqliteCodecOptions, SqliteContractSerializer, SqliteContractView, SqliteCreateTable, type SqliteDatetimeDescriptor, SqliteDdlNode, type SqliteDdlVisitor, type SqliteIntegerDescriptor, type SqliteJsonDescriptor, type SqliteMigrationDestinationInfo, SqliteMigrationPlanner, type SqliteOpFactoryCall, type SqlitePlanResult, type SqlitePlanTargetDetails, type SqliteRealDescriptor, type SqliteRuntimeTargetInstance, type SqliteTextDescriptor, SqliteUnboundDatabase, type TableExistsCheckBuilder, TypeScriptRenderableSqliteMigration, buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, buildSqliteCodecDescriptorRegistry, buildTargetDetails, col, columnExistsAst, createSqliteMigrationPlanner, createTable, dataTransform, datetime, defineSqliteCodecs, escapeLiteral, fn, foreignKey, indexExistsAst, integer, isSqliteCodecDescriptor, jsonDocumentRetag, jsonText, lit, normalizeSqliteNativeType, parseSqliteDefault, placeholder, primaryKey, quoteIdentifier, rawSql, renderOps, sqliteBigintColumn, sqliteBlobColumn, sqliteCodec, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteCreateNamespace, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTable, sqliteTextColumn, tableExistsAst, text, unique };
|
package/dist/target.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { a as sqliteCodec, i as isSqliteCodecDescriptor, n as buildSqliteCodecDescriptorRegistry, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-kVCSW1OR-CPatZUPM.mjs";
|
|
2
|
+
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-xicqpuAa-DHnKqnIs.mjs";
|
|
3
|
+
import { a as sqliteCodecRegistry, c as sqliteJsonColumn, i as sqliteCodecDescriptorRegistry, l as sqliteRealColumn, n as sqliteBigintColumn, o as sqliteDatetimeColumn, r as sqliteBlobColumn, s as sqliteIntegerColumn, t as jsonDocumentRetag, u as sqliteTextColumn } from "./codecs-CM_2W3uA.mjs";
|
|
4
|
+
import { n as SqliteDdlNode, t as SqliteCreateTable } from "./nodes-DUZSdX86-BBEEaxXY.mjs";
|
|
5
|
+
import { i as tableExistsAst, n as createTable, r as indexExistsAst, t as columnExistsAst } from "./ddl-CW34JvfE-rd1ZIxOn.mjs";
|
|
6
|
+
import { a as jsonText, i as integer, n as buildSignMarkerBootstrapQueries, o as sqliteTable, r as datetime, s as text, t as buildControlTableBootstrapQueries } from "./contract-free-DElSXD0q.mjs";
|
|
7
|
+
import { n as quoteIdentifier, t as escapeLiteral } from "./sql-utils-DqPXZBMA-Mm27NNjs.mjs";
|
|
8
|
+
import { t as buildTargetDetails } from "./planner-target-details-CIQ789Gc-C5U4yVY9.mjs";
|
|
9
|
+
import { t as parseSqliteDefault } from "./default-normalizer-DuoHj9-O-DsK7lJZn.mjs";
|
|
10
|
+
import { a as DropColumnCall, c as RawSqlCall, i as DataTransformCall, l as RecreateTableCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall } from "./op-factory-call-C_or6163-B_LDzC37.mjs";
|
|
11
|
+
import { n as LEDGER_TABLE_NAME, r as MARKER_TABLE_NAME, t as CONTROL_TABLE_NAMES } from "./control-tables-D_o8dKRB-BXi43noL.mjs";
|
|
12
|
+
import { t as renderOps } from "./render-ops-DIOn_wOx-D33LOy3b.mjs";
|
|
13
|
+
import { i as sqliteCreateNamespace, n as SqliteContractView, r as SqliteUnboundDatabase, t as SqliteContractSerializer } from "./sqlite-contract-view-CnDITHEE-BvjSbmzL.mjs";
|
|
14
|
+
import { t as SqliteMigration } from "./sqlite-migration-CV6LIqhx-D5eMTAbH.mjs";
|
|
15
|
+
import { t as TypeScriptRenderableSqliteMigration } from "./planner-produced-sqlite-migration-C8nxPT0P-DdBqfmAD.mjs";
|
|
16
|
+
import { n as createSqliteMigrationPlanner, t as SqliteMigrationPlanner } from "./planner-DiGcIjl1-QnNAhVmX.mjs";
|
|
17
|
+
import { a as foreignKey, c as primaryKey, i as fn, l as rawSql, n as col, o as lit, r as dataTransform, s as placeholder, t as MigrationCLI, u as unique } from "./migration-jsmNRI_8.mjs";
|
|
18
|
+
import { t as normalizeSqliteNativeType } from "./native-type-normalizer-GpQMEyN5.mjs";
|
|
19
|
+
export { AddColumnCall, CONTROL_TABLE_NAMES, CreateIndexCall, CreateTableCall, DataTransformCall, DropColumnCall, DropIndexCall, DropTableCall, LEDGER_TABLE_NAME, MARKER_TABLE_NAME, SqliteMigration as Migration, MigrationCLI, RawSqlCall, RecreateTableCall, 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, SqliteCodecDescriptor, SqliteContractSerializer, SqliteContractView, SqliteCreateTable, SqliteDdlNode, SqliteMigrationPlanner, SqliteUnboundDatabase, TypeScriptRenderableSqliteMigration, buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, buildSqliteCodecDescriptorRegistry, buildTargetDetails, col, columnExistsAst, createSqliteMigrationPlanner, createTable, dataTransform, datetime, defineSqliteCodecs, escapeLiteral, fn, foreignKey, indexExistsAst, integer, isSqliteCodecDescriptor, jsonDocumentRetag, jsonText, lit, normalizeSqliteNativeType, parseSqliteDefault, placeholder, primaryKey, quoteIdentifier, rawSql, renderOps, sqliteBigintColumn, sqliteBlobColumn, sqliteCodec, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteCreateNamespace, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTable, sqliteTextColumn, tableExistsAst, text, unique };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as SqliteCodecOptions, c as isSqliteCodecDescriptor, i as SqliteCodecDescriptorRegistry, l as sqliteCodec, n as AnySqliteCodecDescriptor, o as buildSqliteCodecDescriptorRegistry, r as SqliteCodecDescriptor, s as defineSqliteCodecs, t as AdaptedSqliteCodecDescriptor } from "./codec-descriptor-BcgD9f3L-BjEkn9Ob.mjs";
|
|
2
|
+
import "./codec-descriptor-CyCQXvSl.mjs";
|
|
3
|
+
export { type AdaptedSqliteCodecDescriptor, type AnySqliteCodecDescriptor, SqliteCodecDescriptor, type SqliteCodecDescriptorRegistry, type SqliteCodecOptions, buildSqliteCodecDescriptorRegistry, defineSqliteCodecs, isSqliteCodecDescriptor, sqliteCodec };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as sqliteCodec, i as isSqliteCodecDescriptor, n as buildSqliteCodecDescriptorRegistry, r as defineSqliteCodecs, t as SqliteCodecDescriptor } from "./codec-descriptor-kVCSW1OR-CPatZUPM.mjs";
|
|
2
|
+
export { SqliteCodecDescriptor, buildSqliteCodecDescriptorRegistry, defineSqliteCodecs, isSqliteCodecDescriptor, sqliteCodec };
|
|
@@ -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-DocGjhs--CHhP1jNZ.mjs";
|
|
2
|
+
import "./codec-ids-ChRBs2aB.mjs";
|
|
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,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-xicqpuAa-DHnKqnIs.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 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { _ as sqliteRealColumn, a as SqliteIntegerDescriptor, c as SqliteTextDescriptor, d as sqliteBlobColumn, f as sqliteCodecDescriptorRegistry, g as sqliteJsonColumn, h as sqliteIntegerColumn, i as SqliteDatetimeDescriptor, l as jsonDocumentRetag, m as sqliteDatetimeColumn, n as SqliteBigintDescriptor, o as SqliteJsonDescriptor, p as sqliteCodecRegistry, r as SqliteBlobDescriptor, s as SqliteRealDescriptor, t as JsonValue$1, u as sqliteBigintColumn, v as sqliteTextColumn } from "./codecs-1-oOsTPG-Bv518Lbm.mjs";
|
|
2
|
+
import "./codecs-j-8RDkOt.mjs";
|
|
3
|
+
export { type JsonValue$1 as JsonValue, type SqliteBigintDescriptor, type SqliteBlobDescriptor, type SqliteDatetimeDescriptor, type SqliteIntegerDescriptor, type SqliteJsonDescriptor, type SqliteRealDescriptor, type SqliteTextDescriptor, jsonDocumentRetag, sqliteBigintColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as sqliteCodecRegistry, c as sqliteJsonColumn, i as sqliteCodecDescriptorRegistry, l as sqliteRealColumn, n as sqliteBigintColumn, o as sqliteDatetimeColumn, r as sqliteBlobColumn, s as sqliteIntegerColumn, t as jsonDocumentRetag, u as sqliteTextColumn } from "./codecs-CM_2W3uA.mjs";
|
|
2
|
+
export { jsonDocumentRetag, sqliteBigintColumn, sqliteBlobColumn, sqliteCodecDescriptorRegistry, sqliteCodecRegistry, sqliteDatetimeColumn, sqliteIntegerColumn, sqliteJsonColumn, sqliteRealColumn, sqliteTextColumn };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as buildSignMarkerBootstrapQueries, c as datetime, d as jsonText, f as sqliteTable, i as buildControlTableBootstrapQueries, l as indexExistsAst, m as text, n as IndexExistsCheckBuilder, o as columnExistsAst, p as tableExistsAst, r as TableExistsCheckBuilder, s as createTable, t as ColumnExistsCheckBuilder, u as integer } from "./contract-free-CCLAXZV2.mjs";
|
|
2
|
+
export { type ColumnExistsCheckBuilder, type IndexExistsCheckBuilder, type TableExistsCheckBuilder, buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, columnExistsAst, createTable, datetime, indexExistsAst, integer, jsonText, sqliteTable, tableExistsAst, text };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { i as tableExistsAst, n as createTable, r as indexExistsAst, t as columnExistsAst } from "./ddl-CW34JvfE-rd1ZIxOn.mjs";
|
|
2
|
+
import { a as jsonText, i as integer, n as buildSignMarkerBootstrapQueries, o as sqliteTable, r as datetime, s as text, t as buildControlTableBootstrapQueries } from "./contract-free-DElSXD0q.mjs";
|
|
3
|
+
export { buildControlTableBootstrapQueries, buildSignMarkerBootstrapQueries, columnExistsAst, createTable, datetime, indexExistsAst, integer, jsonText, sqliteTable, tableExistsAst, text };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { t as SqlitePlanTargetDetails } from "./planner-target-details-xR6UfIcz-CMahymzq.mjs";
|
|
2
|
+
import { n as sqliteControlTargetDescriptor, r as sqliteCreateNamespace, t as SqliteUnboundDatabase } from "./control--wMueaTg.mjs";
|
|
3
|
+
export { type SqlitePlanTargetDetails, SqliteUnboundDatabase, sqliteControlTargetDescriptor as default, sqliteCreateNamespace };
|