qubu 0.4.0 → 0.4.2

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 (103) 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-BavBtv8J.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-DH0qV6aS.d.mts → index-1DpA3mUh.d.mts} +20 -20
  15. package/dist/{index-D3ZOwPT-.d.mts → index-CPvfEheG.d.mts} +13 -15
  16. package/dist/index.d.mts +1 -1
  17. package/dist/index.mjs +94 -95
  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-CKEKGnj4.mjs → mysql-B_cYzzX2.mjs} +237 -7
  24. package/dist/mysql.d.mts +2 -2
  25. package/dist/mysql.mjs +3 -3
  26. package/dist/{on-conflict-4MOBl51J.mjs → on-conflict-hfPW0KmQ.mjs} +3 -4
  27. package/dist/postgres.d.mts +5 -5
  28. package/dist/postgres.mjs +6 -6
  29. package/dist/{registry-CXV8u7Pt.mjs → registry-BRMLYwDp.mjs} +26 -29
  30. package/dist/{relational-DuQ9IHSb.mjs → relational-BZ3WDPzC.mjs} +2 -2
  31. package/dist/schema.d.mts +1 -1
  32. package/dist/schema.mjs +5 -6
  33. package/dist/{snapshot-DJpfmxhQ.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-DGO3DRgg.mjs → source-BcS2AsIg.mjs} +6 -8
  37. package/dist/{serialize-CFtYYAdk.mjs → sqlite-Cg0nwYEH.mjs} +326 -12
  38. package/dist/sqlite.d.mts +1 -1
  39. package/dist/sqlite.mjs +2 -2
  40. package/dist/{standard-BTVYKh_F.mjs → standard-DfcZEVOj.mjs} +1 -1
  41. package/dist/{table-D6rcs8SB.mjs → table-Bp5irMSj.mjs} +2 -3
  42. package/dist/{types-Deo_q43Y.d.mts → types-BK1COGZe.d.mts} +1113 -1128
  43. package/dist/{types-g-vVvj1B.mjs → types-JM3FcAnX.mjs} +7 -8
  44. package/dist/{types-CSNJTYaM.d.mts → types-JSZHpUEj.d.mts} +83 -84
  45. package/dist/{value-b6OFZXVS.mjs → value-Bi71Agyf.mjs} +1 -1
  46. package/dist/vite/ambient.d.ts +309 -340
  47. package/dist/vite.d.mts +5 -6
  48. package/dist/vite.mjs +3 -4
  49. package/docs/dialects-and-execution.md +45 -55
  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 +26 -26
  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-D-8OqGuV.mjs +0 -328
  90. package/dist/column-LV7oGQde.mjs +0 -296
  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 -57
  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/postgres-BK2APkKP.mjs +0 -236
  101. package/dist/runtime-Cn_Xgzta.mjs +0 -193
  102. package/dist/sqlite-CrsK0Fza.mjs +0 -320
  103. package/dist/types-DZsueVoI.d.mts +0 -45
@@ -1,8 +1,7 @@
1
- import { s as resolveCastTarget } from "./json-CUZlv4HT.mjs";
2
- import { t as standardDialect } from "./standard-BTVYKh_F.mjs";
3
- import { C as fragment, v as makeExpression, y as makeSchemaExpression } from "./column-D-8OqGuV.mjs";
4
- import { a as columnResultValue } from "./column-LV7oGQde.mjs";
5
- import { t as asValue } from "./value-b6OFZXVS.mjs";
1
+ import { s as resolveCastTarget } from "./json-Db7XRD91.mjs";
2
+ import { t as standardDialect } from "./standard-DfcZEVOj.mjs";
3
+ import { H as makeSchemaExpression, K as fragment, V as makeExpression, u as columnResultValue } from "./column-hqKr7-1I.mjs";
4
+ import { t as asValue } from "./value-Bi71Agyf.mjs";
6
5
  //#region src/core/render.ts
7
6
  function render(query, options = {}) {
8
7
  const dialect = isDialect(options) ? options : options.dialect ?? standardDialect();
@@ -82,9 +81,9 @@ function call(name, ...args) {
82
81
  });
83
82
  }
84
83
  /**
85
- * Internal built-in function constructor for deterministic schema functions.
86
- * Arbitrary calls stay on {@link call} and require an explicit schema
87
- * extension contract before they can be used in schema metadata.
84
+ * Internal built-in function constructor for deterministic schema functions. Arbitrary calls stay
85
+ * on {@link call} and require an explicit schema extension contract before they can be used in
86
+ * schema metadata.
88
87
  */
89
88
  function schemaCall(name, ...args) {
90
89
  routineName(name);
@@ -1,4 +1,4 @@
1
- import { n as SchemaSnapshot } from "./types-Deo_q43Y.mjs";
1
+ import { n as SchemaSnapshot } from "./types-BK1COGZe.mjs";
2
2
  //#region src/introspection/connection.d.ts
3
3
  /** A parameterized statement owned by a catalog adapter. */
4
4
  interface CatalogQuery {
@@ -15,10 +15,9 @@ interface CatalogQueryOptions {
15
15
  /**
16
16
  * User-owned catalog query boundary.
17
17
  *
18
- * Qubu does not select a driver, open or close a connection, manage a pool,
19
- * authenticate, retry, start a transaction, or impose a timeout. The
20
- * connection only executes fixed, parameterized catalog statements and
21
- * returns already-decoded row records.
18
+ * Qubu does not select a driver, open or close a connection, manage a pool, authenticate, retry,
19
+ * start a transaction, or impose a timeout. The connection only executes fixed, parameterized
20
+ * catalog statements and returns already-decoded row records.
22
21
  */
23
22
  interface CatalogConnection {
24
23
  readonly dialect: CatalogDialect;
@@ -27,9 +26,9 @@ interface CatalogConnection {
27
26
  //#endregion
28
27
  //#region src/introspection/diagnostics.d.ts
29
28
  /** Stable severity levels for discovery and normalization findings. */
30
- type IntrospectionDiagnosticSeverity = 'error' | 'warning' | 'info';
29
+ type IntrospectionDiagnosticSeverity = "error" | "warning" | "info";
31
30
  /** Stable codes emitted by catalog discovery and normalization. */
32
- type IntrospectionDiagnosticCode = 'connection-failed' | 'query-failed' | 'permission-denied' | 'unsupported-product' | 'unsupported-server' | 'unsupported-feature' | 'invalid-catalog-row' | 'missing-catalog-row' | 'expression-parse-failed' | 'unresolved-reference' | 'ambiguous-identity' | 'unmodeled-object' | 'lossy-mapping' | 'dialect-mismatch' | 'partial-result';
31
+ type IntrospectionDiagnosticCode = "connection-failed" | "query-failed" | "permission-denied" | "unsupported-product" | "unsupported-server" | "unsupported-feature" | "invalid-catalog-row" | "missing-catalog-row" | "expression-parse-failed" | "unresolved-reference" | "ambiguous-identity" | "unmodeled-object" | "lossy-mapping" | "dialect-mismatch" | "partial-result";
33
32
  /** A path-addressed diagnostic from catalog discovery or normalization. */
34
33
  interface IntrospectionDiagnostic {
35
34
  readonly severity: IntrospectionDiagnosticSeverity;
@@ -47,8 +46,8 @@ interface IntrospectionDiagnostic {
47
46
  /** Input accepted by {@link createIntrospectionDiagnostic}. */
48
47
  type IntrospectionDiagnosticInput = IntrospectionDiagnostic;
49
48
  /**
50
- * Create one immutable diagnostic without interpreting catalog text or
51
- * copying driver error details into the structured fields.
49
+ * Create one immutable diagnostic without interpreting catalog text or copying driver error details
50
+ * into the structured fields.
52
51
  */
53
52
  declare function createIntrospectionDiagnostic(diagnostic: IntrospectionDiagnosticInput): IntrospectionDiagnostic;
54
53
  /** Return whether a diagnostic list prevents strict introspection output. */
@@ -63,9 +62,9 @@ declare class IntrospectionError extends Error {
63
62
  //#endregion
64
63
  //#region src/introspection/identity.d.ts
65
64
  /** The source selected by the stable introspection identity precedence. */
66
- type CatalogIdentitySource = 'explicit-hint' | 'previous-snapshot' | 'physical-name' | 'deterministic-fallback';
65
+ type CatalogIdentitySource = "explicit-hint" | "previous-snapshot" | "physical-name" | "deterministic-fallback";
67
66
  /** Entity kinds for which a caller may provide a logical identity hint. */
68
- type CatalogIdentityEntityKind = Exclude<CatalogEntityKind, 'namespace' | 'deferred-object'>;
67
+ type CatalogIdentityEntityKind = Exclude<CatalogEntityKind, "namespace" | "deferred-object">;
69
68
  /** A physical selector for one table-scoped or namespace-scoped entity. */
70
69
  interface CatalogIdentityHint {
71
70
  readonly kind: CatalogIdentityEntityKind;
@@ -79,7 +78,7 @@ interface CatalogIdentityHint {
79
78
  /** The caller-provided identity hints accepted by an introspection run. */
80
79
  type CatalogIdentityHints = readonly CatalogIdentityHint[];
81
80
  /** How invalid physical names become deterministic logical IDs. */
82
- type CatalogIdentityFallback = 'escaped' | 'hashed';
81
+ type CatalogIdentityFallback = "escaped" | "hashed";
83
82
  /** Versioned metadata for the identity policy used by one introspection run. */
84
83
  interface CatalogIdentityPolicy {
85
84
  readonly name: string;
@@ -95,8 +94,8 @@ interface CatalogResolvedIdentity {
95
94
  readonly source: CatalogIdentitySource;
96
95
  }
97
96
  /**
98
- * Inputs used when carrying a prior snapshot's table and column IDs forward.
99
- * The resolver must match physical names inside the selected namespace only.
97
+ * Inputs used when carrying a prior snapshot's table and column IDs forward. The resolver must
98
+ * match physical names inside the selected namespace only.
100
99
  */
101
100
  interface CatalogPreviousSnapshotIdentitySource {
102
101
  readonly snapshot: SchemaSnapshot;
@@ -104,11 +103,11 @@ interface CatalogPreviousSnapshotIdentitySource {
104
103
  //#endregion
105
104
  //#region src/introspection/types.d.ts
106
105
  /** SQL engines supported by the common catalog contract. */
107
- type CatalogDialect = 'postgresql' | 'sqlite' | 'mysql';
106
+ type CatalogDialect = "postgresql" | "sqlite" | "mysql";
108
107
  /** A decoded row returned by a user-owned catalog connection. */
109
108
  type CatalogQueryRow = Readonly<Record<string, unknown>>;
110
109
  /** Physical objects that can receive stable logical IDs. */
111
- type CatalogEntityKind = 'namespace' | 'table' | 'column' | 'constraint' | 'index' | 'view' | 'materialized-view' | 'sequence' | 'enum' | 'domain' | 'collation' | 'trigger' | 'routine' | 'partition' | 'policy' | 'extension' | 'comment' | 'ownership' | 'opaque-object' | 'deferred-object';
110
+ type CatalogEntityKind = "namespace" | "table" | "column" | "constraint" | "index" | "view" | "materialized-view" | "sequence" | "enum" | "domain" | "collation" | "trigger" | "routine" | "partition" | "policy" | "extension" | "comment" | "ownership" | "opaque-object" | "deferred-object";
112
111
  /** A scalar value retained as catalog data rather than executable SQL. */
113
112
  type CatalogScalar = null | boolean | string | number | bigint;
114
113
  /** Plain catalog data used for dialect extensions and unknown fields. */
@@ -122,8 +121,8 @@ interface CatalogCatalogReference {
122
121
  readonly value: string | number;
123
122
  }
124
123
  /**
125
- * A physical object reference with an optional current-run catalog key.
126
- * PostgreSQL OIDs and similar values belong in `catalog`, not in logical IDs.
124
+ * A physical object reference with an optional current-run catalog key. PostgreSQL OIDs and similar
125
+ * values belong in `catalog`, not in logical IDs.
127
126
  */
128
127
  interface CatalogReference {
129
128
  readonly kind: CatalogEntityKind;
@@ -133,7 +132,7 @@ interface CatalogReference {
133
132
  readonly catalog?: CatalogCatalogReference;
134
133
  }
135
134
  /** Where an opaque catalog SQL expression came from. */
136
- type CatalogProvenanceKind = 'catalog' | 'decompiler' | 'create-sql';
135
+ type CatalogProvenanceKind = "catalog" | "decompiler" | "create-sql";
137
136
  /** Source location retained with catalog-derived SQL text. */
138
137
  interface CatalogProvenance {
139
138
  readonly kind: CatalogProvenanceKind;
@@ -142,24 +141,24 @@ interface CatalogProvenance {
142
141
  readonly path?: readonly (string | number)[];
143
142
  }
144
143
  /**
145
- * Opaque SQL text recovered from catalog metadata. It has no evaluator or
146
- * Qubu expression implementation and must not be executed by introspection.
144
+ * Opaque SQL text recovered from catalog metadata. It has no evaluator or Qubu expression
145
+ * implementation and must not be executed by introspection.
147
146
  */
148
147
  interface CatalogSqlExpression {
149
- readonly kind: 'sql';
148
+ readonly kind: "sql";
150
149
  readonly dialect: CatalogDialect;
151
150
  readonly text: string;
152
151
  readonly provenance: CatalogProvenance;
153
152
  }
154
153
  /** A literal catalog fact with optional source provenance. */
155
154
  interface CatalogLiteralFact {
156
- readonly kind: 'literal';
155
+ readonly kind: "literal";
157
156
  readonly value: CatalogScalar;
158
157
  readonly provenance?: CatalogProvenance;
159
158
  }
160
159
  /** A catalog fact whose value remains opaque dialect SQL. */
161
160
  interface CatalogExpressionFact {
162
- readonly kind: 'expression';
161
+ readonly kind: "expression";
163
162
  readonly expression: CatalogSqlExpression;
164
163
  }
165
164
  /** Tagged data used by defaults, identity options, and dialect metadata. */
@@ -172,12 +171,12 @@ interface CatalogUnknownField {
172
171
  }
173
172
  /** A reference to an object in the normalized catalog. */
174
173
  interface CatalogObjectReference {
175
- readonly kind: Exclude<CatalogEntityKind, 'namespace'>;
174
+ readonly kind: Exclude<CatalogEntityKind, "namespace">;
176
175
  readonly id: string;
177
176
  }
178
177
  /** A comment observed for a physical catalog object. */
179
178
  interface CatalogComment {
180
- readonly kind: 'comment';
179
+ readonly kind: "comment";
181
180
  readonly id: string;
182
181
  readonly object: CatalogObjectReference;
183
182
  readonly text: string;
@@ -188,7 +187,7 @@ interface CatalogComment {
188
187
  }
189
188
  /** Ownership metadata observed for a physical catalog object. */
190
189
  interface CatalogOwnership {
191
- readonly kind: 'ownership';
190
+ readonly kind: "ownership";
192
191
  readonly id: string;
193
192
  readonly object: CatalogObjectReference;
194
193
  readonly owner: string;
@@ -205,7 +204,7 @@ interface CatalogObjectMetadata {
205
204
  }
206
205
  /** Common identity and physical-name fields for complete catalog objects. */
207
206
  interface CatalogObjectBase extends CatalogObjectMetadata {
208
- readonly kind: Exclude<CatalogEntityKind, 'namespace'>;
207
+ readonly kind: Exclude<CatalogEntityKind, "namespace">;
209
208
  readonly id: string;
210
209
  readonly identitySource: CatalogIdentitySource;
211
210
  readonly physicalName: string;
@@ -214,9 +213,9 @@ interface CatalogObjectBase extends CatalogObjectMetadata {
214
213
  readonly unknownFields?: readonly CatalogUnknownField[];
215
214
  }
216
215
  /** Portable classification retained beside an exact native declaration. */
217
- type CatalogPortableStorageType = 'integer' | 'numeric' | 'text' | 'boolean' | 'date' | 'timestamp' | 'uuid' | 'json' | 'bigint' | 'binary';
216
+ type CatalogPortableStorageType = "integer" | "numeric" | "text" | "boolean" | "date" | "timestamp" | "uuid" | "json" | "bigint" | "binary";
218
217
  /** Confidence for a portable classification, never a replacement for native type text. */
219
- type CatalogClassificationConfidence = 'exact' | 'inferred' | 'unknown';
218
+ type CatalogClassificationConfidence = "exact" | "inferred" | "unknown";
220
219
  /** Exact native storage plus an optional portable classification. */
221
220
  interface CatalogStorageType {
222
221
  readonly nativeType: string;
@@ -227,14 +226,14 @@ interface CatalogStorageType {
227
226
  }
228
227
  /** A generated-column expression and its recovered storage mode. */
229
228
  interface CatalogGeneratedColumn {
230
- readonly kind: 'generated';
229
+ readonly kind: "generated";
231
230
  readonly expression: CatalogSqlExpression;
232
- readonly mode: 'stored' | 'virtual' | 'unknown';
231
+ readonly mode: "stored" | "virtual" | "unknown";
233
232
  }
234
233
  /** Identity behavior kept separate from defaults and generated expressions. */
235
234
  interface CatalogIdentity {
236
- readonly kind: 'identity';
237
- readonly generation: 'always' | 'by-default';
235
+ readonly kind: "identity";
236
+ readonly generation: "always" | "by-default";
238
237
  readonly options: Readonly<Record<string, CatalogValueFact>>;
239
238
  readonly dialect?: CatalogDialectExtension;
240
239
  }
@@ -250,13 +249,13 @@ interface CatalogCapabilities {
250
249
  readonly generatedColumns: boolean;
251
250
  readonly identityMetadata: boolean;
252
251
  readonly checkConstraints: boolean;
253
- readonly checkConstraintEnforcement: 'enforced' | 'metadata-only' | 'unknown';
252
+ readonly checkConstraintEnforcement: "enforced" | "metadata-only" | "unknown";
254
253
  readonly expressionDecompilation: boolean;
255
254
  readonly indexExpressions: boolean;
256
255
  readonly indexPredicates: boolean;
257
256
  readonly indexIncludedColumns: boolean;
258
257
  readonly namespaces: boolean;
259
- readonly visibility: 'complete' | 'limited' | 'unknown';
258
+ readonly visibility: "complete" | "limited" | "unknown";
260
259
  readonly [capability: string]: boolean | string;
261
260
  }
262
261
  /** Server product, raw version text, parsed version, and adapter capabilities. */
@@ -268,7 +267,7 @@ interface CatalogServerInfo {
268
267
  }
269
268
  /** The one physical namespace selected for a catalog run. */
270
269
  interface CatalogNamespace {
271
- readonly kind: 'postgres-schema' | 'sqlite-database' | 'mysql-database';
270
+ readonly kind: "postgres-schema" | "sqlite-database" | "mysql-database";
272
271
  readonly name: string;
273
272
  readonly reference?: CatalogReference;
274
273
  readonly provenance?: CatalogProvenance;
@@ -279,20 +278,20 @@ interface CatalogNamespace {
279
278
  }
280
279
  /** A logical reference used for normalized cross-object relationships. */
281
280
  interface CatalogEntityReference {
282
- readonly kind: Exclude<CatalogEntityKind, 'namespace' | 'deferred-object'>;
281
+ readonly kind: Exclude<CatalogEntityKind, "namespace" | "deferred-object">;
283
282
  readonly id: string;
284
283
  readonly tableId?: string;
285
284
  }
286
285
  /** A primary key constraint in the normalized catalog. */
287
286
  interface CatalogPrimaryKeyConstraint extends CatalogObjectMetadata {
288
- readonly kind: 'primary-key';
287
+ readonly kind: "primary-key";
289
288
  readonly id: string;
290
289
  readonly identitySource: CatalogIdentitySource;
291
290
  readonly physicalName?: string;
292
291
  readonly columns: readonly string[];
293
292
  readonly backingIndex?: CatalogEntityReference;
294
293
  readonly deferrable?: boolean;
295
- readonly initially?: 'immediate' | 'deferred';
294
+ readonly initially?: "immediate" | "deferred";
296
295
  readonly validated?: boolean;
297
296
  readonly reference?: CatalogReference;
298
297
  readonly dialect?: CatalogDialectExtension;
@@ -300,15 +299,15 @@ interface CatalogPrimaryKeyConstraint extends CatalogObjectMetadata {
300
299
  }
301
300
  /** A unique constraint, including nullable uniqueness semantics. */
302
301
  interface CatalogUniqueConstraint extends CatalogObjectMetadata {
303
- readonly kind: 'unique';
302
+ readonly kind: "unique";
304
303
  readonly id: string;
305
304
  readonly identitySource: CatalogIdentitySource;
306
305
  readonly physicalName?: string;
307
306
  readonly columns: readonly string[];
308
- readonly nulls: 'distinct' | 'not-distinct';
307
+ readonly nulls: "distinct" | "not-distinct";
309
308
  readonly backingIndex?: CatalogEntityReference;
310
309
  readonly deferrable?: boolean;
311
- readonly initially?: 'immediate' | 'deferred';
310
+ readonly initially?: "immediate" | "deferred";
312
311
  readonly validated?: boolean;
313
312
  readonly reference?: CatalogReference;
314
313
  readonly dialect?: CatalogDialectExtension;
@@ -321,17 +320,17 @@ interface CatalogForeignKeyTarget {
321
320
  }
322
321
  /** A foreign key with ordered columns and referential actions. */
323
322
  interface CatalogForeignKeyConstraint extends CatalogObjectMetadata {
324
- readonly kind: 'foreign-key';
323
+ readonly kind: "foreign-key";
325
324
  readonly id: string;
326
325
  readonly identitySource: CatalogIdentitySource;
327
326
  readonly physicalName?: string;
328
327
  readonly columns: readonly string[];
329
328
  readonly target: CatalogForeignKeyTarget;
330
- readonly onUpdate?: 'no-action' | 'restrict' | 'cascade' | 'set-null' | 'set-default';
331
- readonly onDelete?: 'no-action' | 'restrict' | 'cascade' | 'set-null' | 'set-default';
332
- readonly match?: 'simple' | 'full' | 'partial';
329
+ readonly onUpdate?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
330
+ readonly onDelete?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
331
+ readonly match?: "simple" | "full" | "partial";
333
332
  readonly deferrable?: boolean;
334
- readonly initially?: 'immediate' | 'deferred';
333
+ readonly initially?: "immediate" | "deferred";
335
334
  readonly validated?: boolean;
336
335
  readonly reference?: CatalogReference;
337
336
  readonly dialect?: CatalogDialectExtension;
@@ -339,13 +338,13 @@ interface CatalogForeignKeyConstraint extends CatalogObjectMetadata {
339
338
  }
340
339
  /** A check constraint whose expression remains tagged catalog SQL. */
341
340
  interface CatalogCheckConstraint extends CatalogObjectMetadata {
342
- readonly kind: 'check';
341
+ readonly kind: "check";
343
342
  readonly id: string;
344
343
  readonly identitySource: CatalogIdentitySource;
345
344
  readonly physicalName?: string;
346
345
  readonly expression: CatalogSqlExpression;
347
346
  readonly deferrable?: boolean;
348
- readonly initially?: 'immediate' | 'deferred';
347
+ readonly initially?: "immediate" | "deferred";
349
348
  readonly validated?: boolean;
350
349
  readonly reference?: CatalogReference;
351
350
  readonly dialect?: CatalogDialectExtension;
@@ -355,24 +354,24 @@ interface CatalogCheckConstraint extends CatalogObjectMetadata {
355
354
  type CatalogConstraint = CatalogPrimaryKeyConstraint | CatalogUniqueConstraint | CatalogForeignKeyConstraint | CatalogCheckConstraint;
356
355
  /** One ordered column or expression term in a normalized index. */
357
356
  type CatalogIndexTerm = {
358
- readonly kind: 'column';
357
+ readonly kind: "column";
359
358
  readonly column: string;
360
359
  readonly position: number;
361
- readonly direction?: 'ASC' | 'DESC';
362
- readonly nulls?: 'FIRST' | 'LAST';
360
+ readonly direction?: "ASC" | "DESC";
361
+ readonly nulls?: "FIRST" | "LAST";
363
362
  readonly prefixLength?: CatalogValueFact;
364
363
  readonly operatorClass?: string;
365
364
  } | {
366
- readonly kind: 'expression';
365
+ readonly kind: "expression";
367
366
  readonly expression: CatalogSqlExpression;
368
367
  readonly position: number;
369
- readonly direction?: 'ASC' | 'DESC';
370
- readonly nulls?: 'FIRST' | 'LAST';
368
+ readonly direction?: "ASC" | "DESC";
369
+ readonly nulls?: "FIRST" | "LAST";
371
370
  readonly operatorClass?: string;
372
371
  };
373
372
  /** A normalized index with ordered terms and backing relationships. */
374
373
  interface CatalogIndex extends CatalogObjectMetadata {
375
- readonly kind: 'index';
374
+ readonly kind: "index";
376
375
  readonly id: string;
377
376
  readonly identitySource: CatalogIdentitySource;
378
377
  readonly physicalName?: string;
@@ -388,7 +387,7 @@ interface CatalogIndex extends CatalogObjectMetadata {
388
387
  }
389
388
  /** A normalized table containing only ordinary included table metadata. */
390
389
  interface CatalogTable extends CatalogObjectMetadata {
391
- readonly kind: 'table';
390
+ readonly kind: "table";
392
391
  readonly id: string;
393
392
  readonly identitySource: CatalogIdentitySource;
394
393
  readonly physicalName: string;
@@ -402,7 +401,7 @@ interface CatalogTable extends CatalogObjectMetadata {
402
401
  }
403
402
  /** A normalized visible column within an ordinary table. */
404
403
  interface CatalogColumn extends CatalogObjectMetadata {
405
- readonly kind: 'column';
404
+ readonly kind: "column";
406
405
  readonly id: string;
407
406
  readonly identitySource: CatalogIdentitySource;
408
407
  readonly physicalName: string;
@@ -418,10 +417,10 @@ interface CatalogColumn extends CatalogObjectMetadata {
418
417
  readonly unknownFields?: readonly CatalogUnknownField[];
419
418
  }
420
419
  /** Object categories intentionally retained outside Snapshot v1 tables. */
421
- type CatalogDeferredObjectKind = 'view' | 'materialized-view' | 'sequence' | 'enum' | 'domain' | 'collation' | 'routine' | 'trigger' | 'policy' | 'extension' | 'partition' | 'virtual-table' | 'shadow-table' | 'temporary-object' | 'foreign-table' | 'other';
420
+ type CatalogDeferredObjectKind = "view" | "materialized-view" | "sequence" | "enum" | "domain" | "collation" | "routine" | "trigger" | "policy" | "extension" | "partition" | "virtual-table" | "shadow-table" | "temporary-object" | "foreign-table" | "other";
422
421
  /** A deferred or unmodeled object retained for diagnostics and future support. */
423
422
  interface CatalogDeferredObject extends CatalogObjectMetadata {
424
- readonly kind: 'deferred-object';
423
+ readonly kind: "deferred-object";
425
424
  readonly objectKind: CatalogDeferredObjectKind;
426
425
  /** Optional in the legacy reader contract; complete readers should set it. */
427
426
  readonly id?: string;
@@ -439,17 +438,17 @@ interface CatalogDialectExtension {
439
438
  }
440
439
  /** A view or materialized view definition and its exposed columns. */
441
440
  interface CatalogView extends CatalogObjectBase {
442
- readonly kind: 'view' | 'materialized-view';
441
+ readonly kind: "view" | "materialized-view";
443
442
  readonly columns: readonly CatalogColumn[];
444
443
  readonly definition: CatalogSqlExpression;
445
444
  readonly dependencies?: readonly CatalogObjectReference[];
446
- readonly checkOption?: 'none' | 'local' | 'cascaded';
445
+ readonly checkOption?: "none" | "local" | "cascaded";
447
446
  readonly securityBarrier?: boolean;
448
447
  readonly securityInvoker?: boolean;
449
448
  }
450
449
  /** Sequence metadata, including options needed to describe an identity. */
451
450
  interface CatalogSequence extends CatalogObjectBase {
452
- readonly kind: 'sequence';
451
+ readonly kind: "sequence";
453
452
  readonly storage?: CatalogStorageType;
454
453
  readonly start?: CatalogValueFact;
455
454
  readonly increment?: CatalogValueFact;
@@ -468,12 +467,12 @@ interface CatalogEnumValue {
468
467
  }
469
468
  /** A database enum type with stable label ordering. */
470
469
  interface CatalogEnum extends CatalogObjectBase {
471
- readonly kind: 'enum';
470
+ readonly kind: "enum";
472
471
  readonly values: readonly CatalogEnumValue[];
473
472
  }
474
473
  /** A domain type layered over a native storage declaration. */
475
474
  interface CatalogDomain extends CatalogObjectBase {
476
- readonly kind: 'domain';
475
+ readonly kind: "domain";
477
476
  readonly storage: CatalogStorageType;
478
477
  readonly nullable?: boolean;
479
478
  readonly default?: CatalogValueFact;
@@ -481,7 +480,7 @@ interface CatalogDomain extends CatalogObjectBase {
481
480
  }
482
481
  /** Collation properties that affect comparison and ordering semantics. */
483
482
  interface CatalogCollation extends CatalogObjectBase {
484
- readonly kind: 'collation';
483
+ readonly kind: "collation";
485
484
  readonly provider?: string;
486
485
  readonly locale?: string;
487
486
  readonly deterministic?: boolean;
@@ -489,11 +488,11 @@ interface CatalogCollation extends CatalogObjectBase {
489
488
  }
490
489
  /** A trigger attached to a table or view, retaining its body as opaque SQL. */
491
490
  interface CatalogTrigger extends CatalogObjectBase {
492
- readonly kind: 'trigger';
491
+ readonly kind: "trigger";
493
492
  readonly table: CatalogObjectReference;
494
- readonly timing: 'before' | 'after' | 'instead-of' | 'unknown';
495
- readonly events: readonly ('insert' | 'update' | 'delete' | 'truncate')[];
496
- readonly orientation?: 'row' | 'statement';
493
+ readonly timing: "before" | "after" | "instead-of" | "unknown";
494
+ readonly events: readonly ("insert" | "update" | "delete" | "truncate")[];
495
+ readonly orientation?: "row" | "statement";
497
496
  readonly condition?: CatalogSqlExpression;
498
497
  readonly body: CatalogSqlExpression;
499
498
  readonly enabled?: boolean;
@@ -501,7 +500,7 @@ interface CatalogTrigger extends CatalogObjectBase {
501
500
  /** A routine parameter as observed in a function or procedure signature. */
502
501
  interface CatalogRoutineParameter {
503
502
  readonly name?: string;
504
- readonly mode?: 'in' | 'out' | 'inout' | 'variadic' | 'table';
503
+ readonly mode?: "in" | "out" | "inout" | "variadic" | "table";
505
504
  readonly storage: CatalogStorageType;
506
505
  readonly default?: CatalogValueFact;
507
506
  readonly ordinalPosition: number;
@@ -509,31 +508,31 @@ interface CatalogRoutineParameter {
509
508
  }
510
509
  /** A function, procedure, aggregate, or other routine declaration. */
511
510
  interface CatalogRoutine extends CatalogObjectBase {
512
- readonly kind: 'routine';
513
- readonly routineKind: 'function' | 'procedure' | 'aggregate' | 'window' | 'unknown';
511
+ readonly kind: "routine";
512
+ readonly routineKind: "function" | "procedure" | "aggregate" | "window" | "unknown";
514
513
  readonly parameters: readonly CatalogRoutineParameter[];
515
514
  readonly returnType?: CatalogStorageType;
516
515
  readonly language?: string;
517
516
  readonly body?: CatalogSqlExpression;
518
- readonly volatility?: 'immutable' | 'stable' | 'volatile' | 'unknown';
519
- readonly parallel?: 'safe' | 'restricted' | 'unsafe' | 'unknown';
520
- readonly security?: 'invoker' | 'definer' | 'unknown';
517
+ readonly volatility?: "immutable" | "stable" | "volatile" | "unknown";
518
+ readonly parallel?: "safe" | "restricted" | "unsafe" | "unknown";
519
+ readonly security?: "invoker" | "definer" | "unknown";
521
520
  readonly dependencies?: readonly CatalogObjectReference[];
522
521
  }
523
522
  /** A partition child and its normalized bound expression. */
524
523
  interface CatalogPartition extends CatalogObjectBase {
525
- readonly kind: 'partition';
524
+ readonly kind: "partition";
526
525
  readonly parent: CatalogObjectReference;
527
- readonly strategy: 'range' | 'list' | 'hash' | 'reference' | 'unknown';
526
+ readonly strategy: "range" | "list" | "hash" | "reference" | "unknown";
528
527
  readonly keyColumns?: readonly string[];
529
528
  readonly bound?: CatalogSqlExpression;
530
529
  readonly default?: boolean;
531
530
  }
532
531
  /** A row-level security policy attached to a table. */
533
532
  interface CatalogPolicy extends CatalogObjectBase {
534
- readonly kind: 'policy';
533
+ readonly kind: "policy";
535
534
  readonly table: CatalogObjectReference;
536
- readonly command: 'all' | 'select' | 'insert' | 'update' | 'delete' | 'unknown';
535
+ readonly command: "all" | "select" | "insert" | "update" | "delete" | "unknown";
537
536
  readonly roles?: readonly string[];
538
537
  readonly permissive?: boolean;
539
538
  readonly using?: CatalogSqlExpression;
@@ -541,7 +540,7 @@ interface CatalogPolicy extends CatalogObjectBase {
541
540
  }
542
541
  /** An engine extension object and its typed, versioned payload. */
543
542
  interface CatalogExtensionObject extends CatalogObjectBase {
544
- readonly kind: 'extension';
543
+ readonly kind: "extension";
545
544
  readonly extensionName: string;
546
545
  readonly extensionVersion?: string;
547
546
  readonly schema?: string;
@@ -550,7 +549,7 @@ interface CatalogExtensionObject extends CatalogObjectBase {
550
549
  }
551
550
  /** An observed object whose family is not yet modeled by a first-party type. */
552
551
  interface CatalogOpaqueObject extends CatalogObjectBase {
553
- readonly kind: 'opaque-object';
552
+ readonly kind: "opaque-object";
554
553
  readonly objectKind: string;
555
554
  readonly data: CatalogData;
556
555
  readonly sql?: CatalogSqlExpression;
@@ -609,7 +608,7 @@ interface IntrospectionCatalog {
609
608
  readonly diagnostics: readonly IntrospectionDiagnostic[];
610
609
  }
611
610
  /** Strictness of the optional normalized-catalog-to-snapshot step. */
612
- type IntrospectionMode = 'strict' | 'lossy';
611
+ type IntrospectionMode = "strict" | "lossy";
613
612
  /** Inputs shared by dialect adapters and the later snapshot mapper. */
614
613
  interface IntrospectionOptions {
615
614
  /** PostgreSQL schema, MySQL database, or SQLite database name. */
@@ -1,4 +1,4 @@
1
- import { C as fragment, y as makeSchemaExpression } from "./column-D-8OqGuV.mjs";
1
+ import { H as makeSchemaExpression, K as fragment } from "./column-hqKr7-1I.mjs";
2
2
  //#region src/core/primitives/parameter.ts
3
3
  function parameter(_value) {
4
4
  return fragment((context) => context.parameter(_value));