@prisma-next/target-sqlite 0.5.0-dev.6 → 0.5.0-dev.61

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.
Files changed (134) hide show
  1. package/dist/codec-ids-B1-OiN8Q.mjs +14 -0
  2. package/dist/codec-ids-B1-OiN8Q.mjs.map +1 -0
  3. package/dist/codec-ids-DyLO2Rfx.d.mts +13 -0
  4. package/dist/codec-ids-DyLO2Rfx.d.mts.map +1 -0
  5. package/dist/codec-ids.d.mts +2 -0
  6. package/dist/codec-ids.mjs +3 -0
  7. package/dist/codec-types-Bbzv7qCW.d.mts +24 -0
  8. package/dist/codec-types-Bbzv7qCW.d.mts.map +1 -0
  9. package/dist/codec-types.d.mts +4 -0
  10. package/dist/codec-types.mjs +3 -0
  11. package/dist/codecs-BqDitp2X.d.mts +127 -0
  12. package/dist/codecs-BqDitp2X.d.mts.map +1 -0
  13. package/dist/codecs-CDcidsHL.mjs +221 -0
  14. package/dist/codecs-CDcidsHL.mjs.map +1 -0
  15. package/dist/codecs.d.mts +3 -0
  16. package/dist/codecs.mjs +14 -0
  17. package/dist/codecs.mjs.map +1 -0
  18. package/dist/control.d.mts +4 -3
  19. package/dist/control.d.mts.map +1 -1
  20. package/dist/control.mjs +343 -1
  21. package/dist/control.mjs.map +1 -1
  22. package/dist/default-normalizer-R-sQXAYt.mjs +69 -0
  23. package/dist/default-normalizer-R-sQXAYt.mjs.map +1 -0
  24. package/dist/default-normalizer.d.mts +8 -0
  25. package/dist/default-normalizer.d.mts.map +1 -0
  26. package/dist/default-normalizer.mjs +3 -0
  27. package/dist/descriptor-meta-BA2YAFQq.mjs +24 -0
  28. package/dist/descriptor-meta-BA2YAFQq.mjs.map +1 -0
  29. package/dist/migration.d.mts +76 -0
  30. package/dist/migration.d.mts.map +1 -0
  31. package/dist/migration.mjs +38 -0
  32. package/dist/migration.mjs.map +1 -0
  33. package/dist/native-type-normalizer-BMovohPm.mjs +14 -0
  34. package/dist/native-type-normalizer-BMovohPm.mjs.map +1 -0
  35. package/dist/native-type-normalizer.d.mts +11 -0
  36. package/dist/native-type-normalizer.d.mts.map +1 -0
  37. package/dist/native-type-normalizer.mjs +3 -0
  38. package/dist/op-factory-call-BUVV-W9F.mjs +252 -0
  39. package/dist/op-factory-call-BUVV-W9F.mjs.map +1 -0
  40. package/dist/op-factory-call-dUIOao68.d.mts +134 -0
  41. package/dist/op-factory-call-dUIOao68.d.mts.map +1 -0
  42. package/dist/op-factory-call.d.mts +3 -0
  43. package/dist/op-factory-call.mjs +3 -0
  44. package/dist/pack.d.mts +37 -1
  45. package/dist/pack.d.mts.map +1 -1
  46. package/dist/pack.mjs +1 -1
  47. package/dist/planner-CuchCrpN.mjs +522 -0
  48. package/dist/planner-CuchCrpN.mjs.map +1 -0
  49. package/dist/planner-produced-sqlite-migration-BfIIUtxe.d.mts +24 -0
  50. package/dist/planner-produced-sqlite-migration-BfIIUtxe.d.mts.map +1 -0
  51. package/dist/planner-produced-sqlite-migration-C3AAaQoW.mjs +107 -0
  52. package/dist/planner-produced-sqlite-migration-C3AAaQoW.mjs.map +1 -0
  53. package/dist/planner-produced-sqlite-migration.d.mts +5 -0
  54. package/dist/planner-produced-sqlite-migration.mjs +3 -0
  55. package/dist/planner-target-details-BQIWQlBu.mjs +16 -0
  56. package/dist/planner-target-details-BQIWQlBu.mjs.map +1 -0
  57. package/dist/planner-target-details-CtWRvse0.d.mts +12 -0
  58. package/dist/planner-target-details-CtWRvse0.d.mts.map +1 -0
  59. package/dist/planner-target-details.d.mts +2 -0
  60. package/dist/planner-target-details.mjs +3 -0
  61. package/dist/planner.d.mts +56 -0
  62. package/dist/planner.d.mts.map +1 -0
  63. package/dist/planner.mjs +3 -0
  64. package/dist/render-ops-CXOv7SRC.mjs +8 -0
  65. package/dist/render-ops-CXOv7SRC.mjs.map +1 -0
  66. package/dist/render-ops.d.mts +11 -0
  67. package/dist/render-ops.d.mts.map +1 -0
  68. package/dist/render-ops.mjs +3 -0
  69. package/dist/runtime.d.mts.map +1 -1
  70. package/dist/runtime.mjs +2 -4
  71. package/dist/runtime.mjs.map +1 -1
  72. package/dist/shared-D_1fFqLf.d.mts +69 -0
  73. package/dist/shared-D_1fFqLf.d.mts.map +1 -0
  74. package/dist/sql-utils-D3SMPFDD.mjs +33 -0
  75. package/dist/sql-utils-D3SMPFDD.mjs.map +1 -0
  76. package/dist/sql-utils.d.mts +22 -0
  77. package/dist/sql-utils.d.mts.map +1 -0
  78. package/dist/sql-utils.mjs +3 -0
  79. package/dist/sqlite-migration-BeR1cikr.d.mts +18 -0
  80. package/dist/sqlite-migration-BeR1cikr.d.mts.map +1 -0
  81. package/dist/sqlite-migration-CnLhIrJF.mjs +17 -0
  82. package/dist/sqlite-migration-CnLhIrJF.mjs.map +1 -0
  83. package/dist/statement-builders-B3OGOp7n.mjs +148 -0
  84. package/dist/statement-builders-B3OGOp7n.mjs.map +1 -0
  85. package/dist/statement-builders.d.mts +48 -0
  86. package/dist/statement-builders.d.mts.map +1 -0
  87. package/dist/statement-builders.mjs +3 -0
  88. package/dist/tables-sKIg_lWE.mjs +408 -0
  89. package/dist/tables-sKIg_lWE.mjs.map +1 -0
  90. package/package.json +29 -7
  91. package/src/core/authoring.ts +9 -0
  92. package/src/core/codec-helpers.ts +11 -0
  93. package/src/core/codec-ids.ts +13 -0
  94. package/src/core/codecs.ts +337 -0
  95. package/src/core/control-target.ts +54 -11
  96. package/src/core/default-normalizer.ts +92 -0
  97. package/src/core/descriptor-meta.ts +5 -1
  98. package/src/core/migrations/issue-planner.ts +586 -0
  99. package/src/core/migrations/op-factory-call.ts +332 -0
  100. package/src/core/migrations/operations/columns.ts +62 -0
  101. package/src/core/migrations/operations/data-transform.ts +51 -0
  102. package/src/core/migrations/operations/indexes.ts +52 -0
  103. package/src/core/migrations/operations/shared.ts +120 -0
  104. package/src/core/migrations/operations/tables.ts +388 -0
  105. package/src/core/migrations/planner-ddl-builders.ts +142 -0
  106. package/src/core/migrations/planner-produced-sqlite-migration.ts +56 -0
  107. package/src/core/migrations/planner-strategies.ts +231 -0
  108. package/src/core/migrations/planner-target-details.ts +33 -0
  109. package/src/core/migrations/planner.ts +149 -0
  110. package/src/core/migrations/render-ops.ts +9 -0
  111. package/src/core/migrations/render-typescript.ts +91 -0
  112. package/src/core/migrations/runner.ts +593 -0
  113. package/src/core/migrations/sqlite-migration.ts +13 -0
  114. package/src/core/migrations/statement-builders.ts +190 -0
  115. package/src/core/native-type-normalizer.ts +9 -0
  116. package/src/core/registry.ts +11 -0
  117. package/src/core/runtime-target.ts +1 -3
  118. package/src/core/sql-utils.ts +47 -0
  119. package/src/exports/codec-ids.ts +13 -0
  120. package/src/exports/codec-types.ts +43 -0
  121. package/src/exports/codecs.ts +20 -0
  122. package/src/exports/control.ts +1 -0
  123. package/src/exports/default-normalizer.ts +1 -0
  124. package/src/exports/migration.ts +23 -0
  125. package/src/exports/native-type-normalizer.ts +1 -0
  126. package/src/exports/op-factory-call.ts +11 -0
  127. package/src/exports/planner-produced-sqlite-migration.ts +4 -0
  128. package/src/exports/planner-target-details.ts +2 -0
  129. package/src/exports/planner.ts +2 -0
  130. package/src/exports/render-ops.ts +1 -0
  131. package/src/exports/sql-utils.ts +1 -0
  132. package/src/exports/statement-builders.ts +11 -0
  133. package/dist/descriptor-meta-DbuuziYA.mjs +0 -14
  134. package/dist/descriptor-meta-DbuuziYA.mjs.map +0 -1
@@ -0,0 +1,38 @@
1
+ import { t as buildTargetDetails } from "./planner-target-details-BQIWQlBu.mjs";
2
+ import { a as recreateTable, f as addColumn, i as dropTable, m as step, o as createIndex, p as dropColumn, r as createTable, s as dropIndex } from "./tables-sKIg_lWE.mjs";
3
+ import { t as SqliteMigration } from "./sqlite-migration-CnLhIrJF.mjs";
4
+ import { placeholder } from "@prisma-next/errors/migration";
5
+ import { MigrationCLI } from "@prisma-next/cli/migration-cli";
6
+
7
+ //#region src/core/migrations/operations/data-transform.ts
8
+ /**
9
+ * User-facing `dataTransform` factory for the SQLite migration authoring
10
+ * surface. Invoked directly inside a `migration.ts` file to supply a
11
+ * user-authored SQL statement that runs with operation class `'data'`.
12
+ *
13
+ * Typical use: the planner emits a `DataTransformCall` stub when a NOT NULL
14
+ * tightening requires a backfill. The rendered `migration.ts` exposes the
15
+ * backfill as a `placeholder("…")` slot the user fills in with an
16
+ * `UPDATE … WHERE col IS NULL` statement. The filled-in `dataTransform(...)`
17
+ * invocation returns a runnable operation the runner executes before the
18
+ * subsequent recreate-table op copies data into the tightened schema.
19
+ */
20
+ function dataTransform(opts) {
21
+ return {
22
+ id: opts.id,
23
+ label: opts.label,
24
+ summary: opts.description,
25
+ operationClass: "data",
26
+ target: {
27
+ id: "sqlite",
28
+ details: buildTargetDetails("table", opts.table)
29
+ },
30
+ precheck: [],
31
+ execute: [step(opts.description, opts.run())],
32
+ postcheck: []
33
+ };
34
+ }
35
+
36
+ //#endregion
37
+ export { SqliteMigration as Migration, MigrationCLI, addColumn, createIndex, createTable, dataTransform, dropColumn, dropIndex, dropTable, placeholder, recreateTable };
38
+ //# sourceMappingURL=migration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.mjs","names":[],"sources":["../src/core/migrations/operations/data-transform.ts"],"sourcesContent":["/**\n * User-facing `dataTransform` factory for the SQLite migration authoring\n * surface. Invoked directly inside a `migration.ts` file to supply a\n * user-authored SQL statement that runs with operation class `'data'`.\n *\n * Typical use: the planner emits a `DataTransformCall` stub when a NOT NULL\n * tightening requires a backfill. The rendered `migration.ts` exposes the\n * backfill as a `placeholder(\"…\")` slot the user fills in with an\n * `UPDATE … WHERE col IS NULL` statement. The filled-in `dataTransform(...)`\n * invocation returns a runnable operation the runner executes before the\n * subsequent recreate-table op copies data into the tightened schema.\n */\n\nimport { buildTargetDetails } from '../planner-target-details';\nimport { type Op, step } from './shared';\n\nexport interface DataTransformOptions {\n /** Stable id used in the ledger / for runner idempotency tracking. */\n readonly id: string;\n /** Human-readable label surfaced in CLI output. */\n readonly label: string;\n /** Table the backfill targets; informs `target.details`. */\n readonly table: string;\n /**\n * Short description of the step (shown by the runner on execute). The\n * planner leaves this as `placeholder(...)` for users to replace.\n */\n readonly description: string;\n /**\n * Producer of the SQL string to execute. Invoked eagerly by\n * `dataTransform(...)`, mirroring the Postgres factory — by the time the\n * user calls this factory in `migration.ts`, the SQL is expected to be\n * ready. Planner-emitted stubs that need to defer until the user fills\n * in the SQL go through `DataTransformCall.renderTypeScript()` instead;\n * this factory is only for the post-fill, runnable form.\n */\n readonly run: () => string;\n}\n\nexport function dataTransform(opts: DataTransformOptions): Op {\n return {\n id: opts.id,\n label: opts.label,\n summary: opts.description,\n operationClass: 'data',\n target: { id: 'sqlite', details: buildTargetDetails('table', opts.table) },\n precheck: [],\n execute: [step(opts.description, opts.run())],\n postcheck: [],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,cAAc,MAAgC;AAC5D,QAAO;EACL,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,SAAS,KAAK;EACd,gBAAgB;EAChB,QAAQ;GAAE,IAAI;GAAU,SAAS,mBAAmB,SAAS,KAAK,MAAM;GAAE;EAC1E,UAAU,EAAE;EACZ,SAAS,CAAC,KAAK,KAAK,aAAa,KAAK,KAAK,CAAC,CAAC;EAC7C,WAAW,EAAE;EACd"}
@@ -0,0 +1,14 @@
1
+ //#region src/core/native-type-normalizer.ts
2
+ /**
3
+ * Canonicalizes SQLite native-type tokens for verifier comparison.
4
+ * Lives target-side so the planner / runner / adapter all share the same
5
+ * normalization without crossing the `target-sqlite` ↔ `adapter-sqlite`
6
+ * boundary.
7
+ */
8
+ function normalizeSqliteNativeType(nativeType) {
9
+ return nativeType.trim().toLowerCase();
10
+ }
11
+
12
+ //#endregion
13
+ export { normalizeSqliteNativeType as t };
14
+ //# sourceMappingURL=native-type-normalizer-BMovohPm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-type-normalizer-BMovohPm.mjs","names":[],"sources":["../src/core/native-type-normalizer.ts"],"sourcesContent":["/**\n * Canonicalizes SQLite native-type tokens for verifier comparison.\n * Lives target-side so the planner / runner / adapter all share the same\n * normalization without crossing the `target-sqlite` ↔ `adapter-sqlite`\n * boundary.\n */\nexport function normalizeSqliteNativeType(nativeType: string): string {\n return nativeType.trim().toLowerCase();\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,0BAA0B,YAA4B;AACpE,QAAO,WAAW,MAAM,CAAC,aAAa"}
@@ -0,0 +1,11 @@
1
+ //#region src/core/native-type-normalizer.d.ts
2
+ /**
3
+ * Canonicalizes SQLite native-type tokens for verifier comparison.
4
+ * Lives target-side so the planner / runner / adapter all share the same
5
+ * normalization without crossing the `target-sqlite` ↔ `adapter-sqlite`
6
+ * boundary.
7
+ */
8
+ declare function normalizeSqliteNativeType(nativeType: string): string;
9
+ //#endregion
10
+ export { normalizeSqliteNativeType };
11
+ //# sourceMappingURL=native-type-normalizer.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-type-normalizer.d.mts","names":[],"sources":["../src/core/native-type-normalizer.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;iBAAgB,yBAAA"}
@@ -0,0 +1,3 @@
1
+ import { t as normalizeSqliteNativeType } from "./native-type-normalizer-BMovohPm.mjs";
2
+
3
+ export { normalizeSqliteNativeType };
@@ -0,0 +1,252 @@
1
+ import { a as recreateTable, f as addColumn, i as dropTable, o as createIndex, p as dropColumn, r as createTable, s as dropIndex } from "./tables-sKIg_lWE.mjs";
2
+ import { errorUnfilledPlaceholder } from "@prisma-next/errors/migration";
3
+ import { TsExpression, jsonToTsSource } from "@prisma-next/ts-render";
4
+
5
+ //#region src/core/migrations/op-factory-call.ts
6
+ /**
7
+ * SQLite migration IR: one concrete `*Call` class per pure factory under
8
+ * `operations/`, plus a shared `SqliteOpFactoryCallNode` abstract base.
9
+ *
10
+ * Each call class carries fully-resolved literal arguments (flat
11
+ * `SqliteColumnSpec` / `SqliteTableSpec` etc.) — codec / `typeRef` / default
12
+ * expansion happens upstream in the issue-planner / strategies, mirroring
13
+ * the Postgres `ColumnSpec` pattern. As a result, `toOp()` and
14
+ * `renderTypeScript()` both pass the same flat data through; the rendered
15
+ * TypeScript scaffold is fully self-contained and does not need access to a
16
+ * `storageTypes` map at runtime.
17
+ */
18
+ const TARGET_MIGRATION_MODULE = "@prisma-next/target-sqlite/migration";
19
+ var SqliteOpFactoryCallNode = class extends TsExpression {
20
+ importRequirements() {
21
+ return [{
22
+ moduleSpecifier: TARGET_MIGRATION_MODULE,
23
+ symbol: this.factoryName
24
+ }];
25
+ }
26
+ freeze() {
27
+ Object.freeze(this);
28
+ }
29
+ };
30
+ var CreateTableCall = class extends SqliteOpFactoryCallNode {
31
+ factoryName = "createTable";
32
+ operationClass = "additive";
33
+ tableName;
34
+ spec;
35
+ label;
36
+ constructor(tableName, spec) {
37
+ super();
38
+ this.tableName = tableName;
39
+ this.spec = spec;
40
+ this.label = `Create table ${tableName}`;
41
+ this.freeze();
42
+ }
43
+ toOp() {
44
+ return createTable(this.tableName, this.spec);
45
+ }
46
+ renderTypeScript() {
47
+ return `createTable(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.spec)})`;
48
+ }
49
+ };
50
+ var DropTableCall = class extends SqliteOpFactoryCallNode {
51
+ factoryName = "dropTable";
52
+ operationClass = "destructive";
53
+ tableName;
54
+ label;
55
+ constructor(tableName) {
56
+ super();
57
+ this.tableName = tableName;
58
+ this.label = `Drop table ${tableName}`;
59
+ this.freeze();
60
+ }
61
+ toOp() {
62
+ return dropTable(this.tableName);
63
+ }
64
+ renderTypeScript() {
65
+ return `dropTable(${jsonToTsSource(this.tableName)})`;
66
+ }
67
+ };
68
+ var RecreateTableCall = class extends SqliteOpFactoryCallNode {
69
+ factoryName = "recreateTable";
70
+ operationClass;
71
+ tableName;
72
+ contractTable;
73
+ schemaColumnNames;
74
+ indexes;
75
+ summary;
76
+ postchecks;
77
+ label;
78
+ constructor(args) {
79
+ super();
80
+ this.tableName = args.tableName;
81
+ this.contractTable = args.contractTable;
82
+ this.schemaColumnNames = args.schemaColumnNames;
83
+ this.indexes = args.indexes;
84
+ this.summary = args.summary;
85
+ this.postchecks = args.postchecks;
86
+ this.operationClass = args.operationClass;
87
+ this.label = `Recreate table ${args.tableName}`;
88
+ this.freeze();
89
+ }
90
+ toOp() {
91
+ return recreateTable({
92
+ tableName: this.tableName,
93
+ contractTable: this.contractTable,
94
+ schemaColumnNames: this.schemaColumnNames,
95
+ indexes: this.indexes,
96
+ summary: this.summary,
97
+ postchecks: this.postchecks,
98
+ operationClass: this.operationClass
99
+ });
100
+ }
101
+ renderTypeScript() {
102
+ return `recreateTable(${jsonToTsSource({
103
+ tableName: this.tableName,
104
+ contractTable: this.contractTable,
105
+ schemaColumnNames: this.schemaColumnNames,
106
+ indexes: this.indexes,
107
+ summary: this.summary,
108
+ postchecks: this.postchecks,
109
+ operationClass: this.operationClass
110
+ })})`;
111
+ }
112
+ };
113
+ var AddColumnCall = class extends SqliteOpFactoryCallNode {
114
+ factoryName = "addColumn";
115
+ operationClass = "additive";
116
+ tableName;
117
+ columnName;
118
+ column;
119
+ label;
120
+ constructor(tableName, column) {
121
+ super();
122
+ this.tableName = tableName;
123
+ this.columnName = column.name;
124
+ this.column = column;
125
+ this.label = `Add column ${column.name} on ${tableName}`;
126
+ this.freeze();
127
+ }
128
+ toOp() {
129
+ return addColumn(this.tableName, this.column);
130
+ }
131
+ renderTypeScript() {
132
+ return `addColumn(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.column)})`;
133
+ }
134
+ };
135
+ var DropColumnCall = class extends SqliteOpFactoryCallNode {
136
+ factoryName = "dropColumn";
137
+ operationClass = "destructive";
138
+ tableName;
139
+ columnName;
140
+ label;
141
+ constructor(tableName, columnName) {
142
+ super();
143
+ this.tableName = tableName;
144
+ this.columnName = columnName;
145
+ this.label = `Drop column ${columnName} on ${tableName}`;
146
+ this.freeze();
147
+ }
148
+ toOp() {
149
+ return dropColumn(this.tableName, this.columnName);
150
+ }
151
+ renderTypeScript() {
152
+ return `dropColumn(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;
153
+ }
154
+ };
155
+ var CreateIndexCall = class extends SqliteOpFactoryCallNode {
156
+ factoryName = "createIndex";
157
+ operationClass = "additive";
158
+ tableName;
159
+ indexName;
160
+ columns;
161
+ label;
162
+ constructor(tableName, indexName, columns) {
163
+ super();
164
+ this.tableName = tableName;
165
+ this.indexName = indexName;
166
+ this.columns = columns;
167
+ this.label = `Create index ${indexName} on ${tableName}`;
168
+ this.freeze();
169
+ }
170
+ toOp() {
171
+ return createIndex(this.tableName, this.indexName, this.columns);
172
+ }
173
+ renderTypeScript() {
174
+ return `createIndex(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.indexName)}, ${jsonToTsSource(this.columns)})`;
175
+ }
176
+ };
177
+ var DropIndexCall = class extends SqliteOpFactoryCallNode {
178
+ factoryName = "dropIndex";
179
+ operationClass = "destructive";
180
+ tableName;
181
+ indexName;
182
+ label;
183
+ constructor(tableName, indexName) {
184
+ super();
185
+ this.tableName = tableName;
186
+ this.indexName = indexName;
187
+ this.label = `Drop index ${indexName} on ${tableName}`;
188
+ this.freeze();
189
+ }
190
+ toOp() {
191
+ return dropIndex(this.tableName, this.indexName);
192
+ }
193
+ renderTypeScript() {
194
+ return `dropIndex(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.indexName)})`;
195
+ }
196
+ };
197
+ /**
198
+ * A planner-generated data-transform stub. The current default strategy
199
+ * (`nullabilityTighteningBackfillStrategy`) emits one of these with a
200
+ * backfill-flavored `id`/`label` when the policy allows `'data'` and the
201
+ * contract tightens a column's nullability, but the op itself is generic —
202
+ * any future strategy that needs a placeholder data step can construct one
203
+ * with its own id/label.
204
+ *
205
+ * `toOp()` always throws `PN-MIG-2001`: the planner cannot lower a stubbed
206
+ * transform to a runtime op — the user must edit the rendered
207
+ * `migration.ts` and re-emit.
208
+ */
209
+ var DataTransformCall = class extends SqliteOpFactoryCallNode {
210
+ factoryName = "dataTransform";
211
+ operationClass = "data";
212
+ id;
213
+ label;
214
+ tableName;
215
+ columnName;
216
+ constructor(id, label, tableName, columnName) {
217
+ super();
218
+ this.id = id;
219
+ this.label = label;
220
+ this.tableName = tableName;
221
+ this.columnName = columnName;
222
+ this.freeze();
223
+ }
224
+ toOp() {
225
+ throw errorUnfilledPlaceholder(this.label);
226
+ }
227
+ renderTypeScript() {
228
+ const slot = `${this.tableName}-${this.columnName}-backfill-sql`;
229
+ return [
230
+ "dataTransform({",
231
+ ` id: ${jsonToTsSource(this.id)},`,
232
+ ` label: ${jsonToTsSource(this.label)},`,
233
+ ` table: ${jsonToTsSource(this.tableName)},`,
234
+ ` description: ${jsonToTsSource(`Backfill NULL ${this.columnName} values in ${this.tableName}`)},`,
235
+ ` run: () => placeholder(${jsonToTsSource(slot)}),`,
236
+ "})"
237
+ ].join("\n");
238
+ }
239
+ importRequirements() {
240
+ return [{
241
+ moduleSpecifier: TARGET_MIGRATION_MODULE,
242
+ symbol: this.factoryName
243
+ }, {
244
+ moduleSpecifier: TARGET_MIGRATION_MODULE,
245
+ symbol: "placeholder"
246
+ }];
247
+ }
248
+ };
249
+
250
+ //#endregion
251
+ export { DropColumnCall as a, RecreateTableCall as c, DataTransformCall as i, CreateIndexCall as n, DropIndexCall as o, CreateTableCall as r, DropTableCall as s, AddColumnCall as t };
252
+ //# sourceMappingURL=op-factory-call-BUVV-W9F.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"op-factory-call-BUVV-W9F.mjs","names":[],"sources":["../src/core/migrations/op-factory-call.ts"],"sourcesContent":["/**\n * SQLite migration IR: one concrete `*Call` class per pure factory under\n * `operations/`, plus a shared `SqliteOpFactoryCallNode` abstract base.\n *\n * Each call class carries fully-resolved literal arguments (flat\n * `SqliteColumnSpec` / `SqliteTableSpec` etc.) — codec / `typeRef` / default\n * expansion happens upstream in the issue-planner / strategies, mirroring\n * the Postgres `ColumnSpec` pattern. As a result, `toOp()` and\n * `renderTypeScript()` both pass the same flat data through; the rendered\n * TypeScript scaffold is fully self-contained and does not need access to a\n * `storageTypes` map at runtime.\n */\n\nimport { errorUnfilledPlaceholder } from '@prisma-next/errors/migration';\nimport type {\n MigrationOperationClass,\n SqlMigrationPlanOperation,\n} from '@prisma-next/family-sql/control';\nimport type { OpFactoryCall as FrameworkOpFactoryCall } from '@prisma-next/framework-components/control';\nimport { type ImportRequirement, jsonToTsSource, TsExpression } from '@prisma-next/ts-render';\nimport { addColumn, dropColumn } from './operations/columns';\nimport { createIndex, dropIndex } from './operations/indexes';\nimport type { SqliteColumnSpec, SqliteIndexSpec, SqliteTableSpec } from './operations/shared';\nimport { createTable, dropTable, recreateTable } from './operations/tables';\nimport type { SqlitePlanTargetDetails } from './planner-target-details';\n\ntype Op = SqlMigrationPlanOperation<SqlitePlanTargetDetails>;\n\nconst TARGET_MIGRATION_MODULE = '@prisma-next/target-sqlite/migration';\n\nabstract class SqliteOpFactoryCallNode extends TsExpression implements FrameworkOpFactoryCall {\n abstract readonly factoryName: string;\n abstract readonly operationClass: MigrationOperationClass;\n abstract readonly label: string;\n abstract toOp(): Op;\n\n importRequirements(): readonly ImportRequirement[] {\n return [{ moduleSpecifier: TARGET_MIGRATION_MODULE, symbol: this.factoryName }];\n }\n\n protected freeze(): void {\n Object.freeze(this);\n }\n}\n\n// ============================================================================\n// Table\n// ============================================================================\n\nexport class CreateTableCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'createTable' as const;\n readonly operationClass = 'additive' as const;\n readonly tableName: string;\n readonly spec: SqliteTableSpec;\n readonly label: string;\n\n constructor(tableName: string, spec: SqliteTableSpec) {\n super();\n this.tableName = tableName;\n this.spec = spec;\n this.label = `Create table ${tableName}`;\n this.freeze();\n }\n\n toOp(): Op {\n return createTable(this.tableName, this.spec);\n }\n\n renderTypeScript(): string {\n return `createTable(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.spec)})`;\n }\n}\n\nexport class DropTableCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'dropTable' as const;\n readonly operationClass = 'destructive' as const;\n readonly tableName: string;\n readonly label: string;\n\n constructor(tableName: string) {\n super();\n this.tableName = tableName;\n this.label = `Drop table ${tableName}`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropTable(this.tableName);\n }\n\n renderTypeScript(): string {\n return `dropTable(${jsonToTsSource(this.tableName)})`;\n }\n}\n\nexport class RecreateTableCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'recreateTable' as const;\n readonly operationClass: MigrationOperationClass;\n readonly tableName: string;\n readonly contractTable: SqliteTableSpec;\n readonly schemaColumnNames: readonly string[];\n readonly indexes: readonly SqliteIndexSpec[];\n readonly summary: string;\n readonly postchecks: readonly { readonly description: string; readonly sql: string }[];\n readonly label: string;\n\n constructor(args: {\n tableName: string;\n contractTable: SqliteTableSpec;\n schemaColumnNames: readonly string[];\n indexes: readonly SqliteIndexSpec[];\n summary: string;\n postchecks: readonly { readonly description: string; readonly sql: string }[];\n operationClass: MigrationOperationClass;\n }) {\n super();\n this.tableName = args.tableName;\n this.contractTable = args.contractTable;\n this.schemaColumnNames = args.schemaColumnNames;\n this.indexes = args.indexes;\n this.summary = args.summary;\n this.postchecks = args.postchecks;\n this.operationClass = args.operationClass;\n this.label = `Recreate table ${args.tableName}`;\n this.freeze();\n }\n\n toOp(): Op {\n return recreateTable({\n tableName: this.tableName,\n contractTable: this.contractTable,\n schemaColumnNames: this.schemaColumnNames,\n indexes: this.indexes,\n summary: this.summary,\n postchecks: this.postchecks,\n operationClass: this.operationClass,\n });\n }\n\n renderTypeScript(): string {\n const args = {\n tableName: this.tableName,\n contractTable: this.contractTable,\n schemaColumnNames: this.schemaColumnNames,\n indexes: this.indexes,\n summary: this.summary,\n postchecks: this.postchecks,\n operationClass: this.operationClass,\n };\n return `recreateTable(${jsonToTsSource(args)})`;\n }\n}\n\n// ============================================================================\n// Column\n// ============================================================================\n\nexport class AddColumnCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'addColumn' as const;\n readonly operationClass = 'additive' as const;\n readonly tableName: string;\n readonly columnName: string;\n readonly column: SqliteColumnSpec;\n readonly label: string;\n\n constructor(tableName: string, column: SqliteColumnSpec) {\n super();\n this.tableName = tableName;\n this.columnName = column.name;\n this.column = column;\n this.label = `Add column ${column.name} on ${tableName}`;\n this.freeze();\n }\n\n toOp(): Op {\n return addColumn(this.tableName, this.column);\n }\n\n renderTypeScript(): string {\n return `addColumn(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.column)})`;\n }\n}\n\nexport class DropColumnCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'dropColumn' as const;\n readonly operationClass = 'destructive' as const;\n readonly tableName: string;\n readonly columnName: string;\n readonly label: string;\n\n constructor(tableName: string, columnName: string) {\n super();\n this.tableName = tableName;\n this.columnName = columnName;\n this.label = `Drop column ${columnName} on ${tableName}`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropColumn(this.tableName, this.columnName);\n }\n\n renderTypeScript(): string {\n return `dropColumn(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.columnName)})`;\n }\n}\n\n// ============================================================================\n// Index\n// ============================================================================\n\nexport class CreateIndexCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'createIndex' as const;\n readonly operationClass = 'additive' as const;\n readonly tableName: string;\n readonly indexName: string;\n readonly columns: readonly string[];\n readonly label: string;\n\n constructor(tableName: string, indexName: string, columns: readonly string[]) {\n super();\n this.tableName = tableName;\n this.indexName = indexName;\n this.columns = columns;\n this.label = `Create index ${indexName} on ${tableName}`;\n this.freeze();\n }\n\n toOp(): Op {\n return createIndex(this.tableName, this.indexName, this.columns);\n }\n\n renderTypeScript(): string {\n return `createIndex(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.indexName)}, ${jsonToTsSource(this.columns)})`;\n }\n}\n\nexport class DropIndexCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'dropIndex' as const;\n readonly operationClass = 'destructive' as const;\n readonly tableName: string;\n readonly indexName: string;\n readonly label: string;\n\n constructor(tableName: string, indexName: string) {\n super();\n this.tableName = tableName;\n this.indexName = indexName;\n this.label = `Drop index ${indexName} on ${tableName}`;\n this.freeze();\n }\n\n toOp(): Op {\n return dropIndex(this.tableName, this.indexName);\n }\n\n renderTypeScript(): string {\n return `dropIndex(${jsonToTsSource(this.tableName)}, ${jsonToTsSource(this.indexName)})`;\n }\n}\n\n// ============================================================================\n// Data transform\n// ============================================================================\n\n/**\n * A planner-generated data-transform stub. The current default strategy\n * (`nullabilityTighteningBackfillStrategy`) emits one of these with a\n * backfill-flavored `id`/`label` when the policy allows `'data'` and the\n * contract tightens a column's nullability, but the op itself is generic —\n * any future strategy that needs a placeholder data step can construct one\n * with its own id/label.\n *\n * `toOp()` always throws `PN-MIG-2001`: the planner cannot lower a stubbed\n * transform to a runtime op — the user must edit the rendered\n * `migration.ts` and re-emit.\n */\nexport class DataTransformCall extends SqliteOpFactoryCallNode {\n readonly factoryName = 'dataTransform' as const;\n readonly operationClass = 'data' as const;\n readonly id: string;\n readonly label: string;\n readonly tableName: string;\n readonly columnName: string;\n\n constructor(id: string, label: string, tableName: string, columnName: string) {\n super();\n this.id = id;\n this.label = label;\n this.tableName = tableName;\n this.columnName = columnName;\n this.freeze();\n }\n\n toOp(): Op {\n throw errorUnfilledPlaceholder(this.label);\n }\n\n renderTypeScript(): string {\n const slot = `${this.tableName}-${this.columnName}-backfill-sql`;\n return [\n 'dataTransform({',\n ` id: ${jsonToTsSource(this.id)},`,\n ` label: ${jsonToTsSource(this.label)},`,\n ` table: ${jsonToTsSource(this.tableName)},`,\n ` description: ${jsonToTsSource(`Backfill NULL ${this.columnName} values in ${this.tableName}`)},`,\n ` run: () => placeholder(${jsonToTsSource(slot)}),`,\n '})',\n ].join('\\n');\n }\n\n override importRequirements(): readonly ImportRequirement[] {\n return [\n { moduleSpecifier: TARGET_MIGRATION_MODULE, symbol: this.factoryName },\n { moduleSpecifier: TARGET_MIGRATION_MODULE, symbol: 'placeholder' },\n ];\n }\n}\n\n// ============================================================================\n// Union\n// ============================================================================\n\nexport type SqliteOpFactoryCall =\n | CreateTableCall\n | DropTableCall\n | RecreateTableCall\n | AddColumnCall\n | DropColumnCall\n | CreateIndexCall\n | DropIndexCall\n | DataTransformCall;\n"],"mappings":"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"}
@@ -0,0 +1,134 @@
1
+ import { t as SqlitePlanTargetDetails } from "./planner-target-details-CtWRvse0.mjs";
2
+ import { i as SqliteTableSpec, n as SqliteColumnSpec, r as SqliteIndexSpec } from "./shared-D_1fFqLf.mjs";
3
+ import { MigrationOperationClass, SqlMigrationPlanOperation } from "@prisma-next/family-sql/control";
4
+ import { ImportRequirement, TsExpression } from "@prisma-next/ts-render";
5
+ import { OpFactoryCall } from "@prisma-next/framework-components/control";
6
+
7
+ //#region src/core/migrations/op-factory-call.d.ts
8
+
9
+ type Op = SqlMigrationPlanOperation<SqlitePlanTargetDetails>;
10
+ declare abstract class SqliteOpFactoryCallNode extends TsExpression implements OpFactoryCall {
11
+ abstract readonly factoryName: string;
12
+ abstract readonly operationClass: MigrationOperationClass;
13
+ abstract readonly label: string;
14
+ abstract toOp(): Op;
15
+ importRequirements(): readonly ImportRequirement[];
16
+ protected freeze(): void;
17
+ }
18
+ declare class CreateTableCall extends SqliteOpFactoryCallNode {
19
+ readonly factoryName: "createTable";
20
+ readonly operationClass: "additive";
21
+ readonly tableName: string;
22
+ readonly spec: SqliteTableSpec;
23
+ readonly label: string;
24
+ constructor(tableName: string, spec: SqliteTableSpec);
25
+ toOp(): Op;
26
+ renderTypeScript(): string;
27
+ }
28
+ declare class DropTableCall extends SqliteOpFactoryCallNode {
29
+ readonly factoryName: "dropTable";
30
+ readonly operationClass: "destructive";
31
+ readonly tableName: string;
32
+ readonly label: string;
33
+ constructor(tableName: string);
34
+ toOp(): Op;
35
+ renderTypeScript(): string;
36
+ }
37
+ declare class RecreateTableCall extends SqliteOpFactoryCallNode {
38
+ readonly factoryName: "recreateTable";
39
+ readonly operationClass: MigrationOperationClass;
40
+ readonly tableName: string;
41
+ readonly contractTable: SqliteTableSpec;
42
+ readonly schemaColumnNames: readonly string[];
43
+ readonly indexes: readonly SqliteIndexSpec[];
44
+ readonly summary: string;
45
+ readonly postchecks: readonly {
46
+ readonly description: string;
47
+ readonly sql: string;
48
+ }[];
49
+ readonly label: string;
50
+ constructor(args: {
51
+ tableName: string;
52
+ contractTable: SqliteTableSpec;
53
+ schemaColumnNames: readonly string[];
54
+ indexes: readonly SqliteIndexSpec[];
55
+ summary: string;
56
+ postchecks: readonly {
57
+ readonly description: string;
58
+ readonly sql: string;
59
+ }[];
60
+ operationClass: MigrationOperationClass;
61
+ });
62
+ toOp(): Op;
63
+ renderTypeScript(): string;
64
+ }
65
+ declare class AddColumnCall extends SqliteOpFactoryCallNode {
66
+ readonly factoryName: "addColumn";
67
+ readonly operationClass: "additive";
68
+ readonly tableName: string;
69
+ readonly columnName: string;
70
+ readonly column: SqliteColumnSpec;
71
+ readonly label: string;
72
+ constructor(tableName: string, column: SqliteColumnSpec);
73
+ toOp(): Op;
74
+ renderTypeScript(): string;
75
+ }
76
+ declare class DropColumnCall extends SqliteOpFactoryCallNode {
77
+ readonly factoryName: "dropColumn";
78
+ readonly operationClass: "destructive";
79
+ readonly tableName: string;
80
+ readonly columnName: string;
81
+ readonly label: string;
82
+ constructor(tableName: string, columnName: string);
83
+ toOp(): Op;
84
+ renderTypeScript(): string;
85
+ }
86
+ declare class CreateIndexCall extends SqliteOpFactoryCallNode {
87
+ readonly factoryName: "createIndex";
88
+ readonly operationClass: "additive";
89
+ readonly tableName: string;
90
+ readonly indexName: string;
91
+ readonly columns: readonly string[];
92
+ readonly label: string;
93
+ constructor(tableName: string, indexName: string, columns: readonly string[]);
94
+ toOp(): Op;
95
+ renderTypeScript(): string;
96
+ }
97
+ declare class DropIndexCall extends SqliteOpFactoryCallNode {
98
+ readonly factoryName: "dropIndex";
99
+ readonly operationClass: "destructive";
100
+ readonly tableName: string;
101
+ readonly indexName: string;
102
+ readonly label: string;
103
+ constructor(tableName: string, indexName: string);
104
+ toOp(): Op;
105
+ renderTypeScript(): string;
106
+ }
107
+ /**
108
+ * A planner-generated data-transform stub. The current default strategy
109
+ * (`nullabilityTighteningBackfillStrategy`) emits one of these with a
110
+ * backfill-flavored `id`/`label` when the policy allows `'data'` and the
111
+ * contract tightens a column's nullability, but the op itself is generic —
112
+ * any future strategy that needs a placeholder data step can construct one
113
+ * with its own id/label.
114
+ *
115
+ * `toOp()` always throws `PN-MIG-2001`: the planner cannot lower a stubbed
116
+ * transform to a runtime op — the user must edit the rendered
117
+ * `migration.ts` and re-emit.
118
+ */
119
+ declare class DataTransformCall extends SqliteOpFactoryCallNode {
120
+ readonly factoryName: "dataTransform";
121
+ readonly operationClass: "data";
122
+ readonly id: string;
123
+ readonly label: string;
124
+ readonly tableName: string;
125
+ readonly columnName: string;
126
+ constructor(id: string, label: string, tableName: string, columnName: string);
127
+ toOp(): Op;
128
+ renderTypeScript(): string;
129
+ importRequirements(): readonly ImportRequirement[];
130
+ }
131
+ type SqliteOpFactoryCall = CreateTableCall | DropTableCall | RecreateTableCall | AddColumnCall | DropColumnCall | CreateIndexCall | DropIndexCall | DataTransformCall;
132
+ //#endregion
133
+ export { DropColumnCall as a, RecreateTableCall as c, DataTransformCall as i, SqliteOpFactoryCall as l, CreateIndexCall as n, DropIndexCall as o, CreateTableCall as r, DropTableCall as s, AddColumnCall as t };
134
+ //# sourceMappingURL=op-factory-call-dUIOao68.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"op-factory-call-dUIOao68.d.mts","names":[],"sources":["../src/core/migrations/op-factory-call.ts"],"sourcesContent":[],"mappings":";;;;;;;;KA0BK,EAAA,GAAK,yBA8B6B,CA9BH,uBA8BG,CAAA;uBA1BxB,uBAAA,SAAgC,YAAA,YAAwB,aAkC7D,CAAA;EAf2B,kBAAA,WAAA,EAAA,MAAA;EAAuB,kBAAA,cAAA,EAjBxB,uBAiBwB;EAwB/C,kBAAc,KAAA,EAAA,MAajB;EASG,SAAA,IAAA,CAAA,CAAA,EA7DM,EA6DN;EAEc,kBAAA,CAAA,CAAA,EAAA,SA7DM,iBA6DN,EAAA;EAED,UAAA,MAAA,CAAA,CAAA,EAAA,IAAA;;AASP,cA3DN,eAAA,SAAwB,uBAAA,CA2DlB;EAEG,SAAA,WAAA,EAAA,aAAA;EAGF,SAAA,cAAA,EAAA,UAAA;EAcV,SAAA,SAAA,EAAA,MAAA;EAhC6B,SAAA,IAAA,EA1CtB,eA0CsB;EAAuB,SAAA,KAAA,EAAA,MAAA;EA8DjD,WAAA,CAAA,SAAc,EAAA,MAAA,EAAA,IAAA,EArGY,eAqGZ;EAKR,IAAA,CAAA,CAAA,EAlGT,EAkGS;EAGsB,gBAAA,CAAA,CAAA,EAAA,MAAA;;AARN,cApFtB,aAAA,SAAsB,uBAAA,CAoFA;EAAuB,SAAA,WAAA,EAAA,WAAA;EA0B7C,SAAA,cAAe,EAAA,aAAQ;EA4BvB,SAAA,SAAgB,EAAA,MAAA;EA0BhB,SAAA,KAAA,EAAc,MAAA;EAwCd,WAAA,CAAA,SAAkB,EAAA,MAAA;EAiBrB,IAAA,CAAA,CAAA,EAhNA,EAgNA;EAiBgC,gBAAA,CAAA,CAAA,EAAA,MAAA;;AAlCoB,cAtLjD,iBAAA,SAA0B,uBAAA,CAsLuB;EA8ClD,SAAA,WAAA,EAAmB,eAAA;EAC3B,SAAA,cAAA,EAnOuB,uBAmOvB;EACA,SAAA,SAAA,EAAA,MAAA;EACA,SAAA,aAAA,EAnOsB,eAmOtB;EACA,SAAA,iBAAA,EAAA,SAAA,MAAA,EAAA;EACA,SAAA,OAAA,EAAA,SAnOyB,eAmOzB,EAAA;EACA,SAAA,OAAA,EAAA,MAAA;EACA,SAAA,UAAA,EAAA,SAAA;IACA,SAAA,WAAA,EAAA,MAAA;IAAiB,SAAA,GAAA,EAAA,MAAA;;;;;mBA/NF;;sBAEG;;;;;;oBAGF;;UAcV;;;cA8BG,aAAA,SAAsB,uBAAA;;;;;mBAKhB;;yCAGsB;UAS/B;;;cASG,cAAA,SAAuB,uBAAA;;;;;;;UAe1B;;;cAaG,eAAA,SAAwB,uBAAA;;;;;;;;UAiB3B;;;cASG,aAAA,SAAsB,uBAAA;;;;;;;UAezB;;;;;;;;;;;;;;;cAyBG,iBAAA,SAA0B,uBAAA;;;;;;;;UAiB7B;;iCAiBgC;;KAY9B,mBAAA,GACR,kBACA,gBACA,oBACA,gBACA,iBACA,kBACA,gBACA"}
@@ -0,0 +1,3 @@
1
+ import "./shared-D_1fFqLf.mjs";
2
+ import { a as DropColumnCall, c as RecreateTableCall, i as DataTransformCall, l as SqliteOpFactoryCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall } from "./op-factory-call-dUIOao68.mjs";
3
+ export { AddColumnCall, CreateIndexCall, CreateTableCall, DataTransformCall, DropColumnCall, DropIndexCall, DropTableCall, RecreateTableCall, type SqliteOpFactoryCall };
@@ -0,0 +1,3 @@
1
+ import { a as DropColumnCall, c as RecreateTableCall, i as DataTransformCall, n as CreateIndexCall, o as DropIndexCall, r as CreateTableCall, s as DropTableCall, t as AddColumnCall } from "./op-factory-call-BUVV-W9F.mjs";
2
+
3
+ export { AddColumnCall, CreateIndexCall, CreateTableCall, DataTransformCall, DropColumnCall, DropIndexCall, DropTableCall, RecreateTableCall };
package/dist/pack.d.mts CHANGED
@@ -1,4 +1,6 @@
1
- import { CodecTypes } from "@prisma-next/adapter-sqlite/codec-types";
1
+ import "./codec-ids-DyLO2Rfx.mjs";
2
+ import "./codecs-BqDitp2X.mjs";
3
+ import { t as CodecTypes } from "./codec-types-Bbzv7qCW.mjs";
2
4
 
3
5
  //#region src/core/descriptor-meta.d.ts
4
6
  declare const sqliteTargetDescriptorMetaBase: {
@@ -8,6 +10,40 @@ declare const sqliteTargetDescriptorMetaBase: {
8
10
  readonly id: "sqlite";
9
11
  readonly version: "0.0.1";
10
12
  readonly capabilities: {};
13
+ readonly authoring: {
14
+ readonly field: {
15
+ readonly temporal: {
16
+ readonly createdAt: {
17
+ readonly kind: "fieldPreset";
18
+ readonly output: {
19
+ readonly codecId: "sqlite/datetime@1";
20
+ readonly nativeType: "text";
21
+ readonly default: {
22
+ readonly kind: "function";
23
+ readonly expression: "now()";
24
+ };
25
+ };
26
+ };
27
+ readonly updatedAt: {
28
+ readonly kind: "fieldPreset";
29
+ readonly output: {
30
+ readonly codecId: "sqlite/datetime@1";
31
+ readonly nativeType: "text";
32
+ readonly executionDefaults: {
33
+ readonly onCreate: {
34
+ readonly kind: "generator";
35
+ readonly id: "timestampNow";
36
+ };
37
+ readonly onUpdate: {
38
+ readonly kind: "generator";
39
+ readonly id: "timestampNow";
40
+ };
41
+ };
42
+ };
43
+ };
44
+ };
45
+ };
46
+ };
11
47
  };
12
48
  declare const sqliteTargetDescriptorMeta: typeof sqliteTargetDescriptorMetaBase & {
13
49
  readonly __codecTypes?: CodecTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"sourcesContent":[],"mappings":";;;cAEM;;EAAA,SAAA,QAAA,EAAA,KAAA;EASO,SAAA,QAAA,EAAA,QAAA;;;;;cAAA,mCAAmC;0BACtB"}
1
+ {"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/descriptor-meta.ts"],"sourcesContent":[],"mappings":";;;;;cAGM;;;;EAAA,SAAA,EAAA,EAAA,QAAA;EAYO,SAAA,OAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAA,mCAAmC;0BACtB"}
package/dist/pack.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { t as sqliteTargetDescriptorMeta } from "./descriptor-meta-DbuuziYA.mjs";
1
+ import { t as sqliteTargetDescriptorMeta } from "./descriptor-meta-BA2YAFQq.mjs";
2
2
 
3
3
  export { sqliteTargetDescriptorMeta as default };