qubu 0.3.5 → 0.4.1

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 (104) hide show
  1. package/dist/{canonical-BbnqavJm.mjs → canonical-BXUguqfo.mjs} +23 -23
  2. package/dist/codegen.d.mts +25 -33
  3. package/dist/codegen.mjs +38 -45
  4. package/dist/column-hqKr7-1I.mjs +620 -0
  5. package/dist/{complete-D5Djh-zo.mjs → complete-WYyVozgK.mjs} +50 -50
  6. package/dist/{complete-types-B2PO6wQD.d.mts → complete-types-IjEn5VPN.d.mts} +56 -56
  7. package/dist/core.d.mts +2 -2
  8. package/dist/core.mjs +4 -4
  9. package/dist/ddl.d.mts +12 -12
  10. package/dist/ddl.mjs +13 -14
  11. package/dist/{dialect-b2-Z6uBF.mjs → dialect-wUKrnPMB.mjs} +2 -2
  12. package/dist/diff.d.mts +1 -1
  13. package/dist/diff.mjs +6 -7
  14. package/dist/{index-7qc6OcIC.d.mts → index-1DpA3mUh.d.mts} +20 -20
  15. package/dist/{index-CqWnouTK.d.mts → index-CPvfEheG.d.mts} +13 -15
  16. package/dist/index.d.mts +2 -2
  17. package/dist/index.mjs +148 -120
  18. package/dist/introspection.d.mts +8 -8
  19. package/dist/introspection.mjs +29 -30
  20. package/dist/{json-CUZlv4HT.mjs → json-Db7XRD91.mjs} +2 -2
  21. package/dist/migration.d.mts +20 -21
  22. package/dist/migration.mjs +5 -6
  23. package/dist/{mysql-DqkqXB6A.mjs → mysql-B_cYzzX2.mjs} +237 -7
  24. package/dist/mysql.d.mts +1 -1
  25. package/dist/mysql.mjs +3 -3
  26. package/dist/{on-conflict-BxnxubMb.mjs → on-conflict-hfPW0KmQ.mjs} +4 -4
  27. package/dist/postgres.d.mts +5 -5
  28. package/dist/postgres.mjs +6 -6
  29. package/dist/{registry-BufIskVN.mjs → registry-BRMLYwDp.mjs} +27 -135
  30. package/dist/{relational-DCZrrNia.mjs → relational-BZ3WDPzC.mjs} +4 -4
  31. package/dist/schema.d.mts +2 -2
  32. package/dist/schema.mjs +6 -6
  33. package/dist/{snapshot-CWPgzxNx.mjs → snapshot-C-W65HEd.mjs} +5 -5
  34. package/dist/snapshot.d.mts +3 -3
  35. package/dist/snapshot.mjs +5 -7
  36. package/dist/{source-DUoJVXmL.mjs → source-BcS2AsIg.mjs} +7 -9
  37. package/dist/{serialize-PF1cfH2P.mjs → sqlite-Cg0nwYEH.mjs} +326 -12
  38. package/dist/sqlite.d.mts +2 -2
  39. package/dist/sqlite.mjs +2 -2
  40. package/dist/{standard-BTVYKh_F.mjs → standard-DfcZEVOj.mjs} +1 -1
  41. package/dist/{table-CCUJ60rB.mjs → table-Bp5irMSj.mjs} +5 -7
  42. package/dist/{types-D8M1yZF4.d.mts → types-BK1COGZe.d.mts} +2661 -2150
  43. package/dist/{types-Cec0xzo4.mjs → types-JM3FcAnX.mjs} +8 -8
  44. package/dist/{types-LBt5rclR.d.mts → types-JSZHpUEj.d.mts} +83 -84
  45. package/dist/{value-BvilP0oz.mjs → value-Bi71Agyf.mjs} +1 -1
  46. package/dist/vite/ambient.d.ts +311 -390
  47. package/dist/vite.d.mts +5 -6
  48. package/dist/vite.mjs +3 -4
  49. package/docs/dialects-and-execution.md +121 -81
  50. package/docs/getting-started.md +4 -4
  51. package/docs/guides/better-auth.md +57 -0
  52. package/docs/guides/compose-queries.md +24 -67
  53. package/docs/guides/drizzle.md +23 -23
  54. package/docs/guides/extensions/dialects.md +4 -4
  55. package/docs/guides/extensions/sources-and-clauses.md +15 -15
  56. package/docs/guides/extensions/typed-expressions.md +13 -17
  57. package/docs/guides/extensions/unsafe-syntax.md +3 -3
  58. package/docs/guides/json.md +7 -7
  59. package/docs/guides/mutations.md +14 -21
  60. package/docs/guides/select/conditions.md +6 -8
  61. package/docs/guides/select/grouping-and-windows.md +4 -15
  62. package/docs/guides/select/ordering-and-pagination.md +6 -19
  63. package/docs/guides/select/overview.md +12 -26
  64. package/docs/guides/sql-templates.md +20 -24
  65. package/docs/guides/vite-plugin.md +9 -13
  66. package/docs/index.md +5 -7
  67. package/docs/query-model/fragments.md +4 -15
  68. package/docs/query-model/result-shapes.md +11 -14
  69. package/docs/query-model/source-scope.md +31 -49
  70. package/docs/reference/mysql-snapshot.md +2 -5
  71. package/docs/reference/postgres-snapshot.md +3 -3
  72. package/docs/reference/sqlite-snapshot.md +2 -5
  73. package/docs/reference/supported-surface.md +33 -33
  74. package/docs/schema/catalog-model.md +2 -5
  75. package/docs/schema/code-generation.md +18 -18
  76. package/docs/schema/columns-and-writes.md +17 -25
  77. package/docs/schema/constraints-and-indexes.md +36 -52
  78. package/docs/schema/ddl-emission.md +6 -6
  79. package/docs/schema/diff.md +5 -5
  80. package/docs/schema/introspection.md +7 -7
  81. package/docs/schema/migration-plans.md +9 -9
  82. package/docs/schema/snapshots.md +3 -3
  83. package/docs/schema/storage-and-schema-sql.md +11 -11
  84. package/docs/schema/tables-and-names.md +11 -14
  85. package/docs/sql-semantic-types.md +10 -10
  86. package/docs/troubleshooting.md +10 -10
  87. package/package.json +21 -33
  88. package/skills/qubu/agents/openai.yaml +3 -3
  89. package/dist/column-CXMxx8Hq.mjs +0 -118
  90. package/dist/column-CYMbKbOy.mjs +0 -290
  91. package/dist/drizzle-mysql.d.mts +0 -24
  92. package/dist/drizzle-mysql.mjs +0 -72
  93. package/dist/drizzle-postgres.d.mts +0 -24
  94. package/dist/drizzle-postgres.mjs +0 -73
  95. package/dist/drizzle-sqlite.d.mts +0 -50
  96. package/dist/drizzle-sqlite.mjs +0 -108
  97. package/dist/drizzle.d.mts +0 -13
  98. package/dist/drizzle.mjs +0 -2
  99. package/dist/errors-BGCoLe_r.mjs +0 -14
  100. package/dist/naming-QVCOnSj2.mjs +0 -20
  101. package/dist/postgres-DEBBeh52.mjs +0 -235
  102. package/dist/runtime-Cn_Xgzta.mjs +0 -193
  103. package/dist/sqlite-BU6DBxef.mjs +0 -320
  104. package/dist/types-Ctlxz1ip.d.mts +0 -45
@@ -1,4 +1,4 @@
1
- import { A as SnapshotStorage, D as SnapshotLiteral, O as SnapshotNamingPolicy, T as SnapshotJsonValue, b as SnapshotGeneratedColumn, d as SnapshotDefault, f as SnapshotDiagnostic, g as SnapshotExpression, h as SnapshotDialectExtension, i as SchemaSnapshotInput, m as SnapshotDialect } from "./types-D8M1yZF4.mjs";
1
+ import { A as SnapshotStorage, D as SnapshotLiteral, O as SnapshotNamingPolicy, T as SnapshotJsonValue, b as SnapshotGeneratedColumn, d as SnapshotDefault, f as SnapshotDiagnostic, g as SnapshotExpression, h as SnapshotDialectExtension, i as SchemaSnapshotInput, m as SnapshotDialect } from "./types-BK1COGZe.mjs";
2
2
  //#region src/snapshot/complete-types.d.ts
3
3
  /** The stable envelope tag shared by Snapshot v1 and the complete model. */
4
4
  declare const completeSchemaSnapshotFormat: "qubu-schema";
@@ -10,15 +10,15 @@ declare const schemaSnapshotV2Version: 2;
10
10
  declare const schemaSnapshotCompleteVersion: 2;
11
11
  declare const schemaSnapshotVersion2: 2;
12
12
  /** Object families that may appear in a complete canonical snapshot. */
13
- type CompleteSnapshotObjectKind = 'namespace' | 'table' | 'column' | 'constraint' | 'index' | 'view' | 'materialized-view' | 'sequence' | 'enum' | 'domain' | 'collation' | 'trigger' | 'routine' | 'partition' | 'policy' | 'extension' | 'comment' | 'ownership' | 'deferred-object' | 'opaque-object';
13
+ type CompleteSnapshotObjectKind = "namespace" | "table" | "column" | "constraint" | "index" | "view" | "materialized-view" | "sequence" | "enum" | "domain" | "collation" | "trigger" | "routine" | "partition" | "policy" | "extension" | "comment" | "ownership" | "deferred-object" | "opaque-object";
14
14
  /** A stable logical object reference used by complete snapshot relations. */
15
15
  interface CompleteSnapshotObjectReference {
16
- readonly kind: Exclude<CompleteSnapshotObjectKind, 'namespace'>;
16
+ readonly kind: Exclude<CompleteSnapshotObjectKind, "namespace">;
17
17
  readonly id: string;
18
18
  }
19
19
  /** Source evidence retained without persisting a database catalog key. */
20
20
  interface CompleteSnapshotProvenance {
21
- readonly kind: 'catalog' | 'decompiler' | 'create-sql';
21
+ readonly kind: "catalog" | "decompiler" | "create-sql";
22
22
  readonly dialect: string;
23
23
  readonly path?: readonly (string | number)[];
24
24
  }
@@ -31,7 +31,7 @@ interface CompleteSnapshotPhysicalReference {
31
31
  }
32
32
  /** Namespace identity and selected physical boundary for a snapshot. */
33
33
  interface CompleteSnapshotNamespace extends CompleteSnapshotObjectMetadata {
34
- readonly kind: 'postgres-schema' | 'sqlite-database' | 'mysql-database';
34
+ readonly kind: "postgres-schema" | "sqlite-database" | "mysql-database";
35
35
  readonly name: string;
36
36
  }
37
37
  /** Capability facts reported by the adapter that produced the snapshot. */
@@ -39,13 +39,13 @@ interface CompleteSnapshotCapabilities {
39
39
  readonly generatedColumns: boolean;
40
40
  readonly identityMetadata: boolean;
41
41
  readonly checkConstraints: boolean;
42
- readonly checkConstraintEnforcement: 'enforced' | 'metadata-only' | 'unknown';
42
+ readonly checkConstraintEnforcement: "enforced" | "metadata-only" | "unknown";
43
43
  readonly expressionDecompilation: boolean;
44
44
  readonly indexExpressions: boolean;
45
45
  readonly indexPredicates: boolean;
46
46
  readonly indexIncludedColumns: boolean;
47
47
  readonly namespaces: boolean;
48
- readonly visibility: 'complete' | 'limited' | 'unknown';
48
+ readonly visibility: "complete" | "limited" | "unknown";
49
49
  readonly [capability: string]: boolean | string;
50
50
  }
51
51
  /** Metadata common to every complete snapshot object. */
@@ -56,7 +56,7 @@ interface CompleteSnapshotObjectMetadata {
56
56
  }
57
57
  /** A complete snapshot column, including physical ordinal evidence. */
58
58
  interface CompleteSnapshotColumn extends CompleteSnapshotObjectMetadata {
59
- readonly kind: 'column';
59
+ readonly kind: "column";
60
60
  readonly id: string;
61
61
  readonly physicalName: string;
62
62
  readonly ordinalPosition: number;
@@ -71,38 +71,38 @@ interface CompleteSnapshotColumn extends CompleteSnapshotObjectMetadata {
71
71
  }
72
72
  /** A richer identity declaration retained beside a column or sequence. */
73
73
  interface CompleteSnapshotIdentity extends CompleteSnapshotObjectMetadata {
74
- readonly kind: 'identity';
75
- readonly generation: 'always' | 'by-default';
74
+ readonly kind: "identity";
75
+ readonly generation: "always" | "by-default";
76
76
  readonly options: Readonly<Record<string, CompleteSnapshotValueFact>>;
77
77
  }
78
78
  /** A literal or opaque expression value in complete object metadata. */
79
79
  type CompleteSnapshotValueFact = {
80
- readonly kind: 'literal';
80
+ readonly kind: "literal";
81
81
  readonly value: SnapshotLiteral;
82
82
  } | {
83
- readonly kind: 'expression';
83
+ readonly kind: "expression";
84
84
  readonly expression: SnapshotExpression;
85
85
  };
86
86
  /** An ordered column or expression term in a complete index. */
87
87
  type CompleteSnapshotIndexTerm = {
88
- readonly kind: 'column';
88
+ readonly kind: "column";
89
89
  readonly column: string;
90
90
  readonly position: number;
91
- readonly direction?: 'ASC' | 'DESC';
92
- readonly nulls?: 'FIRST' | 'LAST';
91
+ readonly direction?: "ASC" | "DESC";
92
+ readonly nulls?: "FIRST" | "LAST";
93
93
  readonly prefixLength?: CompleteSnapshotValueFact;
94
94
  readonly operatorClass?: string;
95
95
  } | {
96
- readonly kind: 'expression';
96
+ readonly kind: "expression";
97
97
  readonly expression: SnapshotExpression;
98
98
  readonly position: number;
99
- readonly direction?: 'ASC' | 'DESC';
100
- readonly nulls?: 'FIRST' | 'LAST';
99
+ readonly direction?: "ASC" | "DESC";
100
+ readonly nulls?: "FIRST" | "LAST";
101
101
  readonly operatorClass?: string;
102
102
  };
103
103
  /** A complete index with engine-specific method and included-column facts. */
104
104
  interface CompleteSnapshotIndex extends CompleteSnapshotObjectMetadata {
105
- readonly kind: 'index';
105
+ readonly kind: "index";
106
106
  readonly id: string;
107
107
  readonly physicalName: string;
108
108
  readonly terms: readonly CompleteSnapshotIndexTerm[];
@@ -115,19 +115,19 @@ interface CompleteSnapshotIndex extends CompleteSnapshotObjectMetadata {
115
115
  }
116
116
  /** A key or uniqueness constraint in a complete table. */
117
117
  interface CompleteSnapshotKeyConstraint extends CompleteSnapshotObjectMetadata {
118
- readonly kind: 'primary-key' | 'unique' | 'unique-constraint';
118
+ readonly kind: "primary-key" | "unique" | "unique-constraint";
119
119
  readonly id: string;
120
120
  readonly physicalName: string;
121
121
  readonly columns: readonly string[];
122
- readonly nulls?: 'distinct' | 'not-distinct';
122
+ readonly nulls?: "distinct" | "not-distinct";
123
123
  readonly backingIndex?: CompleteSnapshotObjectReference;
124
124
  readonly deferrable?: boolean;
125
- readonly initially?: 'immediate' | 'deferred';
125
+ readonly initially?: "immediate" | "deferred";
126
126
  readonly validated?: boolean;
127
127
  }
128
128
  /** A foreign key with explicit target object identity and actions. */
129
129
  interface CompleteSnapshotForeignKey extends CompleteSnapshotObjectMetadata {
130
- readonly kind: 'foreign-key';
130
+ readonly kind: "foreign-key";
131
131
  readonly id: string;
132
132
  readonly physicalName: string;
133
133
  readonly columns: readonly string[];
@@ -135,28 +135,28 @@ interface CompleteSnapshotForeignKey extends CompleteSnapshotObjectMetadata {
135
135
  readonly table: CompleteSnapshotObjectReference;
136
136
  readonly columns: readonly string[];
137
137
  };
138
- readonly onUpdate?: 'no-action' | 'restrict' | 'cascade' | 'set-null' | 'set-default';
139
- readonly onDelete?: 'no-action' | 'restrict' | 'cascade' | 'set-null' | 'set-default';
140
- readonly match?: 'simple' | 'full' | 'partial';
138
+ readonly onUpdate?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
139
+ readonly onDelete?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
140
+ readonly match?: "simple" | "full" | "partial";
141
141
  readonly deferrable?: boolean;
142
- readonly initially?: 'immediate' | 'deferred';
142
+ readonly initially?: "immediate" | "deferred";
143
143
  readonly validated?: boolean;
144
144
  }
145
145
  /** A check constraint whose expression remains tagged data. */
146
146
  interface CompleteSnapshotCheckConstraint extends CompleteSnapshotObjectMetadata {
147
- readonly kind: 'check';
147
+ readonly kind: "check";
148
148
  readonly id: string;
149
149
  readonly physicalName: string;
150
150
  readonly expression: SnapshotExpression;
151
151
  readonly deferrable?: boolean;
152
- readonly initially?: 'immediate' | 'deferred';
152
+ readonly initially?: "immediate" | "deferred";
153
153
  readonly validated?: boolean;
154
154
  }
155
155
  /** Every constraint represented by the complete neutral snapshot model. */
156
156
  type CompleteSnapshotConstraint = CompleteSnapshotKeyConstraint | CompleteSnapshotForeignKey | CompleteSnapshotCheckConstraint;
157
157
  /** A complete table record keyed by stable logical identity. */
158
158
  interface CompleteSnapshotTable extends CompleteSnapshotObjectMetadata {
159
- readonly kind: 'table';
159
+ readonly kind: "table";
160
160
  readonly id: string;
161
161
  readonly physicalName: string;
162
162
  readonly columns: readonly CompleteSnapshotColumn[];
@@ -165,19 +165,19 @@ interface CompleteSnapshotTable extends CompleteSnapshotObjectMetadata {
165
165
  }
166
166
  /** A view or materialized-view declaration and its output columns. */
167
167
  interface CompleteSnapshotView extends CompleteSnapshotObjectMetadata {
168
- readonly kind: 'view' | 'materialized-view';
168
+ readonly kind: "view" | "materialized-view";
169
169
  readonly id: string;
170
170
  readonly physicalName: string;
171
171
  readonly columns: readonly CompleteSnapshotColumn[];
172
172
  readonly definition: SnapshotExpression;
173
173
  readonly dependencies?: readonly CompleteSnapshotObjectReference[];
174
- readonly checkOption?: 'none' | 'local' | 'cascaded';
174
+ readonly checkOption?: "none" | "local" | "cascaded";
175
175
  readonly securityBarrier?: boolean;
176
176
  readonly securityInvoker?: boolean;
177
177
  }
178
178
  /** A sequence and its exact option facts. */
179
179
  interface CompleteSnapshotSequence extends CompleteSnapshotObjectMetadata {
180
- readonly kind: 'sequence';
180
+ readonly kind: "sequence";
181
181
  readonly id: string;
182
182
  readonly physicalName: string;
183
183
  readonly storage?: SnapshotStorage;
@@ -192,7 +192,7 @@ interface CompleteSnapshotSequence extends CompleteSnapshotObjectMetadata {
192
192
  }
193
193
  /** An ordered enum declaration. */
194
194
  interface CompleteSnapshotEnum extends CompleteSnapshotObjectMetadata {
195
- readonly kind: 'enum';
195
+ readonly kind: "enum";
196
196
  readonly id: string;
197
197
  readonly physicalName: string;
198
198
  readonly values: readonly {
@@ -203,7 +203,7 @@ interface CompleteSnapshotEnum extends CompleteSnapshotObjectMetadata {
203
203
  }
204
204
  /** A domain declaration and its base type constraints. */
205
205
  interface CompleteSnapshotDomain extends CompleteSnapshotObjectMetadata {
206
- readonly kind: 'domain';
206
+ readonly kind: "domain";
207
207
  readonly id: string;
208
208
  readonly physicalName: string;
209
209
  readonly storage: SnapshotStorage;
@@ -213,7 +213,7 @@ interface CompleteSnapshotDomain extends CompleteSnapshotObjectMetadata {
213
213
  }
214
214
  /** Collation behavior that can affect deterministic schema comparison. */
215
215
  interface CompleteSnapshotCollation extends CompleteSnapshotObjectMetadata {
216
- readonly kind: 'collation';
216
+ readonly kind: "collation";
217
217
  readonly id: string;
218
218
  readonly physicalName: string;
219
219
  readonly provider?: string;
@@ -223,13 +223,13 @@ interface CompleteSnapshotCollation extends CompleteSnapshotObjectMetadata {
223
223
  }
224
224
  /** Trigger declaration attached to a table or view. */
225
225
  interface CompleteSnapshotTrigger extends CompleteSnapshotObjectMetadata {
226
- readonly kind: 'trigger';
226
+ readonly kind: "trigger";
227
227
  readonly id: string;
228
228
  readonly physicalName: string;
229
229
  readonly table: CompleteSnapshotObjectReference;
230
- readonly timing: 'before' | 'after' | 'instead-of' | 'unknown';
231
- readonly events: readonly ('insert' | 'update' | 'delete' | 'truncate')[];
232
- readonly orientation?: 'row' | 'statement';
230
+ readonly timing: "before" | "after" | "instead-of" | "unknown";
231
+ readonly events: readonly ("insert" | "update" | "delete" | "truncate")[];
232
+ readonly orientation?: "row" | "statement";
233
233
  readonly condition?: SnapshotExpression;
234
234
  readonly body: SnapshotExpression;
235
235
  readonly enabled?: boolean;
@@ -237,44 +237,44 @@ interface CompleteSnapshotTrigger extends CompleteSnapshotObjectMetadata {
237
237
  /** Routine argument declaration. */
238
238
  interface CompleteSnapshotRoutineParameter {
239
239
  readonly name?: string;
240
- readonly mode?: 'in' | 'out' | 'inout' | 'variadic' | 'table';
240
+ readonly mode?: "in" | "out" | "inout" | "variadic" | "table";
241
241
  readonly storage: SnapshotStorage;
242
242
  readonly default?: CompleteSnapshotValueFact;
243
243
  readonly ordinalPosition: number;
244
244
  }
245
245
  /** Function, procedure, aggregate, or window routine declaration. */
246
246
  interface CompleteSnapshotRoutine extends CompleteSnapshotObjectMetadata {
247
- readonly kind: 'routine';
247
+ readonly kind: "routine";
248
248
  readonly id: string;
249
249
  readonly physicalName: string;
250
- readonly routineKind: 'function' | 'procedure' | 'aggregate' | 'window' | 'unknown';
250
+ readonly routineKind: "function" | "procedure" | "aggregate" | "window" | "unknown";
251
251
  readonly parameters: readonly CompleteSnapshotRoutineParameter[];
252
252
  readonly returnType?: SnapshotStorage;
253
253
  readonly language?: string;
254
254
  readonly body?: SnapshotExpression;
255
- readonly volatility?: 'immutable' | 'stable' | 'volatile' | 'unknown';
256
- readonly parallel?: 'safe' | 'restricted' | 'unsafe' | 'unknown';
257
- readonly security?: 'invoker' | 'definer' | 'unknown';
255
+ readonly volatility?: "immutable" | "stable" | "volatile" | "unknown";
256
+ readonly parallel?: "safe" | "restricted" | "unsafe" | "unknown";
257
+ readonly security?: "invoker" | "definer" | "unknown";
258
258
  readonly dependencies?: readonly CompleteSnapshotObjectReference[];
259
259
  }
260
260
  /** A partition child, its parent, and normalized bound expression. */
261
261
  interface CompleteSnapshotPartition extends CompleteSnapshotObjectMetadata {
262
- readonly kind: 'partition';
262
+ readonly kind: "partition";
263
263
  readonly id: string;
264
264
  readonly physicalName: string;
265
265
  readonly parent: CompleteSnapshotObjectReference;
266
- readonly strategy: 'range' | 'list' | 'hash' | 'reference' | 'unknown';
266
+ readonly strategy: "range" | "list" | "hash" | "reference" | "unknown";
267
267
  readonly keyColumns?: readonly string[];
268
268
  readonly bound?: SnapshotExpression;
269
269
  readonly default?: boolean;
270
270
  }
271
271
  /** A row-level security policy attached to a table. */
272
272
  interface CompleteSnapshotPolicy extends CompleteSnapshotObjectMetadata {
273
- readonly kind: 'policy';
273
+ readonly kind: "policy";
274
274
  readonly id: string;
275
275
  readonly physicalName: string;
276
276
  readonly table: CompleteSnapshotObjectReference;
277
- readonly command: 'all' | 'select' | 'insert' | 'update' | 'delete' | 'unknown';
277
+ readonly command: "all" | "select" | "insert" | "update" | "delete" | "unknown";
278
278
  readonly roles?: readonly string[];
279
279
  readonly permissive?: boolean;
280
280
  readonly using?: SnapshotExpression;
@@ -282,7 +282,7 @@ interface CompleteSnapshotPolicy extends CompleteSnapshotObjectMetadata {
282
282
  }
283
283
  /** An extension object with a typed, versioned payload. */
284
284
  interface CompleteSnapshotExtension extends CompleteSnapshotObjectMetadata {
285
- readonly kind: 'extension';
285
+ readonly kind: "extension";
286
286
  readonly id: string;
287
287
  readonly physicalName: string;
288
288
  readonly extensionName: string;
@@ -293,7 +293,7 @@ interface CompleteSnapshotExtension extends CompleteSnapshotObjectMetadata {
293
293
  }
294
294
  /** A deferred object retained as a reviewable, non-lossy boundary record. */
295
295
  interface CompleteSnapshotDeferredObject extends CompleteSnapshotObjectMetadata {
296
- readonly kind: 'deferred-object';
296
+ readonly kind: "deferred-object";
297
297
  readonly id: string;
298
298
  readonly objectKind: string;
299
299
  readonly physicalName: string;
@@ -302,7 +302,7 @@ interface CompleteSnapshotDeferredObject extends CompleteSnapshotObjectMetadata
302
302
  }
303
303
  /** An opaque object observed by an adapter but not yet structurally modeled. */
304
304
  interface CompleteSnapshotOpaqueObject extends CompleteSnapshotObjectMetadata {
305
- readonly kind: 'opaque-object';
305
+ readonly kind: "opaque-object";
306
306
  readonly id: string;
307
307
  readonly objectKind: string;
308
308
  readonly physicalName: string;
@@ -311,7 +311,7 @@ interface CompleteSnapshotOpaqueObject extends CompleteSnapshotObjectMetadata {
311
311
  }
312
312
  /** A comment attached to a stable logical object. */
313
313
  interface CompleteSnapshotComment extends CompleteSnapshotObjectMetadata {
314
- readonly kind: 'comment';
314
+ readonly kind: "comment";
315
315
  readonly id: string;
316
316
  readonly physicalName: string;
317
317
  readonly object: CompleteSnapshotObjectReference;
@@ -319,7 +319,7 @@ interface CompleteSnapshotComment extends CompleteSnapshotObjectMetadata {
319
319
  }
320
320
  /** Ownership metadata attached to a stable logical object. */
321
321
  interface CompleteSnapshotOwnership extends CompleteSnapshotObjectMetadata {
322
- readonly kind: 'ownership';
322
+ readonly kind: "ownership";
323
323
  readonly id: string;
324
324
  readonly physicalName: string;
325
325
  readonly object: CompleteSnapshotObjectReference;
@@ -363,7 +363,7 @@ type CompleteSnapshotDecodeResult = {
363
363
  };
364
364
  /** A complete snapshot creation result with immutable successful output. */
365
365
  type CompleteSnapshotCreateResult = CompleteSnapshotDecodeResult;
366
- /** v2 aliases kept explicit for consumers that prefer numbered APIs. */
366
+ /** V2 aliases kept explicit for consumers that prefer numbered APIs. */
367
367
  type SchemaSnapshotV2 = CompleteSchemaSnapshot;
368
368
  type SchemaSnapshotV2Input = CompleteSchemaSnapshotInput;
369
369
  type SchemaSnapshotV2DecodeResult = CompleteSnapshotDecodeResult;
package/dist/core.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as PaginationKind, $l as ResultMeta, Al as GroupingMeta, B as CastTarget, Bl as OutputOf, Cl as CardinalityOf, Cu as SqlTextLike, Dl as FragmentMeta, Do as RenderedQuery, Du as SqlUuid, El as Fragment, Eo as RenderOptions, Eu as SqlUnknown, Fi as SelectClause, Fl as InheritedMetadataOf, G as DialectJson, Gl as RenderContext, H as DialectCapability, Hl as ProvidesOuterSourceMeta, Il as MetadataOf, J as DialectRowLocking, Jl as RequiresOf, K as DialectOptions, Kl as RenderFunction, Ll as NullabilityOf, Ml as HasSubquery, Nl as HasWindow, Ol as GroupingDependenciesOf, Oo as render, Pi as ClausePlacement, Pl as InheritedMetadata, Q as NamedCastTarget, Ql as RequiresSourceMeta, Rl as NullableSourceMeta, Sl as CardinalityMeta, Su as SqlText, Tl as ExpressionMeta, To as RenderCapabilityValidation, Tu as SqlTypeSatisfies, U as DialectCastTypes, Ul as ProvidesSourceMeta, V as Dialect, Va as typedValue, Vl as ProvidesOuterOf, W as DialectExplain, Wa as typedCast, Wl as QueryCardinality, X as ExplainRenderOptions, Xl as RequiresOuterOf, Y as ExplainFormat, Yl as RequiresOuterMetadataOf, Z as JsonScalarKind, Zl as RequiresOuterSourceMeta, _l as AggregateDependenciesOf, _u as SqlJson, at as SchemaLiteralRenderer, au as isFragment, bl as CapabilitiesOf, bu as SqlOrderable, ct as resolveCastTarget, cu as AnySqlType, du as SqlBoolean, et as PaginationPart, eu as SqlTypeOf, fu as SqlDate, gl as withDialectCapability, gu as SqlInteger, hl as markExpressionCategory, hu as SqlEqualityCompatible, il as Expression, it as RowLockWaitPolicy, iu as fragment, jl as HasAggregate, kl as GroupingKeysOf, lu as SqlBigInt, ml as makeExpression, mu as SqlEqualityComparable, nt as PortableCastType, nu as VisibleDependenciesOf, ot as assertDialectCapability, ou as parenthesize, pl as isExpression, pu as SqlDecimal, q as DialectPagination, ql as RequiresCapabilityMeta, ra as typedCall, rt as RowLockMode, ru as WindowMeta, st as createDialect, su as sequence, tl as expressionFragment, tt as PortableCastTarget, tu as SubqueryMeta, uu as SqlBinary, vl as AggregateMeta, vu as SqlNumericLike, wl as DependenciesOf, wu as SqlTimestamp, xl as CapabilityMetadataOf, xu as SqlSemanticType, yl as AnyFragment, yu as SqlOrderCompatible, zl as NullableSourcesOf } from "./types-D8M1yZF4.mjs";
1
+ import { $ as PaginationKind, $c as RenderCapabilityValidation, $l as InheritedMetadata, Au as SqlBoolean, B as CastTarget, Bl as CapabilityMetadataOf, Bu as SqlSemanticType, Ca as SelectClause, Cl as markExpressionCategory, Cu as fragment, Du as AnySqlType, Eu as sequence, Fu as SqlInteger, G as DialectJson, Ga as typedCall, Gl as Fragment, Gu as SqlUnknown, H as DialectCapability, Hl as CardinalityOf, Hu as SqlTextLike, Il as AggregateDependenciesOf, Iu as SqlJson, J as DialectRowLocking, Jl as GroupingKeysOf, K as DialectOptions, Kl as FragmentMeta, Ku as SqlUuid, Ll as AggregateMeta, Lu as SqlNumericLike, Mu as SqlDecimal, No as typedCast, Nu as SqlEqualityComparable, Ou as SqlBigInt, Pu as SqlEqualityCompatible, Q as NamedCastTarget, Ql as HasWindow, Rl as AnyFragment, Ru as SqlOrderCompatible, Sa as ClausePlacement, Sl as makeExpression, Su as WindowMeta, Tu as parenthesize, U as DialectCastTypes, Ul as DependenciesOf, Uu as SqlTimestamp, V as Dialect, Vl as CardinalityMeta, Vu as SqlText, W as DialectExplain, Wl as ExpressionMeta, Wu as SqlTypeSatisfies, X as ExplainRenderOptions, Xl as HasAggregate, Y as ExplainFormat, Yl as GroupingMeta, Z as JsonScalarKind, Zl as HasSubquery, _u as RequiresSourceMeta, at as SchemaLiteralRenderer, au as OutputOf, bu as SubqueryMeta, ct as resolveCastTarget, cu as ProvidesSourceMeta, du as RenderFunction, el as RenderOptions, et as PaginationPart, eu as InheritedMetadataOf, fl as Expression, fu as RequiresCapabilityMeta, gu as RequiresOuterSourceMeta, hu as RequiresOuterOf, it as RowLockWaitPolicy, iu as NullableSourcesOf, ju as SqlDate, ko as typedValue, ku as SqlBinary, ll as expressionFragment, lu as QueryCardinality, mu as RequiresOuterMetadataOf, nl as render, nt as PortableCastType, nu as NullabilityOf, ot as assertDialectCapability, ou as ProvidesOuterOf, pu as RequiresOf, q as DialectPagination, ql as GroupingDependenciesOf, rt as RowLockMode, ru as NullableSourceMeta, st as createDialect, su as ProvidesOuterSourceMeta, tl as RenderedQuery, tt as PortableCastTarget, tu as MetadataOf, uu as RenderContext, vu as ResultMeta, wl as withDialectCapability, wu as isFragment, xl as isExpression, xu as VisibleDependenciesOf, yu as SqlTypeOf, zl as CapabilitiesOf, zu as SqlOrderable } from "./types-BK1COGZe.mjs";
2
2
  //#region src/core/primitives/compose.d.ts
3
3
  declare function commaSeparated<const TParts extends readonly AnyFragment[]>(parts: TParts): Fragment<InheritedMetadata<TParts[number]>>;
4
4
  declare function keyword<TPart extends AnyFragment | undefined>(value: string, part?: TPart): Fragment<TPart extends AnyFragment ? InheritedMetadata<TPart> : never>;
@@ -20,7 +20,7 @@ declare function syntax(value: string): Fragment<never>;
20
20
  //#endregion
21
21
  //#region src/expressions/unsafe.d.ts
22
22
  /** Explicit escape hatch for syntax the standard primitives do not model. */
23
- declare function unsafeExpression<T = unknown, TSqlType extends AnySqlType = SqlUnknown>(sql: string): Expression<ResultMeta<T, never, TSqlType> | ExpressionMeta<never>, 'unsafe'>;
23
+ declare function unsafeExpression<T = unknown, TSqlType extends AnySqlType = SqlUnknown>(sql: string): Expression<ResultMeta<T, never, TSqlType> | ExpressionMeta<never>, "unsafe">;
24
24
  //#endregion
25
25
  //#region src/query/clauses/custom.d.ts
26
26
  declare function customClause<TMetadata = never>(options: {
package/dist/core.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { a as assertDialectCapability, o as createDialect, s as resolveCastTarget } from "./json-CUZlv4HT.mjs";
2
- import { a as routineName, c as render, i as typedCall, s as typedCast, t as createClause } from "./types-Cec0xzo4.mjs";
3
- import { a as qualifiedIdentifier, c as makeExpression, f as withDialectCapability, g as sequence, h as parenthesize, i as identifier, m as isFragment, n as expressionFragment, o as isExpression, p as fragment, u as markExpressionCategory } from "./column-CXMxx8Hq.mjs";
4
- import { a as parameter, r as typedValue } from "./value-BvilP0oz.mjs";
1
+ import { a as assertDialectCapability, o as createDialect, s as resolveCastTarget } from "./json-Db7XRD91.mjs";
2
+ import { a as routineName, c as render, i as typedCall, s as typedCast, t as createClause } from "./types-JM3FcAnX.mjs";
3
+ import { G as withDialectCapability, J as parenthesize, K as fragment, U as markExpressionCategory, V as makeExpression, Y as sequence, a as qualifiedIdentifier, i as identifier, n as expressionFragment, q as isFragment, z as isExpression } from "./column-hqKr7-1I.mjs";
4
+ import { a as parameter, r as typedValue } from "./value-Bi71Agyf.mjs";
5
5
  //#region src/core/primitives/compose.ts
6
6
  function commaSeparated(parts) {
7
7
  return sequence(parts, ", ");
package/dist/ddl.d.mts CHANGED
@@ -1,16 +1,16 @@
1
- import { Mr as SchemaDialect } from "./types-D8M1yZF4.mjs";
1
+ import { Tr as SchemaDialect } from "./types-BK1COGZe.mjs";
2
2
  import { MigrationLockRequirement, MigrationOperation, MigrationPlan, MigrationTransactionRequirement } from "./migration.mjs";
3
3
  //#region src/ddl/types.d.ts
4
4
  /** Stable diagnostic categories produced before a migration is rendered. */
5
- type DdlDiagnosticCode = 'invalid-plan' | 'blocked-plan' | 'decision-required' | 'dialect-mismatch' | 'unsupported' | 'server-version' | 'lock-conflict' | 'transaction-conflict' | 'lossy' | 'unknown' | 'destructive' | 'review-required' | 'ambiguous' | 'malformed-operation' | 'custom-sql' | 'capability' | 'non-canonical';
5
+ type DdlDiagnosticCode = "invalid-plan" | "blocked-plan" | "decision-required" | "dialect-mismatch" | "unsupported" | "server-version" | "lock-conflict" | "transaction-conflict" | "lossy" | "unknown" | "destructive" | "review-required" | "ambiguous" | "malformed-operation" | "custom-sql" | "capability" | "non-canonical";
6
6
  /** A path-addressed finding from DDL preflight or rendering. */
7
7
  interface DdlDiagnostic {
8
8
  readonly code: DdlDiagnosticCode;
9
- readonly severity: 'error' | 'warning';
9
+ readonly severity: "error" | "warning";
10
10
  readonly message: string;
11
11
  readonly operationId?: string;
12
12
  readonly path: readonly (string | number)[];
13
- readonly kind?: MigrationOperation['kind'];
13
+ readonly kind?: MigrationOperation["kind"];
14
14
  readonly dialect?: string;
15
15
  readonly requiredVersion?: string;
16
16
  readonly actualVersion?: string;
@@ -21,7 +21,7 @@ interface DdlDiagnostic {
21
21
  interface DdlStatement {
22
22
  readonly operationId: string;
23
23
  readonly position: number;
24
- readonly kind: MigrationOperation['kind'];
24
+ readonly kind: MigrationOperation["kind"];
25
25
  /** SQL text with dialect placeholders, if a dialect ever needs them. */
26
26
  readonly sql: string;
27
27
  /** Alias for callers that use the query renderer's terminology. */
@@ -44,9 +44,9 @@ interface DdlEmissionOptions {
44
44
  /** Server version used for syntax checks, such as SQLite DROP COLUMN. */
45
45
  readonly serverVersion?: string | number;
46
46
  /** Whether the caller will wrap statements in one transaction. */
47
- readonly transaction?: 'managed' | 'autocommit' | 'none';
47
+ readonly transaction?: "managed" | "autocommit" | "none";
48
48
  /** Maximum lock the caller can acquire for this migration. */
49
- readonly lock?: Exclude<MigrationLockRequirement, 'unknown'>;
49
+ readonly lock?: Exclude<MigrationLockRequirement, "unknown">;
50
50
  }
51
51
  /** Result of preflight plus deterministic statement rendering. */
52
52
  interface DdlEmission {
@@ -70,12 +70,12 @@ interface DdlEmitter {
70
70
  //#endregion
71
71
  //#region src/ddl/emitter.d.ts
72
72
  interface DdlFeatures {
73
- readonly dialect: 'postgresql' | 'sqlite' | 'mysql';
73
+ readonly dialect: "postgresql" | "sqlite" | "mysql";
74
74
  readonly supports: ReadonlySet<string>;
75
75
  }
76
76
  /**
77
- * Build the shared strict preflight and rendering boundary for one engine.
78
- * The renderer only receives a validated MigrationPlan and a SchemaDialect.
77
+ * Build the shared strict preflight and rendering boundary for one engine. The renderer only
78
+ * receives a validated MigrationPlan and a SchemaDialect.
79
79
  */
80
80
  declare function createDdlEmitter(features: DdlFeatures): DdlEmitter;
81
81
  //#endregion
@@ -110,8 +110,8 @@ declare function ddlEmitterForDialect(dialect: SchemaDialect): DdlEmitter;
110
110
  declare function emitMigrationPlan(plan: MigrationPlan, dialect: SchemaDialect, options?: DdlEmissionOptions): DdlEmission;
111
111
  /** Convenient defaults for callers that already selected a plan dialect. */
112
112
  declare const ddlDialects: Readonly<{
113
- postgresql: SchemaDialect<"json" | "ilike" | "on-conflict" | "row-locking">;
114
- sqlite: SchemaDialect<"json" | "on-conflict">;
113
+ postgresql: SchemaDialect<"on-conflict" | "json" | "ilike" | "row-locking">;
114
+ sqlite: SchemaDialect<"on-conflict" | "json">;
115
115
  mysql: SchemaDialect<"json" | "row-locking">;
116
116
  }>;
117
117
  //#endregion
package/dist/ddl.mjs CHANGED
@@ -1,6 +1,5 @@
1
- import { n as sqliteSchemaDialect } from "./sqlite-BU6DBxef.mjs";
2
- import { n as postgresSchemaDialect } from "./postgres-DEBBeh52.mjs";
3
- import { n as mysqlSchemaDialect } from "./mysql-DqkqXB6A.mjs";
1
+ import { n as sqliteSchemaDialect } from "./sqlite-Cg0nwYEH.mjs";
2
+ import { n as mysqlSchemaDialect, s as postgresSchemaDialect } from "./mysql-B_cYzzX2.mjs";
4
3
  import { assertMigrationPlan } from "./migration.mjs";
5
4
  //#region src/ddl/emitter.ts
6
5
  const objectKinds = /* @__PURE__ */ new Set([
@@ -32,8 +31,8 @@ const lockRank = {
32
31
  exclusive: 2
33
32
  };
34
33
  /**
35
- * Build the shared strict preflight and rendering boundary for one engine.
36
- * The renderer only receives a validated MigrationPlan and a SchemaDialect.
34
+ * Build the shared strict preflight and rendering boundary for one engine. The renderer only
35
+ * receives a validated MigrationPlan and a SchemaDialect.
37
36
  */
38
37
  function createDdlEmitter(features) {
39
38
  const emitter = {
@@ -286,7 +285,7 @@ function isOperationSupported(features, operation) {
286
285
  function renderOperation(operation, operations, dialect, features) {
287
286
  if (operation.type === "custom-sql") return normalizeSql(operation.customSql?.sql ?? "");
288
287
  const object = operation.type === "remove" ? operation.origin?.before : operation.origin?.after ?? operation.origin?.before;
289
- if (object === void 0) return void 0;
288
+ if (object === void 0) return;
290
289
  const value = object.value;
291
290
  switch (operation.type) {
292
291
  case "add": return renderAdd(operation, value, operations, dialect, features);
@@ -297,7 +296,7 @@ function renderOperation(operation, operations, dialect, features) {
297
296
  }
298
297
  }
299
298
  function renderAdd(operation, value, operations, dialect, features) {
300
- if (!isRecord(value)) return void 0;
299
+ if (!isRecord(value)) return;
301
300
  const name = requiredName(operation, value);
302
301
  switch (operation.kind) {
303
302
  case "namespace": return features.dialect === "postgresql" ? `CREATE SCHEMA ${dialect.quoteIdentifier(name)}` : void 0;
@@ -322,7 +321,7 @@ function renderAdd(operation, value, operations, dialect, features) {
322
321
  }
323
322
  }
324
323
  function renderRemove(operation, value, operations, dialect, features) {
325
- if (!isRecord(value)) return void 0;
324
+ if (!isRecord(value)) return;
326
325
  const name = requiredName(operation, value);
327
326
  switch (operation.kind) {
328
327
  case "namespace": return features.dialect === "postgresql" ? `DROP SCHEMA ${dialect.quoteIdentifier(name)}` : void 0;
@@ -350,7 +349,7 @@ function renderRemove(operation, value, operations, dialect, features) {
350
349
  }
351
350
  }
352
351
  function renderPropertyChange(operation, value, operations, dialect, features) {
353
- if (!isRecord(value)) return void 0;
352
+ if (!isRecord(value)) return;
354
353
  if (operation.kind === "comment" || operation.kind === "ownership") return operation.kind === "comment" ? renderComment(operation, value, dialect, features) : renderOwnership(operation, value, dialect, features);
355
354
  if (operation.kind === "column") return renderAlterColumn(operation, value, operations, dialect, features);
356
355
  if (operation.kind === "index") {
@@ -374,7 +373,7 @@ function renderPropertyChange(operation, value, operations, dialect, features) {
374
373
  function renderRename(operation, operations, dialect, features) {
375
374
  const before = operation.origin?.before;
376
375
  const after = operation.origin?.after;
377
- if (before === void 0 || after === void 0) return void 0;
376
+ if (before === void 0 || after === void 0) return;
378
377
  const oldName = requiredValueName(before.value);
379
378
  const newName = requiredValueName(after.value);
380
379
  const oldQualified = qualifiedName(operation, oldName, dialect);
@@ -842,7 +841,7 @@ function requiredValueName(value) {
842
841
  }
843
842
  function operationName(operation, value) {
844
843
  if (operation.kind === "namespace" && isRecord(value)) return stringValue(value.name);
845
- if (!isRecord(value)) return void 0;
844
+ if (!isRecord(value)) return;
846
845
  return operation.physicalName ?? stringValue(value.physicalName) ?? stringValue(value.id);
847
846
  }
848
847
  function requiresPhysicalName(kind) {
@@ -931,7 +930,7 @@ function stringArray(value) {
931
930
  return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
932
931
  }
933
932
  function expressionValue(value) {
934
- if (!isRecord(value) || value.kind !== "expression" || typeof value.sql !== "string" || typeof value.expressionKind !== "string") return void 0;
933
+ if (!isRecord(value) || value.kind !== "expression" || typeof value.sql !== "string" || typeof value.expressionKind !== "string") return;
935
934
  return value;
936
935
  }
937
936
  function expressionsIn(value) {
@@ -1001,11 +1000,11 @@ function dollarQuote(sql) {
1001
1000
  }
1002
1001
  function parseVersion(value) {
1003
1002
  if (typeof value === "number") {
1004
- if (!Number.isFinite(value) || value < 0) return void 0;
1003
+ if (!Number.isFinite(value) || value < 0) return;
1005
1004
  value = String(value);
1006
1005
  }
1007
1006
  const match = value.trim().match(/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?/iu);
1008
- if (match === null) return void 0;
1007
+ if (match === null) return;
1009
1008
  return match.slice(1).filter((item) => item !== void 0).map((item) => Number(item));
1010
1009
  }
1011
1010
  function compareVersion(left, right) {
@@ -1,7 +1,7 @@
1
1
  //#region src/schema/dialect.ts
2
2
  /**
3
- * Add schema behavior to an existing query dialect without rebuilding any of
4
- * its identifier, literal, placeholder, JSON, cast, or capability policies.
3
+ * Add schema behavior to an existing query dialect without rebuilding any of its identifier,
4
+ * literal, placeholder, JSON, cast, or capability policies.
5
5
  */
6
6
  function createSchemaDialect(queryDialect, schema) {
7
7
  return Object.freeze({
package/dist/diff.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { C as SnapshotDiffPropertyChange, D as SnapshotRenameTarget, E as SnapshotRenameSuggestion, S as SnapshotDiffPath, T as SnapshotRenameHintResult, _ as SnapshotDiffObjectKind, a as diffSnapshots, b as SnapshotDiffOperationType, c as validateRenameHints, d as SnapshotDiffDecodeResult, f as SnapshotDiffDiagnostic, g as SnapshotDiffObject, h as SnapshotDiffInput, i as decodeSnapshotRenameHints, l as validateSnapshotRenameHints, m as SnapshotDiffEvidence, n as decodeRenameHints, o as encodeRenameHints, p as SnapshotDiffDiagnosticCode, r as decodeSnapshotForDiff, s as encodeSnapshotRenameHints, t as compareSnapshots, u as SnapshotDiff, v as SnapshotDiffObjectReference, w as SnapshotRenameHint, x as SnapshotDiffOptions, y as SnapshotDiffOperation } from "./index-CqWnouTK.mjs";
1
+ import { C as SnapshotDiffPropertyChange, D as SnapshotRenameTarget, E as SnapshotRenameSuggestion, S as SnapshotDiffPath, T as SnapshotRenameHintResult, _ as SnapshotDiffObjectKind, a as diffSnapshots, b as SnapshotDiffOperationType, c as validateRenameHints, d as SnapshotDiffDecodeResult, f as SnapshotDiffDiagnostic, g as SnapshotDiffObject, h as SnapshotDiffInput, i as decodeSnapshotRenameHints, l as validateSnapshotRenameHints, m as SnapshotDiffEvidence, n as decodeRenameHints, o as encodeRenameHints, p as SnapshotDiffDiagnosticCode, r as decodeSnapshotForDiff, s as encodeSnapshotRenameHints, t as compareSnapshots, u as SnapshotDiff, v as SnapshotDiffObjectReference, w as SnapshotRenameHint, x as SnapshotDiffOptions, y as SnapshotDiffOperation } from "./index-CPvfEheG.mjs";
2
2
  export { SnapshotDiff, SnapshotDiffDecodeResult, SnapshotDiffDiagnostic, SnapshotDiffDiagnosticCode, SnapshotDiffEvidence, SnapshotDiffInput, SnapshotDiffObject, SnapshotDiffObjectKind, SnapshotDiffObjectReference, SnapshotDiffOperation, SnapshotDiffOperationType, SnapshotDiffOptions, SnapshotDiffPath, SnapshotDiffPropertyChange, SnapshotRenameHint, SnapshotRenameHintResult, SnapshotRenameSuggestion, SnapshotRenameTarget, compareSnapshots, decodeRenameHints, decodeSnapshotForDiff, decodeSnapshotRenameHints, diffSnapshots, encodeRenameHints, encodeSnapshotRenameHints, validateRenameHints, validateSnapshotRenameHints };
package/dist/diff.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as toSnapshotJsonValue, i as schemaSnapshotDigest, l as decodeSchemaSnapshot, n as canonicalJson } from "./canonical-BbnqavJm.mjs";
2
- import { c as decodeCompleteSchemaSnapshot, s as completeSchemaSnapshotDigest } from "./complete-D5Djh-zo.mjs";
1
+ import { a as toSnapshotJsonValue, i as schemaSnapshotDigest, l as decodeSchemaSnapshot, n as canonicalJson } from "./canonical-BXUguqfo.mjs";
2
+ import { c as decodeCompleteSchemaSnapshot, s as completeSchemaSnapshotDigest } from "./complete-WYyVozgK.mjs";
3
3
  //#region src/diff/diff.ts
4
4
  const objectKinds = /* @__PURE__ */ new Set([
5
5
  "namespace",
@@ -32,9 +32,8 @@ const operationOrder = /* @__PURE__ */ new Map([
32
32
  /**
33
33
  * Compare Snapshot v1 or v2 values and return immutable, reviewable data.
34
34
  *
35
- * The function never opens a connection, renders SQL, or turns a heuristic
36
- * match into a rename. Invalid input and malformed hints are represented by
37
- * diagnostics in the returned value.
35
+ * The function never opens a connection, renders SQL, or turns a heuristic match into a rename.
36
+ * Invalid input and malformed hints are represented by diagnostics in the returned value.
38
37
  */
39
38
  function diffSnapshots(beforeInput, afterInput, options = {}) {
40
39
  const diagnostics = [];
@@ -568,7 +567,7 @@ function operationForMatch(match, diagnostics) {
568
567
  source: match.source,
569
568
  destructive: false
570
569
  });
571
- if (effectiveChanges.length === 0) return void 0;
570
+ if (effectiveChanges.length === 0) return;
572
571
  const destructive = effectiveChanges.some(isDestructiveProperty);
573
572
  if (destructive) diagnostics.push(diffDiagnostic("destructive", `Property changes on ${before.kind} "${before.id}" may remove or narrow existing data`, before.path, {
574
573
  kind: before.kind,
@@ -819,7 +818,7 @@ function normalizeRenameTarget(value, path, diagnostics) {
819
818
  diagnostics.push(diffDiagnostic("invalid-rename-hint", "Rename target needs an id, physicalName, or path", path));
820
819
  return;
821
820
  }
822
- if (id !== void 0 && (typeof id !== "string" || id.length === 0) || physicalName !== void 0 && (typeof physicalName !== "string" || physicalName.length === 0) || targetPath !== void 0 && !isPath(targetPath)) return void 0;
821
+ if (id !== void 0 && (typeof id !== "string" || id.length === 0) || physicalName !== void 0 && (typeof physicalName !== "string" || physicalName.length === 0) || targetPath !== void 0 && !isPath(targetPath)) return;
823
822
  return freeze({
824
823
  ...typeof id === "string" ? { id } : {},
825
824
  ...typeof physicalName === "string" ? { physicalName } : {},