qubu 0.6.0 → 0.6.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.
- package/README.md +112 -0
- package/dist/{complete-DP7pliuY.mjs → canonical-B5_ouh-c.mjs} +466 -241
- package/dist/codegen.d.mts +2 -2
- package/dist/codegen.mjs +180 -90
- package/dist/column-Cyc2CMnG.mjs +116 -0
- package/dist/column-DDRvD7SF.mjs +721 -0
- package/dist/{constraints-YGyNPQ_z.mjs → constraints-CAmi18Uk.mjs} +8 -3
- package/dist/core.d.mts +3 -3
- package/dist/core.mjs +4 -5
- package/dist/diagnostics-I9vVtXkc.mjs +40 -0
- package/dist/diff.d.mts +9 -9
- package/dist/diff.mjs +152 -102
- package/dist/{explain-CkIK13L_.mjs → explain-BIqEmZha.mjs} +1 -1
- package/dist/expressions-_6JF_J77.mjs +130 -0
- package/dist/index-CaxrMD1A.d.mts +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +414 -77
- package/dist/introspection/mysql.d.mts +26 -0
- package/dist/introspection/mysql.mjs +1278 -0
- package/dist/introspection/postgres.d.mts +43 -0
- package/dist/introspection/postgres.mjs +1889 -0
- package/dist/introspection/sqlite.d.mts +15 -0
- package/dist/introspection/sqlite.mjs +1172 -0
- package/dist/introspection.d.mts +26 -87
- package/dist/introspection.mjs +3 -4351
- package/dist/mysql.d.mts +3 -3
- package/dist/mysql.mjs +8 -7
- package/dist/{errors-Dxv73YJu.mjs → omit-VEr9Ydux.mjs} +5 -1
- package/dist/{on-conflict-DZQ85f1t.mjs → on-conflict-B2rFyHGF.mjs} +78 -8
- package/dist/on-duplicate-key-update-Czsw1Yq-.mjs +95 -0
- package/dist/postgres-hFhd0I9n.mjs +68 -0
- package/dist/postgres.d.mts +3 -3
- package/dist/postgres.mjs +3 -52
- package/dist/registry-BXE_4M9P.mjs +127 -0
- package/dist/{relational-CxnLCqZQ.mjs → relational-CoPBETjI.mjs} +3 -3
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +8 -7
- package/dist/{serialize-BN07IK0v.mjs → serialize-CyobNEx-.mjs} +174 -30
- package/dist/serialize-Du2UPZMt.d.mts +92 -0
- package/dist/snapshot/mysql.d.mts +5 -5
- package/dist/snapshot/mysql.mjs +32 -32
- package/dist/snapshot/postgres.d.mts +5 -5
- package/dist/snapshot/postgres.mjs +25 -25
- package/dist/snapshot/sqlite.d.mts +5 -5
- package/dist/snapshot/sqlite.mjs +30 -30
- package/dist/snapshot-mIb-Zzb5.mjs +1489 -0
- package/dist/snapshot.d.mts +4 -5
- package/dist/snapshot.mjs +3 -4
- package/dist/{source-SqrKWjFJ.mjs → source-DYSUqzvb.mjs} +2 -2
- package/dist/sqlite.d.mts +2 -2
- package/dist/sqlite.mjs +10 -10
- package/dist/{table-BwflqeAj.mjs → table-B8zEq0az.mjs} +4 -4
- package/dist/{types-BIJsj2fJ.mjs → types-CYHpSPwj.mjs} +10 -7
- package/dist/{types-CTCqtFlS.d.mts → types-CiMvKi5V.d.mts} +14 -4
- package/dist/{types-C0VkiwpR.d.mts → types-Dqr4o2I1.d.mts} +640 -189
- package/dist/value-CpaUFtjw.mjs +45 -0
- package/dist/vite/ambient.d.ts +2 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -0
- package/docs/dialects-and-execution.md +61 -11
- package/docs/getting-started.md +1 -1
- package/docs/guides/compose-queries.md +22 -0
- package/docs/guides/drizzle.md +11 -11
- package/docs/guides/extensions/typed-expressions.md +5 -3
- package/docs/guides/json.md +95 -2
- package/docs/guides/mutations.md +125 -0
- package/docs/guides/valtio-sync.md +113 -0
- package/docs/index.md +1 -1
- package/docs/migrations/adapters.md +58 -21
- package/docs/migrations/index.md +50 -12
- package/docs/migrations/operations.md +20 -6
- package/docs/migrations/recovery.md +7 -1
- package/docs/query-model/fragments.md +21 -1
- package/docs/reference/introspection-support.md +16 -18
- package/docs/reference/supported-surface.md +23 -11
- package/docs/schema/catalog-model.md +20 -7
- package/docs/schema/code-generation.md +4 -3
- package/docs/schema/diff.md +2 -2
- package/docs/schema/introspection.md +24 -16
- package/docs/schema/snapshots.md +18 -8
- package/docs/schema/storage-and-schema-sql.md +7 -2
- package/docs/sql-semantic-types.md +8 -0
- package/package.json +14 -1
- package/dist/canonical-DMvR9yBe.mjs +0 -972
- package/dist/column-Da37jYSD.mjs +0 -309
- package/dist/column-r1Y4ivwt.mjs +0 -327
- package/dist/complete-types-CY0KbzNw.d.mts +0 -371
- package/dist/index-B2rZf3-2.d.mts +0 -32
- package/dist/json-Db7XRD91.mjs +0 -169
- package/dist/omit-OxV58AwX.mjs +0 -5
- package/dist/registry-BRcUuazJ.mjs +0 -256
- package/dist/serialize-CEIIlWhC.d.mts +0 -66
- package/dist/snapshot-Xam8-q0j.mjs +0 -392
- package/dist/standard-DfcZEVOj.mjs +0 -12
- package/dist/value-D14I_XgL.mjs +0 -29
|
@@ -50,6 +50,8 @@ type SqlBigInt = SqlSemanticType<"bigint"> & SqlNumericLike & SqlOrderable<"nume
|
|
|
50
50
|
type SqlBinary = SqlSemanticType<"binary"> & SqlEqualityComparable<"binary">;
|
|
51
51
|
/** Any declared SQL semantic type, including user and dialect extensions. */
|
|
52
52
|
type AnySqlType = SqlSemanticType<string>;
|
|
53
|
+
/** Runtime name for a SQL semantic domain, including user and dialect extensions. */
|
|
54
|
+
type SqlTypeName = AnySqlType["sqlType"];
|
|
53
55
|
type IsUnresolvedSqlType<T> = T extends SqlUnknown ? true : T extends AnySqlType ? string extends T["sqlType"] ? true : false : false;
|
|
54
56
|
/** Whether a declared SQL domain satisfies a semantic capability constraint. */
|
|
55
57
|
type SqlTypeSatisfies<TActual, TConstraint> = true extends IsUnresolvedSqlType<TActual> ? true : TActual extends TConstraint ? true : false;
|
|
@@ -123,7 +125,7 @@ type CardinalityMeta<TCardinality extends QueryCardinality = QueryCardinality> =
|
|
|
123
125
|
readonly cardinality: TCardinality;
|
|
124
126
|
};
|
|
125
127
|
/** A fragment whose syntax must be rendered by a dialect with this capability. */
|
|
126
|
-
type RequiresCapabilityMeta<TCapability extends
|
|
128
|
+
type RequiresCapabilityMeta<TCapability extends string = DialectCapability> = {
|
|
127
129
|
readonly kind: "requires-capability";
|
|
128
130
|
readonly capability: TCapability;
|
|
129
131
|
};
|
|
@@ -133,7 +135,8 @@ interface RenderContext {
|
|
|
133
135
|
/** Whether selected fields name an application result or a SQL relation. */
|
|
134
136
|
readonly projectionMode: "result" | "relation";
|
|
135
137
|
append(text: string): void;
|
|
136
|
-
parameter
|
|
138
|
+
/** Add one ordered parameter, optionally declaring its runtime SQL domain. */
|
|
139
|
+
parameter(value: unknown, sqlType?: SqlTypeName): void;
|
|
137
140
|
render(part: Fragment<any>): void;
|
|
138
141
|
/** Render an embedded query with SQL-facing projection names. */
|
|
139
142
|
renderRelation(part: Fragment<any>): void;
|
|
@@ -208,7 +211,7 @@ type Cardinality<TMetadata> = TMetadata extends {
|
|
|
208
211
|
} ? TCardinality : never;
|
|
209
212
|
type RequiredCapabilities<TMetadata> = TMetadata extends {
|
|
210
213
|
readonly kind: "requires-capability";
|
|
211
|
-
readonly capability: infer TCapability extends
|
|
214
|
+
readonly capability: infer TCapability extends string;
|
|
212
215
|
} ? TCapability : never;
|
|
213
216
|
type InheritedMetadataOf<TMetadata> = WithoutResult<TMetadata>;
|
|
214
217
|
type InheritedMetadata<T> = InheritedMetadataOf<MetadataOf<T>>;
|
|
@@ -248,7 +251,7 @@ declare function isFragment(value: unknown): value is AnyFragment;
|
|
|
248
251
|
//#endregion
|
|
249
252
|
//#region src/result.d.ts
|
|
250
253
|
/** Portable result domains that can require driver-specific normalization. */
|
|
251
|
-
type DecodableResultType = "boolean" | "date" | "timestamp" | "json";
|
|
254
|
+
type DecodableResultType = "boolean" | "date" | "timestamp" | "json" | "bigint";
|
|
252
255
|
/** Context supplied while decoding one projected field. */
|
|
253
256
|
interface ResultDecodeContext {
|
|
254
257
|
readonly dialect: Dialect;
|
|
@@ -264,6 +267,8 @@ interface ResultField {
|
|
|
264
267
|
readonly name: string;
|
|
265
268
|
readonly type?: DecodableResultType;
|
|
266
269
|
readonly decoder?: ResultDecoder;
|
|
270
|
+
/** SQL semantic domain supplied to the adapter before it executes the request. */
|
|
271
|
+
readonly sqlType?: SqlTypeName;
|
|
267
272
|
}
|
|
268
273
|
/** Runtime description of a query's named result row. */
|
|
269
274
|
interface ResultShape {
|
|
@@ -272,11 +277,14 @@ interface ResultShape {
|
|
|
272
277
|
interface ResultValueMetadata {
|
|
273
278
|
readonly type?: DecodableResultType;
|
|
274
279
|
readonly decoder?: ResultDecoder;
|
|
280
|
+
/** SQL semantic domain retained for adapter-specific result handling. */
|
|
281
|
+
readonly sqlType?: SqlTypeName;
|
|
275
282
|
}
|
|
276
283
|
declare const resultValueMetadata: unique symbol;
|
|
277
284
|
type ResultValueCarrier = {
|
|
278
285
|
readonly [resultValueMetadata]?: ResultValueMetadata;
|
|
279
286
|
};
|
|
287
|
+
declare function resultValue(type?: DecodableResultType, decoder?: ResultDecoder, sqlType?: SqlTypeName): ResultValueMetadata | undefined;
|
|
280
288
|
/** Decode SQLite/MySQL-style boolean values while accepting native booleans. */
|
|
281
289
|
declare const booleanResultDecoder: ResultDecoder<boolean>;
|
|
282
290
|
/** Decode a SQL DATE string as a JavaScript Date at UTC midnight. */
|
|
@@ -285,6 +293,8 @@ declare const dateResultDecoder: ResultDecoder<Date>;
|
|
|
285
293
|
declare const timestampResultDecoder: ResultDecoder<Date>;
|
|
286
294
|
/** Decode a serialized JSON result. Use only when the adapter returns JSON text. */
|
|
287
295
|
declare const jsonTextResultDecoder: ResultDecoder;
|
|
296
|
+
/** Decode an exact integer result without ever accepting an unsafe JavaScript number. */
|
|
297
|
+
declare const bigintResultDecoder: ResultDecoder<bigint>;
|
|
288
298
|
/** Error raised when a projected driver value cannot be decoded. */
|
|
289
299
|
declare class ResultDecodingError extends TypeError {
|
|
290
300
|
readonly name = "ResultDecodingError";
|
|
@@ -319,7 +329,7 @@ type ExpressionNullability<T> = NullabilityOf<T>;
|
|
|
319
329
|
/** Extract the SQL semantic domain produced by an expression. */
|
|
320
330
|
type ExpressionSqlType<T> = SqlTypeOf<T>;
|
|
321
331
|
/** Add a concrete dialect requirement without dropping expression metadata. */
|
|
322
|
-
declare function withDialectCapability<const TCapability extends
|
|
332
|
+
declare function withDialectCapability<const TCapability extends string, TExpression extends AnyExpression>(expression: TExpression, capability: TCapability): TExpression extends SchemaExpression<any, any> ? SchemaExpression<MetadataOf<TExpression> | RequiresCapabilityMeta<TCapability>, TExpression["expressionKind"]> : Expression<MetadataOf<TExpression> | RequiresCapabilityMeta<TCapability>, TExpression["expressionKind"]>;
|
|
323
333
|
/** An expression whose result is known to be assignable to `TOutput`. */
|
|
324
334
|
type ExpressionWithOutput<TOutput, TKind extends ExpressionKind = ExpressionKind> = Expression<ResultMeta<TOutput, unknown, AnySqlType> | RequiresSourceMeta<unknown> | NullableSourceMeta<unknown> | ExpressionMeta<unknown> | AggregateMeta<unknown> | RequiresCapabilityMeta | WindowMeta | SubqueryMeta, TKind>;
|
|
325
335
|
/** Sparse type-level configuration for a result-producing expression. */
|
|
@@ -401,15 +411,17 @@ type DefaultDialectCapability = "json";
|
|
|
401
411
|
interface RenderedQuery {
|
|
402
412
|
readonly text: string;
|
|
403
413
|
readonly parameters: readonly unknown[];
|
|
414
|
+
/** Runtime SQL domains aligned with `parameters`; omitted when all domains are unknown. */
|
|
415
|
+
readonly parameterSqlTypes?: readonly (SqlTypeName | undefined)[];
|
|
404
416
|
}
|
|
405
|
-
interface RenderOptions<TCapabilities extends
|
|
417
|
+
interface RenderOptions<TCapabilities extends string = string> {
|
|
406
418
|
readonly dialect?: Dialect<TCapabilities>;
|
|
407
419
|
}
|
|
408
420
|
type IsAny$1<T> = 0 extends 1 & T ? true : false;
|
|
409
|
-
type MissingCapabilities<TQuery, TCapabilities extends
|
|
410
|
-
type RenderCapabilityValidation<TQuery, TCapabilities extends
|
|
421
|
+
type MissingCapabilities<TQuery, TCapabilities extends string> = IsAny$1<CapabilitiesOf<TQuery>> extends true ? never : Exclude<CapabilitiesOf<TQuery>, TCapabilities>;
|
|
422
|
+
type RenderCapabilityValidation<TQuery, TCapabilities extends string> = [MissingCapabilities<TQuery, TCapabilities>] extends [never] ? unknown : QueryTypeValidation<"missing-dialect-capability", "render.dialect", "Provide a dialect that supports every capability required by the query.", MissingCapabilities<TQuery, TCapabilities>>;
|
|
411
423
|
declare function render<TQuery extends AnyFragment>(query: TQuery & RenderCapabilityValidation<TQuery, DefaultDialectCapability>): RenderedQuery;
|
|
412
|
-
declare function render<TQuery extends AnyFragment, TCapabilities extends
|
|
424
|
+
declare function render<TQuery extends AnyFragment, TCapabilities extends string>(query: TQuery & RenderCapabilityValidation<TQuery, TCapabilities>, options: RenderOptions<TCapabilities> | Dialect<TCapabilities>): RenderedQuery;
|
|
413
425
|
//#endregion
|
|
414
426
|
//#region src/execution.d.ts
|
|
415
427
|
type StreamableQuery<TRow extends object = Record<string, unknown>> = QueryWithRow<TRow> & {
|
|
@@ -506,9 +518,9 @@ interface QubuHooks {
|
|
|
506
518
|
interface QubuOptions {
|
|
507
519
|
readonly hooks?: QubuHooks;
|
|
508
520
|
}
|
|
509
|
-
/** One rendered statement and
|
|
521
|
+
/** One rendered statement, runtime parameter domains, and controls passed to an application adapter. */
|
|
510
522
|
interface ExecutionRequest {
|
|
511
|
-
/** SQL text
|
|
523
|
+
/** SQL text, raw application parameters, and optional domain sidecar produced by Qubu's renderer. */
|
|
512
524
|
readonly statement: RenderedQuery;
|
|
513
525
|
/** The source query kind, available without parsing rendered SQL. */
|
|
514
526
|
readonly queryKind: QueryKind;
|
|
@@ -550,9 +562,10 @@ interface ExplainResult<TPlanRow extends object = Record<string, unknown>> {
|
|
|
550
562
|
}
|
|
551
563
|
/**
|
|
552
564
|
* The driver-facing boundary. `request.statement.parameters` contains raw application values in
|
|
553
|
-
* placeholder order
|
|
554
|
-
*
|
|
555
|
-
*
|
|
565
|
+
* placeholder order, and `request.statement.parameterSqlTypes` optionally contains their aligned
|
|
566
|
+
* SQL domains. The adapter binds and encodes them for its driver. Connection pooling, transactions,
|
|
567
|
+
* retries, and proprietary driver-row normalization remain adapter concerns. Qubu applies the
|
|
568
|
+
* adapter's registered logical result decoders afterward.
|
|
556
569
|
*/
|
|
557
570
|
interface QueryAdapter {
|
|
558
571
|
/** Default rendering policy for queries sent through this adapter. */
|
|
@@ -594,6 +607,8 @@ type QueryExecutor = QueryAdapter;
|
|
|
594
607
|
interface TransactionalQueryAdapter<TTransactionAdapter extends QueryAdapter = QueryAdapter> extends QueryAdapter {
|
|
595
608
|
transaction<T>(callback: (adapter: TTransactionAdapter) => Promise<T>, options?: TransactionOptions): Promise<T>;
|
|
596
609
|
}
|
|
610
|
+
/** Opt-in recursive transaction scopes; adapters own savepoints and scope lifetime. */
|
|
611
|
+
interface NestedTransactionalQueryAdapter<TBase extends QueryAdapter = QueryAdapter> extends TransactionalQueryAdapter<TBase & NestedTransactionalQueryAdapter<TBase>> {}
|
|
597
612
|
type TransactionAdapterOf<TAdapter extends TransactionalQueryAdapter> = TAdapter extends TransactionalQueryAdapter<infer TTransactionAdapter> ? TTransactionAdapter : never;
|
|
598
613
|
/** A transaction-capable streaming adapter whose scoped client can stream. */
|
|
599
614
|
type StreamingTransactionalQueryAdapter = StreamingQueryAdapter & TransactionalQueryAdapter<StreamingQueryAdapter>;
|
|
@@ -618,7 +633,8 @@ interface QubuStreamingClient<TAdapter extends StreamingQueryAdapter = Streaming
|
|
|
618
633
|
}
|
|
619
634
|
/** A bound client that supports both streaming and typed EXPLAIN plans. */
|
|
620
635
|
interface QubuStreamingExplainableClient<TAdapter extends StreamingQueryAdapter & ExplainableQueryAdapter = StreamingQueryAdapter & ExplainableQueryAdapter> extends QubuStreamingClient<TAdapter>, QubuExplainableClient<TAdapter> {}
|
|
621
|
-
type
|
|
636
|
+
type QubuBaseClientFor<TAdapter extends QueryAdapter> = TAdapter extends StreamingQueryAdapter ? TAdapter extends ExplainableQueryAdapter ? QubuStreamingExplainableClient<TAdapter> : QubuStreamingClient<TAdapter> : TAdapter extends ExplainableQueryAdapter ? QubuExplainableClient<TAdapter> : QubuClient<TAdapter>;
|
|
637
|
+
type QubuClientFor<TAdapter extends QueryAdapter> = QubuBaseClientFor<TAdapter> & (TAdapter extends TransactionalQueryAdapter ? QubuTransactionalClient<TAdapter, TransactionAdapterOf<TAdapter>> : {});
|
|
622
638
|
/** The client available inside a transaction callback. */
|
|
623
639
|
type QubuTransaction = QubuClient<QueryAdapter>;
|
|
624
640
|
/** The streaming client available inside a streaming transaction callback. */
|
|
@@ -638,6 +654,7 @@ interface QubuStreamingTransactionalClient<TAdapter extends StreamingTransaction
|
|
|
638
654
|
transaction<T>(callback: (transaction: QubuStreamingTransaction) => Promise<T>, options?: TransactionOptions): Promise<T>;
|
|
639
655
|
}
|
|
640
656
|
/** Bind an application-owned adapter once for repeated query execution. */
|
|
657
|
+
declare function qubu<TAdapter extends NestedTransactionalQueryAdapter>(adapter: TAdapter, options?: QubuOptions): QubuClientFor<TAdapter>;
|
|
641
658
|
declare function qubu<TAdapter extends ExplainableQueryAdapter & StreamingTransactionalQueryAdapter>(adapter: TAdapter, options?: QubuOptions): QubuExplainableStreamingTransactionalClient<TAdapter>;
|
|
642
659
|
declare function qubu<TAdapter extends ExplainableQueryAdapter & TransactionalQueryAdapter & StreamingQueryAdapter>(adapter: TAdapter, options?: QubuOptions): QubuExplainableTransactionalClient<TAdapter> & QubuStreamingExplainableClient<TAdapter>;
|
|
643
660
|
declare function qubu<TAdapter extends ExplainableQueryAdapter & TransactionalQueryAdapter>(adapter: TAdapter, options?: QubuOptions): QubuExplainableTransactionalClient<TAdapter, TransactionAdapterOf<TAdapter>>;
|
|
@@ -649,8 +666,11 @@ declare function qubu<TAdapter extends TransactionalQueryAdapter>(adapter: TAdap
|
|
|
649
666
|
declare function qubu<TAdapter extends StreamingQueryAdapter>(adapter: TAdapter, options?: QubuOptions): QubuStreamingClient<TAdapter>;
|
|
650
667
|
declare function qubu<TAdapter extends QueryAdapter>(adapter: TAdapter, options?: QubuOptions): QubuClient<TAdapter>;
|
|
651
668
|
interface DriverValueEncoder<TDriverValue = unknown> {
|
|
652
|
-
/**
|
|
653
|
-
|
|
669
|
+
/**
|
|
670
|
+
* Convert one Qubu parameter into the driver's bindable representation and receive its SQL
|
|
671
|
+
* domain.
|
|
672
|
+
*/
|
|
673
|
+
encode(value: unknown, sqlType?: SqlTypeName): TDriverValue;
|
|
654
674
|
}
|
|
655
675
|
/**
|
|
656
676
|
* Render a typed query, pass it to an application adapter, and return the adapter's structured
|
|
@@ -798,6 +818,10 @@ type GeneratedColumnDescriptor = ExpressionGeneratedColumnDescriptor | ExternalG
|
|
|
798
818
|
type GeneratedDescriptor = GeneratedColumnDescriptor;
|
|
799
819
|
/** Identity generation policy. Identity is not an ordinary SQL expression. */
|
|
800
820
|
type IdentityGeneration = "always" | "by-default";
|
|
821
|
+
/** Literal or deterministic schema-expression identity option value. */
|
|
822
|
+
type IdentityOptionValue = SchemaLiteralValue | AnySchemaExpression;
|
|
823
|
+
/** Dialect-neutral identity options retained in Snapshot v1. */
|
|
824
|
+
type IdentityOptions = Readonly<Record<string, IdentityOptionValue>>;
|
|
801
825
|
/** SQLite's opt-in AUTOINCREMENT behavior for an INTEGER rowid alias. */
|
|
802
826
|
interface SqliteIdentityExtension extends SchemaDialectExtension<"sqlite"> {
|
|
803
827
|
/** Preserve deleted rowids instead of allowing SQLite to reuse them. */
|
|
@@ -814,6 +838,7 @@ type IdentityDialectExtension = SqliteIdentityExtension | MysqlIdentityExtension
|
|
|
814
838
|
interface IdentityDescriptor {
|
|
815
839
|
readonly kind: "identity";
|
|
816
840
|
readonly generation: IdentityGeneration;
|
|
841
|
+
readonly options?: IdentityOptions;
|
|
817
842
|
/** Optional dialect-owned identity semantics such as SQLite AUTOINCREMENT. */
|
|
818
843
|
readonly dialect?: IdentityDialectExtension;
|
|
819
844
|
}
|
|
@@ -838,6 +863,7 @@ declare function externalGeneratedColumn(): ExternalGeneratedColumnDescriptor;
|
|
|
838
863
|
/** Describe a database identity column without inventing a generated SQL expression. */
|
|
839
864
|
declare function identityColumn(generation?: IdentityGeneration, options?: {
|
|
840
865
|
readonly dialect?: IdentityDialectExtension;
|
|
866
|
+
readonly options?: IdentityOptions;
|
|
841
867
|
}): IdentityDescriptor;
|
|
842
868
|
/** The normalized behavior fields attached to a column definition. */
|
|
843
869
|
interface ResolvedColumnBehavior {
|
|
@@ -951,8 +977,12 @@ interface ColumnOptions<TOutput = unknown, TInsert = TOutput> {
|
|
|
951
977
|
readonly onUpdate?: AnySchemaExpression;
|
|
952
978
|
/** Override the snake_case SQL identifier derived from the field name. */
|
|
953
979
|
readonly sqlName?: string;
|
|
980
|
+
/** Runtime SQL semantic domain name for adapter binding and result metadata. */
|
|
981
|
+
readonly sqlType?: SqlTypeName;
|
|
954
982
|
/** Physical storage metadata for a custom column definition. */
|
|
955
983
|
readonly storage?: ColumnStorage;
|
|
984
|
+
/** Dialect-owned column metadata retained by schema snapshots. */
|
|
985
|
+
readonly dialect?: SchemaDialectExtension;
|
|
956
986
|
/** Override adapter decoding for values selected from this column. */
|
|
957
987
|
readonly decode?: ResultDecoder;
|
|
958
988
|
/** Convert values at the live application-to-driver boundary without affecting schema metadata. */
|
|
@@ -963,8 +993,9 @@ interface ColumnOptions<TOutput = unknown, TInsert = TOutput> {
|
|
|
963
993
|
*/
|
|
964
994
|
readonly castType?: string;
|
|
965
995
|
}
|
|
966
|
-
type BuiltInColumnOptions<TOutput> = Omit<ColumnOptions<TOutput, TOutput>, "castType" | "storage"> & {
|
|
996
|
+
type BuiltInColumnOptions<TOutput> = Omit<ColumnOptions<TOutput, TOutput>, "castType" | "sqlType" | "storage"> & {
|
|
967
997
|
readonly castType?: never;
|
|
998
|
+
readonly sqlType?: never;
|
|
968
999
|
readonly storage?: never;
|
|
969
1000
|
};
|
|
970
1001
|
/** Sparse type-level configuration carried by a column definition. */
|
|
@@ -1033,8 +1064,12 @@ interface ColumnDefinition<TConfig extends ColumnDefinitionConfig = {}> {
|
|
|
1033
1064
|
/** MySQL's optional parameter-free `ON UPDATE` expression. */
|
|
1034
1065
|
readonly onUpdate?: ColumnConfigOnUpdate<TConfig>;
|
|
1035
1066
|
readonly sqlName?: string;
|
|
1067
|
+
/** Runtime SQL semantic domain name for adapter binding and result metadata. */
|
|
1068
|
+
readonly sqlType?: SqlTypeName;
|
|
1036
1069
|
/** Physical storage metadata, separate from the application and SQL types. */
|
|
1037
1070
|
readonly storage?: ColumnConfigStorage<TConfig>;
|
|
1071
|
+
/** Dialect-owned metadata retained by schema snapshots. */
|
|
1072
|
+
readonly dialect?: SchemaDialectExtension;
|
|
1038
1073
|
/** Runtime decoder used when this definition is projected. */
|
|
1039
1074
|
readonly resultDecoder?: ResultDecoder;
|
|
1040
1075
|
/** Runtime default used when an application insert omits this definition. */
|
|
@@ -1266,9 +1301,13 @@ declare function column<TOutput = unknown, TInsert = TOutput, TUpdate = TInsert,
|
|
|
1266
1301
|
declare function column<TOutput = unknown, TInsert = TOutput, TUpdate = TInsert, const TOptions extends ColumnOptions<TOutput, TInsert> = {}, TSqlType extends AnySqlType = SqlUnknown>(options?: TOptions): ColumnFromOptions<TOutput, TInsert, TUpdate, TOptions, TSqlType>;
|
|
1267
1302
|
/** Resolve the runtime result metadata carried by a column definition. */
|
|
1268
1303
|
declare function columnResultValue(definition: {
|
|
1269
|
-
readonly
|
|
1304
|
+
readonly sqlType?: SqlTypeName;
|
|
1270
1305
|
readonly resultDecoder?: ResultDecoder;
|
|
1271
1306
|
}): ResultValueMetadata | undefined;
|
|
1307
|
+
/** Resolve a column's explicit runtime semantic SQL domain for driver-facing metadata. */
|
|
1308
|
+
declare function columnSqlType(definition: {
|
|
1309
|
+
readonly sqlType?: SqlTypeName;
|
|
1310
|
+
}): SqlTypeName | undefined;
|
|
1272
1311
|
/** Apply a live column codec while preserving SQL NULL unchanged. */
|
|
1273
1312
|
declare function encodeColumnParameter(definition: {
|
|
1274
1313
|
readonly parameterEncoder?: (value: any) => unknown;
|
|
@@ -1352,10 +1391,16 @@ declare function mapResult<TOutput, TExpression extends AnyExpression>(expressio
|
|
|
1352
1391
|
interface ValueExpression<T = unknown, TSqlType extends AnySqlType = SqlUnknown> extends SchemaExpression<ResultMeta<T, never, TSqlType> | ExpressionMeta<never>, "value"> {
|
|
1353
1392
|
readonly value: T;
|
|
1354
1393
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1394
|
+
/** Build a parameterized value expression with an optional runtime SQL domain for the adapter. */
|
|
1395
|
+
declare function value<T>(input: T, sqlType?: SqlTypeName): ValueExpression<T>;
|
|
1396
|
+
/**
|
|
1397
|
+
* Bind a value while declaring its compile-time and runtime SQL semantic domain.
|
|
1398
|
+
*
|
|
1399
|
+
* @remarks
|
|
1400
|
+
* The domain is a binding hint; it does not select a JavaScript result decoder.
|
|
1401
|
+
*/
|
|
1402
|
+
declare function typedValue<TSqlType extends AnySqlType, T>(input: T, sqlType: TSqlType["sqlType"]): ValueExpression<T, TSqlType>;
|
|
1403
|
+
declare function asValue<TInput>(input: TInput, sqlType?: SqlTypeName): TInput extends AnyExpression ? TInput : ValueExpression<TInput>;
|
|
1359
1404
|
//#endregion
|
|
1360
1405
|
//#region src/expressions/operators/shared.d.ts
|
|
1361
1406
|
type Operand<T> = T | ExpressionWithOutput<T>;
|
|
@@ -1687,39 +1732,40 @@ declare function typedCall<TSqlType extends AnySqlType, TOutput = unknown>(): <c
|
|
|
1687
1732
|
} ? never : T_1 : never : never), "function">;
|
|
1688
1733
|
//#endregion
|
|
1689
1734
|
//#region src/expressions/functions/string.d.ts
|
|
1735
|
+
type TextOperandValidation<TInput> = SqlCapabilityValidation<OperandSqlType<TInput, SqlText>, SqlTextLike>;
|
|
1690
1736
|
type TextArgumentsValidation<TArguments extends readonly unknown[]> = TArguments extends readonly [infer THead, ...infer TTail] ? SqlCapabilityValidation<OperandSqlType<THead, SqlText>, SqlTextLike> & TextArgumentsValidation<TTail> : unknown;
|
|
1691
|
-
type CoalesceValidation<TFirst, TRest extends readonly unknown[]> = TRest extends readonly [infer THead, ...infer TTail] ? SqlEqualityValidation<ExpressionSqlType<TFirst>,
|
|
1692
|
-
declare function lower<
|
|
1737
|
+
type CoalesceValidation<TFirst, TRest extends readonly unknown[]> = TRest extends readonly [infer THead, ...infer TTail] ? SqlEqualityValidation<ExpressionSqlType<TFirst>, OperandSqlType<THead, ExpressionSqlType<TFirst>>> & CoalesceValidation<TFirst, TTail> : unknown;
|
|
1738
|
+
declare function lower<const TInput extends Operand<string>>(input: TInput & TextOperandValidation<TInput>): Expression<ResultMeta<string, (MetadataOf<TInput> extends (infer T) ? T extends MetadataOf<TInput> ? T extends {
|
|
1693
1739
|
readonly kind: "result";
|
|
1694
|
-
} ? T : never : never : never) extends (infer T_1) ? T_1 extends (MetadataOf<
|
|
1740
|
+
} ? T : never : never : never) extends (infer T_1) ? T_1 extends (MetadataOf<TInput> extends (infer T_2) ? T_2 extends MetadataOf<TInput> ? T_2 extends {
|
|
1695
1741
|
readonly kind: "result";
|
|
1696
1742
|
} ? T_2 : never : never : never) ? T_1 extends {
|
|
1697
1743
|
readonly nullableFrom: infer TSource;
|
|
1698
|
-
} ? TSource : never : never : never, SqlText> | ExpressionMeta<MetadataOf<
|
|
1744
|
+
} ? TSource : never : never : never, SqlText> | ExpressionMeta<MetadataOf<TInput> extends (infer T_3) ? T_3 extends MetadataOf<TInput> ? T_3 extends {
|
|
1699
1745
|
readonly kind: "expression";
|
|
1700
1746
|
readonly dependencies: infer TDependencies;
|
|
1701
|
-
} ? TDependencies : never : never : never> | (MetadataOf<
|
|
1747
|
+
} ? TDependencies : never : never : never> | (MetadataOf<TInput> extends (infer T_4) ? T_4 extends MetadataOf<TInput> ? T_4 extends {
|
|
1702
1748
|
readonly kind: "result" | "cardinality";
|
|
1703
|
-
} ? never : T_4 : never : never), "function"
|
|
1704
|
-
declare function upper<
|
|
1749
|
+
} ? never : T_4 : never : never), "function"> & SchemaExpressionBrand & ResultValueCarrier;
|
|
1750
|
+
declare function upper<const TInput extends Operand<string>>(input: TInput & TextOperandValidation<TInput>): Expression<ResultMeta<string, (MetadataOf<TInput> extends (infer T) ? T extends MetadataOf<TInput> ? T extends {
|
|
1705
1751
|
readonly kind: "result";
|
|
1706
|
-
} ? T : never : never : never) extends (infer T_1) ? T_1 extends (MetadataOf<
|
|
1752
|
+
} ? T : never : never : never) extends (infer T_1) ? T_1 extends (MetadataOf<TInput> extends (infer T_2) ? T_2 extends MetadataOf<TInput> ? T_2 extends {
|
|
1707
1753
|
readonly kind: "result";
|
|
1708
1754
|
} ? T_2 : never : never : never) ? T_1 extends {
|
|
1709
1755
|
readonly nullableFrom: infer TSource;
|
|
1710
|
-
} ? TSource : never : never : never, SqlText> | ExpressionMeta<MetadataOf<
|
|
1756
|
+
} ? TSource : never : never : never, SqlText> | ExpressionMeta<MetadataOf<TInput> extends (infer T_3) ? T_3 extends MetadataOf<TInput> ? T_3 extends {
|
|
1711
1757
|
readonly kind: "expression";
|
|
1712
1758
|
readonly dependencies: infer TDependencies;
|
|
1713
|
-
} ? TDependencies : never : never : never> | (MetadataOf<
|
|
1759
|
+
} ? TDependencies : never : never : never> | (MetadataOf<TInput> extends (infer T_4) ? T_4 extends MetadataOf<TInput> ? T_4 extends {
|
|
1714
1760
|
readonly kind: "result" | "cardinality";
|
|
1715
|
-
} ? never : T_4 : never : never), "function"
|
|
1716
|
-
declare function coalesce<T,
|
|
1761
|
+
} ? never : T_4 : never : never), "function"> & SchemaExpressionBrand & ResultValueCarrier;
|
|
1762
|
+
declare function coalesce<T, TFirst extends ExpressionWithOutput<T>, const TRest extends readonly Operand<NoInfer<T>>[]>(first: TFirst, ...rest: TRest & CoalesceValidation<TFirst, TRest>): Expression<ResultMeta<T, never, ExpressionSqlType<TFirst>> | ExpressionMeta<MetadataOf<[TFirst, ...TRest][number]> extends (infer T_1) ? T_1 extends MetadataOf<[TFirst, ...TRest][number]> ? T_1 extends {
|
|
1717
1763
|
readonly kind: "expression";
|
|
1718
1764
|
readonly dependencies: infer TDependencies;
|
|
1719
|
-
} ? TDependencies : never : never : never> | (MetadataOf<
|
|
1765
|
+
} ? TDependencies : never : never : never> | (MetadataOf<[TFirst, ...TRest][number]> extends (infer T_2) ? T_2 extends MetadataOf<[TFirst, ...TRest][number]> ? T_2 extends {
|
|
1720
1766
|
readonly kind: "result" | "cardinality";
|
|
1721
|
-
} ? never : T_2 : never : never), "function"
|
|
1722
|
-
declare function concat<const TArguments extends readonly Operand<string>[]>(...argumentsToConcat: TArguments & TextArgumentsValidation<TArguments>):
|
|
1767
|
+
} ? never : T_2 : never : never), "function"> & SchemaExpressionBrand & ResultValueCarrier;
|
|
1768
|
+
declare function concat<const TArguments extends readonly Operand<string>[]>(...argumentsToConcat: TArguments & TextArgumentsValidation<TArguments>): Expression<ResultMeta<string, (MetadataOf<TArguments[number]> extends (infer T) ? T extends MetadataOf<TArguments[number]> ? T extends {
|
|
1723
1769
|
readonly kind: "result";
|
|
1724
1770
|
} ? T : never : never : never) extends (infer T_1) ? T_1 extends (MetadataOf<TArguments[number]> extends (infer T_2) ? T_2 extends MetadataOf<TArguments[number]> ? T_2 extends {
|
|
1725
1771
|
readonly kind: "result";
|
|
@@ -1730,7 +1776,7 @@ declare function concat<const TArguments extends readonly Operand<string>[]>(...
|
|
|
1730
1776
|
readonly dependencies: infer TDependencies;
|
|
1731
1777
|
} ? TDependencies : never : never : never> | (MetadataOf<TArguments[number]> extends (infer T_4) ? T_4 extends MetadataOf<TArguments[number]> ? T_4 extends {
|
|
1732
1778
|
readonly kind: "result" | "cardinality";
|
|
1733
|
-
} ? never : T_4 : never : never), "function"
|
|
1779
|
+
} ? never : T_4 : never : never), "function"> & SchemaExpressionBrand & ResultValueCarrier;
|
|
1734
1780
|
//#endregion
|
|
1735
1781
|
//#region src/expressions/functions/window.d.ts
|
|
1736
1782
|
type WindowOrder = AnyExpression | OrderTerm<any>;
|
|
@@ -2670,6 +2716,11 @@ type DeclaredColumnNullabilityOf<TColumn> = TColumn extends DeclaredColumnNullab
|
|
|
2670
2716
|
//#endregion
|
|
2671
2717
|
//#region src/schema/indexes.d.ts
|
|
2672
2718
|
type IndexTerm = AnyExpression | OrderTerm<any>;
|
|
2719
|
+
/** Additional physical facts attached to one index term. */
|
|
2720
|
+
interface IndexTermOptions {
|
|
2721
|
+
readonly prefixLength?: SchemaLiteralValue | AnySchemaExpression;
|
|
2722
|
+
readonly operatorClass?: string;
|
|
2723
|
+
}
|
|
2673
2724
|
/** PostgreSQL-specific index method and storage metadata. */
|
|
2674
2725
|
interface PostgresIndexExtension extends SchemaDialectExtension<"postgresql"> {
|
|
2675
2726
|
readonly method?: "btree" | "hash" | "gist" | "spgist" | "gin" | "brin";
|
|
@@ -2698,6 +2749,12 @@ interface IndexOptions<TPredicate extends AnyExpression | undefined = AnyExpress
|
|
|
2698
2749
|
readonly include?: readonly ColumnReference<string, any>[];
|
|
2699
2750
|
/** Typed engine-specific index options. */
|
|
2700
2751
|
readonly dialect?: TExtension;
|
|
2752
|
+
/** Exact engine index method, when it is not dialect-extension data. */
|
|
2753
|
+
readonly method?: string;
|
|
2754
|
+
/** Physical backing constraint name, when the engine exposes one. */
|
|
2755
|
+
readonly backingConstraint?: string;
|
|
2756
|
+
/** Prefix lengths and operator classes aligned with the terms array. */
|
|
2757
|
+
readonly termOptions?: readonly (IndexTermOptions | undefined)[];
|
|
2701
2758
|
}
|
|
2702
2759
|
type IndexTermExpression$2<TTerm> = TTerm extends OrderTerm<any> ? TTerm["expression"] : TTerm;
|
|
2703
2760
|
type IsNullableIndexColumn<TColumn> = [DeclaredColumnNullabilityOf<TColumn>] extends [never] ? null extends OutputOf<TColumn> ? true : false : true extends DeclaredColumnNullabilityOf<TColumn> ? true : false;
|
|
@@ -2710,7 +2767,8 @@ type DialectOption<TOptions> = TOptions extends {
|
|
|
2710
2767
|
readonly dialect?: infer TDialect;
|
|
2711
2768
|
} ? unknown extends TDialect ? IndexDialectExtension | undefined : TDialect : undefined;
|
|
2712
2769
|
type PredicatePresence<TOptions> = [Exclude<PredicateOption<TOptions>, undefined>] extends [never] ? false : undefined extends PredicateOption<TOptions> ? boolean : true;
|
|
2713
|
-
type
|
|
2770
|
+
type HasTermOptions<TOptions> = "termOptions" extends keyof TOptions ? true : false;
|
|
2771
|
+
type IsCandidateKey<TTerms extends readonly IndexTerm[], TOptions extends IndexOptions<any>> = HasTermOptions<TOptions> extends true ? false : UniqueOption<TOptions> extends false ? false : PredicatePresence<TOptions> extends true ? false : AllEligibleColumns<TTerms> extends false ? false : UniqueOption<TOptions> extends true ? PredicatePresence<TOptions> extends false ? AllEligibleColumns<TTerms> extends true ? true : boolean : boolean : boolean;
|
|
2714
2772
|
/** Portable index metadata retained by a table and its aliases. */
|
|
2715
2773
|
interface TableIndex<TTerms extends readonly IndexTerm[] = any, TOptions extends IndexOptions<any> = any> extends SchemaObjectIdentity {
|
|
2716
2774
|
readonly kind: "index";
|
|
@@ -2721,6 +2779,9 @@ interface TableIndex<TTerms extends readonly IndexTerm[] = any, TOptions extends
|
|
|
2721
2779
|
readonly include: infer TIncluded;
|
|
2722
2780
|
} ? TIncluded : undefined;
|
|
2723
2781
|
readonly dialect?: DialectOption<TOptions>;
|
|
2782
|
+
readonly method?: "method" extends keyof TOptions ? TOptions["method"] : undefined;
|
|
2783
|
+
readonly backingConstraint?: "backingConstraint" extends keyof TOptions ? TOptions["backingConstraint"] : undefined;
|
|
2784
|
+
readonly termOptions?: "termOptions" extends keyof TOptions ? TOptions["termOptions"] : undefined;
|
|
2724
2785
|
readonly candidateKey: IsCandidateKey<TTerms, TOptions>;
|
|
2725
2786
|
}
|
|
2726
2787
|
/** The widened index shape accepted by source metadata records. */
|
|
@@ -2731,6 +2792,9 @@ interface SourceIndex {
|
|
|
2731
2792
|
readonly predicate: AnyExpression | undefined;
|
|
2732
2793
|
readonly includedColumns?: readonly ColumnReference<string, any>[];
|
|
2733
2794
|
readonly dialect?: IndexDialectExtension;
|
|
2795
|
+
readonly method?: string;
|
|
2796
|
+
readonly backingConstraint?: string;
|
|
2797
|
+
readonly termOptions?: readonly (IndexTermOptions | undefined)[];
|
|
2734
2798
|
readonly candidateKey: boolean;
|
|
2735
2799
|
}
|
|
2736
2800
|
type SourceIndexesRecord = Readonly<Record<string, SourceIndex>>;
|
|
@@ -2878,11 +2942,15 @@ interface MysqlConstraintExtension extends SchemaDialectExtension<"mysql"> {
|
|
|
2878
2942
|
type ConstraintDialectExtension = PostgresConstraintExtension | SqliteConstraintExtension | MysqlConstraintExtension | (SchemaDialectExtension<string> & Readonly<Record<string, unknown>>);
|
|
2879
2943
|
/** Shared physical-name and dialect-extension options for constraints. */
|
|
2880
2944
|
interface ConstraintOptions<TExtension extends ConstraintDialectExtension | undefined = ConstraintDialectExtension | undefined> extends SchemaObjectNameOptions {
|
|
2945
|
+
/** Whether the database constraint has been validated. */
|
|
2946
|
+
readonly validated?: boolean;
|
|
2881
2947
|
/** Engine-specific metadata owned by a future schema adapter. */
|
|
2882
2948
|
readonly dialect?: TExtension;
|
|
2883
2949
|
}
|
|
2884
2950
|
/** Options for primary-key and candidate-key declarations. */
|
|
2885
2951
|
interface KeyConstraintOptions<TExtension extends ConstraintDialectExtension | undefined = ConstraintDialectExtension | undefined> extends ConstraintOptions<TExtension> {
|
|
2952
|
+
/** Physical backing index name, when exposed by the database. */
|
|
2953
|
+
readonly backingIndex?: string;
|
|
2886
2954
|
/** Whether the key can be deferred by a supporting dialect. */
|
|
2887
2955
|
readonly deferrable?: boolean;
|
|
2888
2956
|
/** Initial enforcement timing for a deferrable key. */
|
|
@@ -2890,6 +2958,8 @@ interface KeyConstraintOptions<TExtension extends ConstraintDialectExtension | u
|
|
|
2890
2958
|
}
|
|
2891
2959
|
/** Options for a database unique constraint, including nullable columns. */
|
|
2892
2960
|
interface UniqueConstraintOptions<TExtension extends ConstraintDialectExtension | undefined = ConstraintDialectExtension | undefined> extends ConstraintOptions<TExtension> {
|
|
2961
|
+
/** Physical backing index name, when exposed by the database. */
|
|
2962
|
+
readonly backingIndex?: string;
|
|
2893
2963
|
/**
|
|
2894
2964
|
* SQL NULL comparison semantics. `distinct` is the common default in which multiple NULL values
|
|
2895
2965
|
* do not conflict; `not-distinct` permits at most one.
|
|
@@ -2930,6 +3000,8 @@ interface KeyConstraint<TKind extends "primary-key" | "unique" = "primary-key" |
|
|
|
2930
3000
|
readonly columns: TColumns;
|
|
2931
3001
|
readonly physicalName?: string;
|
|
2932
3002
|
readonly dialect?: ConstraintDialectExtension;
|
|
3003
|
+
readonly validated?: boolean;
|
|
3004
|
+
readonly backingIndex?: string;
|
|
2933
3005
|
readonly deferrable?: boolean;
|
|
2934
3006
|
readonly initially?: ConstraintTiming;
|
|
2935
3007
|
}
|
|
@@ -2946,6 +3018,7 @@ interface ForeignKeyConstraint<TColumns extends readonly AnyKeyColumn[] = readon
|
|
|
2946
3018
|
readonly target: TTarget;
|
|
2947
3019
|
readonly physicalName?: string;
|
|
2948
3020
|
readonly dialect?: ConstraintDialectExtension;
|
|
3021
|
+
readonly validated?: boolean;
|
|
2949
3022
|
readonly onUpdate?: ReferentialAction;
|
|
2950
3023
|
readonly onDelete?: ReferentialAction;
|
|
2951
3024
|
readonly match?: ForeignKeyMatch;
|
|
@@ -2959,6 +3032,8 @@ interface UniqueConstraint<TColumns extends readonly AnyKeyColumn[] = readonly A
|
|
|
2959
3032
|
readonly nulls: TNulls;
|
|
2960
3033
|
readonly physicalName?: string;
|
|
2961
3034
|
readonly dialect?: ConstraintDialectExtension;
|
|
3035
|
+
readonly validated?: boolean;
|
|
3036
|
+
readonly backingIndex?: string;
|
|
2962
3037
|
readonly deferrable?: boolean;
|
|
2963
3038
|
readonly initially?: ConstraintTiming;
|
|
2964
3039
|
}
|
|
@@ -2968,6 +3043,7 @@ interface CheckConstraint<TExpression extends AnyExpression = AnyExpression> ext
|
|
|
2968
3043
|
readonly expression: TExpression;
|
|
2969
3044
|
readonly physicalName?: string;
|
|
2970
3045
|
readonly dialect?: ConstraintDialectExtension;
|
|
3046
|
+
readonly validated?: boolean;
|
|
2971
3047
|
readonly deferrable?: boolean;
|
|
2972
3048
|
readonly initially?: ConstraintTiming;
|
|
2973
3049
|
}
|
|
@@ -3237,14 +3313,14 @@ interface SchemaDialectHooks {
|
|
|
3237
3313
|
* A schema dialect must be created with {@link createSchemaDialect}; that helper preserves the exact
|
|
3238
3314
|
* query rendering object and adds only schema behavior and snapshot metadata.
|
|
3239
3315
|
*/
|
|
3240
|
-
interface SchemaDialect<TCapabilities extends
|
|
3316
|
+
interface SchemaDialect<TCapabilities extends string = DialectCapability> extends Dialect<TCapabilities> {
|
|
3241
3317
|
readonly schema: SchemaDialectHooks;
|
|
3242
3318
|
}
|
|
3243
3319
|
/**
|
|
3244
3320
|
* Add schema behavior to an existing query dialect without rebuilding any of its identifier,
|
|
3245
3321
|
* literal, placeholder, JSON, cast, or capability policies.
|
|
3246
3322
|
*/
|
|
3247
|
-
declare function createSchemaDialect<const TCapabilities extends
|
|
3323
|
+
declare function createSchemaDialect<const TCapabilities extends string = DialectCapability>(queryDialect: Dialect<TCapabilities>, schema: SchemaDialectHooks): SchemaDialect<TCapabilities>;
|
|
3248
3324
|
//#endregion
|
|
3249
3325
|
//#region src/query/selection.d.ts
|
|
3250
3326
|
/**
|
|
@@ -3499,13 +3575,15 @@ interface MutationQuery<TConfig extends MutationQueryConfig = {}> extends Query<
|
|
|
3499
3575
|
}> {
|
|
3500
3576
|
readonly queryKind: MutationConfigKind<TConfig>;
|
|
3501
3577
|
}
|
|
3502
|
-
|
|
3578
|
+
/** Metadata inherited from clauses and expressions composed into a mutation. */
|
|
3579
|
+
type MutationMetadata<T> = CapabilityMetadataOf<T> | RequiresOuterMetadataOf<T>;
|
|
3503
3580
|
interface AllowAllClause extends Fragment<never> {
|
|
3504
3581
|
readonly clauseKind: "allow-all";
|
|
3505
3582
|
}
|
|
3506
3583
|
declare function allowAll(): AllowAllClause;
|
|
3507
3584
|
type MutationConditionClause = WhereClause<any>;
|
|
3508
|
-
type
|
|
3585
|
+
type MutationWithClause = WithClause<any>;
|
|
3586
|
+
type MutationClause = MutationConditionClause | AllowAllClause | MutationReturningClause | MutationWithClause;
|
|
3509
3587
|
type MutationSafetyValidation<TClauses extends readonly unknown[]> = Extract<TClauses[number], MutationConditionClause | AllowAllClause> extends never ? QueryTypeValidation<"unsafe-mutation", "mutation.safety", "Add where(...) or allowAll() explicitly."> : unknown;
|
|
3510
3588
|
type MutationReturningClause = ReturningClause<any>;
|
|
3511
3589
|
type MutationReturning<TClauses extends readonly unknown[]> = Extract<TClauses[number], MutationReturningClause>;
|
|
@@ -3513,20 +3591,61 @@ type MutationRow<TClauses extends readonly unknown[]> = ReturningRow<MutationRet
|
|
|
3513
3591
|
type MutationSqlTypes<TClauses extends readonly unknown[]> = ReturningSqlTypes<MutationReturning<TClauses>>;
|
|
3514
3592
|
type MutationScopeValidation<TSource, TClauses extends readonly unknown[]> = [Exclude<RequiresOf<TClauses[number]>, SourceIdentity<TSource>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "mutation.scope", "Use clauses that reference the mutation table or an explicitly correlated source.", Exclude<RequiresOf<TClauses[number]>, SourceIdentity<TSource>>>;
|
|
3515
3593
|
//#endregion
|
|
3594
|
+
//#region src/query/mutation/update-from.d.ts
|
|
3595
|
+
/** A PostgreSQL FROM clause that contributes typed sources to an UPDATE scope. */
|
|
3596
|
+
interface UpdateFromClause<TSources extends readonly AnySource[] = readonly AnySource[], TMetadata = RequiresOuterMetadataOf<TSources[number]> | CapabilityMetadataOf<TSources[number]> | RequiresCapabilityMeta<"update-from">> extends Fragment<TMetadata> {
|
|
3597
|
+
readonly clauseKind: "update-from";
|
|
3598
|
+
readonly sources: TSources;
|
|
3599
|
+
}
|
|
3600
|
+
/** Introduce one or more PostgreSQL sources to an UPDATE statement. */
|
|
3601
|
+
declare function updateFrom<const TSources extends readonly [AnySource, ...AnySource[]]>(...sources: TSources): UpdateFromClause<TSources>;
|
|
3602
|
+
/** Source identities introduced to an UPDATE by updateFrom(). */
|
|
3603
|
+
type UpdateFromScope<T> = T extends UpdateFromClause<infer TSources> ? ProvidedSourceIdentity<TSources[number]> : never;
|
|
3604
|
+
//#endregion
|
|
3516
3605
|
//#region src/query/mutation/update.d.ts
|
|
3517
3606
|
/** A value, target-compatible expression, or explicitly omitted update field. */
|
|
3518
3607
|
type UpdateAssignmentValue<T> = T | ExpressionWithOutput<T> | Omit$1;
|
|
3519
3608
|
/** Writable table fields accepted by {@link update}. */
|
|
3520
3609
|
type UpdateAssignments<TTable extends AnyTable> = { -readonly [K in keyof TableUpdateInput<TTable["definitions"]>]?: UpdateAssignmentValue<TableUpdateInput<TTable["definitions"]>[K]>; };
|
|
3521
3610
|
type InvalidUpdateAssignments<TTable extends AnyTable, TAssignments> = TAssignments extends UpdateAssignments<TTable> ? Exclude<keyof TAssignments, keyof UpdateAssignments<TTable>> extends never ? unknown : QueryTypeValidation<"invalid-update", "update.assignments", "Use only columns declared by the update table.", Exclude<keyof TAssignments, keyof UpdateAssignments<TTable>>> : QueryTypeValidation<"invalid-update", "update.assignments", "Provide values or expressions matching the update table columns.", TAssignments>;
|
|
3522
|
-
type AssignmentScopeValidation<TTable extends AnyTable, TAssignments> = [Exclude<RequiresOf<TAssignments extends object ? TAssignments[keyof TAssignments] : never>, SourceIdentity<TTable>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "update.assignments", "Use expressions scoped to the update table.", Exclude<RequiresOf<TAssignments extends object ? TAssignments[keyof TAssignments] : never>, SourceIdentity<TTable>>>;
|
|
3523
|
-
|
|
3611
|
+
type AssignmentScopeValidation<TTable extends AnyTable, TAssignments, TClauses extends readonly UpdateClause[]> = [Exclude<RequiresOf<TAssignments extends object ? TAssignments[keyof TAssignments] : never>, SourceIdentity<TTable> | UpdateFromScope<TClauses[number]>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "update.assignments", "Use expressions scoped to the update table or an updateFrom() source.", Exclude<RequiresOf<TAssignments extends object ? TAssignments[keyof TAssignments] : never>, SourceIdentity<TTable> | UpdateFromScope<TClauses[number]>>>;
|
|
3612
|
+
type UpdateClause = MutationClause | UpdateFromClause;
|
|
3613
|
+
type UpdateScopeValidation<TTable extends AnyTable, TClauses extends readonly UpdateClause[]> = [Exclude<RequiresOf<TClauses[number]>, SourceIdentity<TTable> | UpdateFromScope<TClauses[number]>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "mutation.scope", "Use clauses that reference the update table or an updateFrom() source.", Exclude<RequiresOf<TClauses[number]>, SourceIdentity<TTable> | UpdateFromScope<TClauses[number]>>>;
|
|
3614
|
+
type UpdateFromSourceValidation<TClauses extends readonly UpdateClause[]> = [Exclude<RequiresOuterOf<Extract<TClauses[number], UpdateFromClause>>, UpdateFromScope<TClauses[number]>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "update.from", "Use FROM sources whose outer requirements are provided by another updateFrom() source.", Exclude<RequiresOuterOf<Extract<TClauses[number], UpdateFromClause>>, UpdateFromScope<TClauses[number]>>>;
|
|
3615
|
+
declare function update<const TTable extends AnyTable, const TAssignments extends object, const TClauses extends readonly UpdateClause[]>(table: TTable, assignments: TAssignments & InvalidUpdateAssignments<TTable, TAssignments> & AssignmentScopeValidation<TTable, TAssignments, TClauses>, ...clauses: TClauses & UpdateScopeValidation<TTable, TClauses> & UpdateFromSourceValidation<TClauses> & MutationSafetyValidation<TClauses>): MutationQuery<{
|
|
3524
3616
|
readonly row: MutationRow<TClauses>;
|
|
3525
3617
|
readonly kind: "update";
|
|
3526
|
-
readonly metadata:
|
|
3618
|
+
readonly metadata: MutationMetadata<TClauses[number] | (TAssignments extends object ? TAssignments[keyof TAssignments] : never)>;
|
|
3527
3619
|
readonly sqlTypes: MutationSqlTypes<TClauses>;
|
|
3528
3620
|
}>;
|
|
3529
3621
|
//#endregion
|
|
3622
|
+
//#region src/query/mutation/on-duplicate-key-update.d.ts
|
|
3623
|
+
/** Identity of the proposed row for one MySQL INSERT target. */
|
|
3624
|
+
type IncomingIdentity<TIdentity> = {
|
|
3625
|
+
readonly sourceKind: "mysql-incoming";
|
|
3626
|
+
readonly table: TIdentity;
|
|
3627
|
+
};
|
|
3628
|
+
/** Typed proposed-row columns usable only in duplicate-key assignments. */
|
|
3629
|
+
type IncomingColumns<TTable extends AnyTable> = SourceColumns<SourceRow<TTable>, IncomingIdentity<SourceIdentity<TTable>>, SourceSqlTypeMap<TTable>>;
|
|
3630
|
+
/**
|
|
3631
|
+
* Reference the incoming row in MySQL duplicate-key assignments. INSERT SELECT exposes only its
|
|
3632
|
+
* explicit target columns; other references fail during rendering. These references cannot be used
|
|
3633
|
+
* as a FROM source.
|
|
3634
|
+
*/
|
|
3635
|
+
declare function incoming<const TTable extends AnyTable>(table: TTable): IncomingColumns<TTable>;
|
|
3636
|
+
type AssignmentValidation<TTable extends AnyTable, TAssignments extends object> = TAssignments extends UpdateAssignments<TTable> ? Exclude<keyof TAssignments, keyof UpdateAssignments<TTable>> extends never ? Exclude<RequiresOf<TAssignments[keyof TAssignments]> | RequiresOuterOf<TAssignments[keyof TAssignments]>, SourceIdentity<TTable> | IncomingIdentity<SourceIdentity<TTable>>> extends never ? unknown : QueryTypeValidation<"missing-source", "upsert.duplicate-key.assignments", "Use only the target table and its incoming row."> : QueryTypeValidation<"invalid-update", "upsert.duplicate-key.assignments", "Use only writable target columns."> : QueryTypeValidation<"invalid-update", "upsert.duplicate-key.assignments", "Provide target-compatible assignment values.">;
|
|
3637
|
+
/** MySQL INSERT clause; conflicts are determined by the database's keys. */
|
|
3638
|
+
interface OnDuplicateKeyUpdateClause<TTable extends AnyTable = AnyTable, TAssignments extends object = object> extends Fragment<RequiresCapabilityMeta<"on-duplicate-key-update"> | RequiresSourceMeta<SourceIdentity<TTable>> | CapabilityMetadataOf<TAssignments[keyof TAssignments]>> {
|
|
3639
|
+
readonly clauseKind: "on-duplicate-key-update";
|
|
3640
|
+
readonly table: TTable;
|
|
3641
|
+
}
|
|
3642
|
+
/**
|
|
3643
|
+
* Update writable columns when a MySQL INSERT row conflicts with a key. Raw values use target
|
|
3644
|
+
* column encoders. Expressions may reference the target table or incoming(table). At least one
|
|
3645
|
+
* non-omitted assignment is required.
|
|
3646
|
+
*/
|
|
3647
|
+
declare function onDuplicateKeyUpdate<const TTable extends AnyTable, const TAssignments extends object>(table: TTable, assignments: TAssignments & AssignmentValidation<TTable, TAssignments>): OnDuplicateKeyUpdateClause<TTable, TAssignments>;
|
|
3648
|
+
//#endregion
|
|
3530
3649
|
//#region src/query/mutation/on-conflict.d.ts
|
|
3531
3650
|
type ExcludedIdentity<TTableIdentity> = {
|
|
3532
3651
|
readonly sourceKind: "excluded";
|
|
@@ -3556,8 +3675,15 @@ type TableConstraints<TTable extends AnyTable> = TTable extends {
|
|
|
3556
3675
|
readonly constraints: infer TConstraints extends SourceConstraintsRecord;
|
|
3557
3676
|
} ? TConstraints : never;
|
|
3558
3677
|
type TableKeyConstraint<TTable extends AnyTable> = Extract<TableConstraints<TTable>[keyof TableConstraints<TTable>], KeyConstraint>;
|
|
3559
|
-
|
|
3560
|
-
|
|
3678
|
+
type TableIndexes<TTable extends AnyTable> = TTable extends {
|
|
3679
|
+
readonly indexes: infer TIndexes extends SourceIndexesRecord;
|
|
3680
|
+
} ? TIndexes : never;
|
|
3681
|
+
type PostgresUniqueIndex<TIndex> = TIndex extends SourceIndex ? TIndex["unique"] extends true ? [Exclude<TIndex["dialect"], undefined>] extends [never] ? TIndex : Exclude<TIndex["dialect"], undefined> extends {
|
|
3682
|
+
readonly dialect: "postgresql";
|
|
3683
|
+
} ? TIndex : never : never : never;
|
|
3684
|
+
type TableConflictIndex<TTable extends AnyTable> = PostgresUniqueIndex<TableIndexes<TTable>[keyof TableIndexes<TTable>]>;
|
|
3685
|
+
/** A declared primary key, unique constraint, or PostgreSQL-compatible unique index. */
|
|
3686
|
+
type ConflictTarget<TTable extends AnyTable = AnyTable> = TableKeyConstraint<TTable> | TableConflictIndex<TTable>;
|
|
3561
3687
|
type ConflictSources<TTable extends AnyTable> = SourceIdentity<TTable> | ExcludedIdentity<SourceIdentity<TTable>>;
|
|
3562
3688
|
type ConflictAssignmentValidation<TTable extends AnyTable, TAssignments> = TAssignments extends UpdateAssignments<TTable> ? Exclude<keyof TAssignments, keyof UpdateAssignments<TTable>> extends never ? [Exclude<RequiresOf<TAssignments[keyof TAssignments]>, ConflictSources<TTable>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "upsert.update.assignments", "Use expressions scoped to the target table or excluded row.", Exclude<RequiresOf<TAssignments[keyof TAssignments]>, ConflictSources<TTable>>> : QueryTypeValidation<"invalid-update", "upsert.update.assignments", "Use only writable columns declared by the target table.", Exclude<keyof TAssignments, keyof UpdateAssignments<TTable>>> : QueryTypeValidation<"invalid-update", "upsert.update.assignments", "Provide values or expressions matching the target table update columns.", TAssignments>;
|
|
3563
3689
|
type ConflictWhereValidation<TTable extends AnyTable, TWhere> = TWhere extends undefined ? unknown : [Exclude<RequiresOf<TWhere>, ConflictSources<TTable>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "upsert.update.where", "Use expressions scoped to the target table or excluded row.", Exclude<RequiresOf<TWhere>, ConflictSources<TTable>>>;
|
|
@@ -3565,10 +3691,10 @@ type ConflictActionValidation<TTable extends AnyTable, TAction extends ConflictA
|
|
|
3565
3691
|
type ConflictActionCapabilities<TAction extends ConflictAction> = TAction extends DoUpdateAction<infer TAssignments, infer TWhere> ? CapabilityMetadataOf<TAssignments[keyof TAssignments] | Exclude<TWhere, undefined>> : never;
|
|
3566
3692
|
interface OnConflictClause<TAction extends ConflictAction = ConflictAction> extends Fragment<RequiresCapabilityMeta<"on-conflict"> | ConflictActionCapabilities<TAction>> {
|
|
3567
3693
|
readonly clauseKind: "on-conflict";
|
|
3568
|
-
readonly target: KeyConstraint | undefined;
|
|
3694
|
+
readonly target: KeyConstraint | SourceIndex | undefined;
|
|
3569
3695
|
readonly action: TAction;
|
|
3570
3696
|
}
|
|
3571
|
-
type InsertClause = MutationReturningClause | OnConflictClause
|
|
3697
|
+
type InsertClause = MutationReturningClause | OnConflictClause | MutationWithClause | OnDuplicateKeyUpdateClause<any, any>;
|
|
3572
3698
|
declare function onConflict(action: DoNothingAction): OnConflictClause<DoNothingAction>;
|
|
3573
3699
|
declare function onConflict<const TTable extends AnyTable, const TTarget extends ConflictTarget<TTable>, const TAction extends ConflictAction>(table: TTable, target: TTarget, action: TAction & ConflictActionValidation<TTable, TAction>): OnConflictClause<TAction>;
|
|
3574
3700
|
//#endregion
|
|
@@ -3589,9 +3715,14 @@ interface InsertSelectSource<TQuery extends AnyQuery = AnyQuery, TColumns extend
|
|
|
3589
3715
|
}
|
|
3590
3716
|
declare function insertSelect<TQuery extends AnyQuery, const TColumns extends readonly [string, ...string[]]>(query: TQuery, columns: TColumns): InsertSelectSource<TQuery, TColumns>;
|
|
3591
3717
|
type InsertSource = ValuesSource<any> | DefaultValuesSource | InsertSelectSource<any, any>;
|
|
3592
|
-
type
|
|
3593
|
-
|
|
3594
|
-
type
|
|
3718
|
+
type InsertSourceMetadata<TSource extends InsertSource> = TSource extends InsertSelectSource<infer TQuery, any> ? CapabilityMetadataOf<TQuery> | RequiresOuterMetadataOf<TQuery> : TSource extends ValuesSource<infer TRows> ? CapabilityMetadataOf<InsertRowsValue<TRows>> : never;
|
|
3719
|
+
/** A raw application input or target-compatible expression accepted by an insert field. */
|
|
3720
|
+
type InsertValue<T> = T | ExpressionWithOutput<T>;
|
|
3721
|
+
/** Writable table fields accepted by {@link insertInto} through {@link values}. */
|
|
3722
|
+
type InsertValuesRow<TTable extends AnyTable> = { -readonly [K in keyof TableInsertInput<TTable["definitions"]>]: InsertValue<TableInsertInput<TTable["definitions"]>[K]>; };
|
|
3723
|
+
type InsertRowsValue<TRows extends readonly object[]> = TRows[number] extends (infer TRow) ? TRow extends object ? TRow[keyof TRow] : never : never;
|
|
3724
|
+
type InsertValuesScopeValidation<TSource extends InsertSource> = TSource extends ValuesSource<infer TRows> ? [RequiresOf<InsertRowsValue<TRows>>] extends [never] ? unknown : QueryTypeValidation<"missing-source", "insert.values.row", "Use source-free expressions in INSERT values.", RequiresOf<InsertRowsValue<TRows>>> : unknown;
|
|
3725
|
+
type InvalidInsertRow<TTable extends AnyTable, TRow> = TRow extends InsertValuesRow<TTable> ? Exclude<keyof TRow, keyof InsertValuesRow<TTable>> extends never ? unknown : QueryTypeValidation<"invalid-insert", "insert.values.columns", "Use only columns declared by the insert table.", Exclude<keyof TRow, keyof InsertValuesRow<TTable>>> : QueryTypeValidation<"invalid-insert", "insert.values.row", "Provide values matching the insert table columns.", TRow>;
|
|
3595
3726
|
type ValidInsertSource<TTable extends AnyTable, TSource extends InsertSource> = TSource extends ValuesSource<infer TRows> ? TRows[number] extends (infer TRow) ? InvalidInsertRow<TTable, TRow> : never : TSource extends DefaultValuesSource ? Exclude<keyof TTable["definitions"], { [K in keyof TTable["definitions"]]-?: ColumnIsGenerated<TTable["definitions"][K]> extends true ? K : TTable["definitions"][K] extends {
|
|
3596
3727
|
hasDefault: true;
|
|
3597
3728
|
} | {
|
|
@@ -3601,10 +3732,14 @@ type ValidInsertSource<TTable extends AnyTable, TSource extends InsertSource> =
|
|
|
3601
3732
|
} | {
|
|
3602
3733
|
hasRuntimeDefault: true;
|
|
3603
3734
|
} ? K : never; }[keyof TTable["definitions"]]>> : TSource extends InsertSelectSource<any, infer TColumns> ? Exclude<TColumns[number], keyof TTable["definitions"]> extends never ? Exclude<{ [K in keyof TTable["definitions"]]-?: ColumnIsGenerated<TTable["definitions"][K]> extends true ? never : ColumnHasDefault<TTable["definitions"][K]> extends true ? never : K; }[keyof TTable["definitions"]], TColumns[number]> extends never ? unknown : QueryTypeValidation<"invalid-insert", "insert.select.columns", "Include every required insert column in the target list.", Exclude<{ [K in keyof TTable["definitions"]]-?: ColumnIsGenerated<TTable["definitions"][K]> extends true ? never : ColumnHasDefault<TTable["definitions"][K]> extends true ? never : K; }[keyof TTable["definitions"]], TColumns[number]>> : QueryTypeValidation<"invalid-insert", "insert.select.columns", "Use only columns declared by the insert table.", Exclude<TColumns[number], keyof TTable["definitions"]>> : never;
|
|
3604
|
-
declare function insertInto<const TTable extends AnyTable, const TSource extends InsertSource, const TClauses extends readonly InsertClause[]>(table: TTable, source: TSource & ValidInsertSource<TTable, TSource>, ...clauses: TClauses & MutationScopeValidation<TTable, TClauses>
|
|
3735
|
+
declare function insertInto<const TTable extends AnyTable, const TSource extends InsertSource, const TClauses extends readonly InsertClause[]>(table: TTable, source: TSource & ValidInsertSource<TTable, TSource> & InsertValuesScopeValidation<TSource>, ...clauses: TClauses & MutationScopeValidation<TTable, TClauses> & (Extract<TClauses[number], {
|
|
3736
|
+
clauseKind: "on-duplicate-key-update";
|
|
3737
|
+
}> extends never ? unknown : Extract<TClauses[number], {
|
|
3738
|
+
clauseKind: "returning";
|
|
3739
|
+
}> extends never ? unknown : QueryTypeValidation<"invalid-mutation", "insert.duplicate-key", "MySQL duplicate-key updates do not support RETURNING.">)): MutationQuery<{
|
|
3605
3740
|
readonly row: MutationRow<TClauses>;
|
|
3606
3741
|
readonly kind: "insert";
|
|
3607
|
-
readonly metadata:
|
|
3742
|
+
readonly metadata: MutationMetadata<TClauses[number]> | InsertSourceMetadata<TSource>;
|
|
3608
3743
|
readonly sqlTypes: MutationSqlTypes<TClauses>;
|
|
3609
3744
|
}>;
|
|
3610
3745
|
//#endregion
|
|
@@ -3612,10 +3747,41 @@ declare function insertInto<const TTable extends AnyTable, const TSource extends
|
|
|
3612
3747
|
declare function deleteFrom<const TTable extends AnyTable, const TClauses extends readonly MutationClause[]>(table: TTable, ...clauses: TClauses & MutationScopeValidation<TTable, TClauses> & MutationSafetyValidation<TClauses>): MutationQuery<{
|
|
3613
3748
|
readonly row: MutationRow<TClauses>;
|
|
3614
3749
|
readonly kind: "delete";
|
|
3615
|
-
readonly metadata:
|
|
3750
|
+
readonly metadata: MutationMetadata<TClauses[number]>;
|
|
3616
3751
|
readonly sqlTypes: MutationSqlTypes<TClauses>;
|
|
3617
3752
|
}>;
|
|
3618
3753
|
//#endregion
|
|
3754
|
+
//#region src/expressions/nested-json.d.ts
|
|
3755
|
+
type JsonSourceQuery = AnyQuery & {
|
|
3756
|
+
readonly queryKind: "select" | "set";
|
|
3757
|
+
};
|
|
3758
|
+
type JsonQueryExpression<TQuery, TOutput> = Expression<ResultMeta<TOutput, never, SqlJson<TOutput>> | InheritedMetadata<TQuery> | SubqueryMeta, "subquery">;
|
|
3759
|
+
type ObjectQueryValidation<TQuery> = 0 extends 1 & CardinalityOf<TQuery> ? QueryTypeValidation<"invalid-subquery", "jsonObjectFrom.query", "Prove at most one row with fetchFirst(1)."> : [CardinalityOf<TQuery>] extends ["exactly-one" | "zero-or-one"] ? unknown : QueryTypeValidation<"invalid-subquery", "jsonObjectFrom.query", "Prove at most one row with fetchFirst(1).">;
|
|
3760
|
+
/**
|
|
3761
|
+
* Turn a SELECT or set query into an inferred array expression; empty queries return [].
|
|
3762
|
+
*
|
|
3763
|
+
* Preserves correlation, explicit ordering and pagination on PostgreSQL, MySQL 8.0.21+, and SQLite
|
|
3764
|
+
* 3.45+. Without ORDER BY, element order is unspecified. DISTINCT ordering must use expressions
|
|
3765
|
+
* present in the projection.
|
|
3766
|
+
*
|
|
3767
|
+
* Nested fields require supported runtime SQL domains. Bigints, binary values and serialized JSON
|
|
3768
|
+
* use exact text transport; dates and booleans are normalized without adapter-specific decoders.
|
|
3769
|
+
* Unsupported domains or lossy numeric representations throw. Custom result decoders receive the
|
|
3770
|
+
* transport value (including strings for bigint, decimal, binary hex and JSON), consistent with
|
|
3771
|
+
* their unknown-input contract.
|
|
3772
|
+
*/
|
|
3773
|
+
declare function jsonArrayFrom<TQuery extends JsonSourceQuery>(query: TQuery): JsonQueryExpression<TQuery, QueryRow<TQuery>[]>;
|
|
3774
|
+
/**
|
|
3775
|
+
* Turn a query proven to return at most one row into an inferred object.
|
|
3776
|
+
*
|
|
3777
|
+
* Empty queries return null; exactly-one queries retain a non-null result type. Use an
|
|
3778
|
+
* unconditional fetchFirst(1) to prove the row bound for a table query. Shares dialect, projection
|
|
3779
|
+
* and exact-decoding rules with {@link jsonArrayFrom}.
|
|
3780
|
+
*
|
|
3781
|
+
* @throws {TypeError} When the query lacks a runtime at-most-one-row proof.
|
|
3782
|
+
*/
|
|
3783
|
+
declare function jsonObjectFrom<TQuery extends JsonSourceQuery>(query: TQuery & ObjectQueryValidation<TQuery>): JsonQueryExpression<TQuery, QueryRow<TQuery> | ([CardinalityOf<TQuery>] extends ["exactly-one"] ? never : null)>;
|
|
3784
|
+
//#endregion
|
|
3619
3785
|
//#region src/query/clauses/order-by.d.ts
|
|
3620
3786
|
type OrderDirection = "ASC" | "DESC";
|
|
3621
3787
|
type NullsOrder = "FIRST" | "LAST";
|
|
@@ -3657,6 +3823,7 @@ type AnyTable = Source<any> & {
|
|
|
3657
3823
|
readonly definitions: TableDefinitions;
|
|
3658
3824
|
/** Application field keys mapped to physical SQL column names. */
|
|
3659
3825
|
readonly sqlNames: Readonly<Record<string, string>>;
|
|
3826
|
+
readonly dialect?: SchemaDialectExtension;
|
|
3660
3827
|
};
|
|
3661
3828
|
type TableRow<TDefinitions extends TableDefinitions> = { -readonly [K in keyof TDefinitions]: ColumnOutput<TDefinitions[K]>; };
|
|
3662
3829
|
/** SQL semantic domains derived from a table's column definitions. */
|
|
@@ -3683,11 +3850,13 @@ type Table<TName extends string = string, TDefinitions extends TableDefinitions
|
|
|
3683
3850
|
readonly columns: TableColumns<TDefinitions, TableIdentity<TName>>;
|
|
3684
3851
|
readonly constraints: TConstraints;
|
|
3685
3852
|
readonly indexes: TIndexes;
|
|
3853
|
+
readonly dialect?: SchemaDialectExtension;
|
|
3686
3854
|
} & TableColumns<TDefinitions, TableIdentity<TName>>;
|
|
3687
3855
|
/** Schema metadata that applies to a table as a relation. */
|
|
3688
3856
|
interface TableOptions<TConstraints extends SourceConstraintsRecord = SourceConstraintsRecord, TIndexes extends SourceIndexesRecord = SourceIndexesRecord> {
|
|
3689
3857
|
readonly constraints: TConstraints;
|
|
3690
3858
|
readonly indexes: TIndexes;
|
|
3859
|
+
readonly dialect?: SchemaDialectExtension;
|
|
3691
3860
|
}
|
|
3692
3861
|
type ConstraintColumns<TConstraint> = TConstraint extends KeyConstraint<any, infer TColumns> | UniqueConstraint<infer TColumns> | ForeignKeyConstraint<infer TColumns, any> ? TColumns[number] : never;
|
|
3693
3862
|
type InvalidConstraintDependencies<TName extends string, TConstraints extends SourceConstraintsRecord> = Exclude<DependenciesOf<ConstraintColumns<TConstraints[keyof TConstraints]>>, ColumnDependency<TableIdentity<TName>, string>>;
|
|
@@ -3798,9 +3967,10 @@ interface CustomSourceOptions<TIdentity, TDefinitions extends TableDefinitions>
|
|
|
3798
3967
|
readonly columns: TDefinitions;
|
|
3799
3968
|
readonly sourceKind?: SourceKind;
|
|
3800
3969
|
}
|
|
3801
|
-
type CustomSource<TIdentity, TDefinitions extends TableDefinitions> = Source<{
|
|
3970
|
+
type CustomSource<TIdentity, TDefinitions extends TableDefinitions, TMetadata = never> = Source<{
|
|
3802
3971
|
readonly identity: TIdentity;
|
|
3803
3972
|
readonly row: TableRow<TDefinitions>;
|
|
3973
|
+
readonly metadata: TMetadata;
|
|
3804
3974
|
readonly sqlTypes: TableSqlTypes<TDefinitions>;
|
|
3805
3975
|
}> & {
|
|
3806
3976
|
readonly identity: TIdentity;
|
|
@@ -3819,7 +3989,7 @@ declare function createSource<TIdentity, TRow extends object, TMetadata = never,
|
|
|
3819
3989
|
* function. The renderer owns the relation syntax and may bind values through context.parameter();
|
|
3820
3990
|
* the source identity and output columns remain available to the normal FROM/JOIN scope checks.
|
|
3821
3991
|
*/
|
|
3822
|
-
declare function customSource<const TIdentity, const TDefinitions extends TableDefinitions>(options: CustomSourceOptions<TIdentity, TDefinitions>): CustomSource<TIdentity, TDefinitions>;
|
|
3992
|
+
declare function customSource<const TIdentity, const TDefinitions extends TableDefinitions, const TMetadata = never>(options: CustomSourceOptions<TIdentity, TDefinitions>): CustomSource<TIdentity, TDefinitions, TMetadata>;
|
|
3823
3993
|
/**
|
|
3824
3994
|
* Add convenient direct column properties without allowing a column name to overwrite the source's
|
|
3825
3995
|
* rendering or metadata primitives.
|
|
@@ -3845,9 +4015,13 @@ interface Query<TConfig extends QueryConfig = {}> extends Fragment<ResultMeta<re
|
|
|
3845
4015
|
/** @internal Type-level configuration retained for inference. */
|
|
3846
4016
|
readonly __queryConfig?: TConfig;
|
|
3847
4017
|
readonly queryKind: QueryKind;
|
|
4018
|
+
/** @internal Runtime row-bound proof retained by built-in query constructors. */
|
|
4019
|
+
readonly cardinality?: QueryCardinality;
|
|
3848
4020
|
readonly row: QueryConfigRow<TConfig>;
|
|
3849
4021
|
/** Runtime metadata used to decode named result fields. */
|
|
3850
4022
|
readonly resultShape: ResultShape;
|
|
4023
|
+
/** @internal Render a SELECT with an ordering ordinal for nested JSON aggregation. */
|
|
4024
|
+
readonly renderJsonRows?: (context: RenderContext, ordinal: string) => void;
|
|
3851
4025
|
/** Type-only SQL domains of the named query projection. */
|
|
3852
4026
|
readonly sqlTypes?: QueryConfigSqlTypes<TConfig>;
|
|
3853
4027
|
}
|
|
@@ -3869,7 +4043,7 @@ type QuerySqlTypeMap<T> = T extends {
|
|
|
3869
4043
|
//#endregion
|
|
3870
4044
|
//#region src/core/dialect.d.ts
|
|
3871
4045
|
/** Capabilities whose syntax must be explicitly supported by a dialect. */
|
|
3872
|
-
type DialectCapability = "ilike" | "json" | "on-conflict" | "row-locking";
|
|
4046
|
+
type DialectCapability = "ilike" | "json" | "on-conflict" | "on-duplicate-key-update" | "row-locking" | "update-from";
|
|
3873
4047
|
/**
|
|
3874
4048
|
* Optional dialect hook used by schema expressions when a JavaScript value must become SQL text
|
|
3875
4049
|
* instead of a query parameter.
|
|
@@ -3932,7 +4106,7 @@ interface ExplainRenderOptions {
|
|
|
3932
4106
|
interface DialectExplain {
|
|
3933
4107
|
readonly render: (statement: string, queryKind: QueryKind, options: ExplainRenderOptions) => string;
|
|
3934
4108
|
}
|
|
3935
|
-
interface Dialect<TCapabilities extends
|
|
4109
|
+
interface Dialect<TCapabilities extends string = string> {
|
|
3936
4110
|
readonly name: string;
|
|
3937
4111
|
quoteIdentifier(identifier: string): string;
|
|
3938
4112
|
placeholder(position: number): string;
|
|
@@ -3950,7 +4124,7 @@ interface Dialect<TCapabilities extends DialectCapability = DialectCapability> {
|
|
|
3950
4124
|
/** Capabilities advertised by this dialect at the rendering boundary. */
|
|
3951
4125
|
readonly capabilities?: readonly TCapabilities[];
|
|
3952
4126
|
}
|
|
3953
|
-
interface DialectOptions<TCapabilities extends
|
|
4127
|
+
interface DialectOptions<TCapabilities extends string = never, TJson extends DialectJson | undefined = DialectJson | undefined> {
|
|
3954
4128
|
readonly name: string;
|
|
3955
4129
|
readonly quoteIdentifier?: (identifier: string) => string;
|
|
3956
4130
|
readonly placeholder: (position: number) => string;
|
|
@@ -3972,20 +4146,401 @@ declare function resolveCastTarget(dialect: Dialect, target: CastTarget): string
|
|
|
3972
4146
|
* Create a dialect from the few rendering decisions that SQL builders need to leave open. More
|
|
3973
4147
|
* involved syntax can be supplied as a custom fragment.
|
|
3974
4148
|
*/
|
|
3975
|
-
declare function createDialect<const TCapabilities extends
|
|
4149
|
+
declare function createDialect<const TCapabilities extends string = never>(options: DialectOptions<TCapabilities, DialectJson> & {
|
|
3976
4150
|
readonly json: DialectJson;
|
|
3977
4151
|
}): Dialect<TCapabilities | "json">;
|
|
3978
|
-
declare function createDialect<const TCapabilities extends
|
|
4152
|
+
declare function createDialect<const TCapabilities extends string = never>(options: DialectOptions<TCapabilities, undefined>): Dialect<TCapabilities>;
|
|
3979
4153
|
/**
|
|
3980
4154
|
* Check a capability at runtime for callers that intentionally bypass the typed render boundary or
|
|
3981
4155
|
* use a dialect supplied by an older integration.
|
|
3982
4156
|
*/
|
|
3983
|
-
declare function assertDialectCapability(dialect: Dialect
|
|
4157
|
+
declare function assertDialectCapability(dialect: Dialect<string>, capability: string): void;
|
|
4158
|
+
/** Extend a dialect with capabilities owned by an addon without changing its SQL policies. */
|
|
4159
|
+
declare function extendDialect<const TCapabilities extends string, const TAdditionalCapabilities extends string>(dialect: Dialect<TCapabilities>, additionalCapabilities: readonly TAdditionalCapabilities[]): Dialect<TCapabilities | TAdditionalCapabilities>;
|
|
4160
|
+
//#endregion
|
|
4161
|
+
//#region src/snapshot/complete-types.d.ts
|
|
4162
|
+
/** The canonical schema snapshot envelope tag. */
|
|
4163
|
+
declare const completeSchemaSnapshotFormat: "qubu-schema";
|
|
4164
|
+
/** The current strict format version for the complete catalog/object model. */
|
|
4165
|
+
declare const completeSchemaSnapshotVersion: 1;
|
|
4166
|
+
/** Descriptive alias for consumers that select a numbered snapshot version. */
|
|
4167
|
+
declare const schemaSnapshotV1Version: 1;
|
|
4168
|
+
/** Explicit format-version aliases for generated tooling and fixtures. */
|
|
4169
|
+
declare const schemaSnapshotCompleteVersion: 1;
|
|
4170
|
+
declare const schemaSnapshotVersion1: 1;
|
|
4171
|
+
/** Object families that may appear in a complete canonical snapshot. */
|
|
4172
|
+
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";
|
|
4173
|
+
/** Object families that can own nested complete snapshot objects. */
|
|
4174
|
+
type CompleteSnapshotObjectOwnerKind = "table" | "view" | "materialized-view" | "domain";
|
|
4175
|
+
/** A non-recursive owner scope for a nested complete snapshot object. */
|
|
4176
|
+
interface CompleteSnapshotObjectOwner {
|
|
4177
|
+
readonly kind: CompleteSnapshotObjectOwnerKind;
|
|
4178
|
+
readonly id: string;
|
|
4179
|
+
}
|
|
4180
|
+
/** A stable logical object reference used by complete snapshot relations. */
|
|
4181
|
+
interface CompleteSnapshotObjectReference {
|
|
4182
|
+
readonly kind: Exclude<CompleteSnapshotObjectKind, "namespace">;
|
|
4183
|
+
readonly id: string;
|
|
4184
|
+
/** Required when the target is a nested column, constraint, or index. */
|
|
4185
|
+
readonly owner?: CompleteSnapshotObjectOwner;
|
|
4186
|
+
}
|
|
4187
|
+
/** Source evidence retained without persisting a database catalog key. */
|
|
4188
|
+
interface CompleteSnapshotProvenance {
|
|
4189
|
+
readonly kind: "catalog" | "decompiler" | "create-sql";
|
|
4190
|
+
readonly dialect: string;
|
|
4191
|
+
readonly path?: readonly (string | number)[];
|
|
4192
|
+
}
|
|
4193
|
+
/** Physical-name evidence retained without ephemeral catalog identity keys. */
|
|
4194
|
+
interface CompleteSnapshotPhysicalReference {
|
|
4195
|
+
readonly kind: CompleteSnapshotObjectKind;
|
|
4196
|
+
readonly namespace?: string;
|
|
4197
|
+
readonly table?: string;
|
|
4198
|
+
readonly name: string;
|
|
4199
|
+
}
|
|
4200
|
+
/** Namespace identity and selected physical boundary for a snapshot. */
|
|
4201
|
+
interface CompleteSnapshotNamespace extends CompleteSnapshotObjectMetadata {
|
|
4202
|
+
readonly kind: "generic" | "postgres-schema" | "sqlite-database" | "mysql-database";
|
|
4203
|
+
readonly name: string;
|
|
4204
|
+
}
|
|
4205
|
+
/** Capability facts reported by the adapter that produced the snapshot. */
|
|
4206
|
+
interface CompleteSnapshotCapabilities {
|
|
4207
|
+
readonly generatedColumns: boolean;
|
|
4208
|
+
readonly identityMetadata: boolean;
|
|
4209
|
+
readonly checkConstraints: boolean;
|
|
4210
|
+
readonly checkConstraintEnforcement: "enforced" | "metadata-only" | "unknown";
|
|
4211
|
+
readonly expressionDecompilation: boolean;
|
|
4212
|
+
readonly indexExpressions: boolean;
|
|
4213
|
+
readonly indexPredicates: boolean;
|
|
4214
|
+
readonly indexIncludedColumns: boolean;
|
|
4215
|
+
readonly namespaces: boolean;
|
|
4216
|
+
readonly visibility: "complete" | "limited" | "unknown";
|
|
4217
|
+
readonly [capability: string]: boolean | string;
|
|
4218
|
+
}
|
|
4219
|
+
/** Metadata common to every complete snapshot object. */
|
|
4220
|
+
interface CompleteSnapshotObjectMetadata {
|
|
4221
|
+
readonly provenance?: CompleteSnapshotProvenance;
|
|
4222
|
+
readonly physicalReference?: CompleteSnapshotPhysicalReference;
|
|
4223
|
+
readonly dialect?: SnapshotDialectExtension;
|
|
4224
|
+
}
|
|
4225
|
+
/** A complete snapshot column, including physical ordinal evidence. */
|
|
4226
|
+
interface CompleteSnapshotColumn extends CompleteSnapshotObjectMetadata {
|
|
4227
|
+
readonly kind: "column";
|
|
4228
|
+
readonly id: string;
|
|
4229
|
+
readonly physicalName: string;
|
|
4230
|
+
readonly ordinalPosition: number;
|
|
4231
|
+
readonly nullable: boolean;
|
|
4232
|
+
readonly hasDefault: boolean;
|
|
4233
|
+
readonly generated: boolean;
|
|
4234
|
+
readonly storage?: SnapshotStorage;
|
|
4235
|
+
readonly default?: SnapshotDefault;
|
|
4236
|
+
readonly generatedColumn?: SnapshotGeneratedColumn;
|
|
4237
|
+
readonly identity?: CompleteSnapshotIdentity;
|
|
4238
|
+
readonly onUpdate?: SnapshotExpression;
|
|
4239
|
+
}
|
|
4240
|
+
/** A richer identity declaration retained beside a column or sequence. */
|
|
4241
|
+
interface CompleteSnapshotIdentity extends CompleteSnapshotObjectMetadata {
|
|
4242
|
+
readonly kind: "identity";
|
|
4243
|
+
readonly generation: "always" | "by-default";
|
|
4244
|
+
readonly options: Readonly<Record<string, CompleteSnapshotValueFact>>;
|
|
4245
|
+
}
|
|
4246
|
+
/** A literal or opaque expression value in complete object metadata. */
|
|
4247
|
+
type CompleteSnapshotValueFact = {
|
|
4248
|
+
readonly kind: "literal";
|
|
4249
|
+
readonly value: SnapshotLiteral;
|
|
4250
|
+
} | {
|
|
4251
|
+
readonly kind: "expression";
|
|
4252
|
+
readonly expression: SnapshotExpression;
|
|
4253
|
+
};
|
|
4254
|
+
/** An ordered column or expression term in a complete index. */
|
|
4255
|
+
type CompleteSnapshotIndexTerm = {
|
|
4256
|
+
readonly kind: "column";
|
|
4257
|
+
readonly column: string;
|
|
4258
|
+
readonly position: number;
|
|
4259
|
+
readonly direction?: "ASC" | "DESC";
|
|
4260
|
+
readonly nulls?: "FIRST" | "LAST";
|
|
4261
|
+
readonly prefixLength?: CompleteSnapshotValueFact;
|
|
4262
|
+
readonly operatorClass?: string;
|
|
4263
|
+
} | {
|
|
4264
|
+
readonly kind: "expression";
|
|
4265
|
+
readonly expression: SnapshotExpression;
|
|
4266
|
+
readonly position: number;
|
|
4267
|
+
readonly direction?: "ASC" | "DESC";
|
|
4268
|
+
readonly nulls?: "FIRST" | "LAST";
|
|
4269
|
+
readonly operatorClass?: string;
|
|
4270
|
+
};
|
|
4271
|
+
/** A complete index with engine-specific method and included-column facts. */
|
|
4272
|
+
interface CompleteSnapshotIndex extends CompleteSnapshotObjectMetadata {
|
|
4273
|
+
readonly kind: "index";
|
|
4274
|
+
readonly id: string;
|
|
4275
|
+
readonly physicalName: string;
|
|
4276
|
+
readonly terms: readonly CompleteSnapshotIndexTerm[];
|
|
4277
|
+
readonly unique: boolean;
|
|
4278
|
+
readonly candidateKey: boolean;
|
|
4279
|
+
readonly predicate?: SnapshotExpression;
|
|
4280
|
+
readonly includedColumns?: readonly string[];
|
|
4281
|
+
readonly backingConstraint?: CompleteSnapshotObjectReference;
|
|
4282
|
+
readonly method?: string;
|
|
4283
|
+
}
|
|
4284
|
+
/** A key or uniqueness constraint in a complete table. */
|
|
4285
|
+
interface CompleteSnapshotKeyConstraint extends CompleteSnapshotObjectMetadata {
|
|
4286
|
+
readonly kind: "primary-key" | "unique" | "unique-constraint";
|
|
4287
|
+
readonly id: string;
|
|
4288
|
+
readonly physicalName: string;
|
|
4289
|
+
readonly columns: readonly string[];
|
|
4290
|
+
readonly nulls?: "distinct" | "not-distinct";
|
|
4291
|
+
readonly backingIndex?: CompleteSnapshotObjectReference;
|
|
4292
|
+
readonly deferrable?: boolean;
|
|
4293
|
+
readonly initially?: "immediate" | "deferred";
|
|
4294
|
+
readonly validated?: boolean;
|
|
4295
|
+
}
|
|
4296
|
+
/** A foreign key with explicit target object identity and actions. */
|
|
4297
|
+
interface CompleteSnapshotForeignKey extends CompleteSnapshotObjectMetadata {
|
|
4298
|
+
readonly kind: "foreign-key";
|
|
4299
|
+
readonly id: string;
|
|
4300
|
+
readonly physicalName: string;
|
|
4301
|
+
readonly columns: readonly string[];
|
|
4302
|
+
readonly target: {
|
|
4303
|
+
readonly table: CompleteSnapshotObjectReference;
|
|
4304
|
+
readonly columns: readonly string[];
|
|
4305
|
+
};
|
|
4306
|
+
readonly onUpdate?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
|
|
4307
|
+
readonly onDelete?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
|
|
4308
|
+
readonly match?: "simple" | "full" | "partial";
|
|
4309
|
+
readonly deferrable?: boolean;
|
|
4310
|
+
readonly initially?: "immediate" | "deferred";
|
|
4311
|
+
readonly validated?: boolean;
|
|
4312
|
+
}
|
|
4313
|
+
/** A check constraint whose expression remains tagged data. */
|
|
4314
|
+
interface CompleteSnapshotCheckConstraint extends CompleteSnapshotObjectMetadata {
|
|
4315
|
+
readonly kind: "check";
|
|
4316
|
+
readonly id: string;
|
|
4317
|
+
readonly physicalName: string;
|
|
4318
|
+
readonly expression: SnapshotExpression;
|
|
4319
|
+
readonly deferrable?: boolean;
|
|
4320
|
+
readonly initially?: "immediate" | "deferred";
|
|
4321
|
+
readonly validated?: boolean;
|
|
4322
|
+
}
|
|
4323
|
+
/** Every constraint represented by the complete neutral snapshot model. */
|
|
4324
|
+
type CompleteSnapshotConstraint = CompleteSnapshotKeyConstraint | CompleteSnapshotForeignKey | CompleteSnapshotCheckConstraint;
|
|
4325
|
+
/** A complete table record keyed by stable logical identity. */
|
|
4326
|
+
interface CompleteSnapshotTable extends CompleteSnapshotObjectMetadata {
|
|
4327
|
+
readonly kind: "table";
|
|
4328
|
+
readonly id: string;
|
|
4329
|
+
readonly physicalName: string;
|
|
4330
|
+
readonly columns: readonly CompleteSnapshotColumn[];
|
|
4331
|
+
readonly constraints: readonly CompleteSnapshotConstraint[];
|
|
4332
|
+
readonly indexes: readonly CompleteSnapshotIndex[];
|
|
4333
|
+
}
|
|
4334
|
+
/** A view or materialized-view declaration and its output columns. */
|
|
4335
|
+
interface CompleteSnapshotView extends CompleteSnapshotObjectMetadata {
|
|
4336
|
+
readonly kind: "view" | "materialized-view";
|
|
4337
|
+
readonly id: string;
|
|
4338
|
+
readonly physicalName: string;
|
|
4339
|
+
readonly columns: readonly CompleteSnapshotColumn[];
|
|
4340
|
+
readonly definition: SnapshotExpression;
|
|
4341
|
+
readonly dependencies?: readonly CompleteSnapshotObjectReference[];
|
|
4342
|
+
readonly checkOption?: "none" | "local" | "cascaded";
|
|
4343
|
+
readonly securityBarrier?: boolean;
|
|
4344
|
+
readonly securityInvoker?: boolean;
|
|
4345
|
+
}
|
|
4346
|
+
/** A sequence and its exact option facts. */
|
|
4347
|
+
interface CompleteSnapshotSequence extends CompleteSnapshotObjectMetadata {
|
|
4348
|
+
readonly kind: "sequence";
|
|
4349
|
+
readonly id: string;
|
|
4350
|
+
readonly physicalName: string;
|
|
4351
|
+
readonly storage?: SnapshotStorage;
|
|
4352
|
+
readonly start?: CompleteSnapshotValueFact;
|
|
4353
|
+
readonly increment?: CompleteSnapshotValueFact;
|
|
4354
|
+
readonly minimum?: CompleteSnapshotValueFact;
|
|
4355
|
+
readonly maximum?: CompleteSnapshotValueFact;
|
|
4356
|
+
readonly cache?: CompleteSnapshotValueFact;
|
|
4357
|
+
readonly cycle?: boolean;
|
|
4358
|
+
readonly ownedBy?: CompleteSnapshotObjectReference;
|
|
4359
|
+
readonly identity?: CompleteSnapshotIdentity;
|
|
4360
|
+
}
|
|
4361
|
+
/** An ordered enum declaration. */
|
|
4362
|
+
interface CompleteSnapshotEnum extends CompleteSnapshotObjectMetadata {
|
|
4363
|
+
readonly kind: "enum";
|
|
4364
|
+
readonly id: string;
|
|
4365
|
+
readonly physicalName: string;
|
|
4366
|
+
readonly values: readonly {
|
|
4367
|
+
readonly value: string;
|
|
4368
|
+
readonly ordinalPosition: number;
|
|
4369
|
+
readonly provenance?: CompleteSnapshotProvenance;
|
|
4370
|
+
}[];
|
|
4371
|
+
}
|
|
4372
|
+
/** A domain declaration and its base type constraints. */
|
|
4373
|
+
interface CompleteSnapshotDomain extends CompleteSnapshotObjectMetadata {
|
|
4374
|
+
readonly kind: "domain";
|
|
4375
|
+
readonly id: string;
|
|
4376
|
+
readonly physicalName: string;
|
|
4377
|
+
readonly storage: SnapshotStorage;
|
|
4378
|
+
readonly nullable?: boolean;
|
|
4379
|
+
readonly default?: CompleteSnapshotValueFact;
|
|
4380
|
+
readonly constraints?: readonly CompleteSnapshotCheckConstraint[];
|
|
4381
|
+
}
|
|
4382
|
+
/** Collation behavior that can affect deterministic schema comparison. */
|
|
4383
|
+
interface CompleteSnapshotCollation extends CompleteSnapshotObjectMetadata {
|
|
4384
|
+
readonly kind: "collation";
|
|
4385
|
+
readonly id: string;
|
|
4386
|
+
readonly physicalName: string;
|
|
4387
|
+
readonly provider?: string;
|
|
4388
|
+
readonly locale?: string;
|
|
4389
|
+
readonly deterministic?: boolean;
|
|
4390
|
+
readonly version?: string;
|
|
4391
|
+
}
|
|
4392
|
+
/** Trigger declaration attached to a table or view. */
|
|
4393
|
+
interface CompleteSnapshotTrigger extends CompleteSnapshotObjectMetadata {
|
|
4394
|
+
readonly kind: "trigger";
|
|
4395
|
+
readonly id: string;
|
|
4396
|
+
readonly physicalName: string;
|
|
4397
|
+
readonly table: CompleteSnapshotObjectReference;
|
|
4398
|
+
readonly timing: "before" | "after" | "instead-of" | "unknown";
|
|
4399
|
+
readonly events: readonly ("insert" | "update" | "delete" | "truncate")[];
|
|
4400
|
+
readonly orientation?: "row" | "statement";
|
|
4401
|
+
readonly condition?: SnapshotExpression;
|
|
4402
|
+
readonly body: SnapshotExpression;
|
|
4403
|
+
readonly enabled?: boolean;
|
|
4404
|
+
}
|
|
4405
|
+
/** Routine argument declaration. */
|
|
4406
|
+
interface CompleteSnapshotRoutineParameter {
|
|
4407
|
+
readonly name?: string;
|
|
4408
|
+
readonly mode?: "in" | "out" | "inout" | "variadic" | "table";
|
|
4409
|
+
readonly storage: SnapshotStorage;
|
|
4410
|
+
readonly default?: CompleteSnapshotValueFact;
|
|
4411
|
+
readonly ordinalPosition: number;
|
|
4412
|
+
readonly provenance?: CompleteSnapshotProvenance;
|
|
4413
|
+
}
|
|
4414
|
+
/** Function, procedure, aggregate, or window routine declaration. */
|
|
4415
|
+
interface CompleteSnapshotRoutine extends CompleteSnapshotObjectMetadata {
|
|
4416
|
+
readonly kind: "routine";
|
|
4417
|
+
readonly id: string;
|
|
4418
|
+
readonly physicalName: string;
|
|
4419
|
+
readonly routineKind: "function" | "procedure" | "aggregate" | "window" | "unknown";
|
|
4420
|
+
readonly parameters: readonly CompleteSnapshotRoutineParameter[];
|
|
4421
|
+
readonly returnType?: SnapshotStorage;
|
|
4422
|
+
readonly language?: string;
|
|
4423
|
+
readonly body?: SnapshotExpression;
|
|
4424
|
+
readonly volatility?: "immutable" | "stable" | "volatile" | "unknown";
|
|
4425
|
+
readonly parallel?: "safe" | "restricted" | "unsafe" | "unknown";
|
|
4426
|
+
readonly security?: "invoker" | "definer" | "unknown";
|
|
4427
|
+
readonly dependencies?: readonly CompleteSnapshotObjectReference[];
|
|
4428
|
+
}
|
|
4429
|
+
/** A partition child, its parent, and normalized bound expression. */
|
|
4430
|
+
interface CompleteSnapshotPartition extends CompleteSnapshotObjectMetadata {
|
|
4431
|
+
readonly kind: "partition";
|
|
4432
|
+
readonly id: string;
|
|
4433
|
+
readonly physicalName: string;
|
|
4434
|
+
readonly parent: CompleteSnapshotObjectReference;
|
|
4435
|
+
readonly strategy: "range" | "list" | "hash" | "reference" | "unknown";
|
|
4436
|
+
readonly keyColumns?: readonly string[];
|
|
4437
|
+
readonly bound?: SnapshotExpression;
|
|
4438
|
+
readonly default?: boolean;
|
|
4439
|
+
}
|
|
4440
|
+
/** A row-level security policy attached to a table. */
|
|
4441
|
+
interface CompleteSnapshotPolicy extends CompleteSnapshotObjectMetadata {
|
|
4442
|
+
readonly kind: "policy";
|
|
4443
|
+
readonly id: string;
|
|
4444
|
+
readonly physicalName: string;
|
|
4445
|
+
readonly table: CompleteSnapshotObjectReference;
|
|
4446
|
+
readonly command: "all" | "select" | "insert" | "update" | "delete" | "unknown";
|
|
4447
|
+
readonly roles?: readonly string[];
|
|
4448
|
+
readonly permissive?: boolean;
|
|
4449
|
+
readonly using?: SnapshotExpression;
|
|
4450
|
+
readonly check?: SnapshotExpression;
|
|
4451
|
+
}
|
|
4452
|
+
/** An extension object with a typed, versioned payload. */
|
|
4453
|
+
interface CompleteSnapshotExtension extends CompleteSnapshotObjectMetadata {
|
|
4454
|
+
readonly kind: "extension";
|
|
4455
|
+
readonly id: string;
|
|
4456
|
+
readonly physicalName: string;
|
|
4457
|
+
readonly extensionName: string;
|
|
4458
|
+
readonly extensionVersion?: string;
|
|
4459
|
+
readonly schema?: string;
|
|
4460
|
+
readonly data: SnapshotJsonValue;
|
|
4461
|
+
readonly configuration?: SnapshotJsonValue;
|
|
4462
|
+
}
|
|
4463
|
+
/** A deferred object retained as a reviewable, non-lossy boundary record. */
|
|
4464
|
+
interface CompleteSnapshotDeferredObject extends CompleteSnapshotObjectMetadata {
|
|
4465
|
+
readonly kind: "deferred-object";
|
|
4466
|
+
readonly id: string;
|
|
4467
|
+
readonly objectKind: string;
|
|
4468
|
+
readonly physicalName: string;
|
|
4469
|
+
readonly reason?: string;
|
|
4470
|
+
readonly data?: SnapshotJsonValue;
|
|
4471
|
+
}
|
|
4472
|
+
/** An opaque object observed by an adapter but not yet structurally modeled. */
|
|
4473
|
+
interface CompleteSnapshotOpaqueObject extends CompleteSnapshotObjectMetadata {
|
|
4474
|
+
readonly kind: "opaque-object";
|
|
4475
|
+
readonly id: string;
|
|
4476
|
+
readonly objectKind: string;
|
|
4477
|
+
readonly physicalName: string;
|
|
4478
|
+
readonly data: SnapshotJsonValue;
|
|
4479
|
+
readonly sql?: SnapshotExpression;
|
|
4480
|
+
}
|
|
4481
|
+
/** A comment attached to a stable logical object. */
|
|
4482
|
+
interface CompleteSnapshotComment extends CompleteSnapshotObjectMetadata {
|
|
4483
|
+
readonly kind: "comment";
|
|
4484
|
+
readonly id: string;
|
|
4485
|
+
readonly physicalName: string;
|
|
4486
|
+
readonly object: CompleteSnapshotObjectReference;
|
|
4487
|
+
readonly text: string;
|
|
4488
|
+
}
|
|
4489
|
+
/** Ownership metadata attached to a stable logical object. */
|
|
4490
|
+
interface CompleteSnapshotOwnership extends CompleteSnapshotObjectMetadata {
|
|
4491
|
+
readonly kind: "ownership";
|
|
4492
|
+
readonly id: string;
|
|
4493
|
+
readonly physicalName: string;
|
|
4494
|
+
readonly object: CompleteSnapshotObjectReference;
|
|
4495
|
+
readonly owner: string;
|
|
4496
|
+
}
|
|
4497
|
+
/** Every complete snapshot object family, including retained boundaries. */
|
|
4498
|
+
type CompleteSnapshotObject = CompleteSnapshotTable | CompleteSnapshotView | CompleteSnapshotSequence | CompleteSnapshotEnum | CompleteSnapshotDomain | CompleteSnapshotCollation | CompleteSnapshotTrigger | CompleteSnapshotRoutine | CompleteSnapshotPartition | CompleteSnapshotPolicy | CompleteSnapshotExtension | CompleteSnapshotDeferredObject | CompleteSnapshotOpaqueObject | CompleteSnapshotComment | CompleteSnapshotOwnership;
|
|
4499
|
+
/** The immutable strict Snapshot v1 envelope. */
|
|
4500
|
+
interface CompleteSchemaSnapshot {
|
|
4501
|
+
readonly format: typeof completeSchemaSnapshotFormat;
|
|
4502
|
+
readonly version: typeof completeSchemaSnapshotVersion;
|
|
4503
|
+
readonly dialect: SnapshotDialect;
|
|
4504
|
+
readonly namingPolicy: SnapshotNamingPolicy;
|
|
4505
|
+
readonly namespace: CompleteSnapshotNamespace;
|
|
4506
|
+
readonly capabilities: CompleteSnapshotCapabilities;
|
|
4507
|
+
readonly tables: readonly CompleteSnapshotTable[];
|
|
4508
|
+
readonly views: readonly CompleteSnapshotView[];
|
|
4509
|
+
readonly sequences: readonly CompleteSnapshotSequence[];
|
|
4510
|
+
readonly enums: readonly CompleteSnapshotEnum[];
|
|
4511
|
+
readonly domains: readonly CompleteSnapshotDomain[];
|
|
4512
|
+
readonly collations: readonly CompleteSnapshotCollation[];
|
|
4513
|
+
readonly triggers: readonly CompleteSnapshotTrigger[];
|
|
4514
|
+
readonly routines: readonly CompleteSnapshotRoutine[];
|
|
4515
|
+
readonly partitions: readonly CompleteSnapshotPartition[];
|
|
4516
|
+
readonly policies: readonly CompleteSnapshotPolicy[];
|
|
4517
|
+
readonly extensions: readonly CompleteSnapshotExtension[];
|
|
4518
|
+
readonly deferredObjects: readonly CompleteSnapshotDeferredObject[];
|
|
4519
|
+
readonly opaqueObjects: readonly CompleteSnapshotOpaqueObject[];
|
|
4520
|
+
readonly comments: readonly CompleteSnapshotComment[];
|
|
4521
|
+
readonly ownership: readonly CompleteSnapshotOwnership[];
|
|
4522
|
+
}
|
|
4523
|
+
/** Input accepted by the strict complete snapshot encoder. */
|
|
4524
|
+
type CompleteSchemaSnapshotInput = CompleteSchemaSnapshot | Readonly<Record<string, unknown>>;
|
|
4525
|
+
/** A complete snapshot decoder result with immutable successful output. */
|
|
4526
|
+
type CompleteSnapshotDecodeResult = {
|
|
4527
|
+
readonly ok: true;
|
|
4528
|
+
readonly value: CompleteSchemaSnapshot;
|
|
4529
|
+
} | {
|
|
4530
|
+
readonly ok: false;
|
|
4531
|
+
readonly diagnostics: readonly SnapshotDiagnostic[];
|
|
4532
|
+
};
|
|
4533
|
+
/** A complete snapshot creation result with immutable successful output. */
|
|
4534
|
+
type CompleteSnapshotCreateResult = CompleteSnapshotDecodeResult;
|
|
4535
|
+
/** V1 aliases kept explicit for consumers that prefer numbered APIs. */
|
|
4536
|
+
type SchemaSnapshotV1 = CompleteSchemaSnapshot;
|
|
4537
|
+
type SchemaSnapshotV1Input = CompleteSchemaSnapshotInput;
|
|
4538
|
+
type SchemaSnapshotV1DecodeResult = CompleteSnapshotDecodeResult;
|
|
3984
4539
|
//#endregion
|
|
3985
4540
|
//#region src/snapshot/types.d.ts
|
|
3986
4541
|
/** The JSON object tag used by Qubu schema snapshots. */
|
|
3987
4542
|
declare const schemaSnapshotFormat: "qubu-schema";
|
|
3988
|
-
/** The
|
|
4543
|
+
/** The current canonical schema snapshot format version. */
|
|
3989
4544
|
declare const schemaSnapshotVersion: 1;
|
|
3990
4545
|
/** The first version of the dialect-extension envelope. */
|
|
3991
4546
|
declare const schemaSnapshotDialectVersion: 1;
|
|
@@ -4075,27 +4630,11 @@ type SnapshotGeneratedColumn = {
|
|
|
4075
4630
|
} | {
|
|
4076
4631
|
readonly kind: "external";
|
|
4077
4632
|
};
|
|
4078
|
-
/**
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
}
|
|
4084
|
-
/** A canonical column record keyed by its stable logical field ID. */
|
|
4085
|
-
interface SnapshotColumn {
|
|
4086
|
-
readonly id: string;
|
|
4087
|
-
readonly physicalName: string;
|
|
4088
|
-
readonly nullable: boolean;
|
|
4089
|
-
readonly hasDefault: boolean;
|
|
4090
|
-
readonly generated: boolean;
|
|
4091
|
-
readonly storage?: SnapshotStorage;
|
|
4092
|
-
readonly default?: SnapshotDefault;
|
|
4093
|
-
readonly generatedColumn?: SnapshotGeneratedColumn;
|
|
4094
|
-
readonly identity?: SnapshotIdentity;
|
|
4095
|
-
/** MySQL's parameter-free column update expression, when supported. */
|
|
4096
|
-
readonly onUpdate?: SnapshotExpression;
|
|
4097
|
-
}
|
|
4098
|
-
/** An expression or bare column used by an index. */
|
|
4633
|
+
/** V1 object aliases kept in the short snapshot vocabulary used by consumers. */
|
|
4634
|
+
type SnapshotIdentity = CompleteSnapshotIdentity;
|
|
4635
|
+
type SnapshotColumn = CompleteSnapshotColumn;
|
|
4636
|
+
type SnapshotIndexTerm = CompleteSnapshotIndexTerm;
|
|
4637
|
+
/** The expression portion of an index term, without ordering metadata. */
|
|
4099
4638
|
type SnapshotIndexTermExpression = {
|
|
4100
4639
|
readonly kind: "column";
|
|
4101
4640
|
readonly column: string;
|
|
@@ -4103,92 +4642,16 @@ type SnapshotIndexTermExpression = {
|
|
|
4103
4642
|
readonly kind: "expression";
|
|
4104
4643
|
readonly expression: SnapshotExpression;
|
|
4105
4644
|
};
|
|
4106
|
-
|
|
4107
|
-
type
|
|
4108
|
-
readonly kind: "order";
|
|
4109
|
-
readonly expression: SnapshotIndexTermExpression;
|
|
4110
|
-
readonly direction?: "ASC" | "DESC";
|
|
4111
|
-
readonly nulls?: "FIRST" | "LAST";
|
|
4112
|
-
};
|
|
4113
|
-
/** Common key metadata shared by primary and strict unique constraints. */
|
|
4114
|
-
interface SnapshotKeyConstraint {
|
|
4115
|
-
readonly id: string;
|
|
4116
|
-
readonly kind: "primary-key" | "unique";
|
|
4117
|
-
readonly physicalName: string;
|
|
4118
|
-
readonly columns: readonly string[];
|
|
4119
|
-
readonly deferrable?: boolean;
|
|
4120
|
-
readonly initially?: "immediate" | "deferred";
|
|
4121
|
-
readonly dialect?: SnapshotDialectExtension;
|
|
4122
|
-
}
|
|
4123
|
-
/** Nullable database uniqueness, intentionally not a candidate-key proof. */
|
|
4124
|
-
interface SnapshotUniqueConstraint {
|
|
4125
|
-
readonly id: string;
|
|
4645
|
+
type SnapshotKeyConstraint = CompleteSnapshotKeyConstraint;
|
|
4646
|
+
type SnapshotUniqueConstraint = CompleteSnapshotKeyConstraint & {
|
|
4126
4647
|
readonly kind: "unique-constraint";
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
/** A foreign key whose target is represented only by logical IDs. */
|
|
4135
|
-
interface SnapshotForeignKey {
|
|
4136
|
-
readonly id: string;
|
|
4137
|
-
readonly kind: "foreign-key";
|
|
4138
|
-
readonly physicalName: string;
|
|
4139
|
-
readonly columns: readonly string[];
|
|
4140
|
-
readonly target: {
|
|
4141
|
-
readonly table: string;
|
|
4142
|
-
readonly columns: readonly string[];
|
|
4143
|
-
};
|
|
4144
|
-
readonly onUpdate?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
|
|
4145
|
-
readonly onDelete?: "no-action" | "restrict" | "cascade" | "set-null" | "set-default";
|
|
4146
|
-
readonly match?: "simple" | "full" | "partial";
|
|
4147
|
-
readonly deferrable?: boolean;
|
|
4148
|
-
readonly initially?: "immediate" | "deferred";
|
|
4149
|
-
readonly dialect?: SnapshotDialectExtension;
|
|
4150
|
-
}
|
|
4151
|
-
/** A table check constraint with a detached expression value. */
|
|
4152
|
-
interface SnapshotCheckConstraint {
|
|
4153
|
-
readonly id: string;
|
|
4154
|
-
readonly kind: "check";
|
|
4155
|
-
readonly physicalName: string;
|
|
4156
|
-
readonly expression: SnapshotExpression;
|
|
4157
|
-
readonly deferrable?: boolean;
|
|
4158
|
-
readonly initially?: "immediate" | "deferred";
|
|
4159
|
-
readonly dialect?: SnapshotDialectExtension;
|
|
4160
|
-
}
|
|
4161
|
-
/** Every constraint represented by the v1 neutral model. */
|
|
4162
|
-
type SnapshotConstraint = SnapshotKeyConstraint | SnapshotUniqueConstraint | SnapshotForeignKey | SnapshotCheckConstraint;
|
|
4163
|
-
/** A canonical index record keyed by its stable logical ID. */
|
|
4164
|
-
interface SnapshotIndex {
|
|
4165
|
-
readonly id: string;
|
|
4166
|
-
readonly kind: "index";
|
|
4167
|
-
readonly physicalName: string;
|
|
4168
|
-
readonly terms: readonly SnapshotIndexTerm[];
|
|
4169
|
-
readonly unique: boolean;
|
|
4170
|
-
readonly candidateKey: boolean;
|
|
4171
|
-
readonly predicate?: SnapshotExpression;
|
|
4172
|
-
readonly includedColumns?: readonly string[];
|
|
4173
|
-
readonly dialect?: SnapshotDialectExtension;
|
|
4174
|
-
}
|
|
4175
|
-
/** A table record keyed by its stable logical registry ID. */
|
|
4176
|
-
interface SnapshotTable {
|
|
4177
|
-
readonly id: string;
|
|
4178
|
-
readonly physicalName: string;
|
|
4179
|
-
readonly columns: readonly SnapshotColumn[];
|
|
4180
|
-
readonly constraints: readonly SnapshotConstraint[];
|
|
4181
|
-
readonly indexes: readonly SnapshotIndex[];
|
|
4182
|
-
}
|
|
4183
|
-
/** The immutable canonical schema snapshot envelope. */
|
|
4184
|
-
interface SchemaSnapshot {
|
|
4185
|
-
readonly format: typeof schemaSnapshotFormat;
|
|
4186
|
-
readonly version: typeof schemaSnapshotVersion;
|
|
4187
|
-
readonly dialect: SnapshotDialect;
|
|
4188
|
-
readonly namingPolicy: SnapshotNamingPolicy;
|
|
4189
|
-
readonly namespace?: string;
|
|
4190
|
-
readonly tables: readonly SnapshotTable[];
|
|
4191
|
-
}
|
|
4648
|
+
};
|
|
4649
|
+
type SnapshotForeignKey = CompleteSnapshotForeignKey;
|
|
4650
|
+
type SnapshotCheckConstraint = CompleteSnapshotCheckConstraint;
|
|
4651
|
+
type SnapshotConstraint = CompleteSnapshotConstraint;
|
|
4652
|
+
type SnapshotIndex = CompleteSnapshotIndex;
|
|
4653
|
+
type SnapshotTable = CompleteSnapshotTable;
|
|
4654
|
+
type SchemaSnapshot = CompleteSchemaSnapshot;
|
|
4192
4655
|
/** Schema-expression context supplied to a dialect adapter. */
|
|
4193
4656
|
interface SnapshotExpressionContext {
|
|
4194
4657
|
readonly mode: "default" | "generated" | "check" | "index";
|
|
@@ -4215,7 +4678,7 @@ interface SnapshotValidationContext {
|
|
|
4215
4678
|
* only selects that schema dialect, so PostgreSQL, SQLite, and MySQL can share the query rendering
|
|
4216
4679
|
* policy without taking ownership of canonical ordering or cross-reference validation.
|
|
4217
4680
|
*/
|
|
4218
|
-
interface SchemaSnapshotAdapter<TCapabilities extends
|
|
4681
|
+
interface SchemaSnapshotAdapter<TCapabilities extends string = DialectCapability> {
|
|
4219
4682
|
/** The query dialect plus its schema hooks and metadata. */
|
|
4220
4683
|
readonly dialect: SchemaDialect<TCapabilities>;
|
|
4221
4684
|
}
|
|
@@ -4229,24 +4692,12 @@ interface SnapshotDiagnostic {
|
|
|
4229
4692
|
readonly relatedPaths?: readonly (readonly (string | number)[])[];
|
|
4230
4693
|
}
|
|
4231
4694
|
/** Result returned by the strict snapshot decoder. */
|
|
4232
|
-
type SnapshotDecodeResult =
|
|
4233
|
-
readonly ok: true;
|
|
4234
|
-
readonly value: SchemaSnapshot;
|
|
4235
|
-
} | {
|
|
4236
|
-
readonly ok: false;
|
|
4237
|
-
readonly diagnostics: readonly SnapshotDiagnostic[];
|
|
4238
|
-
};
|
|
4695
|
+
type SnapshotDecodeResult = CompleteSnapshotDecodeResult;
|
|
4239
4696
|
/** Result returned by a non-throwing schema traversal helper. */
|
|
4240
|
-
type SnapshotCreateResult =
|
|
4241
|
-
readonly ok: true;
|
|
4242
|
-
readonly value: SchemaSnapshot;
|
|
4243
|
-
} | {
|
|
4244
|
-
readonly ok: false;
|
|
4245
|
-
readonly diagnostics: readonly SnapshotDiagnostic[];
|
|
4246
|
-
};
|
|
4697
|
+
type SnapshotCreateResult = CompleteSnapshotCreateResult;
|
|
4247
4698
|
/** A schema snapshot input accepted by the canonical encoder. */
|
|
4248
|
-
type SchemaSnapshotInput =
|
|
4699
|
+
type SchemaSnapshotInput = CompleteSchemaSnapshotInput;
|
|
4249
4700
|
/** Expose the schema generic in tooling declarations without widening APIs. */
|
|
4250
4701
|
type AnySchema = Schema<any>;
|
|
4251
4702
|
//#endregion
|
|
4252
|
-
export { PaginationKind as $, SqlTag as $a, QubuStreamingTransaction as $c, SourceIndexesRecord as $i, AggregateMeta as $l, WithClause as $n, ColumnStorageDialectOf as $o, generatedTableName as $r, ResolvedColumnBehavior as $s, nullsLast as $t, SqlNumericLike as $u, SnapshotStorage as A, jsonBoolean as Aa, ExplainReadOptions as Ac, catalogCheck as Ai, ExpressionNullability as Al, MutationReturningClause as An, value as Ao, SchemaExpressionErrorCode as Ar, numeric as As, SourceSqlTypeMap as At, RequiresOuterMetadataOf as Au, CastTarget as B, concat as Ba, HookQueryOperation as Bc, AliasedSource as Bi, withDialectCapability as Bl, select as Bn, ColumnHasDefault as Bo, renderSchemaSql as Br, DefaultDescriptor as Bs, TableDefinitions as Bt, isFragment as Bu, SnapshotIndexTerm as C, SelectClause as Ca, ExecutionOptions as Cc, SourceConstraintsRecord as Ci, ColumnDependency as Cl, update as Cn, isTrue as Co, SelectionSqlTypes as Cr, date as Cs, SourceColumns as Ct, ProvidesOuterSourceMeta as Cu, SnapshotLiteral as D, multiply as Da, ExplainOptions as Dc, UniqueConstraint as Di, AnySchemaExpression as Dl, MutationQuery as Dn, SqlCapabilityValidation as Do, createSchemaDialect as Dr, nativeColumn as Ds, SourceKind as Dt, RenderFunction as Du, SnapshotKeyConstraint as E, modulo as Ea, ExplainMutationOptions as Ec, TableLike as Ei, AnyExpression as El, MutationKind as En, OperandSqlType as Eo, SchemaDialectHooks as Er, json as Es, SourceIdentity as Et, RenderContext as Eu, neutralSnapshotDialect as F, denseRank as Fa, HookMetadata as Fc, references as Fi, SchemaExpression as Fl, ReturningClause as Fn, ColumnDefaultOf as Fo, UnsafeSchemaSqlExpression as Fr, CanonicalLiteral as Fs, exposeColumns as Ft, SqlTypeOf as Fu, DialectJson as G, typedCall as Ga, QubuClient as Gc, alias as Gi, ResultDecodingError as Gl, MissingScope as Gn, ColumnIsNullable as Go, SchemaNamingPolicy as Gr, GeneratedColumnDescriptor as Gs, TableRow as Gt, SqlBinary as Gu, DialectCapability as H, upper as Ha, HookSuccessOutcome as Hc, LateralSource as Hi, ResultDecodeContext as Hl, AvailableScope as Hn, ColumnIdentityOf as Ho, unsafeSchemaSql as Hr, ExpressionGeneratedColumnDescriptor as Hs, TableInsertInput as Ht, sequence as Hu, schemaSnapshotDialectVersion as I, over as Ia, HookMetadataValue as Ic, unique as Ii, SchemaExpressionBrand as Il, ReturningRow as In, ColumnDefinition as Io, defineSchemaExpression as Ir, ColumnBehaviorError as Is, sourceIdentity as It, SubqueryMeta as Iu, DialectRowLocking as J, countDistinct as Ja, QubuExplainableTransactionalClient as Jc, IndexOptions as Ji, booleanResultDecoder as Jl, ScopeValidation as Jn, ColumnOutput as Jo, SchemaTableNames as Jr, IdentityDescriptor as Js, table as Jt, SqlDecimal as Ju, DialectOptions as K, avg as Ka, QubuExplainableClient as Kc, lateral as Ki, ResultField as Kl, RequiredOuterScope as Kn, ColumnOnUpdateOf as Ko, SchemaOptions as Kr, GeneratedColumnMode as Ks, TableSqlTypes as Kt, SqlBoolean as Ku, schemaSnapshotFormat as L, rank as La, HookOperation as Lc, uniqueConstraint as Li, isExpression as Ll, ReturningSqlTypes as Ln, ColumnDefinitionConfig as Lo, isUnsafeSchemaSql as Lr, ColumnBehaviorErrorCode as Ls, AnyTable as Lt, VisibleDependenciesOf as Lu, SnapshotTable as M, jsonNumber as Ma, ExplainResult as Mc, check as Mi, ExpressionRequires as Ml, MutationScopeValidation as Mn, cast as Mo, SchemaExpressionMode as Mr, text as Ms, UnknownSourceSqlTypes as Mt, RequiresOuterSourceMeta as Mu, SnapshotUniqueConstraint as N, jsonPath as Na, ExplainableQueryAdapter as Nc, foreignKey as Ni, ExpressionSqlType as Nl, MutationSqlTypes as Nn, typedCast as No, SchemaRenderContext as Nr, timestamp as Ns, createSource as Nt, RequiresSourceMeta as Nu, SnapshotNamingPolicy as O, subtract as Oa, ExplainOptionsFor as Oc, UniqueConstraintOptions as Oi, Expression as Ol, MutationQueryConfig as On, asValue as Oo, RenderedSchemaExpression as Or, nativeStorage as Os, SourceProvision as Ot, RequiresCapabilityMeta as Ou, SnapshotValidationContext as P, jsonText as Pa, HookErrorOutcome as Pc, primaryKey as Pi, ExpressionWithOutput as Pl, allowAll as Pn, ColumnCodec as Po, SchemaRenderOptions as Pr, uuid as Ps, customSource as Pt, ResultMeta as Pu, NamedCastTarget as Q, SqlFragment as Qa, QubuStreamingExplainableClient as Qc, SourceIndex as Qi, AggregateDependenciesOf as Ql, RecursiveCteSource as Qn, ColumnStorageDescriptor as Qo, defaultSchemaNamingPolicy as Qr, MysqlIdentityExtension as Qs, nullsFirst as Qt, SqlJson as Qu, schemaSnapshotNamingPolicyVersion as R, rowNumber as Ra, HookOperationKind as Rc, validateConstraintDialect as Ri, makeExpression as Rl, returning as Rn, ColumnFromOptions as Ro, normalizeSchemaSql as Rr, ColumnDefault as Rs, Table as Rt, WindowMeta as Ru, SnapshotIndex as S, ClausePlacement as Sa, DriverValueEncoder as Sc, SourceConstraint as Si, QueryValidationIssue as Sl, UpdateAssignments as Sn, isNull as So, SelectionOutput as Sr, columnResultValue as Ss, Source as St, ProvidesOuterOf as Su, SnapshotJsonValue as T, divide as Ta, ExecutionResult as Tc, SqliteConstraintExtension as Ti, expressionFragment as Tl, MutationClause as Tn, OperandNullability as To, SchemaDialect as Tr, integer as Ts, SourceConstraints as Tt, QueryCardinality as Tu, DialectCastTypes as U, call as Ua, HookTransactionOperation as Uc, QueryAliasIdentity as Ui, ResultDecoder as Ul, ClauseScope as Un, ColumnInsertInput as Uo, Schema as Ur, ExternalDefaultDescriptor as Us, TableMetadataCallback as Ut, AnySqlType as Uu, Dialect as V, lower as Va, HookStreamEnd as Vc, LateralIdentity as Vi, DecodableResultType as Vl, AvailableOuterScope as Vn, ColumnHasRuntimeDefault as Vo, schemaExpression as Vr, ExpressionDefaultDescriptor as Vs, TableIdentity as Vt, parenthesize as Vu, DialectExplain as W, schemaCall as Wa, OperationEndHook as Wc, QuerySource as Wi, ResultDecoders as Wl, GroupingValidation as Wn, ColumnIsGenerated as Wo, SchemaDiagnostic as Wr, ExternalGeneratedColumnDescriptor as Ws, TableOptions as Wt, SqlBigInt as Wu, ExplainRenderOptions as X, min as Xa, QubuOptions as Xc, MysqlIndexExtension as Xi, jsonTextResultDecoder as Xl, SelectQuery as Xn, ColumnStorage as Xo, SchemaTableRegistry as Xr, IdentityGeneration as Xs, asc as Xt, SqlEqualityCompatible as Xu, ExplainFormat as Y, max as Ya, QubuHooks as Yc, IndexTerm as Yi, dateResultDecoder as Yl, SelectCardinality as Yn, ColumnSqlType as Yo, SchemaTableRecord as Yr, IdentityDialectExtension as Ys, OrderTerm as Yt, SqlEqualityComparable as Yu, JsonScalarKind as Z, sum as Za, QubuStreamingClient as Zc, PostgresIndexExtension as Zi, timestampResultDecoder as Zl, CteSource as Zn, ColumnStorageDeclarationOf as Zo, SchemaValidationError as Zr, LiteralDefaultDescriptor as Zs, desc as Zt, SqlInteger as Zu, SnapshotExpressionContext as _, fetchNext as _a, generatedSchemaObjectName as _c, KeyConstraint as _i, RenderedQuery as _l, doNothing as _n, notLike as _o, FromScope as _r, StorageTypeOf as _s, AnySource as _t, MetadataOf as _u, SnapshotBigInt as a, and as aa, generatedColumn as ac, SqlTimestamp as ad, CheckConstraint as ai, StreamableQuery as al, InsertSource as an, notExists as ao, except as ar, DialectNativeStorage as as, SchemaLiteralRenderer as at, DependenciesOf as au, SnapshotGeneratedColumn as b, distinct as ba, materializeSchemaObjectRecord as bc, PostgresConstraintExtension as bi, QueryValidationError as bl, onConflict as bn, notIn as bo, Selection as br, boolean as bs, ProvidedSourceIdentity as bt, NullableSourcesOf as bu, SnapshotConstraint as c, Omit$1 as ca, SchemaDialectExtension as cc, SqlUuid as cd, ConstraintOptions as ci, TransactionOptions as cl, insertInto as cn, eq as co, unionAll as cr, NativeStorageDescriptor as cs, resolveCastTarget as ct, FragmentMeta as cu, SnapshotDefault as d, omit as da, SchemaMetadataValidationError as dc, FieldLikeOptions as di, executeRows as dl, ConflictAction as dn, isDistinctFrom as do, innerJoin as dr, PortableStorageDescriptor as ds, QueryConfig as dt, GroupingMeta as du, SqliteIndexExtension as ea, SchemaLiteralValue as ec, SqlOrderCompatible as ed, schema as ei, QubuStreamingTransactionalClient as el, order as en, TypedSqlTag as eo, cte as er, ColumnStorageKindOf as es, PaginationPart as et, AnyFragment as eu, SnapshotDiagnostic as f, where as fa, SchemaObjectIdentity as fc, ForeignKeyConstraint as fi, explain as fl, ConflictTarget as fn, isNotDistinctFrom as fo, leftJoin as fr, PortableStorageType as fs, QueryKind as ft, HasAggregate as fu, SnapshotExpression as g, fetchFirst as ga, freezeSchemaMetadata as gc, ForeignKeyTargetInput as gi, RenderOptions as gl, OnConflictClause as gn, ne as go, FromClause as gr, StorageOf as gs, Row as gt, InheritedMetadataOf as gu, SnapshotDialectExtension as h, rowLock as ha, dialectMismatchDiagnostic as hc, ForeignKeyTarget as hi, RenderCapabilityValidation as hl, ExcludedSource as hn, lte as ho, groupBy as hr, StorageDialectOf as hs, QueryWithRow as ht, InheritedMetadata as hu, SchemaSnapshotInput as i, DeclaredColumnNullability as ia, externalGeneratedColumn as ic, SqlTextLike as id, CatalogCheckSql as ii, QueryExecutor as il, InsertSelectSource as in, inQuery as io, SetQuery as ir, ColumnUpdateInput as is, RowLockWaitPolicy as it, CardinalityOf as iu, SnapshotStorageContext as j, jsonExists as ja, ExplainRequest as jc, catalogForeignKey as ji, ExpressionOutput as jl, MutationRow as jn, mapResult as jo, SchemaExpressionInput as jr, portableStorage as js, SourceSqlTypes as jt, RequiresOuterOf as ju, SnapshotSpecialNumber as k, JsonPath as ka, ExplainPlanRow as kc, UniqueNullSemantics as ki, ExpressionKind as kl, MutationReturning as kn, typedValue as ko, SchemaExpressionError as kr, nullable as ks, SourceRow as kt, RequiresOf as ku, SnapshotCreateResult as l, OmittableSelectClause as la, SchemaDialectName as lc, ConstraintTiming as li, TransactionalQueryAdapter as ll, insertSelect as ln, gt as lo, crossJoin as lr, PortableColumnStorage as ls, AnyQuery as lt, GroupingDependenciesOf as lu, SnapshotDialect as m, RowLockOptions as ma, assertSchemaDialectSupport as mc, ForeignKeyOptions as mi, stream as ml, DoUpdateAction as mn, lt as mo, rightJoin as mr, StorageDescriptor as ms, QuerySqlTypeMap as mt, HasWindow as mu, SchemaSnapshot as n, index as na, canonicalLiteral as nc, SqlSemanticType as nd, AnyKeyColumn as ni, QubuTransactionalClient as nl, deleteFrom as nn, caseWhen as no, withCte as nr, ColumnStorageType as ns, PortableCastType as nt, CapabilityMetadataOf as nu, SnapshotCheckConstraint as o, not as oa, identityColumn as oc, SqlTypeSatisfies as od, CheckConstraintOptions as oi, StreamingQueryAdapter as ol, ValuesSource as on, scalar as oo, intersect as or, NativeColumnStorage as os, assertDialectCapability as ot, ExpressionMeta as ou, SnapshotDiagnosticCode as p, RowLockClause as pa, SchemaObjectNameOptions as pc, ForeignKeyMatch as pi, qubu as pl, DoNothingAction as pn, like as po, naturalJoin as pr, StorageDeclarationOf as ps, QueryRow as pt, HasSubquery as pu, DialectPagination as q, count as qa, QubuExplainableStreamingTransactionalClient as qc, IndexDialectExtension as qi, ResultShape as ql, RequiredScope as qn, ColumnOptions as qo, SchemaTableEntry as qr, GeneratedDescriptor as qs, TableUpdateInput as qt, SqlDate as qu, SchemaSnapshotAdapter as r, validateIndexDialect as ra, externalDefault as rc, SqlText as rd, CatalogCheckExpression as ri, QueryAdapter as rl, DefaultValuesSource as rn, exists as ro, SetOperator as rr, ColumnStorageTypeOf as rs, RowLockMode as rt, CardinalityMeta as ru, SnapshotColumn as s, or as sa, resolveColumnBehavior as sc, SqlUnknown as sd, ConstraintDialectExtension as si, StreamingTransactionalQueryAdapter as sl, defaultValues as sn, ComparisonValidation as so, union as sr, NativeStorage as ss, createDialect as st, Fragment as su, AnySchema as t, TableIndex as ta, SqliteIdentityExtension as tc, SqlOrderable as td, schemaNamingPolicyVersion as ti, QubuTransaction as tl, orderBy as tn, sql as to, recursiveCte as tr, ColumnStorageOf as ts, PortableCastTarget as tt, CapabilitiesOf as tu, SnapshotDecodeResult as u, SelectPart as ua, SchemaMetadataDiagnostic as uc, FieldLike as ui, execute as ul, values as un, gte as uo, fullJoin as ur, PortableStorage as us, Query as ut, GroupingKeysOf as uu, SnapshotExtensionContext as v, offset as va, isValidSchemaObjectName as vc, KeyConstraintOptions as vi, render as vl, doUpdate as vn, between as vo, FromSource as vr, bigint as vs, CustomSource as vt, NullabilityOf as vu, SnapshotIndexTermExpression as w, add as wa, ExecutionRequest as wc, SourceLike as wi, ColumnReference as wl, AllowAllClause as wn, Operand as wo, all as wr, encodeColumnParameter as ws, SourceConfig as wt, ProvidesSourceMeta as wu, SnapshotIdentity as x, AnySelectClause as xa, AdapterExecutionResult as xc, ReferentialAction as xi, QueryValidationErrorCode as xl, UpdateAssignmentValue as xn, isNotNull as xo, SelectionObject as xr, column as xs, ProvidedSourceRow as xt, OutputOf as xu, SnapshotForeignKey as y, having as ya, materializeSchemaObjectIdentity as yc, MysqlConstraintExtension as yi, QueryTypeValidation as yl, excluded as yn, inList as yo, from as yr, binary as ys, CustomSourceOptions as yt, NullableSourceMeta as yu, schemaSnapshotVersion as z, coalesce as za, HookOutcome as zc, AliasIdentity as zi, markExpressionCategory as zl, correlate as zn, ColumnGeneratedOf as zo, renderSchemaExpression as zr, ColumnDefaultInput as zs, TableColumns as zt, fragment as zu };
|
|
4703
|
+
export { CompleteSnapshotExtension as $, IndexDialectExtension as $a, GeneratedColumnDescriptor as $c, isFragment as $d, SchemaTableEntry as $i, HookTransactionOperation as $l, DefaultValuesSource as $n, avg as $o, RequiredScope as $r, ColumnOnUpdateOf as $s, assertDialectCapability as $t, ResultDecodeContext as $u, SnapshotStorage as A, SourceLike as Aa, columnSqlType as Ac, MetadataOf as Ad, all as Ai, materializeSchemaObjectRecord as Al, sourceIdentity as An, SelectClause as Ao, AllowAllClause as Ar, isTrue as As, schemaSnapshotCompleteVersion as At, QueryTypeValidation as Au, CompleteSchemaSnapshot as B, primaryKey as Ba, text as Bc, RenderFunction as Bd, SchemaRenderOptions as Bi, ExplainReadOptions as Bl, TableSqlTypes as Bn, jsonPath as Bo, allowAll as Br, typedCast as Bs, DialectPagination as Bt, ExpressionKind as Bu, SnapshotIndexTerm as C, KeyConstraint as Ca, StorageOf as Cc, GroupingKeysOf as Cd, FromScope as Ci, SchemaObjectNameOptions as Cl, SourceRow as Cn, fetchFirst as Co, onDuplicateKeyUpdate as Cr, ne as Cs, CompleteSnapshotValueFact as Ct, explain as Cu, SnapshotLiteral as D, ReferentialAction as Da, boolean as Dc, HasWindow as Dd, SelectionObject as Di, generatedSchemaObjectName as Dl, createSource as Dn, distinct as Do, UpdateFromClause as Dr, notIn as Ds, SchemaSnapshotV1Input as Dt, RenderOptions as Du, SnapshotKeyConstraint as E, PostgresConstraintExtension as Ea, binary as Ec, HasSubquery as Ed, Selection as Ei, freezeSchemaMetadata as El, UnknownSourceSqlTypes as En, having as Eo, update as Er, inList as Es, SchemaSnapshotV1DecodeResult as Et, RenderCapabilityValidation as Eu, neutralSnapshotDialect as F, UniqueNullSemantics as Fa, nativeColumn as Fc, ProvidesOuterOf as Fd, SchemaExpressionError as Fi, ExecutionResult as Fl, TableIdentity as Fn, subtract as Fo, MutationReturning as Fr, asValue as Fs, DialectCapability as Ft, ColumnReference as Fu, CompleteSnapshotColumn as G, AliasIdentity as Ga, ColumnBehaviorErrorCode as Gc, RequiresOuterSourceMeta as Gd, renderSchemaExpression as Gi, HookMetadata as Gl, desc as Gn, rowNumber as Go, correlate as Gr, ColumnFromOptions as Gs, NamedCastTarget as Gt, ExpressionWithOutput as Gu, CompleteSnapshotCapabilities as H, unique as Ha, uuid as Hc, RequiresOf as Hd, defineSchemaExpression as Hi, ExplainResult as Hl, table as Hn, denseRank as Ho, ReturningRow as Hr, ColumnDefaultOf as Hs, ExplainFormat as Ht, ExpressionOutput as Hu, schemaSnapshotDialectVersion as I, catalogCheck as Ia, nativeStorage as Ic, ProvidesOuterSourceMeta as Id, SchemaExpressionErrorCode as Ii, ExplainMutationOptions as Il, TableInsertInput as In, JsonPath as Io, MutationReturningClause as Ir, typedValue as Is, DialectCastTypes as It, expressionFragment as Iu, CompleteSnapshotCreateResult as J, LateralSource as Ja, DefaultDescriptor as Jc, SqlTypeOf as Jd, unsafeSchemaSql as Ji, HookOperationKind as Jl, order as Jn, lower as Jo, AvailableScope as Jr, ColumnHasRuntimeDefault as Js, PortableCastTarget as Jt, isExpression as Ju, CompleteSnapshotComment as K, AliasedSource as Ka, ColumnDefault as Kc, RequiresSourceMeta as Kd, renderSchemaSql as Ki, HookMetadataValue as Kl, nullsFirst as Kn, coalesce as Ko, select as Kr, ColumnGeneratedOf as Ks, PaginationKind as Kt, SchemaExpression as Ku, schemaSnapshotFormat as L, catalogForeignKey as La, nullable as Lc, ProvidesSourceMeta as Ld, SchemaExpressionInput as Li, ExplainOptions as Ll, TableMetadataCallback as Ln, jsonBoolean as Lo, MutationRow as Lr, value as Ls, DialectExplain as Lt, AnyExpression as Lu, SnapshotTable as M, TableLike as Ma, encodeColumnParameter as Mc, NullableSourceMeta as Md, SchemaDialectHooks as Mi, DriverValueEncoder as Ml, Table as Mn, divide as Mo, MutationKind as Mr, OperandNullability as Ms, schemaSnapshotVersion1 as Mt, QueryValidationErrorCode as Mu, SnapshotUniqueConstraint as N, UniqueConstraint as Na, integer as Nc, NullableSourcesOf as Nd, createSchemaDialect as Ni, ExecutionOptions as Nl, TableColumns as Nn, modulo as No, MutationQuery as Nr, OperandSqlType as Ns, CastTarget as Nt, QueryValidationIssue as Nu, SnapshotNamingPolicy as O, SourceConstraint as Oa, column as Oc, InheritedMetadata as Od, SelectionOutput as Oi, isValidSchemaObjectName as Ol, customSource as On, AnySelectClause as Oo, UpdateFromScope as Or, isNotNull as Os, completeSchemaSnapshotFormat as Ot, RenderedQuery as Ou, SnapshotValidationContext as P, UniqueConstraintOptions as Pa, json as Pc, OutputOf as Pd, RenderedSchemaExpression as Pi, ExecutionRequest as Pl, TableDefinitions as Pn, multiply as Po, MutationQueryConfig as Pr, SqlCapabilityValidation as Ps, Dialect as Pt, ColumnDependency as Pu, CompleteSnapshotEnum as Q, lateral as Qa, ExternalGeneratedColumnDescriptor as Qc, fragment as Qd, SchemaOptions as Qi, HookSuccessOutcome as Ql, deleteFrom as Qn, typedCall as Qo, RequiredOuterScope as Qr, ColumnIsNullable as Qs, SchemaLiteralRenderer as Qt, DecodableResultType as Qu, schemaSnapshotNamingPolicyVersion as R, check as Ra, numeric as Rc, QueryCardinality as Rd, SchemaExpressionMode as Ri, ExplainOptionsFor as Rl, TableOptions as Rn, jsonExists as Ro, MutationScopeValidation as Rr, mapResult as Rs, DialectJson as Rt, AnySchemaExpression as Ru, SnapshotIndex as S, ForeignKeyTargetInput as Sa, StorageDialectOf as Sc, GroupingDependenciesOf as Sd, SqlUuid as Sf, FromClause as Si, SchemaObjectIdentity as Sl, SourceProvision as Sn, rowLock as So, incoming as Sr, lte as Ss, CompleteSnapshotTrigger as St, executeRows as Su, SnapshotJsonValue as T, MysqlConstraintExtension as Ta, bigint as Tc, HasAggregate as Td, from as Ti, dialectMismatchDiagnostic as Tl, SourceSqlTypes as Tn, offset as To, UpdateAssignments as Tr, between as Ts, SchemaSnapshotV1 as Tt, stream as Tu, CompleteSnapshotCheckConstraint as U, uniqueConstraint as Ua, CanonicalLiteral as Uc, RequiresOuterMetadataOf as Ud, isUnsafeSchemaSql as Ui, ExplainableQueryAdapter as Ul, OrderTerm as Un, over as Uo, ReturningSqlTypes as Ur, ColumnDefinition as Us, ExplainRenderOptions as Ut, ExpressionRequires as Uu, CompleteSchemaSnapshotInput as V, references as Va, timestamp as Vc, RequiresCapabilityMeta as Vd, UnsafeSchemaSqlExpression as Vi, ExplainRequest as Vl, TableUpdateInput as Vn, jsonText as Vo, ReturningClause as Vr, ColumnCodec as Vs, DialectRowLocking as Vt, ExpressionNullability as Vu, CompleteSnapshotCollation as W, validateConstraintDialect as Wa, ColumnBehaviorError as Wc, RequiresOuterOf as Wd, normalizeSchemaSql as Wi, HookErrorOutcome as Wl, asc as Wn, rank as Wo, returning as Wr, ColumnDefinitionConfig as Ws, JsonScalarKind as Wt, ExpressionSqlType as Wu, CompleteSnapshotDeferredObject as X, QuerySource as Xa, ExpressionGeneratedColumnDescriptor as Xc, VisibleDependenciesOf as Xd, SchemaDiagnostic as Xi, HookQueryOperation as Xl, jsonArrayFrom as Xn, call as Xo, GroupingValidation as Xr, ColumnInsertInput as Xs, RowLockMode as Xt, markExpressionCategory as Xu, CompleteSnapshotDecodeResult as Y, QueryAliasIdentity as Ya, ExpressionDefaultDescriptor as Yc, SubqueryMeta as Yd, Schema as Yi, HookOutcome as Yl, orderBy as Yn, upper as Yo, ClauseScope as Yr, ColumnIdentityOf as Ys, PortableCastType as Yt, makeExpression as Yu, CompleteSnapshotDomain as Z, alias as Za, ExternalDefaultDescriptor as Zc, WindowMeta as Zd, SchemaNamingPolicy as Zi, HookStreamEnd as Zl, jsonObjectFrom as Zn, schemaCall as Zo, MissingScope as Zr, ColumnIsGenerated as Zs, RowLockWaitPolicy as Zt, withDialectCapability as Zu, SnapshotExpressionContext as _, FieldLikeOptions as _a, PortableStorage as _c, CardinalityOf as _d, SqlTextLike as _f, innerJoin as _i, resolveColumnBehavior as _l, SourceColumns as _n, SelectPart as _o, excluded as _r, gte as _s, CompleteSnapshotProvenance as _t, StreamingQueryAdapter as _u, SnapshotBigInt as a, generatedTableName as aa, ColumnStorageDescriptor as ac, bigintResultDecoder as ad, SqlBoolean as af, WithClause as ai, IdentityOptionValue as al, QueryConfig as an, SourceIndex as ao, defaultValues as ar, SqlFragment as as, CompleteSnapshotNamespace as at, QubuExplainableTransactionalClient as au, SnapshotGeneratedColumn as b, ForeignKeyOptions as ba, StorageDeclarationOf as bc, Fragment as bd, SqlTypeSatisfies as bf, rightJoin as bi, SchemaMetadataDiagnostic as bl, SourceIdentity as bn, RowLockClause as bo, IncomingIdentity as br, like as bs, CompleteSnapshotSequence as bt, TransactionalQueryAdapter as bu, SnapshotConstraint as c, AnyKeyColumn as ca, ColumnStorageOf as cc, jsonTextResultDecoder as cd, SqlEqualityComparable as cf, withCte as ci, MysqlIdentityExtension as cl, QuerySqlTypeMap as cn, TableIndex as co, values as cr, sql as cs, CompleteSnapshotObjectMetadata as ct, QubuStreamingClient as cu, SnapshotDefault as d, CheckConstraint as da, ColumnUpdateInput as dc, AggregateDependenciesOf as dd, SqlJson as df, except as di, SqliteIdentityExtension as dl, AnySource as dn, DeclaredColumnNullability as do, DoNothingAction as dr, inQuery as ds, CompleteSnapshotObjectReference as dt, QubuStreamingTransactionalClient as du, SchemaTableNames as ea, ColumnOptions as ec, ResultDecoder as ed, parenthesize as ef, ScopeValidation as ei, GeneratedColumnMode as el, createDialect as en, IndexOptions as eo, InsertSelectSource as er, count as es, CompleteSnapshotForeignKey as et, NestedTransactionalQueryAdapter as eu, SnapshotDiagnostic as f, CheckConstraintOptions as fa, DialectNativeStorage as fc, AggregateMeta as fd, SqlNumericLike as ff, intersect as fi, canonicalLiteral as fl, CustomSource as fn, and as fo, DoUpdateAction as fr, notExists as fs, CompleteSnapshotOpaqueObject as ft, QubuTransaction as fu, SnapshotExpression as g, FieldLike as ga, PortableColumnStorage as gc, CardinalityMeta as gd, SqlText as gf, fullJoin as gi, identityColumn as gl, Source as gn, OmittableSelectClause as go, doUpdate as gr, gt as gs, CompleteSnapshotPolicy as gt, StreamableQuery as gu, SnapshotDialectExtension as h, ConstraintTiming as ha, NativeStorageDescriptor as hc, CapabilityMetadataOf as hd, SqlSemanticType as hf, crossJoin as hi, generatedColumn as hl, ProvidedSourceRow as hn, Omit$1 as ho, doNothing as hr, eq as hs, CompleteSnapshotPhysicalReference as ht, QueryExecutor as hu, SchemaSnapshotInput as i, defaultSchemaNamingPolicy as ia, ColumnStorageDeclarationOf as ic, ResultShape as id, SqlBinary as if, RecursiveCteSource as ii, IdentityGeneration as il, Query as in, PostgresIndexExtension as io, ValuesSource as ir, sum as is, CompleteSnapshotKeyConstraint as it, QubuExplainableStreamingTransactionalClient as iu, SnapshotStorageContext as j, SqliteConstraintExtension as ja, date as jc, NullabilityOf as jd, SchemaDialect as ji, AdapterExecutionResult as jl, AnyTable as jn, add as jo, MutationClause as jr, Operand as js, schemaSnapshotV1Version as jt, QueryValidationError as ju, SnapshotSpecialNumber as k, SourceConstraintsRecord as ka, columnResultValue as kc, InheritedMetadataOf as kd, SelectionSqlTypes as ki, materializeSchemaObjectIdentity as kl, exposeColumns as kn, ClausePlacement as ko, updateFrom as kr, isNull as ks, completeSchemaSnapshotVersion as kt, render as ku, SnapshotCreateResult as l, CatalogCheckExpression as la, ColumnStorageType as lc, resultValue as ld, SqlEqualityCompatible as lf, SetOperator as li, ResolvedColumnBehavior as ll, QueryWithRow as ln, index as lo, ConflictAction as lr, caseWhen as ls, CompleteSnapshotObjectOwner as lt, QubuStreamingExplainableClient as lu, SnapshotDialect as m, ConstraintOptions as ma, NativeStorage as mc, CapabilitiesOf as md, SqlOrderable as mf, unionAll as mi, externalGeneratedColumn as ml, ProvidedSourceIdentity as mn, or as mo, OnConflictClause as mr, ComparisonValidation as ms, CompleteSnapshotPartition as mt, QueryAdapter as mu, SchemaSnapshot as n, SchemaTableRegistry as na, ColumnSqlType as nc, ResultDecodingError as nd, AnySqlType as nf, SelectQuery as ni, IdentityDescriptor as nl, resolveCastTarget as nn, IndexTermOptions as no, InsertValue as nr, max as ns, CompleteSnapshotIndex as nt, QubuClient as nu, SnapshotCheckConstraint as o, schema as oa, ColumnStorageDialectOf as oc, booleanResultDecoder as od, SqlDate as of, cte as oi, IdentityOptions as ol, QueryKind as on, SourceIndexesRecord as oo, insertInto as or, SqlTag as os, CompleteSnapshotObject as ot, QubuHooks as ou, SnapshotDiagnosticCode as p, ConstraintDialectExtension as pa, NativeColumnStorage as pc, AnyFragment as pd, SqlOrderCompatible as pf, union as pi, externalDefault as pl, CustomSourceOptions as pn, not as po, ExcludedSource as pr, scalar as ps, CompleteSnapshotOwnership as pt, QubuTransactionalClient as pu, CompleteSnapshotConstraint as q, LateralIdentity as qa, ColumnDefaultInput as qc, ResultMeta as qd, schemaExpression as qi, HookOperation as ql, nullsLast as qn, concat as qo, AvailableOuterScope as qr, ColumnHasDefault as qs, PaginationPart as qt, SchemaExpressionBrand as qu, SchemaSnapshotAdapter as r, SchemaValidationError as ra, ColumnStorage as rc, ResultField as rd, SqlBigInt as rf, CteSource as ri, IdentityDialectExtension as rl, AnyQuery as rn, MysqlIndexExtension as ro, InsertValuesRow as rr, min as rs, CompleteSnapshotIndexTerm as rt, QubuExplainableClient as ru, SnapshotColumn as s, schemaNamingPolicyVersion as sa, ColumnStorageKindOf as sc, dateResultDecoder as sd, SqlDecimal as sf, recursiveCte as si, LiteralDefaultDescriptor as sl, QueryRow as sn, SqliteIndexExtension as so, insertSelect as sr, TypedSqlTag as ss, CompleteSnapshotObjectKind as st, QubuOptions as su, AnySchema as t, SchemaTableRecord as ta, ColumnOutput as tc, ResultDecoders as td, sequence as tf, SelectCardinality as ti, GeneratedDescriptor as tl, extendDialect as tn, IndexTerm as to, InsertSource as tr, countDistinct as ts, CompleteSnapshotIdentity as tt, OperationEndHook as tu, SnapshotDecodeResult as u, CatalogCheckSql as ua, ColumnStorageTypeOf as uc, timestampResultDecoder as ud, SqlInteger as uf, SetQuery as ui, SchemaLiteralValue as ul, Row as un, validateIndexDialect as uo, ConflictTarget as ur, exists as us, CompleteSnapshotObjectOwnerKind as ut, QubuStreamingTransaction as uu, SnapshotExtensionContext as v, ForeignKeyConstraint as va, PortableStorageDescriptor as vc, DependenciesOf as vd, SqlTimestamp as vf, leftJoin as vi, SchemaDialectExtension as vl, SourceConfig as vn, omit as vo, onConflict as vr, isDistinctFrom as vs, CompleteSnapshotRoutine as vt, StreamingTransactionalQueryAdapter as vu, SnapshotIndexTermExpression as w, KeyConstraintOptions as wa, StorageTypeOf as wc, GroupingMeta as wd, FromSource as wi, assertSchemaDialectSupport as wl, SourceSqlTypeMap as wn, fetchNext as wo, UpdateAssignmentValue as wr, notLike as ws, CompleteSnapshotView as wt, qubu as wu, SnapshotIdentity as x, ForeignKeyTarget as xa, StorageDescriptor as xc, FragmentMeta as xd, SqlUnknown as xf, groupBy as xi, SchemaMetadataValidationError as xl, SourceKind as xn, RowLockOptions as xo, OnDuplicateKeyUpdateClause as xr, lt as xs, CompleteSnapshotTable as xt, execute as xu, SnapshotForeignKey as y, ForeignKeyMatch as ya, PortableStorageType as yc, ExpressionMeta as yd, SqlTypeName as yf, naturalJoin as yi, SchemaDialectName as yl, SourceConstraints as yn, where as yo, IncomingColumns as yr, isNotDistinctFrom as ys, CompleteSnapshotRoutineParameter as yt, TransactionOptions as yu, schemaSnapshotVersion as z, foreignKey as za, portableStorage as zc, RenderContext as zd, SchemaRenderContext as zi, ExplainPlanRow as zl, TableRow as zn, jsonNumber as zo, MutationSqlTypes as zr, cast as zs, DialectOptions as zt, Expression as zu };
|