qubu 0.6.3 → 0.7.0

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.
@@ -1,4 +1,4 @@
1
- import { V as CatalogPortableStorageType, i as CatalogClassificationConfidence, p as CatalogDialect, pt as IntrospectionResult, wt as IntrospectionDiagnostic } from "./types-CiMvKi5V.mjs";
1
+ import { V as CatalogPortableStorageType, i as CatalogClassificationConfidence, p as CatalogDialect, pt as IntrospectionResult, wt as IntrospectionDiagnostic } from "./types-CdcYI0lU.mjs";
2
2
  //#region src/codegen/types.d.ts
3
3
  /** TypeScript value types that the controlled source printer can emit. */
4
4
  type CodegenApplicationType = "unknown" | "string" | "number" | "boolean" | "bigint" | "Date" | "Uint8Array";
package/dist/codegen.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { c as candidateKeyIndexColumns, l as hasCandidateKeyShape, t as mapCatalogToSnapshot, u as isCandidateKeyIndex } from "./snapshot-mIb-Zzb5.mjs";
1
+ import { c as candidateKeyIndexColumns, l as hasCandidateKeyShape, t as mapCatalogToSnapshot, u as isCandidateKeyIndex } from "./snapshot-C1x2R-iK.mjs";
2
2
  import { l as decodeSchemaSnapshot } from "./canonical-B5_ouh-c.mjs";
3
3
  //#region src/codegen/source.ts
4
4
  const header = `/* Generated by Qubu. Do not edit this machine-owned file. */
package/dist/core.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $d as isFragment, $t as assertDialectCapability, Ad as MetadataOf, Ao as SelectClause, Bd as RenderFunction, Bs as typedCast, Bt as DialectPagination, Cd as GroupingKeysOf, Dd as HasWindow, Du as RenderOptions, Ed as HasSubquery, Eu as RenderCapabilityValidation, Fd as ProvidesOuterOf, Ft as DialectCapability, Gd as RequiresOuterSourceMeta, Gt as NamedCastTarget, Hd as RequiresOf, Ht as ExplainFormat, Id as ProvidesOuterSourceMeta, Is as typedValue, It as DialectCastTypes, Iu as expressionFragment, Jd as SqlTypeOf, Jt as PortableCastTarget, Ju as isExpression, Kd as RequiresSourceMeta, Kt as PaginationKind, Ld as ProvidesSourceMeta, Lt as DialectExplain, Md as NullableSourceMeta, Nd as NullableSourcesOf, Nt as CastTarget, Od as InheritedMetadata, Ou as RenderedQuery, Pd as OutputOf, Pt as Dialect, Qd as fragment, Qo as typedCall, Qt as SchemaLiteralRenderer, Rd as QueryCardinality, Rt as DialectJson, Sd as GroupingDependenciesOf, Sf as SqlUuid, Td as HasAggregate, Ud as RequiresOuterMetadataOf, Ut as ExplainRenderOptions, Vd as RequiresCapabilityMeta, Vt as DialectRowLocking, Wd as RequiresOuterOf, Wt as JsonScalarKind, Xd as VisibleDependenciesOf, Xt as RowLockMode, Xu as markExpressionCategory, Yd as SubqueryMeta, Yt as PortableCastType, Yu as makeExpression, Zd as WindowMeta, Zt as RowLockWaitPolicy, Zu as withDialectCapability, _d as CardinalityOf, _f as SqlTextLike, af as SqlBoolean, bd as Fragment, bf as SqlTypeSatisfies, cf as SqlEqualityComparable, dd as AggregateDependenciesOf, df as SqlJson, ef as parenthesize, en as createDialect, fd as AggregateMeta, ff as SqlNumericLike, gd as CardinalityMeta, gf as SqlText, hd as CapabilityMetadataOf, hf as SqlSemanticType, if as SqlBinary, jd as NullabilityOf, kd as InheritedMetadataOf, ko as ClausePlacement, ku as render, ld as resultValue, lf as SqlEqualityCompatible, md as CapabilitiesOf, mf as SqlOrderable, nf as AnySqlType, nn as resolveCastTarget, of as SqlDate, pd as AnyFragment, pf as SqlOrderCompatible, qd as ResultMeta, qt as PaginationPart, rf as SqlBigInt, sf as SqlDecimal, tf as sequence, tn as extendDialect, uf as SqlInteger, vd as DependenciesOf, vf as SqlTimestamp, wd as GroupingMeta, xd as FragmentMeta, xf as SqlUnknown, yd as ExpressionMeta, yf as SqlTypeName, zd as RenderContext, zt as DialectOptions, zu as Expression } from "./types-Dqr4o2I1.mjs";
1
+ import { $d as isFragment, $t as assertDialectCapability, Ad as MetadataOf, Ao as SelectClause, Bd as RenderFunction, Bs as typedCast, Bt as DialectPagination, Cd as GroupingKeysOf, Dd as HasWindow, Du as RenderOptions, Ed as HasSubquery, Eu as RenderCapabilityValidation, Fd as ProvidesOuterOf, Ft as DialectCapability, Gd as RequiresOuterSourceMeta, Gt as NamedCastTarget, Hd as RequiresOf, Ht as ExplainFormat, Id as ProvidesOuterSourceMeta, Is as typedValue, It as DialectCastTypes, Iu as expressionFragment, Jd as SqlTypeOf, Jt as PortableCastTarget, Ju as isExpression, Kd as RequiresSourceMeta, Kt as PaginationKind, Ld as ProvidesSourceMeta, Lt as DialectExplain, Md as NullableSourceMeta, Nd as NullableSourcesOf, Nt as CastTarget, Od as InheritedMetadata, Ou as RenderedQuery, Pd as OutputOf, Pt as Dialect, Qd as fragment, Qo as typedCall, Qt as SchemaLiteralRenderer, Rd as QueryCardinality, Rt as DialectJson, Sd as GroupingDependenciesOf, Sf as SqlUuid, Td as HasAggregate, Ud as RequiresOuterMetadataOf, Ut as ExplainRenderOptions, Vd as RequiresCapabilityMeta, Vt as DialectRowLocking, Wd as RequiresOuterOf, Wt as JsonScalarKind, Xd as VisibleDependenciesOf, Xt as RowLockMode, Xu as markExpressionCategory, Yd as SubqueryMeta, Yt as PortableCastType, Yu as makeExpression, Zd as WindowMeta, Zt as RowLockWaitPolicy, Zu as withDialectCapability, _d as CardinalityOf, _f as SqlTextLike, af as SqlBoolean, bd as Fragment, bf as SqlTypeSatisfies, cf as SqlEqualityComparable, dd as AggregateDependenciesOf, df as SqlJson, ef as parenthesize, en as createDialect, fd as AggregateMeta, ff as SqlNumericLike, gd as CardinalityMeta, gf as SqlText, hd as CapabilityMetadataOf, hf as SqlSemanticType, if as SqlBinary, jd as NullabilityOf, kd as InheritedMetadataOf, ko as ClausePlacement, ku as render, ld as resultValue, lf as SqlEqualityCompatible, md as CapabilitiesOf, mf as SqlOrderable, nf as AnySqlType, nn as resolveCastTarget, of as SqlDate, pd as AnyFragment, pf as SqlOrderCompatible, qd as ResultMeta, qt as PaginationPart, rf as SqlBigInt, sf as SqlDecimal, tf as sequence, tn as extendDialect, uf as SqlInteger, vd as DependenciesOf, vf as SqlTimestamp, wd as GroupingMeta, xd as FragmentMeta, xf as SqlUnknown, yd as ExpressionMeta, yf as SqlTypeName, zd as RenderContext, zt as DialectOptions, zu as Expression } from "./types-DcIiNePM.mjs";
2
2
  //#region src/core/primitives/compose.d.ts
3
3
  declare function commaSeparated<const TParts extends readonly AnyFragment[]>(parts: TParts): Fragment<InheritedMetadata<TParts[number]>>;
4
4
  declare function keyword<TPart extends AnyFragment | undefined>(value: string, part?: TPart): Fragment<TPart extends AnyFragment ? InheritedMetadata<TPart> : never>;
package/dist/diff.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { T as SnapshotJsonValue, m as SnapshotDialect, n as SchemaSnapshot, st as CompleteSnapshotObjectKind } from "./types-Dqr4o2I1.mjs";
1
+ import { T as SnapshotJsonValue, m as SnapshotDialect, n as SchemaSnapshot, st as CompleteSnapshotObjectKind } from "./types-DcIiNePM.mjs";
2
2
  //#region src/diff/types.d.ts
3
3
  /** Object families understood by the snapshot diff engine. */
4
4
  type SnapshotDiffObjectKind = CompleteSnapshotObjectKind;
@@ -0,0 +1,2 @@
1
+ import "./types-DcIiNePM.mjs";
2
+ import "./serialize-Dg-Q55YQ.mjs";
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $a as IndexDialectExtension, $c as GeneratedColumnDescriptor, $i as SchemaTableEntry, $l as HookTransactionOperation, $n as DefaultValuesSource, $o as avg, $r as RequiredScope, $s as ColumnOnUpdateOf, $u as ResultDecodeContext, Aa as SourceLike, Ad as MetadataOf, Ai as all, Ao as SelectClause, Ar as AllowAllClause, As as isTrue, Au as QueryTypeValidation, Ba as primaryKey, Bc as text, Bd as RenderFunction, Bi as SchemaRenderOptions, Bl as ExplainReadOptions, Bn as TableSqlTypes, Bo as jsonPath, Br as allowAll, Bt as DialectPagination, Bu as ExpressionKind, Ca as KeyConstraint, Cd as GroupingKeysOf, Ci as FromScope, Cl as SchemaObjectNameOptions, Cn as SourceRow, Co as fetchFirst, Cs as ne, Cu as explain, Da as ReferentialAction, Dc as boolean, Dd as HasWindow, Di as SelectionObject, Do as distinct, Ds as notIn, Du as RenderOptions, Ea as PostgresConstraintExtension, Ec as binary, Ed as HasSubquery, Ei as Selection, Eo as having, Er as update, Es as inList, Fa as UniqueNullSemantics, Fc as nativeColumn, Fd as ProvidesOuterOf, Fl as ExecutionResult, Fn as TableIdentity, Fo as subtract, Fr as MutationReturning, Fs as asValue, Ft as DialectCapability, Fu as ColumnReference, Ga as AliasIdentity, Gc as ColumnBehaviorErrorCode, Gd as RequiresOuterSourceMeta, Gl as HookMetadata, Gn as desc, Go as rowNumber, Gr as correlate, Gt as NamedCastTarget, Gu as ExpressionWithOutput, Ha as unique, Hc as uuid, Hd as RequiresOf, Hl as ExplainResult, Hn as table, Ho as denseRank, Hr as ReturningRow, Hs as ColumnDefaultOf, Ht as ExplainFormat, Hu as ExpressionOutput, Ia as catalogCheck, Ic as nativeStorage, Id as ProvidesOuterSourceMeta, Ii as SchemaExpressionErrorCode, Il as ExplainMutationOptions, In as TableInsertInput, Io as JsonPath, Ir as MutationReturningClause, It as DialectCastTypes, Ja as LateralSource, Jc as DefaultDescriptor, Jd as SqlTypeOf, Ji as unsafeSchemaSql, Jl as HookOperationKind, Jn as order, Jo as lower, Jr as AvailableScope, Js as ColumnHasRuntimeDefault, Jt as PortableCastTarget, Ka as AliasedSource, Kc as ColumnDefault, Kd as RequiresSourceMeta, Kl as HookMetadataValue, Kn as nullsFirst, Ko as coalesce, Kr as select, Ks as ColumnGeneratedOf, Kt as PaginationKind, Ku as SchemaExpression, La as catalogForeignKey, Lc as nullable, Ld as ProvidesSourceMeta, Li as SchemaExpressionInput, Ll as ExplainOptions, Lo as jsonBoolean, Lr as MutationRow, Ls as value, Lt as DialectExplain, Lu as AnyExpression, Ma as TableLike, Md as NullableSourceMeta, Mi as SchemaDialectHooks, Ml as DriverValueEncoder, Mn as Table, Mo as divide, Mr as MutationKind, Mu as QueryValidationErrorCode, Na as UniqueConstraint, Nc as integer, Nd as NullableSourcesOf, Nl as ExecutionOptions, Nn as TableColumns, No as modulo, Nr as MutationQuery, Nt as CastTarget, Nu as QueryValidationIssue, Oa as SourceConstraint, Oc as column, Od as InheritedMetadata, Oi as SelectionOutput, Oo as AnySelectClause, Os as isNotNull, Ou as RenderedQuery, Pa as UniqueConstraintOptions, Pc as json, Pd as OutputOf, Pi as RenderedSchemaExpression, Pl as ExecutionRequest, Pn as TableDefinitions, Po as multiply, Pr as MutationQueryConfig, Pt as Dialect, Pu as ColumnDependency, Qa as lateral, Qc as ExternalGeneratedColumnDescriptor, Qi as SchemaOptions, Ql as HookSuccessOutcome, Qn as deleteFrom, Qr as RequiredOuterScope, Qt as SchemaLiteralRenderer, Qu as DecodableResultType, Ra as check, Rc as numeric, Rd as QueryCardinality, Ri as SchemaExpressionMode, Rl as ExplainOptionsFor, Ro as jsonExists, Rr as MutationScopeValidation, Rs as mapResult, Rt as DialectJson, Ru as AnySchemaExpression, Sa as ForeignKeyTargetInput, Sd as GroupingDependenciesOf, Sf as SqlUuid, Si as FromClause, Sl as SchemaObjectIdentity, Sn as SourceProvision, So as rowLock, Ss as lte, Su as executeRows, Ta as MysqlConstraintExtension, Tc as bigint, Td as HasAggregate, Ti as from, To as offset, Tr as UpdateAssignments, Ts as between, Tu as stream, Ua as uniqueConstraint, Uc as CanonicalLiteral, Ud as RequiresOuterMetadataOf, Ul as ExplainableQueryAdapter, Un as OrderTerm, Uo as over, Ur as ReturningSqlTypes, Us as ColumnDefinition, Ut as ExplainRenderOptions, Uu as ExpressionRequires, Va as references, Vc as timestamp, Vd as RequiresCapabilityMeta, Vi as UnsafeSchemaSqlExpression, Vl as ExplainRequest, Vn as TableUpdateInput, Vo as jsonText, Vr as ReturningClause, Vs as ColumnCodec, Vt as DialectRowLocking, Vu as ExpressionNullability, Wc as ColumnBehaviorError, Wd as RequiresOuterOf, Wl as HookErrorOutcome, Wn as asc, Wo as rank, Wr as returning, Ws as ColumnDefinitionConfig, Wt as JsonScalarKind, Wu as ExpressionSqlType, Xa as QuerySource, Xc as ExpressionGeneratedColumnDescriptor, Xd as VisibleDependenciesOf, Xi as SchemaDiagnostic, Xl as HookQueryOperation, Xn as jsonArrayFrom, Xo as call, Xr as GroupingValidation, Xs as ColumnInsertInput, Xt as RowLockMode, Ya as QueryAliasIdentity, Yc as ExpressionDefaultDescriptor, Yd as SubqueryMeta, Yi as Schema, Yl as HookOutcome, Yn as orderBy, Yo as upper, Yr as ClauseScope, Ys as ColumnIdentityOf, Yt as PortableCastType, Za as alias, Zc as ExternalDefaultDescriptor, Zd as WindowMeta, Zi as SchemaNamingPolicy, Zl as HookStreamEnd, Zn as jsonObjectFrom, Zo as schemaCall, Zr as MissingScope, Zs as ColumnIsGenerated, Zt as RowLockWaitPolicy, _a as FieldLikeOptions, _d as CardinalityOf, _f as SqlTextLike, _i as innerJoin, _n as SourceColumns, _o as SelectPart, _s as gte, _u as StreamingQueryAdapter, ad as bigintResultDecoder, af as SqlBoolean, ai as WithClause, al as IdentityOptionValue, an as QueryConfig, ao as SourceIndex, ar as defaultValues, as as SqlFragment, au as QubuExplainableTransactionalClient, ba as ForeignKeyOptions, bd as Fragment, bf as SqlTypeSatisfies, bi as rightJoin, bl as SchemaMetadataDiagnostic, bn as SourceIdentity, bo as RowLockClause, bs as like, bu as TransactionalQueryAdapter, ca as AnyKeyColumn, cc as ColumnStorageOf, cd as jsonTextResultDecoder, cf as SqlEqualityComparable, ci as withCte, cl as MysqlIdentityExtension, cn as QuerySqlTypeMap, co as TableIndex, cr as values, cs as sql, cu as QubuStreamingClient, da as CheckConstraint, dc as ColumnUpdateInput, dd as AggregateDependenciesOf, df as SqlJson, di as except, dl as SqliteIdentityExtension, dn as AnySource, do as DeclaredColumnNullability, ds as inQuery, du as QubuStreamingTransactionalClient, ea as SchemaTableNames, ec as ColumnOptions, ed as ResultDecoder, ei as ScopeValidation, el as GeneratedColumnMode, eo as IndexOptions, er as InsertSelectSource, es as count, eu as NestedTransactionalQueryAdapter, fa as CheckConstraintOptions, fd as AggregateMeta, ff as SqlNumericLike, fi as intersect, fo as and, fs as notExists, fu as QubuTransaction, ga as FieldLike, gc as PortableColumnStorage, gd as CardinalityMeta, gf as SqlText, gi as fullJoin, gl as identityColumn, gn as Source, go as OmittableSelectClause, gs as gt, gu as StreamableQuery, ha as ConstraintTiming, hd as CapabilityMetadataOf, hf as SqlSemanticType, hi as crossJoin, hl as generatedColumn, hn as ProvidedSourceRow, ho as Omit, hs as eq, hu as QueryExecutor, ic as ColumnStorageDeclarationOf, id as ResultShape, if as SqlBinary, ii as RecursiveCteSource, il as IdentityGeneration, in as Query, io as PostgresIndexExtension, ir as ValuesSource, is as sum, iu as QubuExplainableStreamingTransactionalClient, ja as SqliteConstraintExtension, jc as date, jd as NullabilityOf, ji as SchemaDialect, jl as AdapterExecutionResult, jn as AnyTable, jo as add, jr as MutationClause, ju as QueryValidationError, ka as SourceConstraintsRecord, kd as InheritedMetadataOf, ki as SelectionSqlTypes, ko as ClausePlacement, ks as isNull, ku as render, la as CatalogCheckExpression, lf as SqlEqualityCompatible, li as SetOperator, ll as ResolvedColumnBehavior, ln as QueryWithRow, lo as index, ls as caseWhen, lu as QubuStreamingExplainableClient, ma as ConstraintOptions, md as CapabilitiesOf, mf as SqlOrderable, mi as unionAll, ml as externalGeneratedColumn, mn as ProvidedSourceIdentity, mo as or, mu as QueryAdapter, na as SchemaTableRegistry, nc as ColumnSqlType, nd as ResultDecodingError, nf as AnySqlType, ni as SelectQuery, nl as IdentityDescriptor, no as IndexTermOptions, nr as InsertValue, ns as max, nu as QubuClient, oa as schema, oc as ColumnStorageDialectOf, od as booleanResultDecoder, of as SqlDate, oi as cte, ol as IdentityOptions, on as QueryKind, oo as SourceIndexesRecord, or as insertInto, os as SqlTag, ou as QubuHooks, pa as ConstraintDialectExtension, pc as NativeColumnStorage, pd as AnyFragment, pf as SqlOrderCompatible, pi as union, pl as externalDefault, po as not, ps as scalar, pu as QubuTransactionalClient, qa as LateralIdentity, qc as ColumnDefaultInput, qd as ResultMeta, ql as HookOperation, qn as nullsLast, qo as concat, qr as AvailableOuterScope, qs as ColumnHasDefault, qt as PaginationPart, qu as SchemaExpressionBrand, rc as ColumnStorage, rd as ResultField, rf as SqlBigInt, ri as CteSource, rl as IdentityDialectExtension, rn as AnyQuery, ro as MysqlIndexExtension, rr as InsertValuesRow, rs as min, ru as QubuExplainableClient, sc as ColumnStorageKindOf, sd as dateResultDecoder, sf as SqlDecimal, si as recursiveCte, sl as LiteralDefaultDescriptor, sn as QueryRow, so as SqliteIndexExtension, sr as insertSelect, ss as TypedSqlTag, su as QubuOptions, ta as SchemaTableRecord, tc as ColumnOutput, td as ResultDecoders, ti as SelectCardinality, tl as GeneratedDescriptor, to as IndexTerm, tr as InsertSource, ts as countDistinct, tu as OperationEndHook, ua as CatalogCheckSql, uc as ColumnStorageTypeOf, ud as timestampResultDecoder, uf as SqlInteger, ui as SetQuery, ul as SchemaLiteralValue, un as Row, us as exists, uu as QubuStreamingTransaction, va as ForeignKeyConstraint, vd as DependenciesOf, vf as SqlTimestamp, vi as leftJoin, vl as SchemaDialectExtension, vn as SourceConfig, vo as omit, vs as isDistinctFrom, vu as StreamingTransactionalQueryAdapter, wa as KeyConstraintOptions, wd as GroupingMeta, wi as FromSource, wn as SourceSqlTypeMap, wo as fetchNext, wr as UpdateAssignmentValue, ws as notLike, wu as qubu, xa as ForeignKeyTarget, xd as FragmentMeta, xf as SqlUnknown, xi as groupBy, xn as SourceKind, xo as RowLockOptions, xs as lt, xu as execute, ya as ForeignKeyMatch, yd as ExpressionMeta, yf as SqlTypeName, yi as naturalJoin, yl as SchemaDialectName, yn as SourceConstraints, yo as where, ys as isNotDistinctFrom, yu as TransactionOptions, za as foreignKey, zc as portableStorage, zd as RenderContext, zi as SchemaRenderContext, zl as ExplainPlanRow, zn as TableRow, zo as jsonNumber, zr as MutationSqlTypes, zs as cast, zt as DialectOptions, zu as Expression } from "./types-Dqr4o2I1.mjs";
1
+ import { $a as IndexDialectExtension, $c as GeneratedColumnDescriptor, $i as SchemaTableEntry, $l as HookTransactionOperation, $n as DefaultValuesSource, $o as avg, $r as RequiredScope, $s as ColumnOnUpdateOf, $u as ResultDecodeContext, Aa as SourceLike, Ad as MetadataOf, Ai as all, Ao as SelectClause, Ar as AllowAllClause, As as isTrue, Au as QueryTypeValidation, Ba as primaryKey, Bc as text, Bd as RenderFunction, Bi as SchemaRenderOptions, Bl as ExplainReadOptions, Bn as TableSqlTypes, Bo as jsonPath, Br as allowAll, Bt as DialectPagination, Bu as ExpressionKind, Ca as KeyConstraint, Cd as GroupingKeysOf, Ci as FromScope, Cl as SchemaObjectNameOptions, Cn as SourceRow, Co as fetchFirst, Cs as ne, Cu as explain, Da as ReferentialAction, Dc as boolean, Dd as HasWindow, Di as SelectionObject, Do as distinct, Ds as notIn, Du as RenderOptions, Ea as PostgresConstraintExtension, Ec as binary, Ed as HasSubquery, Ei as Selection, Eo as having, Er as update, Es as inList, Fa as UniqueNullSemantics, Fc as nativeColumn, Fd as ProvidesOuterOf, Fl as ExecutionResult, Fn as TableIdentity, Fo as subtract, Fr as MutationReturning, Fs as asValue, Ft as DialectCapability, Fu as ColumnReference, Ga as AliasIdentity, Gc as ColumnBehaviorErrorCode, Gd as RequiresOuterSourceMeta, Gl as HookMetadata, Gn as desc, Go as rowNumber, Gr as correlate, Gt as NamedCastTarget, Gu as ExpressionWithOutput, Ha as unique, Hc as uuid, Hd as RequiresOf, Hl as ExplainResult, Hn as table, Ho as denseRank, Hr as ReturningRow, Hs as ColumnDefaultOf, Ht as ExplainFormat, Hu as ExpressionOutput, Ia as catalogCheck, Ic as nativeStorage, Id as ProvidesOuterSourceMeta, Ii as SchemaExpressionErrorCode, Il as ExplainMutationOptions, In as TableInsertInput, Io as JsonPath, Ir as MutationReturningClause, It as DialectCastTypes, Ja as LateralSource, Jc as DefaultDescriptor, Jd as SqlTypeOf, Ji as unsafeSchemaSql, Jl as HookOperationKind, Jn as order, Jo as lower, Jr as AvailableScope, Js as ColumnHasRuntimeDefault, Jt as PortableCastTarget, Ka as AliasedSource, Kc as ColumnDefault, Kd as RequiresSourceMeta, Kl as HookMetadataValue, Kn as nullsFirst, Ko as coalesce, Kr as select, Ks as ColumnGeneratedOf, Kt as PaginationKind, Ku as SchemaExpression, La as catalogForeignKey, Lc as nullable, Ld as ProvidesSourceMeta, Li as SchemaExpressionInput, Ll as ExplainOptions, Lo as jsonBoolean, Lr as MutationRow, Ls as value, Lt as DialectExplain, Lu as AnyExpression, Ma as TableLike, Md as NullableSourceMeta, Mi as SchemaDialectHooks, Ml as DriverValueEncoder, Mn as Table, Mo as divide, Mr as MutationKind, Mu as QueryValidationErrorCode, Na as UniqueConstraint, Nc as integer, Nd as NullableSourcesOf, Nl as ExecutionOptions, Nn as TableColumns, No as modulo, Nr as MutationQuery, Nt as CastTarget, Nu as QueryValidationIssue, Oa as SourceConstraint, Oc as column, Od as InheritedMetadata, Oi as SelectionOutput, Oo as AnySelectClause, Os as isNotNull, Ou as RenderedQuery, Pa as UniqueConstraintOptions, Pc as json, Pd as OutputOf, Pi as RenderedSchemaExpression, Pl as ExecutionRequest, Pn as TableDefinitions, Po as multiply, Pr as MutationQueryConfig, Pt as Dialect, Pu as ColumnDependency, Qa as lateral, Qc as ExternalGeneratedColumnDescriptor, Qi as SchemaOptions, Ql as HookSuccessOutcome, Qn as deleteFrom, Qr as RequiredOuterScope, Qt as SchemaLiteralRenderer, Qu as DecodableResultType, Ra as check, Rc as numeric, Rd as QueryCardinality, Ri as SchemaExpressionMode, Rl as ExplainOptionsFor, Ro as jsonExists, Rr as MutationScopeValidation, Rs as mapResult, Rt as DialectJson, Ru as AnySchemaExpression, Sa as ForeignKeyTargetInput, Sd as GroupingDependenciesOf, Sf as SqlUuid, Si as FromClause, Sl as SchemaObjectIdentity, Sn as SourceProvision, So as rowLock, Ss as lte, Su as executeRows, Ta as MysqlConstraintExtension, Tc as bigint, Td as HasAggregate, Ti as from, To as offset, Tr as UpdateAssignments, Ts as between, Tu as stream, Ua as uniqueConstraint, Uc as CanonicalLiteral, Ud as RequiresOuterMetadataOf, Ul as ExplainableQueryAdapter, Un as OrderTerm, Uo as over, Ur as ReturningSqlTypes, Us as ColumnDefinition, Ut as ExplainRenderOptions, Uu as ExpressionRequires, Va as references, Vc as timestamp, Vd as RequiresCapabilityMeta, Vi as UnsafeSchemaSqlExpression, Vl as ExplainRequest, Vn as TableUpdateInput, Vo as jsonText, Vr as ReturningClause, Vs as ColumnCodec, Vt as DialectRowLocking, Vu as ExpressionNullability, Wc as ColumnBehaviorError, Wd as RequiresOuterOf, Wl as HookErrorOutcome, Wn as asc, Wo as rank, Wr as returning, Ws as ColumnDefinitionConfig, Wt as JsonScalarKind, Wu as ExpressionSqlType, Xa as QuerySource, Xc as ExpressionGeneratedColumnDescriptor, Xd as VisibleDependenciesOf, Xi as SchemaDiagnostic, Xl as HookQueryOperation, Xn as jsonArrayFrom, Xo as call, Xr as GroupingValidation, Xs as ColumnInsertInput, Xt as RowLockMode, Ya as QueryAliasIdentity, Yc as ExpressionDefaultDescriptor, Yd as SubqueryMeta, Yi as Schema, Yl as HookOutcome, Yn as orderBy, Yo as upper, Yr as ClauseScope, Ys as ColumnIdentityOf, Yt as PortableCastType, Za as alias, Zc as ExternalDefaultDescriptor, Zd as WindowMeta, Zi as SchemaNamingPolicy, Zl as HookStreamEnd, Zn as jsonObjectFrom, Zo as schemaCall, Zr as MissingScope, Zs as ColumnIsGenerated, Zt as RowLockWaitPolicy, _a as FieldLikeOptions, _d as CardinalityOf, _f as SqlTextLike, _i as innerJoin, _n as SourceColumns, _o as SelectPart, _s as gte, _u as StreamingQueryAdapter, ad as bigintResultDecoder, af as SqlBoolean, ai as WithClause, al as IdentityOptionValue, an as QueryConfig, ao as SourceIndex, ar as defaultValues, as as SqlFragment, au as QubuExplainableTransactionalClient, ba as ForeignKeyOptions, bd as Fragment, bf as SqlTypeSatisfies, bi as rightJoin, bl as SchemaMetadataDiagnostic, bn as SourceIdentity, bo as RowLockClause, bs as like, bu as TransactionalQueryAdapter, ca as AnyKeyColumn, cc as ColumnStorageOf, cd as jsonTextResultDecoder, cf as SqlEqualityComparable, ci as withCte, cl as MysqlIdentityExtension, cn as QuerySqlTypeMap, co as TableIndex, cr as values, cs as sql, cu as QubuStreamingClient, da as CheckConstraint, dc as ColumnUpdateInput, dd as AggregateDependenciesOf, df as SqlJson, di as except, dl as SqliteIdentityExtension, dn as AnySource, do as DeclaredColumnNullability, ds as inQuery, du as QubuStreamingTransactionalClient, ea as SchemaTableNames, ec as ColumnOptions, ed as ResultDecoder, ei as ScopeValidation, el as GeneratedColumnMode, eo as IndexOptions, er as InsertSelectSource, es as count, eu as NestedTransactionalQueryAdapter, fa as CheckConstraintOptions, fd as AggregateMeta, ff as SqlNumericLike, fi as intersect, fo as and, fs as notExists, fu as QubuTransaction, ga as FieldLike, gc as PortableColumnStorage, gd as CardinalityMeta, gf as SqlText, gi as fullJoin, gl as identityColumn, gn as Source, go as OmittableSelectClause, gs as gt, gu as StreamableQuery, ha as ConstraintTiming, hd as CapabilityMetadataOf, hf as SqlSemanticType, hi as crossJoin, hl as generatedColumn, hn as ProvidedSourceRow, ho as Omit, hs as eq, hu as QueryExecutor, ic as ColumnStorageDeclarationOf, id as ResultShape, if as SqlBinary, ii as RecursiveCteSource, il as IdentityGeneration, in as Query, io as PostgresIndexExtension, ir as ValuesSource, is as sum, iu as QubuExplainableStreamingTransactionalClient, ja as SqliteConstraintExtension, jc as date, jd as NullabilityOf, ji as SchemaDialect, jl as AdapterExecutionResult, jn as AnyTable, jo as add, jr as MutationClause, ju as QueryValidationError, ka as SourceConstraintsRecord, kd as InheritedMetadataOf, ki as SelectionSqlTypes, ko as ClausePlacement, ks as isNull, ku as render, la as CatalogCheckExpression, lf as SqlEqualityCompatible, li as SetOperator, ll as ResolvedColumnBehavior, ln as QueryWithRow, lo as index, ls as caseWhen, lu as QubuStreamingExplainableClient, ma as ConstraintOptions, md as CapabilitiesOf, mf as SqlOrderable, mi as unionAll, ml as externalGeneratedColumn, mn as ProvidedSourceIdentity, mo as or, mu as QueryAdapter, na as SchemaTableRegistry, nc as ColumnSqlType, nd as ResultDecodingError, nf as AnySqlType, ni as SelectQuery, nl as IdentityDescriptor, no as IndexTermOptions, nr as InsertValue, ns as max, nu as QubuClient, oa as schema, oc as ColumnStorageDialectOf, od as booleanResultDecoder, of as SqlDate, oi as cte, ol as IdentityOptions, on as QueryKind, oo as SourceIndexesRecord, or as insertInto, os as SqlTag, ou as QubuHooks, pa as ConstraintDialectExtension, pc as NativeColumnStorage, pd as AnyFragment, pf as SqlOrderCompatible, pi as union, pl as externalDefault, po as not, ps as scalar, pu as QubuTransactionalClient, qa as LateralIdentity, qc as ColumnDefaultInput, qd as ResultMeta, ql as HookOperation, qn as nullsLast, qo as concat, qr as AvailableOuterScope, qs as ColumnHasDefault, qt as PaginationPart, qu as SchemaExpressionBrand, rc as ColumnStorage, rd as ResultField, rf as SqlBigInt, ri as CteSource, rl as IdentityDialectExtension, rn as AnyQuery, ro as MysqlIndexExtension, rr as InsertValuesRow, rs as min, ru as QubuExplainableClient, sc as ColumnStorageKindOf, sd as dateResultDecoder, sf as SqlDecimal, si as recursiveCte, sl as LiteralDefaultDescriptor, sn as QueryRow, so as SqliteIndexExtension, sr as insertSelect, ss as TypedSqlTag, su as QubuOptions, ta as SchemaTableRecord, tc as ColumnOutput, td as ResultDecoders, ti as SelectCardinality, tl as GeneratedDescriptor, to as IndexTerm, tr as InsertSource, ts as countDistinct, tu as OperationEndHook, ua as CatalogCheckSql, uc as ColumnStorageTypeOf, ud as timestampResultDecoder, uf as SqlInteger, ui as SetQuery, ul as SchemaLiteralValue, un as Row, us as exists, uu as QubuStreamingTransaction, va as ForeignKeyConstraint, vd as DependenciesOf, vf as SqlTimestamp, vi as leftJoin, vl as SchemaDialectExtension, vn as SourceConfig, vo as omit, vs as isDistinctFrom, vu as StreamingTransactionalQueryAdapter, wa as KeyConstraintOptions, wd as GroupingMeta, wi as FromSource, wn as SourceSqlTypeMap, wo as fetchNext, wr as UpdateAssignmentValue, ws as notLike, wu as qubu, xa as ForeignKeyTarget, xd as FragmentMeta, xf as SqlUnknown, xi as groupBy, xn as SourceKind, xo as RowLockOptions, xs as lt, xu as execute, ya as ForeignKeyMatch, yd as ExpressionMeta, yf as SqlTypeName, yi as naturalJoin, yl as SchemaDialectName, yn as SourceConstraints, yo as where, ys as isNotDistinctFrom, yu as TransactionOptions, za as foreignKey, zc as portableStorage, zd as RenderContext, zi as SchemaRenderContext, zl as ExplainPlanRow, zn as TableRow, zo as jsonNumber, zr as MutationSqlTypes, zs as cast, zt as DialectOptions, zu as Expression } from "./types-DcIiNePM.mjs";
2
2
  export { type AdapterExecutionResult, type AggregateDependenciesOf, type AggregateMeta, type AliasIdentity, type AliasedSource, type AllowAllClause, type AnyExpression, type AnyFragment, type AnyKeyColumn, type AnyQuery, type AnySchemaExpression, type AnySelectClause, type AnySource, type AnySqlType, type AnyTable, type AvailableOuterScope, type AvailableScope, type CanonicalLiteral, type CapabilitiesOf, type CapabilityMetadataOf, type CardinalityMeta, type CardinalityOf, type CastTarget, type CatalogCheckExpression, type CatalogCheckSql, type CheckConstraint, type CheckConstraintOptions, type ClausePlacement, type ClauseScope, type ColumnBehaviorError, type ColumnBehaviorErrorCode, type ColumnCodec, type ColumnDefault, type ColumnDefaultInput, type ColumnDefaultOf, type ColumnDefinition, type ColumnDefinitionConfig, type ColumnDependency, type ColumnGeneratedOf, type ColumnHasDefault, type ColumnHasRuntimeDefault, type ColumnIdentityOf, type ColumnInsertInput, type ColumnIsGenerated, type ColumnOnUpdateOf, type ColumnOptions, type ColumnOutput, type ColumnReference, type ColumnSqlType, type ColumnStorage, type ColumnStorageDeclarationOf, type ColumnStorageDialectOf, type ColumnStorageKindOf, type ColumnStorageOf, type ColumnStorageTypeOf, type ColumnUpdateInput, type ConstraintDialectExtension, type ConstraintOptions, type ConstraintTiming, type CteSource, type DeclaredColumnNullability, type DecodableResultType, type DefaultDescriptor, type DefaultValuesSource, type DependenciesOf, type Dialect, type DialectCapability, type DialectCastTypes, type DialectExplain, type DialectJson, type DialectOptions, type DialectPagination, type DialectRowLocking, type DriverValueEncoder, type ExecutionOptions, type ExecutionRequest, type ExecutionResult, type ExplainFormat, type ExplainMutationOptions, type ExplainOptions, type ExplainOptionsFor, type ExplainPlanRow, type ExplainReadOptions, type ExplainRenderOptions, type ExplainRequest, type ExplainResult, type ExplainableQueryAdapter, type Expression, type ExpressionDefaultDescriptor, type ExpressionGeneratedColumnDescriptor, type ExpressionKind, type ExpressionMeta, type ExpressionNullability, type ExpressionOutput, type ExpressionRequires, type ExpressionSqlType, type ExpressionWithOutput, type ExternalDefaultDescriptor, type ExternalGeneratedColumnDescriptor, type FieldLike, type FieldLikeOptions, type ForeignKeyConstraint, type ForeignKeyMatch, type ForeignKeyOptions, type ForeignKeyTarget, type ForeignKeyTargetInput, type Fragment, type FragmentMeta, type FromClause, type FromScope, type FromSource, type GeneratedColumnDescriptor, type GeneratedColumnMode, type GeneratedDescriptor, type GroupingDependenciesOf, type GroupingKeysOf, type GroupingMeta, type GroupingValidation, type HasAggregate, type HasSubquery, type HasWindow, type HookErrorOutcome, type HookMetadata, type HookMetadataValue, type HookOperation, type HookOperationKind, type HookOutcome, type HookQueryOperation, type HookStreamEnd, type HookSuccessOutcome, type HookTransactionOperation, type IdentityDescriptor, type IdentityDialectExtension, type IdentityGeneration, type IdentityOptionValue, type IdentityOptions, type IndexDialectExtension, type IndexOptions, type IndexTerm, type IndexTermOptions, type InheritedMetadata, type InheritedMetadataOf, type InsertSelectSource, type InsertSource, type InsertValue, type InsertValuesRow, type JsonPath, type JsonScalarKind, type KeyConstraint, type KeyConstraintOptions, type LateralIdentity, type LateralSource, type LiteralDefaultDescriptor, type MetadataOf, type MissingScope, type MutationClause, type MutationKind, type MutationQuery, type MutationQueryConfig, type MutationReturning, type MutationReturningClause, type MutationRow, type MutationScopeValidation, type MutationSqlTypes, type MysqlConstraintExtension, type MysqlIdentityExtension, type MysqlIndexExtension, type NamedCastTarget, type NativeColumnStorage, type NestedTransactionalQueryAdapter, type NullabilityOf, type NullableSourceMeta, type NullableSourcesOf, type Omit, type OmittableSelectClause, type OperationEndHook, type OrderTerm, type OutputOf, type PaginationKind, type PaginationPart, type PortableCastTarget, type PortableCastType, type PortableColumnStorage, type PostgresConstraintExtension, type PostgresIndexExtension, type ProvidedSourceIdentity, type ProvidedSourceRow, type ProvidesOuterOf, type ProvidesOuterSourceMeta, type ProvidesSourceMeta, type QubuClient, type QubuExplainableClient, type QubuExplainableStreamingTransactionalClient, type QubuExplainableTransactionalClient, type QubuHooks, type QubuOptions, type QubuStreamingClient, type QubuStreamingExplainableClient, type QubuStreamingTransaction, type QubuStreamingTransactionalClient, type QubuTransaction, type QubuTransactionalClient, type Query, type QueryAdapter, type QueryAliasIdentity, type QueryCardinality, type QueryConfig, type QueryExecutor, type QueryKind, type QueryRow, type QuerySource, type QuerySqlTypeMap, type QueryTypeValidation, QueryValidationError, type QueryValidationErrorCode, type QueryValidationIssue, type QueryWithRow, type RecursiveCteSource, type ReferentialAction, type RenderContext, type RenderFunction, type RenderOptions, type RenderedQuery, type RenderedSchemaExpression, type RequiredOuterScope, type RequiredScope, type RequiresCapabilityMeta, type RequiresOf, type RequiresOuterMetadataOf, type RequiresOuterOf, type RequiresOuterSourceMeta, type RequiresSourceMeta, type ResolvedColumnBehavior, type ResultDecodeContext, type ResultDecoder, type ResultDecoders, ResultDecodingError, type ResultField, type ResultMeta, type ResultShape, type ReturningClause, type ReturningRow, type ReturningSqlTypes, type Row, type RowLockClause, type RowLockMode, type RowLockOptions, type RowLockWaitPolicy, type Schema, type SchemaDiagnostic, type SchemaDialect, type SchemaDialectExtension, type SchemaDialectHooks, type SchemaDialectName, type SchemaExpression, type SchemaExpressionBrand, type SchemaExpressionErrorCode, type SchemaExpressionInput, type SchemaExpressionMode, type SchemaLiteralRenderer, type SchemaLiteralValue, type SchemaMetadataDiagnostic, type SchemaNamingPolicy, type SchemaObjectIdentity, type SchemaObjectNameOptions, type SchemaOptions, type SchemaRenderContext, type SchemaRenderOptions, type SchemaTableEntry, type SchemaTableNames, type SchemaTableRecord, type SchemaTableRegistry, type ScopeValidation, type SelectCardinality, type SelectClause, type SelectPart, type SelectQuery, type Selection, type SelectionObject, type SelectionOutput, type SelectionSqlTypes, type SetOperator, type SetQuery, type Source, type SourceColumns, type SourceConfig, type SourceConstraint, type SourceConstraints, type SourceConstraintsRecord, type SourceIdentity, type SourceIndex, type SourceIndexesRecord, type SourceKind, type SourceLike, type SourceProvision, type SourceRow, type SourceSqlTypeMap, type SqlBigInt, type SqlBinary, type SqlBoolean, type SqlDate, type SqlDecimal, type SqlEqualityComparable, type SqlEqualityCompatible, type SqlFragment, type SqlInteger, type SqlJson, type SqlNumericLike, type SqlOrderCompatible, type SqlOrderable, type SqlSemanticType, type SqlTag, type SqlText, type SqlTextLike, type SqlTimestamp, type SqlTypeName, type SqlTypeOf, type SqlTypeSatisfies, type SqlUnknown, type SqlUuid, type SqliteConstraintExtension, type SqliteIdentityExtension, type SqliteIndexExtension, type StreamableQuery, type StreamingQueryAdapter, type StreamingTransactionalQueryAdapter, type SubqueryMeta, type Table, type TableColumns, type TableDefinitions, type TableIdentity, type TableIndex, type TableInsertInput, type TableLike, type TableRow, type TableSqlTypes, type TableUpdateInput, type TransactionOptions, type TransactionalQueryAdapter, type TypedSqlTag, type UniqueConstraint, type UniqueConstraintOptions, type UniqueNullSemantics, type UnsafeSchemaSqlExpression, type UpdateAssignmentValue, type UpdateAssignments, type ValuesSource, type VisibleDependenciesOf, type WindowMeta, type WithClause, add, alias, all, allowAll, and, asValue, asc, avg, between, bigint, bigintResultDecoder, binary, boolean, booleanResultDecoder, call, caseWhen, cast, catalogCheck, catalogForeignKey, check, coalesce, column, concat, correlate, count, countDistinct, crossJoin, cte, date, dateResultDecoder, defaultValues, deleteFrom, denseRank, desc, distinct, divide, eq, except, execute, executeRows, exists, explain, externalDefault, externalGeneratedColumn, fetchFirst, fetchNext, foreignKey, from, fullJoin, generatedColumn, groupBy, gt, gte, having, identityColumn, inList, inQuery, index, innerJoin, insertInto, insertSelect, integer, intersect, isDistinctFrom, isNotDistinctFrom, isNotNull, isNull, isTrue, json, jsonArrayFrom, jsonBoolean, jsonExists, jsonNumber, jsonObjectFrom, jsonPath, jsonText, jsonTextResultDecoder, lateral, leftJoin, like, lower, lt, lte, mapResult, max, min, modulo, multiply, nativeColumn, nativeStorage, naturalJoin, ne, not, notExists, notIn, notLike, nullable, nullsFirst, nullsLast, numeric, offset, omit, or, order, orderBy, over, portableStorage, primaryKey, qubu, rank, recursiveCte, references, render, returning, rightJoin, rowLock, rowNumber, scalar, schema, schemaCall, select, sql, stream, subtract, sum, table, text, timestamp, timestampResultDecoder, union, unionAll, unique, uniqueConstraint, unsafeSchemaSql, update, upper, uuid, value, values, where, withCte };
@@ -1,4 +1,4 @@
1
- import { ft as IntrospectionOptions, jt as CatalogConnection, lt as IntrospectionCatalog } from "../types-CiMvKi5V.mjs";
1
+ import { ft as IntrospectionOptions, jt as CatalogConnection, lt as IntrospectionCatalog } from "../types-CdcYI0lU.mjs";
2
2
  //#region src/introspection/mysql.d.ts
3
3
  declare const mysqlServerQuery = "SELECT VERSION() AS version, @@version_comment AS version_comment";
4
4
  declare const mysqlTablesQuery = "\n SELECT TABLE_NAME AS table_name, TABLE_TYPE AS table_type,\n ENGINE AS engine, TABLE_COLLATION AS table_collation,\n CREATE_OPTIONS AS create_options, TABLE_COMMENT AS table_comment\n FROM INFORMATION_SCHEMA.TABLES\n WHERE TABLE_SCHEMA = ?\n ORDER BY TABLE_NAME\n";
@@ -1,4 +1,4 @@
1
- import { ft as IntrospectionOptions, jt as CatalogConnection, lt as IntrospectionCatalog } from "../types-CiMvKi5V.mjs";
1
+ import { ft as IntrospectionOptions, jt as CatalogConnection, lt as IntrospectionCatalog } from "../types-CdcYI0lU.mjs";
2
2
  //#region src/introspection/postgres.d.ts
3
3
  /** Fixed server metadata query used by the PostgreSQL catalog reader. */
4
4
  declare const postgresServerQuery = "\n SELECT\n current_setting('server_version_num') AS server_version_num,\n current_setting('server_version') AS server_version\n";
@@ -1,4 +1,4 @@
1
- import { ft as IntrospectionOptions, jt as CatalogConnection, lt as IntrospectionCatalog } from "../types-CiMvKi5V.mjs";
1
+ import { ft as IntrospectionOptions, jt as CatalogConnection, lt as IntrospectionCatalog } from "../types-CdcYI0lU.mjs";
2
2
  //#region src/introspection/sqlite.d.ts
3
3
  declare const sqliteServerQuery = "SELECT sqlite_version() AS version, sqlite_source_id() AS source_id";
4
4
  declare const sqliteDatabaseListQuery = "\n SELECT seq, name, file\n FROM pragma_database_list()\n ORDER BY seq\n";
@@ -1,5 +1,6 @@
1
- import { $ as CatalogStorageType, A as CatalogNamespace, At as hasIntrospectionErrors, B as CatalogPolicy, C as CatalogForeignKeyTarget, Ct as introspectedPhysicalIdentityPolicy, D as CatalogIndexTerm, Dt as IntrospectionDiagnosticSeverity, E as CatalogIndex, Et as IntrospectionDiagnosticInput, F as CatalogObjectOwnerKind, G as CatalogQueryRow, H as CatalogPrimaryKeyConstraint, I as CatalogObjectReference, J as CatalogRoutineParameter, K as CatalogReference, L as CatalogOpaqueObject, M as CatalogObjectBase, Mt as CatalogQuery, N as CatalogObjectMetadata, Nt as CatalogQueryOptions, O as CatalogIntrospector, Ot as IntrospectionError, P as CatalogObjectOwner, Q as CatalogSqlExpression, R as CatalogOwnership, S as CatalogForeignKeyConstraint, St as CatalogResolvedIdentity, T as CatalogIdentity, Tt as IntrospectionDiagnosticCode, U as CatalogProvenance, V as CatalogPortableStorageType, W as CatalogProvenanceKind, X as CatalogSequence, Y as CatalogScalar, Z as CatalogServerInfo, _ as CatalogEntityReference, _t as CatalogIdentityHint, a as CatalogCollation, at as CatalogValueFact, b as CatalogExpressionFact, bt as CatalogIdentitySource, c as CatalogCompleteObject, ct as CompleteIntrospectionCatalog, d as CatalogDeferredObject, dt as IntrospectionMode, et as CatalogTable, f as CatalogDeferredObjectKind, ft as IntrospectionOptions, g as CatalogEntityKind, gt as CatalogIdentityFallback, h as CatalogDomain, ht as CatalogIdentityEntityKind, i as CatalogClassificationConfidence, it as CatalogUnknownObject, j as CatalogObject, jt as CatalogConnection, k as CatalogLiteralFact, kt as createIntrospectionDiagnostic, l as CatalogConstraint, lt as IntrospectionCatalog, m as CatalogDialectExtension, mt as IntrospectionSuccess, n as CatalogCatalogReference, nt as CatalogUniqueConstraint, o as CatalogColumn, ot as CatalogVersion, p as CatalogDialect, pt as IntrospectionResult, q as CatalogRoutine, r as CatalogCheckConstraint, rt as CatalogUnknownField, s as CatalogComment, st as CatalogView, t as CatalogCapabilities, tt as CatalogTrigger, u as CatalogData, ut as IntrospectionFailure, v as CatalogEnum, vt as CatalogIdentityHints, w as CatalogGeneratedColumn, wt as IntrospectionDiagnostic, x as CatalogExtensionObject, xt as CatalogPreviousSnapshotIdentitySource, y as CatalogEnumValue, yt as CatalogIdentityPolicy, z as CatalogPartition } from "./types-CiMvKi5V.mjs";
2
- import { B as CompleteSchemaSnapshot } from "./types-Dqr4o2I1.mjs";
1
+ import { $ as CatalogStorageType, A as CatalogNamespace, At as hasIntrospectionErrors, B as CatalogPolicy, C as CatalogForeignKeyTarget, Ct as introspectedPhysicalIdentityPolicy, D as CatalogIndexTerm, Dt as IntrospectionDiagnosticSeverity, E as CatalogIndex, Et as IntrospectionDiagnosticInput, F as CatalogObjectOwnerKind, G as CatalogQueryRow, H as CatalogPrimaryKeyConstraint, I as CatalogObjectReference, J as CatalogRoutineParameter, K as CatalogReference, L as CatalogOpaqueObject, M as CatalogObjectBase, Mt as CatalogQuery, N as CatalogObjectMetadata, Nt as CatalogQueryOptions, O as CatalogIntrospector, Ot as IntrospectionError, P as CatalogObjectOwner, Q as CatalogSqlExpression, R as CatalogOwnership, S as CatalogForeignKeyConstraint, St as CatalogResolvedIdentity, T as CatalogIdentity, Tt as IntrospectionDiagnosticCode, U as CatalogProvenance, V as CatalogPortableStorageType, W as CatalogProvenanceKind, X as CatalogSequence, Y as CatalogScalar, Z as CatalogServerInfo, _ as CatalogEntityReference, _t as CatalogIdentityHint, a as CatalogCollation, at as CatalogValueFact, b as CatalogExpressionFact, bt as CatalogIdentitySource, c as CatalogCompleteObject, ct as CompleteIntrospectionCatalog, d as CatalogDeferredObject, dt as IntrospectionMode, et as CatalogTable, f as CatalogDeferredObjectKind, ft as IntrospectionOptions, g as CatalogEntityKind, gt as CatalogIdentityFallback, h as CatalogDomain, ht as CatalogIdentityEntityKind, i as CatalogClassificationConfidence, it as CatalogUnknownObject, j as CatalogObject, jt as CatalogConnection, k as CatalogLiteralFact, kt as createIntrospectionDiagnostic, l as CatalogConstraint, lt as IntrospectionCatalog, m as CatalogDialectExtension, mt as IntrospectionSuccess, n as CatalogCatalogReference, nt as CatalogUniqueConstraint, o as CatalogColumn, ot as CatalogVersion, p as CatalogDialect, pt as IntrospectionResult, q as CatalogRoutine, r as CatalogCheckConstraint, rt as CatalogUnknownField, s as CatalogComment, st as CatalogView, t as CatalogCapabilities, tt as CatalogTrigger, u as CatalogData, ut as IntrospectionFailure, v as CatalogEnum, vt as CatalogIdentityHints, w as CatalogGeneratedColumn, wt as IntrospectionDiagnostic, x as CatalogExtensionObject, xt as CatalogPreviousSnapshotIdentitySource, y as CatalogEnumValue, yt as CatalogIdentityPolicy, z as CatalogPartition } from "./types-CdcYI0lU.mjs";
2
+ import { B as CompleteSchemaSnapshot } from "./types-DcIiNePM.mjs";
3
+ import "./index-DB07P2X8.mjs";
3
4
  //#region src/introspection/catalog.d.ts
4
5
  /**
5
6
  * Materialize every optional object-family collection and deeply freeze the normalized catalog.
@@ -1,3 +1,3 @@
1
- import { a as createCompleteIntrospectionCatalog, i as introspectedPhysicalIdentityPolicy, n as mapCatalogToCompleteSnapshot, o as freezeIntrospectionCatalog, r as mapCatalogToSnapshotV1, s as toIntrospectionCatalog, t as mapCatalogToSnapshot } from "./snapshot-mIb-Zzb5.mjs";
1
+ import { a as createCompleteIntrospectionCatalog, i as introspectedPhysicalIdentityPolicy, n as mapCatalogToCompleteSnapshot, o as freezeIntrospectionCatalog, r as mapCatalogToSnapshotV1, s as toIntrospectionCatalog, t as mapCatalogToSnapshot } from "./snapshot-C1x2R-iK.mjs";
2
2
  import { n as createIntrospectionDiagnostic, r as hasIntrospectionErrors, t as IntrospectionError } from "./diagnostics-I9vVtXkc.mjs";
3
3
  export { IntrospectionError, createCompleteIntrospectionCatalog, createIntrospectionDiagnostic, freezeIntrospectionCatalog, hasIntrospectionErrors, introspectedPhysicalIdentityPolicy, mapCatalogToCompleteSnapshot, mapCatalogToSnapshot, mapCatalogToSnapshotV1, toIntrospectionCatalog };
package/dist/mysql.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Cr as onDuplicateKeyUpdate, Pt as Dialect, Sr as incoming, br as IncomingIdentity, xr as OnDuplicateKeyUpdateClause, yr as IncomingColumns } from "./types-Dqr4o2I1.mjs";
1
+ import { Cr as onDuplicateKeyUpdate, Pt as Dialect, Sr as incoming, br as IncomingIdentity, xr as OnDuplicateKeyUpdateClause, yr as IncomingColumns } from "./types-DcIiNePM.mjs";
2
2
  //#region src/dialects/mysql.d.ts
3
3
  declare function mysqlDialect(): Dialect<"json" | "row-locking" | "on-duplicate-key-update">;
4
4
  //#endregion
@@ -1,10 +1,10 @@
1
- import { Ad as MetadataOf, Dr as UpdateFromClause, Gu as ExpressionWithOutput, Ku as SchemaExpression, Ms as OperandNullability, Ns as OperandSqlType, Or as UpdateFromScope, Ps as SqlCapabilityValidation, Pt as Dialect, Vd as RequiresCapabilityMeta, _f as SqlTextLike, _r as excluded, af as SqlBoolean, dr as DoNothingAction, fr as DoUpdateAction, gr as doUpdate, hr as doNothing, js as Operand, kr as updateFrom, lr as ConflictAction, mr as OnConflictClause, ms as ComparisonValidation, nf as AnySqlType, pr as ExcludedSource, qd as ResultMeta, ur as ConflictTarget, vr as onConflict, xf as SqlUnknown, yd as ExpressionMeta } from "./types-Dqr4o2I1.mjs";
1
+ import { Ad as MetadataOf, Dr as UpdateFromClause, Gu as ExpressionWithOutput, Ku as SchemaExpression, Ms as OperandNullability, Ns as OperandSqlType, Or as UpdateFromScope, Ps as SqlCapabilityValidation, Pt as Dialect, Vd as RequiresCapabilityMeta, _f as SqlTextLike, _r as excluded, af as SqlBoolean, dr as DoNothingAction, fr as DoUpdateAction, gr as doUpdate, hr as doNothing, js as Operand, kr as updateFrom, lr as ConflictAction, mr as OnConflictClause, ms as ComparisonValidation, nf as AnySqlType, pr as ExcludedSource, qd as ResultMeta, ur as ConflictTarget, vr as onConflict, xf as SqlUnknown, yd as ExpressionMeta } from "./types-DcIiNePM.mjs";
2
2
  //#region src/dialects/postgres.d.ts
3
3
  /**
4
4
  * PostgreSQL's only core rendering difference is positional parameters. PostgreSQL-specific
5
5
  * expressions and clauses should remain separate modules.
6
6
  */
7
- declare function postgresDialect(): Dialect<"json" | "ilike" | "on-conflict" | "row-locking" | "update-from">;
7
+ declare function postgresDialect(): Dialect<"on-conflict" | "json" | "ilike" | "row-locking" | "update-from">;
8
8
  /** PostgreSQL's case-insensitive pattern-match operator. */
9
9
  declare function ilike<TLeft extends ExpressionWithOutput<string>, R extends Operand<string>>(left: TLeft & ComparisonValidation<TLeft, R, "ILIKE">, pattern: R): SchemaExpression<ResultMeta<boolean, ((MetadataOf<TLeft & SqlCapabilityValidation<(MetadataOf<TLeft> extends (infer T) ? T extends MetadataOf<TLeft> ? T extends {
10
10
  readonly kind: "result";
package/dist/schema.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $a as IndexDialectExtension, $c as GeneratedColumnDescriptor, $i as SchemaTableEntry, $s as ColumnOnUpdateOf, Aa as SourceLike, Ac as columnSqlType, Al as materializeSchemaObjectRecord, An as sourceIdentity, Ba as primaryKey, Bc as text, Bi as SchemaRenderOptions, Bn as TableSqlTypes, Ca as KeyConstraint, Cc as StorageOf, Cl as SchemaObjectNameOptions, Cn as SourceRow, Da as ReferentialAction, Dc as boolean, Dl as generatedSchemaObjectName, Dn as createSource, Ea as PostgresConstraintExtension, Ec as binary, El as freezeSchemaMetadata, En as UnknownSourceSqlTypes, Fa as UniqueNullSemantics, Fc as nativeColumn, Fi as SchemaExpressionError, Fn as TableIdentity, Ga as AliasIdentity, Gc as ColumnBehaviorErrorCode, Gi as renderSchemaExpression, Gs as ColumnFromOptions, Ha as unique, Hc as uuid, Hi as defineSchemaExpression, Hn as table, Hs as ColumnDefaultOf, Ia as catalogCheck, Ic as nativeStorage, Ii as SchemaExpressionErrorCode, In as TableInsertInput, Ja as LateralSource, Jc as DefaultDescriptor, Ji as unsafeSchemaSql, Js as ColumnHasRuntimeDefault, Ka as AliasedSource, Kc as ColumnDefault, Ki as renderSchemaSql, Ks as ColumnGeneratedOf, La as catalogForeignKey, Lc as nullable, Li as SchemaExpressionInput, Ln as TableMetadataCallback, Ma as TableLike, Mc as encodeColumnParameter, Mi as SchemaDialectHooks, Mn as Table, Na as UniqueConstraint, Nc as integer, Ni as createSchemaDialect, Nn as TableColumns, Oa as SourceConstraint, Oc as column, Ol as isValidSchemaObjectName, On as customSource, Pa as UniqueConstraintOptions, Pc as json, Pi as RenderedSchemaExpression, Pn as TableDefinitions, Qa as lateral, Qc as ExternalGeneratedColumnDescriptor, Qi as SchemaOptions, Qs as ColumnIsNullable, Ra as check, Rc as numeric, Ri as SchemaExpressionMode, Rn as TableOptions, Sa as ForeignKeyTargetInput, Sc as StorageDialectOf, Sl as SchemaObjectIdentity, Sn as SourceProvision, Ta as MysqlConstraintExtension, Tc as bigint, Tl as dialectMismatchDiagnostic, Tn as SourceSqlTypes, Ua as uniqueConstraint, Uc as CanonicalLiteral, Ui as isUnsafeSchemaSql, Us as ColumnDefinition, Va as references, Vc as timestamp, Vi as UnsafeSchemaSqlExpression, Vn as TableUpdateInput, Vs as ColumnCodec, Wa as validateConstraintDialect, Wc as ColumnBehaviorError, Wi as normalizeSchemaSql, Ws as ColumnDefinitionConfig, Xa as QuerySource, Xc as ExpressionGeneratedColumnDescriptor, Xi as SchemaDiagnostic, Xs as ColumnInsertInput, Ya as QueryAliasIdentity, Yc as ExpressionDefaultDescriptor, Yi as Schema, Ys as ColumnIdentityOf, Za as alias, Zc as ExternalDefaultDescriptor, Zi as SchemaNamingPolicy, Zs as ColumnIsGenerated, _a as FieldLikeOptions, _c as PortableStorage, _l as resolveColumnBehavior, _n as SourceColumns, aa as generatedTableName, ac as ColumnStorageDescriptor, al as IdentityOptionValue, ao as SourceIndex, ba as ForeignKeyOptions, bc as StorageDeclarationOf, bl as SchemaMetadataDiagnostic, bn as SourceIdentity, ca as AnyKeyColumn, cc as ColumnStorageOf, cl as MysqlIdentityExtension, co as TableIndex, da as CheckConstraint, dc as ColumnUpdateInput, dl as SqliteIdentityExtension, dn as AnySource, do as DeclaredColumnNullability, ea as SchemaTableNames, ec as ColumnOptions, el as GeneratedColumnMode, eo as IndexOptions, fa as CheckConstraintOptions, fc as DialectNativeStorage, fl as canonicalLiteral, fn as CustomSource, ga as FieldLike, gc as PortableColumnStorage, gl as identityColumn, gn as Source, ha as ConstraintTiming, hc as NativeStorageDescriptor, hl as generatedColumn, hn as ProvidedSourceRow, ia as defaultSchemaNamingPolicy, ic as ColumnStorageDeclarationOf, il as IdentityGeneration, io as PostgresIndexExtension, ja as SqliteConstraintExtension, jc as date, ji as SchemaDialect, jn as AnyTable, ka as SourceConstraintsRecord, kc as columnResultValue, kl as materializeSchemaObjectIdentity, kn as exposeColumns, la as CatalogCheckExpression, lc as ColumnStorageType, ll as ResolvedColumnBehavior, lo as index, ma as ConstraintOptions, mc as NativeStorage, ml as externalGeneratedColumn, mn as ProvidedSourceIdentity, na as SchemaTableRegistry, nc as ColumnSqlType, nl as IdentityDescriptor, no as IndexTermOptions, oa as schema, oc as ColumnStorageDialectOf, ol as IdentityOptions, oo as SourceIndexesRecord, pa as ConstraintDialectExtension, pc as NativeColumnStorage, pl as externalDefault, pn as CustomSourceOptions, qa as LateralIdentity, qc as ColumnDefaultInput, qi as schemaExpression, qs as ColumnHasDefault, ra as SchemaValidationError, rc as ColumnStorage, rl as IdentityDialectExtension, ro as MysqlIndexExtension, sa as schemaNamingPolicyVersion, sc as ColumnStorageKindOf, sl as LiteralDefaultDescriptor, so as SqliteIndexExtension, ta as SchemaTableRecord, tc as ColumnOutput, tl as GeneratedDescriptor, to as IndexTerm, ua as CatalogCheckSql, uc as ColumnStorageTypeOf, ul as SchemaLiteralValue, uo as validateIndexDialect, va as ForeignKeyConstraint, vc as PortableStorageDescriptor, vl as SchemaDialectExtension, vn as SourceConfig, wa as KeyConstraintOptions, wc as StorageTypeOf, wl as assertSchemaDialectSupport, wn as SourceSqlTypeMap, xa as ForeignKeyTarget, xc as StorageDescriptor, xl as SchemaMetadataValidationError, xn as SourceKind, ya as ForeignKeyMatch, yc as PortableStorageType, yl as SchemaDialectName, yn as SourceConstraints, za as foreignKey, zc as portableStorage, zi as SchemaRenderContext, zn as TableRow } from "./types-Dqr4o2I1.mjs";
1
+ import { $a as IndexDialectExtension, $c as GeneratedColumnDescriptor, $i as SchemaTableEntry, $s as ColumnOnUpdateOf, Aa as SourceLike, Ac as columnSqlType, Al as materializeSchemaObjectRecord, An as sourceIdentity, Ba as primaryKey, Bc as text, Bi as SchemaRenderOptions, Bn as TableSqlTypes, Ca as KeyConstraint, Cc as StorageOf, Cl as SchemaObjectNameOptions, Cn as SourceRow, Da as ReferentialAction, Dc as boolean, Dl as generatedSchemaObjectName, Dn as createSource, Ea as PostgresConstraintExtension, Ec as binary, El as freezeSchemaMetadata, En as UnknownSourceSqlTypes, Fa as UniqueNullSemantics, Fc as nativeColumn, Fi as SchemaExpressionError, Fn as TableIdentity, Ga as AliasIdentity, Gc as ColumnBehaviorErrorCode, Gi as renderSchemaExpression, Gs as ColumnFromOptions, Ha as unique, Hc as uuid, Hi as defineSchemaExpression, Hn as table, Hs as ColumnDefaultOf, Ia as catalogCheck, Ic as nativeStorage, Ii as SchemaExpressionErrorCode, In as TableInsertInput, Ja as LateralSource, Jc as DefaultDescriptor, Ji as unsafeSchemaSql, Js as ColumnHasRuntimeDefault, Ka as AliasedSource, Kc as ColumnDefault, Ki as renderSchemaSql, Ks as ColumnGeneratedOf, La as catalogForeignKey, Lc as nullable, Li as SchemaExpressionInput, Ln as TableMetadataCallback, Ma as TableLike, Mc as encodeColumnParameter, Mi as SchemaDialectHooks, Mn as Table, Na as UniqueConstraint, Nc as integer, Ni as createSchemaDialect, Nn as TableColumns, Oa as SourceConstraint, Oc as column, Ol as isValidSchemaObjectName, On as customSource, Pa as UniqueConstraintOptions, Pc as json, Pi as RenderedSchemaExpression, Pn as TableDefinitions, Qa as lateral, Qc as ExternalGeneratedColumnDescriptor, Qi as SchemaOptions, Qs as ColumnIsNullable, Ra as check, Rc as numeric, Ri as SchemaExpressionMode, Rn as TableOptions, Sa as ForeignKeyTargetInput, Sc as StorageDialectOf, Sl as SchemaObjectIdentity, Sn as SourceProvision, Ta as MysqlConstraintExtension, Tc as bigint, Tl as dialectMismatchDiagnostic, Tn as SourceSqlTypes, Ua as uniqueConstraint, Uc as CanonicalLiteral, Ui as isUnsafeSchemaSql, Us as ColumnDefinition, Va as references, Vc as timestamp, Vi as UnsafeSchemaSqlExpression, Vn as TableUpdateInput, Vs as ColumnCodec, Wa as validateConstraintDialect, Wc as ColumnBehaviorError, Wi as normalizeSchemaSql, Ws as ColumnDefinitionConfig, Xa as QuerySource, Xc as ExpressionGeneratedColumnDescriptor, Xi as SchemaDiagnostic, Xs as ColumnInsertInput, Ya as QueryAliasIdentity, Yc as ExpressionDefaultDescriptor, Yi as Schema, Ys as ColumnIdentityOf, Za as alias, Zc as ExternalDefaultDescriptor, Zi as SchemaNamingPolicy, Zs as ColumnIsGenerated, _a as FieldLikeOptions, _c as PortableStorage, _l as resolveColumnBehavior, _n as SourceColumns, aa as generatedTableName, ac as ColumnStorageDescriptor, al as IdentityOptionValue, ao as SourceIndex, ba as ForeignKeyOptions, bc as StorageDeclarationOf, bl as SchemaMetadataDiagnostic, bn as SourceIdentity, ca as AnyKeyColumn, cc as ColumnStorageOf, cl as MysqlIdentityExtension, co as TableIndex, da as CheckConstraint, dc as ColumnUpdateInput, dl as SqliteIdentityExtension, dn as AnySource, do as DeclaredColumnNullability, ea as SchemaTableNames, ec as ColumnOptions, el as GeneratedColumnMode, eo as IndexOptions, fa as CheckConstraintOptions, fc as DialectNativeStorage, fl as canonicalLiteral, fn as CustomSource, ga as FieldLike, gc as PortableColumnStorage, gl as identityColumn, gn as Source, ha as ConstraintTiming, hc as NativeStorageDescriptor, hl as generatedColumn, hn as ProvidedSourceRow, ia as defaultSchemaNamingPolicy, ic as ColumnStorageDeclarationOf, il as IdentityGeneration, io as PostgresIndexExtension, ja as SqliteConstraintExtension, jc as date, ji as SchemaDialect, jn as AnyTable, ka as SourceConstraintsRecord, kc as columnResultValue, kl as materializeSchemaObjectIdentity, kn as exposeColumns, la as CatalogCheckExpression, lc as ColumnStorageType, ll as ResolvedColumnBehavior, lo as index, ma as ConstraintOptions, mc as NativeStorage, ml as externalGeneratedColumn, mn as ProvidedSourceIdentity, na as SchemaTableRegistry, nc as ColumnSqlType, nl as IdentityDescriptor, no as IndexTermOptions, oa as schema, oc as ColumnStorageDialectOf, ol as IdentityOptions, oo as SourceIndexesRecord, pa as ConstraintDialectExtension, pc as NativeColumnStorage, pl as externalDefault, pn as CustomSourceOptions, qa as LateralIdentity, qc as ColumnDefaultInput, qi as schemaExpression, qs as ColumnHasDefault, ra as SchemaValidationError, rc as ColumnStorage, rl as IdentityDialectExtension, ro as MysqlIndexExtension, sa as schemaNamingPolicyVersion, sc as ColumnStorageKindOf, sl as LiteralDefaultDescriptor, so as SqliteIndexExtension, ta as SchemaTableRecord, tc as ColumnOutput, tl as GeneratedDescriptor, to as IndexTerm, ua as CatalogCheckSql, uc as ColumnStorageTypeOf, ul as SchemaLiteralValue, uo as validateIndexDialect, va as ForeignKeyConstraint, vc as PortableStorageDescriptor, vl as SchemaDialectExtension, vn as SourceConfig, wa as KeyConstraintOptions, wc as StorageTypeOf, wl as assertSchemaDialectSupport, wn as SourceSqlTypeMap, xa as ForeignKeyTarget, xc as StorageDescriptor, xl as SchemaMetadataValidationError, xn as SourceKind, ya as ForeignKeyMatch, yc as PortableStorageType, yl as SchemaDialectName, yn as SourceConstraints, za as foreignKey, zc as portableStorage, zi as SchemaRenderContext, zn as TableRow } from "./types-DcIiNePM.mjs";
2
2
  export { AliasIdentity, AliasedSource, AnyKeyColumn, AnySource, AnyTable, CanonicalLiteral, CatalogCheckExpression, CatalogCheckSql, CheckConstraint, CheckConstraintOptions, ColumnBehaviorError, ColumnBehaviorErrorCode, ColumnCodec, ColumnDefault, ColumnDefaultInput, ColumnDefaultOf, ColumnDefinition, ColumnDefinitionConfig, ColumnFromOptions, ColumnGeneratedOf, ColumnHasDefault, ColumnHasRuntimeDefault, ColumnIdentityOf, ColumnInsertInput, ColumnIsGenerated, ColumnIsNullable, ColumnOnUpdateOf, ColumnOptions, ColumnOutput, ColumnSqlType, ColumnStorage, ColumnStorageDeclarationOf, ColumnStorageDescriptor, ColumnStorageDialectOf, ColumnStorageKindOf, ColumnStorageOf, ColumnStorageType, ColumnStorageTypeOf, ColumnUpdateInput, ConstraintDialectExtension, ConstraintOptions, ConstraintTiming, CustomSource, CustomSourceOptions, type DeclaredColumnNullability, DefaultDescriptor, DialectNativeStorage, ExpressionDefaultDescriptor, ExpressionGeneratedColumnDescriptor, ExternalDefaultDescriptor, ExternalGeneratedColumnDescriptor, FieldLike, FieldLikeOptions, ForeignKeyConstraint, ForeignKeyMatch, ForeignKeyOptions, ForeignKeyTarget, ForeignKeyTargetInput, GeneratedColumnDescriptor, GeneratedColumnMode, GeneratedDescriptor, IdentityDescriptor, IdentityDialectExtension, IdentityGeneration, IdentityOptionValue, IdentityOptions, IndexDialectExtension, IndexOptions, IndexTerm, IndexTermOptions, KeyConstraint, KeyConstraintOptions, LateralIdentity, LateralSource, LiteralDefaultDescriptor, MysqlConstraintExtension, MysqlIdentityExtension, MysqlIndexExtension, NativeColumnStorage, NativeStorage, NativeStorageDescriptor, PortableColumnStorage, PortableStorage, PortableStorageDescriptor, PortableStorageType, PostgresConstraintExtension, PostgresIndexExtension, ProvidedSourceIdentity, ProvidedSourceRow, QueryAliasIdentity, QuerySource, ReferentialAction, RenderedSchemaExpression, ResolvedColumnBehavior, Schema, SchemaDiagnostic, SchemaDialect, SchemaDialectExtension, SchemaDialectHooks, SchemaDialectName, SchemaExpressionError, SchemaExpressionErrorCode, SchemaExpressionInput, SchemaExpressionMode, SchemaLiteralValue, SchemaMetadataDiagnostic, SchemaMetadataValidationError, SchemaNamingPolicy, SchemaObjectIdentity, SchemaObjectNameOptions, SchemaOptions, SchemaRenderContext, SchemaRenderOptions, SchemaTableEntry, SchemaTableNames, SchemaTableRecord, SchemaTableRegistry, SchemaValidationError, Source, SourceColumns, SourceConfig, SourceConstraint, SourceConstraints, SourceConstraintsRecord, SourceIdentity, SourceIndex, SourceIndexesRecord, SourceKind, SourceLike, SourceProvision, SourceRow, SourceSqlTypeMap, SourceSqlTypes, SqliteConstraintExtension, SqliteIdentityExtension, SqliteIndexExtension, StorageDeclarationOf, StorageDescriptor, StorageDialectOf, StorageOf, StorageTypeOf, Table, TableColumns, TableDefinitions, TableIdentity, TableIndex, TableInsertInput, TableLike, TableMetadataCallback, TableOptions, TableRow, TableSqlTypes, TableUpdateInput, UniqueConstraint, UniqueConstraintOptions, UniqueNullSemantics, UnknownSourceSqlTypes, UnsafeSchemaSqlExpression, alias, assertSchemaDialectSupport, bigint, binary, boolean, canonicalLiteral, catalogCheck, catalogForeignKey, check, column, columnResultValue, columnSqlType, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, encodeColumnParameter, exposeColumns, externalDefault, externalGeneratedColumn, foreignKey, freezeSchemaMetadata, generatedColumn, generatedSchemaObjectName, generatedTableName, identityColumn, index, integer, isUnsafeSchemaSql, isValidSchemaObjectName, json, lateral, materializeSchemaObjectIdentity, materializeSchemaObjectRecord, nativeColumn, nativeStorage, normalizeSchemaSql, nullable, numeric, portableStorage, primaryKey, references, renderSchemaExpression, renderSchemaSql, resolveColumnBehavior, schema, schemaExpression, schemaNamingPolicyVersion, sourceIdentity, table, text, timestamp, unique, uniqueConstraint, unsafeSchemaSql, uuid, validateConstraintDialect, validateIndexDialect };
@@ -1,4 +1,4 @@
1
- import { B as CompleteSchemaSnapshot, T as SnapshotJsonValue, V as CompleteSchemaSnapshotInput, Y as CompleteSnapshotDecodeResult, Yi as Schema, f as SnapshotDiagnostic, i as SchemaSnapshotInput, ji as SchemaDialect, l as SnapshotCreateResult, n as SchemaSnapshot, r as SchemaSnapshotAdapter, u as SnapshotDecodeResult } from "./types-Dqr4o2I1.mjs";
1
+ import { B as CompleteSchemaSnapshot, T as SnapshotJsonValue, V as CompleteSchemaSnapshotInput, Y as CompleteSnapshotDecodeResult, Yi as Schema, f as SnapshotDiagnostic, i as SchemaSnapshotInput, ji as SchemaDialect, l as SnapshotCreateResult, n as SchemaSnapshot, r as SchemaSnapshotAdapter, u as SnapshotDecodeResult } from "./types-DcIiNePM.mjs";
2
2
  //#region src/snapshot/canonical.d.ts
3
3
  /** Error raised when a value cannot cross the canonical JSON boundary. */
4
4
  declare class SnapshotCanonicalError extends TypeError {
@@ -1,5 +1,5 @@
1
- import { Yi as Schema, ji as SchemaDialect, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-Dqr4o2I1.mjs";
2
- import { t as SchemaSnapshotOptions } from "../serialize-Du2UPZMt.mjs";
1
+ import { Yi as Schema, ji as SchemaDialect, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-DcIiNePM.mjs";
2
+ import { t as SchemaSnapshotOptions } from "../serialize-Dg-Q55YQ.mjs";
3
3
  //#region src/snapshot/mysql.d.ts
4
4
  /** MySQL's snapshot dialect-extension identity. */
5
5
  declare const mysqlSnapshotDialect: SnapshotDialect;
@@ -1,5 +1,5 @@
1
- import { Yi as Schema, ji as SchemaDialect, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-Dqr4o2I1.mjs";
2
- import { t as SchemaSnapshotOptions } from "../serialize-Du2UPZMt.mjs";
1
+ import { Yi as Schema, ji as SchemaDialect, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-DcIiNePM.mjs";
2
+ import { t as SchemaSnapshotOptions } from "../serialize-Dg-Q55YQ.mjs";
3
3
  //#region src/snapshot/postgres.d.ts
4
4
  /** PostgreSQL's snapshot dialect-extension identity. */
5
5
  declare const postgresSnapshotDialect: SnapshotDialect;
@@ -1,5 +1,5 @@
1
- import { Yi as Schema, ji as SchemaDialect, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-Dqr4o2I1.mjs";
2
- import { t as SchemaSnapshotOptions } from "../serialize-Du2UPZMt.mjs";
1
+ import { Yi as Schema, ji as SchemaDialect, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-DcIiNePM.mjs";
2
+ import { t as SchemaSnapshotOptions } from "../serialize-Dg-Q55YQ.mjs";
3
3
  //#region src/snapshot/sqlite.d.ts
4
4
  /** SQLite's snapshot dialect-extension identity. */
5
5
  declare const sqliteSnapshotDialect: SnapshotDialect;
@@ -384,7 +384,7 @@ function selectPreviousSnapshot(input, previous, selectedNamespace, diagnostics)
384
384
  function collectIdentityEntries(input) {
385
385
  const entries = [];
386
386
  const seen = /* @__PURE__ */ new Set();
387
- const add = (object, kind, currentId, physicalName, scopePhysicalName, scopeId, physicalIdentityName = physicalName) => {
387
+ const add = (object, kind, currentId, physicalName, scopePhysicalName, scopeId, physicalIdentityName = physicalName, metadataTarget) => {
388
388
  if (seen.has(object)) return;
389
389
  seen.add(object);
390
390
  entries.push({
@@ -393,6 +393,7 @@ function collectIdentityEntries(input) {
393
393
  currentId,
394
394
  physicalName,
395
395
  physicalIdentityName,
396
+ ...metadataTarget === void 0 ? {} : { metadataTarget },
396
397
  ...scopePhysicalName === void 0 ? {} : { scopePhysicalName },
397
398
  ...scopeId === void 0 ? {} : { scopeId }
398
399
  });
@@ -454,15 +455,30 @@ function collectIdentityEntries(input) {
454
455
  add(object, kind, object.id, object.physicalName);
455
456
  }
456
457
  function addMetadataObject(object, kind) {
457
- add(object, kind, object.id, object.reference?.name ?? object.id, void 0, void 0, object.id);
458
+ add(object, kind, object.id, object.reference?.name ?? object.id, void 0, void 0, object.id, metadataIdentityTarget(object.object, input));
458
459
  }
459
460
  }
461
+ function metadataIdentityTarget(reference, source) {
462
+ const owner = reference.owner;
463
+ const objects = [
464
+ ...source.tables,
465
+ ...source.views ?? [],
466
+ ...source.domains ?? []
467
+ ];
468
+ const physicalOwner = owner && objects.find((item) => item.kind === owner.kind && item.id === owner.id)?.physicalName;
469
+ return JSON.stringify([
470
+ reference.kind,
471
+ owner?.kind,
472
+ physicalOwner
473
+ ]);
474
+ }
460
475
  function collectPreviousIdentities(snapshot) {
461
476
  const result = [];
462
- const add = (kind, id, physicalName, scopePhysicalName) => result.push({
477
+ const add = (kind, id, physicalName, scopePhysicalName, metadataTarget) => result.push({
463
478
  kind,
464
479
  id,
465
480
  physicalName,
481
+ ...metadataTarget === void 0 ? {} : { metadataTarget },
466
482
  ...scopePhysicalName === void 0 ? {} : { scopePhysicalName }
467
483
  });
468
484
  for (const table of snapshot.tables) {
@@ -488,8 +504,8 @@ function collectPreviousIdentities(snapshot) {
488
504
  for (const item of snapshot.policies) add("policy", item.id, item.physicalName);
489
505
  for (const item of snapshot.extensions) add("extension", item.id, item.physicalName);
490
506
  for (const item of snapshot.opaqueObjects) add("opaque-object", item.id, item.physicalName);
491
- for (const item of snapshot.comments) add("comment", item.id, item.physicalName);
492
- for (const item of snapshot.ownership) add("ownership", item.id, item.physicalName);
507
+ for (const item of snapshot.comments) add("comment", item.id, item.physicalName, void 0, metadataIdentityTarget(item.object, snapshot));
508
+ for (const item of snapshot.ownership) add("ownership", item.id, item.physicalName, void 0, metadataIdentityTarget(item.object, snapshot));
493
509
  return result;
494
510
  }
495
511
  function createIdentityResolver(entries, hints, previous, policy, diagnostics) {
@@ -498,7 +514,7 @@ function createIdentityResolver(entries, hints, previous, policy, diagnostics) {
498
514
  const byScope = /* @__PURE__ */ new Map();
499
515
  const previousBySelector = /* @__PURE__ */ new Map();
500
516
  for (const item of previous ?? []) {
501
- const key = identitySelectorKey(item.kind, item.physicalName, item.scopePhysicalName);
517
+ const key = identitySelectorKey(item.kind, item.physicalName, item.scopePhysicalName, item.metadataTarget);
502
518
  const existing = previousBySelector.get(key);
503
519
  previousBySelector.set(key, existing === void 0 ? item : null);
504
520
  }
@@ -550,7 +566,7 @@ function resolveIdentityEntry(entry, hints, previous, policy, diagnostics) {
550
566
  source
551
567
  };
552
568
  } else if (source === "previous-snapshot") {
553
- const match = previous.get(identitySelectorKey(entry.kind, entry.physicalName, entry.scopePhysicalName));
569
+ const match = previous.get(identitySelectorKey(entry.kind, entry.physicalName, entry.scopePhysicalName, entry.metadataTarget));
554
570
  if (match !== void 0 && match !== null) return {
555
571
  logicalId: match.id,
556
572
  source
@@ -579,8 +595,8 @@ function resolveIdentityEntry(entry, hints, previous, policy, diagnostics) {
579
595
  source: "deterministic-fallback"
580
596
  };
581
597
  }
582
- function identitySelectorKey(kind, physicalName, scopePhysicalName) {
583
- return `${kind}\u0000${scopePhysicalName ?? ""}\u0000${physicalName}`;
598
+ function identitySelectorKey(kind, physicalName, scopePhysicalName, metadataTarget) {
599
+ return `${metadataTarget ?? ""}\u0000${kind}\u0000${scopePhysicalName ?? ""}\u0000${physicalName}`;
584
600
  }
585
601
  function normalizeIdentityKind(kind) {
586
602
  if (kind === "primary-key" || kind === "unique" || kind === "foreign-key" || kind === "check") return "constraint";
@@ -1,4 +1,4 @@
1
- import { $ as CompleteSnapshotExtension, A as SnapshotStorage, At as schemaSnapshotCompleteVersion, B as CompleteSchemaSnapshot, C as SnapshotIndexTerm, Ct as CompleteSnapshotValueFact, D as SnapshotLiteral, Dt as SchemaSnapshotV1Input, E as SnapshotKeyConstraint, Et as SchemaSnapshotV1DecodeResult, F as neutralSnapshotDialect, G as CompleteSnapshotColumn, H as CompleteSnapshotCapabilities, I as schemaSnapshotDialectVersion, J as CompleteSnapshotCreateResult, K as CompleteSnapshotComment, L as schemaSnapshotFormat, M as SnapshotTable, Mi as SchemaDialectHooks, Mt as schemaSnapshotVersion1, N as SnapshotUniqueConstraint, Ni as createSchemaDialect, O as SnapshotNamingPolicy, Ot as completeSchemaSnapshotFormat, P as SnapshotValidationContext, Q as CompleteSnapshotEnum, R as schemaSnapshotNamingPolicyVersion, S as SnapshotIndex, St as CompleteSnapshotTrigger, T as SnapshotJsonValue, Tt as SchemaSnapshotV1, U as CompleteSnapshotCheckConstraint, V as CompleteSchemaSnapshotInput, W as CompleteSnapshotCollation, X as CompleteSnapshotDeferredObject, Y as CompleteSnapshotDecodeResult, Z as CompleteSnapshotDomain, _ as SnapshotExpressionContext, _t as CompleteSnapshotProvenance, a as SnapshotBigInt, at as CompleteSnapshotNamespace, b as SnapshotGeneratedColumn, bt as CompleteSnapshotSequence, c as SnapshotConstraint, ct as CompleteSnapshotObjectMetadata, d as SnapshotDefault, dt as CompleteSnapshotObjectReference, et as CompleteSnapshotForeignKey, f as SnapshotDiagnostic, ft as CompleteSnapshotOpaqueObject, g as SnapshotExpression, gc as PortableColumnStorage, gt as CompleteSnapshotPolicy, h as SnapshotDialectExtension, ht as CompleteSnapshotPhysicalReference, i as SchemaSnapshotInput, it as CompleteSnapshotKeyConstraint, j as SnapshotStorageContext, ji as SchemaDialect, jt as schemaSnapshotV1Version, k as SnapshotSpecialNumber, kt as completeSchemaSnapshotVersion, l as SnapshotCreateResult, lt as CompleteSnapshotObjectOwner, m as SnapshotDialect, mt as CompleteSnapshotPartition, n as SchemaSnapshot, nt as CompleteSnapshotIndex, o as SnapshotCheckConstraint, ot as CompleteSnapshotObject, p as SnapshotDiagnosticCode, pc as NativeColumnStorage, pt as CompleteSnapshotOwnership, q as CompleteSnapshotConstraint, r as SchemaSnapshotAdapter, rt as CompleteSnapshotIndexTerm, s as SnapshotColumn, st as CompleteSnapshotObjectKind, t as AnySchema, tt as CompleteSnapshotIdentity, u as SnapshotDecodeResult, ut as CompleteSnapshotObjectOwnerKind, v as SnapshotExtensionContext, vt as CompleteSnapshotRoutine, w as SnapshotIndexTermExpression, wt as CompleteSnapshotView, x as SnapshotIdentity, xt as CompleteSnapshotTable, y as SnapshotForeignKey, yt as CompleteSnapshotRoutineParameter, z as schemaSnapshotVersion } from "./types-Dqr4o2I1.mjs";
2
- import { A as encodeCanonicalSnapshot, C as encodeCompleteSchemaSnapshot, D as schemaSnapshotV1Fingerprint, E as fingerprintCompleteSchemaSnapshot, M as toSnapshotJsonValue, O as SnapshotCanonicalError, S as decodeSchemaSnapshotV1, T as encodeSchemaSnapshotV1, _ as canonicalizeCompleteSchemaSnapshot, a as encodeSnapshot, b as decodeCompleteSchemaSnapshot, c as tryCreateSchemaSnapshot, d as canonicalizeSchemaSnapshot, f as decodeSchemaSnapshot, g as assertSchemaSnapshotV1, h as assertCompleteSnapshot, i as encodeSchemaSnapshot, j as schemaSnapshotFingerprint, k as canonicalJson, l as SnapshotValidationError, m as assertCompleteSchemaSnapshot, n as SnapshotSerializationError, o as fingerprintSchemaSnapshot, p as CompleteSnapshotValidationError, r as createSchemaSnapshot, s as serializeSchema, t as SchemaSnapshotOptions, u as assertSchemaSnapshot, v as canonicalizeSchemaSnapshotV1, w as encodeCompleteSnapshot, x as decodeCompleteSnapshot, y as completeSchemaSnapshotFingerprint } from "./serialize-Du2UPZMt.mjs";
3
- import "./index-CaxrMD1A.mjs";
1
+ import { $ as CompleteSnapshotExtension, A as SnapshotStorage, At as schemaSnapshotCompleteVersion, B as CompleteSchemaSnapshot, C as SnapshotIndexTerm, Ct as CompleteSnapshotValueFact, D as SnapshotLiteral, Dt as SchemaSnapshotV1Input, E as SnapshotKeyConstraint, Et as SchemaSnapshotV1DecodeResult, F as neutralSnapshotDialect, G as CompleteSnapshotColumn, H as CompleteSnapshotCapabilities, I as schemaSnapshotDialectVersion, J as CompleteSnapshotCreateResult, K as CompleteSnapshotComment, L as schemaSnapshotFormat, M as SnapshotTable, Mi as SchemaDialectHooks, Mt as schemaSnapshotVersion1, N as SnapshotUniqueConstraint, Ni as createSchemaDialect, O as SnapshotNamingPolicy, Ot as completeSchemaSnapshotFormat, P as SnapshotValidationContext, Q as CompleteSnapshotEnum, R as schemaSnapshotNamingPolicyVersion, S as SnapshotIndex, St as CompleteSnapshotTrigger, T as SnapshotJsonValue, Tt as SchemaSnapshotV1, U as CompleteSnapshotCheckConstraint, V as CompleteSchemaSnapshotInput, W as CompleteSnapshotCollation, X as CompleteSnapshotDeferredObject, Y as CompleteSnapshotDecodeResult, Z as CompleteSnapshotDomain, _ as SnapshotExpressionContext, _t as CompleteSnapshotProvenance, a as SnapshotBigInt, at as CompleteSnapshotNamespace, b as SnapshotGeneratedColumn, bt as CompleteSnapshotSequence, c as SnapshotConstraint, ct as CompleteSnapshotObjectMetadata, d as SnapshotDefault, dt as CompleteSnapshotObjectReference, et as CompleteSnapshotForeignKey, f as SnapshotDiagnostic, ft as CompleteSnapshotOpaqueObject, g as SnapshotExpression, gc as PortableColumnStorage, gt as CompleteSnapshotPolicy, h as SnapshotDialectExtension, ht as CompleteSnapshotPhysicalReference, i as SchemaSnapshotInput, it as CompleteSnapshotKeyConstraint, j as SnapshotStorageContext, ji as SchemaDialect, jt as schemaSnapshotV1Version, k as SnapshotSpecialNumber, kt as completeSchemaSnapshotVersion, l as SnapshotCreateResult, lt as CompleteSnapshotObjectOwner, m as SnapshotDialect, mt as CompleteSnapshotPartition, n as SchemaSnapshot, nt as CompleteSnapshotIndex, o as SnapshotCheckConstraint, ot as CompleteSnapshotObject, p as SnapshotDiagnosticCode, pc as NativeColumnStorage, pt as CompleteSnapshotOwnership, q as CompleteSnapshotConstraint, r as SchemaSnapshotAdapter, rt as CompleteSnapshotIndexTerm, s as SnapshotColumn, st as CompleteSnapshotObjectKind, t as AnySchema, tt as CompleteSnapshotIdentity, u as SnapshotDecodeResult, ut as CompleteSnapshotObjectOwnerKind, v as SnapshotExtensionContext, vt as CompleteSnapshotRoutine, w as SnapshotIndexTermExpression, wt as CompleteSnapshotView, x as SnapshotIdentity, xt as CompleteSnapshotTable, y as SnapshotForeignKey, yt as CompleteSnapshotRoutineParameter, z as schemaSnapshotVersion } from "./types-DcIiNePM.mjs";
2
+ import { A as encodeCanonicalSnapshot, C as encodeCompleteSchemaSnapshot, D as schemaSnapshotV1Fingerprint, E as fingerprintCompleteSchemaSnapshot, M as toSnapshotJsonValue, O as SnapshotCanonicalError, S as decodeSchemaSnapshotV1, T as encodeSchemaSnapshotV1, _ as canonicalizeCompleteSchemaSnapshot, a as encodeSnapshot, b as decodeCompleteSchemaSnapshot, c as tryCreateSchemaSnapshot, d as canonicalizeSchemaSnapshot, f as decodeSchemaSnapshot, g as assertSchemaSnapshotV1, h as assertCompleteSnapshot, i as encodeSchemaSnapshot, j as schemaSnapshotFingerprint, k as canonicalJson, l as SnapshotValidationError, m as assertCompleteSchemaSnapshot, n as SnapshotSerializationError, o as fingerprintSchemaSnapshot, p as CompleteSnapshotValidationError, r as createSchemaSnapshot, s as serializeSchema, t as SchemaSnapshotOptions, u as assertSchemaSnapshot, v as canonicalizeSchemaSnapshotV1, w as encodeCompleteSnapshot, x as decodeCompleteSnapshot, y as completeSchemaSnapshotFingerprint } from "./serialize-Dg-Q55YQ.mjs";
3
+ import "./index-DB07P2X8.mjs";
4
4
  export { AnySchema, CompleteSchemaSnapshot, CompleteSchemaSnapshotInput, CompleteSnapshotCapabilities, CompleteSnapshotCheckConstraint, CompleteSnapshotCollation, CompleteSnapshotColumn, CompleteSnapshotComment, CompleteSnapshotConstraint, CompleteSnapshotCreateResult, CompleteSnapshotDecodeResult, CompleteSnapshotDeferredObject, CompleteSnapshotDomain, CompleteSnapshotEnum, CompleteSnapshotExtension, CompleteSnapshotForeignKey, CompleteSnapshotIdentity, CompleteSnapshotIndex, CompleteSnapshotIndexTerm, CompleteSnapshotKeyConstraint, CompleteSnapshotNamespace, CompleteSnapshotObject, CompleteSnapshotObjectKind, CompleteSnapshotObjectMetadata, CompleteSnapshotObjectOwner, CompleteSnapshotObjectOwnerKind, CompleteSnapshotObjectReference, CompleteSnapshotOpaqueObject, CompleteSnapshotOwnership, CompleteSnapshotPartition, CompleteSnapshotPhysicalReference, CompleteSnapshotPolicy, CompleteSnapshotProvenance, CompleteSnapshotRoutine, CompleteSnapshotRoutineParameter, CompleteSnapshotSequence, CompleteSnapshotTable, CompleteSnapshotTrigger, CompleteSnapshotValidationError, CompleteSnapshotValueFact, CompleteSnapshotView, type NativeColumnStorage, type PortableColumnStorage, type SchemaDialect, type SchemaDialectHooks, SchemaSnapshot, SchemaSnapshotAdapter, SchemaSnapshotInput, SchemaSnapshotOptions, SchemaSnapshotV1, SchemaSnapshotV1DecodeResult, SchemaSnapshotV1Input, SnapshotBigInt, SnapshotCanonicalError, SnapshotCheckConstraint, SnapshotColumn, SnapshotConstraint, SnapshotCreateResult, SnapshotDecodeResult, SnapshotDefault, SnapshotDiagnostic, SnapshotDiagnosticCode, SnapshotDialect, SnapshotDialectExtension, SnapshotExpression, SnapshotExpressionContext, SnapshotExtensionContext, SnapshotForeignKey, SnapshotGeneratedColumn, SnapshotIdentity, SnapshotIndex, SnapshotIndexTerm, SnapshotIndexTermExpression, SnapshotJsonValue, SnapshotKeyConstraint, SnapshotLiteral, SnapshotNamingPolicy, SnapshotSerializationError, SnapshotSpecialNumber, SnapshotStorage, SnapshotStorageContext, SnapshotTable, SnapshotUniqueConstraint, SnapshotValidationContext, SnapshotValidationError, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV1, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV1, completeSchemaSnapshotFingerprint, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createSchemaDialect, createSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV1, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV1, encodeSnapshot, fingerprintCompleteSchemaSnapshot, fingerprintSchemaSnapshot, neutralSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotFingerprint, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV1Fingerprint, schemaSnapshotV1Version, schemaSnapshotVersion, schemaSnapshotVersion1, serializeSchema, toSnapshotJsonValue, tryCreateSchemaSnapshot };
package/dist/sqlite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Pt as Dialect, Us as ColumnDefinition, _r as excluded, dr as DoNothingAction, fr as DoUpdateAction, gr as doUpdate, hr as doNothing, lr as ConflictAction, mr as OnConflictClause, pc as NativeColumnStorage, pr as ExcludedSource, ur as ConflictTarget, vf as SqlTimestamp, vr as onConflict } from "./types-Dqr4o2I1.mjs";
1
+ import { Pt as Dialect, Us as ColumnDefinition, _r as excluded, dr as DoNothingAction, fr as DoUpdateAction, gr as doUpdate, hr as doNothing, lr as ConflictAction, mr as OnConflictClause, pc as NativeColumnStorage, pr as ExcludedSource, ur as ConflictTarget, vf as SqlTimestamp, vr as onConflict } from "./types-DcIiNePM.mjs";
2
2
  //#region src/dialects/sqlite.d.ts
3
3
  /** Integer encoding used by SQLite timestamp columns. */
4
4
  type SqliteTimestampMode = "timestamp" | "timestamp_ms";
@@ -27,6 +27,6 @@ type SqliteTimestampColumn<TOptions extends SqliteTimestampOptions = {}> = Colum
27
27
  }>;
28
28
  /** Declare a SQLite `INTEGER` timestamp with a live Date codec. */
29
29
  declare function sqliteTimestamp<const TOptions extends SqliteTimestampOptions = {}>(options?: TOptions): SqliteTimestampColumn<TOptions>;
30
- declare function sqliteDialect(): Dialect<"json" | "on-conflict">;
30
+ declare function sqliteDialect(): Dialect<"on-conflict" | "json">;
31
31
  //#endregion
32
32
  export { type ConflictAction, type ConflictTarget, type DoNothingAction, type DoUpdateAction, type ExcludedSource, type OnConflictClause, SqliteTimestampColumn, SqliteTimestampMode, SqliteTimestampOptions, doNothing, doUpdate, excluded, onConflict, sqliteDialect, sqliteTimestamp };
@@ -1,4 +1,4 @@
1
- import { n as SchemaSnapshot } from "./types-Dqr4o2I1.mjs";
1
+ import { n as SchemaSnapshot } from "./types-DcIiNePM.mjs";
2
2
  //#region src/introspection/connection.d.ts
3
3
  /** A parameterized statement owned by a catalog adapter. */
4
4
  interface CatalogQuery {
@@ -424,6 +424,13 @@ declare function render<TQuery extends AnyFragment>(query: TQuery & RenderCapabi
424
424
  declare function render<TQuery extends AnyFragment, TCapabilities extends string>(query: TQuery & RenderCapabilityValidation<TQuery, TCapabilities>, options: RenderOptions<TCapabilities> | Dialect<TCapabilities>): RenderedQuery;
425
425
  //#endregion
426
426
  //#region src/execution.d.ts
427
+ declare global {
428
+ interface AbortSignal {
429
+ readonly aborted: boolean;
430
+ readonly reason: any;
431
+ throwIfAborted(): void;
432
+ }
433
+ }
427
434
  type StreamableQuery<TRow extends object = Record<string, unknown>> = QueryWithRow<TRow> & {
428
435
  readonly queryKind: "select" | "set";
429
436
  };
@@ -63,6 +63,14 @@ match the adapter.
63
63
 
64
64
  ### Unavailable profiles
65
65
 
66
+ MySQL has a [basic SQL migration runner](../../adapters/mysql2/README.md#run-sql-migrations),
67
+ `migrate`, which executes pending statements and records completed
68
+ migrations. It runs independently of the shared executor and its stronger
69
+ capability contract. The MySQL profile below remains unavailable; possible
70
+ improvements are tracked in [issue #1](https://github.com/aleclarson/qubu/issues/1).
71
+ The same entry point exports `baselineAdapter` for [reviewed MySQL adoption](adopt.md#mysql)
72
+ through the shared CLI and `@qubu/migrate/baseline` API.
73
+
66
74
  These exported profiles are unavailable and must not be passed to the
67
75
  executor:
68
76
 
@@ -82,11 +90,11 @@ during strict inspection:
82
90
 
83
91
  ```ts
84
92
  import { createClient } from "@libsql/client"
85
- import { libsqlMigrationAdapter, readLibsqlMigrationSnapshot } from "@qubu/adapter-libsql/migration"
93
+ import { migrationAdapter, readMigrationSnapshot } from "@qubu/adapter-libsql/migration"
86
94
 
87
95
  const client = createClient({ url: process.env.DATABASE_URL! })
88
- const adapter = libsqlMigrationAdapter(client, {
89
- readSnapshot: readLibsqlMigrationSnapshot,
96
+ const adapter = migrationAdapter(client, {
97
+ readSnapshot: readMigrationSnapshot,
90
98
  })
91
99
  ```
92
100
 
@@ -0,0 +1,331 @@
1
+ # Adopt an existing database
2
+
3
+ > Capture and accept the live schema as migration history's starting point, then
4
+ > reconcile it with the application's desired schema separately.
5
+
6
+ If the live `game` table lacks `manifest`, the captured baseline must also lack
7
+ it. Adoption changes no application schema/data and does not certify that the
8
+ desired application version can run. Keep incompatible code stopped until a
9
+ separate reviewed migration reconciles the schema.
10
+
11
+ ## Choose an adapter
12
+
13
+ All supported adoption adapters use the same [CLI](#shared-cli) and
14
+ [API](#shared-api). Each checks an empty artifact repository and its own history.
15
+
16
+ | Database and adapter | History storage | Coordination |
17
+ | ----------------------- | -------------------------- | ---------------------------------------------------- |
18
+ | SQLite through `libsql` | Migration journal | Adapter lease coordinates participating Qubu runners |
19
+ | PostgreSQL through `pg` | Migration journal | Pinned client and advisory lease |
20
+ | MySQL through `mysql2` | `__qubu_mysql2_migrations` | Caller serializes runners; no database lease |
21
+
22
+ Adoption does not require migration execution capabilities. MySQL supports the
23
+ shared adoption commands while retaining its basic SQL runner for subsequent
24
+ migrations. See [adapter profiles](adapters.md) for execution contracts.
25
+
26
+ Configure the desired application Snapshot v1 as the managed `scope`
27
+ (`config.snapshot` for the CLI). Preserve the same database, namespace, adapter,
28
+ and original scope through acceptance, including tables that are currently
29
+ absent. A candidate does not persist that original selection or bind itself to
30
+ a particular database. Verify the connection independently; reported selectors
31
+ do not prove database identity. Keep credentials out of snapshots and metadata.
32
+
33
+ ### Inspection scope
34
+
35
+ Standard readers select managed tables by their expected physical names and
36
+ preserve logical identities. Expected facts never fill missing tables or columns.
37
+ Other live tables are reported as unmanaged.
38
+
39
+ | Adapter | Connection and namespace | Other inspected objects |
40
+ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
41
+ | `libsql` | Configure the existing database as in [CLI configuration](operations.md#configuration) | Non-table objects retain the adapter's inspection policy; strict inspection can reject unsupported facts outside selected tables |
42
+ | `pg` | Connected `Client` or acquired `PoolClient`; keep `search_path` equal to the scope's existing namespace; see [PostgreSQL configuration](#postgresql-configuration) | Excluded tables take their sequences, triggers, policies, comments, and ownership with them. Namespace-level views, free sequences, enums, domains, routines, extensions, and opaque evidence remain included |
43
+ | `mysql2` | Dedicated connection, autocommit enabled, no active transaction; the selected database must equal the scope's database | Excluded tables take attached triggers, partitions, and comments with them. Namespace-level views, routines, used collations, and opaque evidence remain included |
44
+
45
+ Readers exclude reserved `__qubu_migration_` objects and their attached metadata;
46
+ MySQL also excludes `__qubu_mysql2_migrations`. Strict catalog failures remain
47
+ errors. A managed reference to an excluded object can require a broader scope.
48
+
49
+ The adapters expose `readMigrationSnapshot` directly. Without an expected scope,
50
+ the `pg` reader inspects non-journal objects in `public`; the `mysql2` reader uses
51
+ the selected database. Use `captureBaseline` for adoption so journal setup
52
+ precedes inspection, including any catalog facts introduced by that setup.
53
+
54
+ ## Capture, review, and verify
55
+
56
+ 1. **Capture** the actual managed schema to a new candidate file. The candidate
57
+ is an ordinary Snapshot v1, not a migration artifact. Keep it outside the
58
+ shared artifact directory and refuse to overwrite an existing candidate.
59
+ 2. **Review** its tables, columns, defaults, constraints, indexes, comments,
60
+ dialect facts, included namespace objects, and reported unmanaged tables.
61
+ 3. **Preflight** the explicitly reviewed file against a fresh inspection of the
62
+ original scope. Require empty history and an identical canonical snapshot,
63
+ including metadata. Changed facts or a newly appeared managed table block
64
+ acceptance. Investigate, recapture, and review; do not patch expected facts
65
+ into the candidate to hide differences.
66
+ 4. **Accept** only after verifying the acknowledgments below. Acceptance repeats
67
+ preflight and records a non-executable baseline at sequence zero with a null
68
+ parent. Preserve the returned or written artifact.
69
+
70
+ Capture and preflight record no baseline and change no application schema/data.
71
+ Session setup may initialize Qubu history tables and perform lease bookkeeping.
72
+ Stop other migrators and prevent concurrent DDL throughout cutover. Leases
73
+ coordinate participating Qubu runners, not every possible schema writer.
74
+ Preflight needs no acceptance confirmations. Comparison failures include
75
+ diagnostics and actual snapshot evidence when available.
76
+
77
+ ### Acceptance acknowledgments
78
+
79
+ All seven facts must be true. The application acknowledgment means incompatible
80
+ code remains stopped; it does not assert that desired code is already compatible.
81
+
82
+ | CLI confirmation | What the operator verifies |
83
+ | ------------------------------------ | ---------------------------------------------------------------------------------- |
84
+ | `database-target` | The configured connection targets the intended database and environment |
85
+ | `snapshot-source` | The selected candidate was captured and reviewed using the unchanged managed scope |
86
+ | `zero-managed-drift` | Fresh strict inspection has zero differences from the reviewed candidate |
87
+ | `backup-restore-ready` | Backup and restore procedures are ready |
88
+ | `other-migrators-stopped` | Other runners are stopped and concurrent DDL is prevented |
89
+ | `incompatible-application-prevented` | Incompatible code will remain stopped until reconciliation is complete |
90
+ | `legacy-history-cutover` | The team accepts this baseline as the new lineage start |
91
+
92
+ ## Shared CLI
93
+
94
+ Install `@qubu/cli`, `@qubu/migrate`, and the selected adapter and driver.
95
+ Configure the [CLI](operations.md#configuration) with the existing database,
96
+ desired application snapshot, and an empty artifact directory. Standard `libsql`
97
+ and `pg` migration adapters provide strict inspection; intentional `readSnapshot`
98
+ overrides remain caller-owned. The CLI accepts either a migration adapter or an
99
+ adoption-only `baselineAdapter` in `config.adapter`. See the connection examples
100
+ for [PostgreSQL](#postgresql-configuration) and [MySQL](#mysql).
101
+
102
+ Capture and review:
103
+
104
+ ```bash
105
+ qubu migrate baseline-capture --out ./baseline-candidate.json \
106
+ --config ./qubu.config.js --format json
107
+ ```
108
+
109
+ The CLI refuses to overwrite the file and reports the config path, environment,
110
+ dialect, namespace, configured managed tables, included tables, and exclusions.
111
+ After reviewing that output and candidate, run preflight:
112
+
113
+ ```bash
114
+ qubu migrate baseline initial --candidate ./baseline-candidate.json \
115
+ --config ./qubu.config.js --dry-run --format json
116
+ ```
117
+
118
+ Once all [acknowledgments](#acceptance-acknowledgments) are verified, accept:
119
+
120
+ ```bash
121
+ qubu migrate baseline initial --candidate ./baseline-candidate.json \
122
+ --config ./qubu.config.js \
123
+ --confirm database-target \
124
+ --confirm snapshot-source \
125
+ --confirm zero-managed-drift \
126
+ --confirm backup-restore-ready \
127
+ --confirm other-migrators-stopped \
128
+ --confirm incompatible-application-prevented \
129
+ --confirm legacy-history-cutover \
130
+ --format json --non-interactive
131
+ ```
132
+
133
+ ### Shared API
134
+
135
+ Import adoption operations from `@qubu/migrate/baseline` and `baselineAdapter`
136
+ from the selected driver's `/migration` entry point. For example, with a
137
+ dedicated MySQL connection:
138
+
139
+ ```ts
140
+ import { baselineAdapter } from "@qubu/adapter-mysql2/migration"
141
+ import { captureBaseline } from "@qubu/migrate/baseline"
142
+ import { encodeSchemaSnapshot } from "qubu/snapshot"
143
+ import { writeFile } from "node:fs/promises"
144
+
145
+ const adapter = baselineAdapter(connection)
146
+ const inspection = await captureBaseline({ adapter, scope: desiredSnapshot })
147
+ await writeFile("baseline-candidate.json", encodeSchemaSnapshot(inspection.snapshot), {
148
+ flag: "wx",
149
+ })
150
+ ```
151
+
152
+ Review the candidate before continuing. Reuse the same database and original
153
+ scope, and reload the reviewed file for preflight and acceptance:
154
+
155
+ ```ts
156
+ import { readFile, writeFile } from "node:fs/promises"
157
+ import { preflightBaseline, createBaseline } from "@qubu/migrate/baseline"
158
+ import { encodeBaselineArtifact } from "@qubu/migrate/artifact"
159
+ import { assertSchemaSnapshot } from "qubu/snapshot"
160
+
161
+ const candidate = assertSchemaSnapshot(await readFile("baseline-candidate.json", "utf8"))
162
+ const input = { adapter, scope: desiredSnapshot, candidate, repository: [] }
163
+ await preflightBaseline(input)
164
+
165
+ const { artifact } = await createBaseline({
166
+ ...input,
167
+ id: "initial",
168
+ provenance: { source: "my-service" },
169
+ confirmation: {
170
+ databaseTargetVerified: true,
171
+ snapshotSourceVerified: true,
172
+ zeroManagedDriftVerified: true,
173
+ backupRestoreReady: true,
174
+ otherMigratorsStopped: true,
175
+ incompatibleApplicationPrevented: true,
176
+ legacyHistoryCutoverAccepted: true,
177
+ },
178
+ })
179
+ await writeFile("baseline-accepted.json", encodeBaselineArtifact(artifact), { flag: "wx" })
180
+ ```
181
+
182
+ Supply the real artifact repository when one exists; `[]` represents an empty
183
+ repository. The adapter separately verifies its database history. The caller
184
+ owns connection cleanup, including after failed capture or acceptance.
185
+
186
+ Existing custom migration adapters can use `fromMigrationAdapter(adapter)` from
187
+ `@qubu/migrate/baseline`. It reuses their strict reader, lease, and journal. A
188
+ custom adoption-only adapter implements `openBaselineSession`; its session
189
+ provides schema inspection, empty-history verification, baseline recording,
190
+ and cleanup. It does not need SQL execution or migration recovery methods.
191
+
192
+ ### PostgreSQL configuration
193
+
194
+ The caller owns connecting, releasing, and ending the pinned `pg` client. Keep
195
+ it exclusively available until the migration session closes. Qubu releases its
196
+ locks and closes its session; it never releases or ends the supplied client.
197
+
198
+ This CLI wrapper opens a client per session and ends it after cleanup. Set
199
+ `search_path` to the snapshot namespace: inspection selects it explicitly, while
200
+ journal SQL and unqualified migration statements use `search_path`.
201
+
202
+ ```ts
203
+ import { defineConfig } from "@qubu/cli/config"
204
+ import { migrationAdapter } from "@qubu/adapter-pg/migration"
205
+ import { Client } from "pg"
206
+ import snapshot from "./schema.snapshot.js"
207
+
208
+ export default defineConfig({
209
+ artifacts: "./migrations",
210
+ snapshot,
211
+ environment: "production",
212
+ provenance: { source: "my-service" },
213
+ adapter: () => ({
214
+ async openMigrationSession(signal) {
215
+ const connectionString = process.env.DATABASE_URL
216
+ if (!connectionString) throw new Error("DATABASE_URL is required")
217
+ const client = new Client({ connectionString })
218
+ try {
219
+ await client.connect()
220
+ const namespace = '"' + snapshot.namespace.name.replaceAll('"', '""') + '"'
221
+ await client.query("SELECT set_config('search_path', $1, false)", [namespace])
222
+ const session = await migrationAdapter(client).openMigrationSession(signal)
223
+ const close = session.close.bind(session)
224
+ let closed = false
225
+ session.close = async () => {
226
+ if (closed) return
227
+ closed = true
228
+ try {
229
+ await close()
230
+ } finally {
231
+ await client.end()
232
+ }
233
+ }
234
+ return session
235
+ } catch (error) {
236
+ await client.end()
237
+ throw error
238
+ }
239
+ },
240
+ }),
241
+ })
242
+ ```
243
+
244
+ ## MySQL
245
+
246
+ Use a dedicated `mysql2/promise` connection with autocommit enabled and no active
247
+ transaction. This configuration opens a connection per adoption session and
248
+ ends it after cleanup. Run the [shared CLI commands](#shared-cli) with this config:
249
+
250
+ ```ts
251
+ import { defineConfig } from "@qubu/cli/config"
252
+ import { baselineAdapter } from "@qubu/adapter-mysql2/migration"
253
+ import mysql from "mysql2/promise"
254
+ import snapshot from "./schema.snapshot.js"
255
+
256
+ export default defineConfig({
257
+ artifacts: "./migrations",
258
+ snapshot,
259
+ environment: "production",
260
+ provenance: { source: "my-service" },
261
+ adapter: () => ({
262
+ async openBaselineSession(scope, signal) {
263
+ const connection = await mysql.createConnection(process.env.DATABASE_URL!)
264
+ try {
265
+ const session = await baselineAdapter(connection).openBaselineSession(scope, signal)
266
+ return {
267
+ ...session,
268
+ async close() {
269
+ try {
270
+ await session.close()
271
+ } finally {
272
+ await connection.end()
273
+ }
274
+ },
275
+ }
276
+ } catch (error) {
277
+ await connection.end()
278
+ throw error
279
+ }
280
+ },
281
+ }),
282
+ })
283
+ ```
284
+
285
+ Acceptance inserts one baseline record in `__qubu_mysql2_migrations`. Its
286
+ `baseline` column contains the full sealed artifact, including the reviewed
287
+ snapshot, provenance, and acknowledgments. The CLI also writes that artifact to
288
+ the configured repository.
289
+
290
+ This adoption-only configuration cannot run `migrate apply`, `status`, or
291
+ `reconcile`, which require the shared migration executor. Use the basic MySQL
292
+ runner for subsequent SQL migrations as shown below.
293
+
294
+ ## After acceptance
295
+
296
+ If recording or artifact-file writing fails, inspect history and saved files
297
+ before retrying. The shared CLI records the journal before writing the artifact;
298
+ MySQL can lose an insert response after the record commits. Rerunning adoption
299
+ against nonempty history is not a recovery procedure. For MySQL, inspect:
300
+
301
+ ```sql
302
+ SELECT id, hash, baseline FROM __qubu_mysql2_migrations WHERE id = 'initial';
303
+ ```
304
+
305
+ Reconcile the desired application schema in a separate reviewed migration.
306
+ For SQLite/PostgreSQL, keep `config.snapshot` as the desired snapshot and plan
307
+ from the accepted baseline:
308
+
309
+ ```bash
310
+ qubu migrate create add-manifest --config ./qubu.config.js --dry-run --format json
311
+ ```
312
+
313
+ Review approvals or custom programs, create the artifact, and apply it through
314
+ the [normal workflow](operations.md). The tested path extends the captured
315
+ catalog snapshot with a supported change. Independently authored snapshots can
316
+ differ in constraint names, native types, defaults, or dialect metadata even
317
+ when their SQL seems equivalent. Adoption adds no general SQL equivalence rules
318
+ or automatic repairs.
319
+
320
+ For MySQL, review changes against the accepted snapshot and append SQL migrations
321
+ with distinct, permanent IDs:
322
+
323
+ ```ts
324
+ import { migrate } from "@qubu/adapter-mysql2/migration"
325
+
326
+ await migrate(connection, [{ id: "add-manifest", sql: ["ALTER TABLE game ADD manifest JSON"] }])
327
+ ```
328
+
329
+ The basic runner skips completed IDs. It does not check live schema drift before
330
+ subsequent migrations or consume sealed executable artifacts. Partial failures
331
+ still require inspection before retrying.
@@ -41,7 +41,7 @@ entrypoint:
41
41
  | `@qubu/migrate/repository` | Verify a complete artifact chain and its journal prefix |
42
42
  | `@qubu/migrate/journal` | Implement or inspect the storage-neutral journal contract |
43
43
  | `@qubu/migrate/executor` | Apply artifacts and reconcile uncertain attempts |
44
- | `@qubu/migrate/baseline` | Verify and record the initial non-executable baseline |
44
+ | `@qubu/migrate/baseline` | Capture, preflight, and accept a reviewed live schema as the initial non-executable baseline |
45
45
  | `@qubu/migrate/status` | Inspect pending work, drift, requirements, and interrupted attempts |
46
46
  | `@qubu/migrate/bootstrap` | Prepare a fresh schema diff and expose shared bootstrap types; accepts a caller-supplied `SchemaDialect` for generic planning |
47
47
  | `@qubu/migrate/bootstrap/postgres` | Plan a fresh PostgreSQL schema through the normal compiler |
@@ -54,6 +54,8 @@ entrypoint:
54
54
  files and approve operations.
55
55
  - [Adapter capability profiles](adapters.md): choose a supported driver.
56
56
  - [Command line operations](operations.md): configure and use the CLI.
57
+ - [Adopt an existing database](adopt.md): capture, review, and accept the live
58
+ starting schema before applying separate migrations.
57
59
  - [Recovery and reconciliation](recovery.md): handle interrupted migrations.
58
60
  - [Lotta Games adoption](lotta-adoption.md): review the downstream cutover
59
61
  plan and combo-matrix release blocker.
@@ -26,7 +26,7 @@ Export a typed config and keep credentials inside the adapter factory:
26
26
 
27
27
  ```ts
28
28
  import { createClient } from "@libsql/client"
29
- import { libsqlMigrationAdapter, readLibsqlMigrationSnapshot } from "@qubu/adapter-libsql/migration"
29
+ import { migrationAdapter, readMigrationSnapshot } from "@qubu/adapter-libsql/migration"
30
30
  import { defineConfig } from "@qubu/cli/config"
31
31
  import snapshot from "./schema.snapshot.js"
32
32
 
@@ -38,8 +38,8 @@ export default defineConfig({
38
38
  snapshot,
39
39
  environment: "production",
40
40
  adapter: () =>
41
- libsqlMigrationAdapter(createClient({ url }), {
42
- readSnapshot: readLibsqlMigrationSnapshot,
41
+ migrationAdapter(createClient({ url }), {
42
+ readSnapshot: readMigrationSnapshot,
43
43
  }),
44
44
  provenance: { source: "my-service" },
45
45
  })
@@ -51,31 +51,32 @@ approvals, custom programs, renderer/server constraints, baseline operator
51
51
  metadata, and reconciliation proof. `artifacts` is resolved from the CLI
52
52
  working directory.
53
53
 
54
- | Field | Required | Meaning |
55
- | ------------------------------------------ | ------------------- | -------------------------------------------------------------------------------------------- |
56
- | `artifacts` | yes | Artifact directory, relative to the command working directory unless absolute |
57
- | `snapshot` | one snapshot source | Snapshot value or sync/async factory |
58
- | `schema` + `snapshotFromSchema` | one snapshot source | Application-owned conversion when the source is a Qubu `Schema` |
59
- | `adapter` | database commands | Sync/async factory returning a migration adapter |
60
- | `approvals` | no | Sync/async operation policy; receives the operation, finding codes, and requested CLI reason |
61
- | `customPrograms` | no | Exact operation substitutions with execution requirements and provenance |
62
- | `renderer`, `serverVersion`, `constraints` | no | Renderer identity and target compatibility constraints |
63
- | `provenance` | no | Artifact source/revision/actor/metadata; defaults to `{ source: "@qubu/cli" }` |
64
- | `environment` | no | `development`, `test`, `staging`, or `production`; context only |
65
- | `baselineOperator` | no | JSON-safe operator metadata stored in a baseline |
66
- | `verifyReconciliation` | reconcile only | Application-owned proof of the selected live outcome |
54
+ | Field | Required | Meaning |
55
+ | ------------------------------------------ | ------------------- | --------------------------------------------------------------------------------------------------- |
56
+ | `artifacts` | yes | Artifact directory, relative to the command working directory unless absolute |
57
+ | `snapshot` | one snapshot source | Snapshot value or sync/async factory |
58
+ | `schema` + `snapshotFromSchema` | one snapshot source | Application-owned conversion when the source is a Qubu `Schema` |
59
+ | `adapter` | database commands | Sync/async factory returning a migration adapter, or an adoption-only adapter for baseline commands |
60
+ | `approvals` | no | Sync/async operation policy; receives the operation, finding codes, and requested CLI reason |
61
+ | `customPrograms` | no | Exact operation substitutions with execution requirements and provenance |
62
+ | `renderer`, `serverVersion`, `constraints` | no | Renderer identity and target compatibility constraints |
63
+ | `provenance` | no | Artifact source/revision/actor/metadata; defaults to `{ source: "@qubu/cli" }` |
64
+ | `environment` | no | `development`, `test`, `staging`, or `production`; context only |
65
+ | `baselineOperator` | no | JSON-safe operator metadata stored in a baseline |
66
+ | `verifyReconciliation` | reconcile only | Application-owned proof of the selected live outcome |
67
67
 
68
68
  ## Commands
69
69
 
70
- | Syntax | Reads or writes | Important failure behavior |
71
- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
72
- | `qubu migrate create <id> [--approve <operation-id=reason>...] [--approved-by <actor>] [--dry-run]` | Verifies the full repository, plans from its embedded final snapshot, seals, then writes one canonical artifact unless dry-run | Unknown operation IDs or missing exact approvals fail policy |
73
- | `qubu migrate verify` | Strictly decodes and verifies every artifact and the complete chain | Any malformed, tampered, forked, gapped, or mismatched artifact fails validation |
74
- | `qubu migrate status` | Opens a session and lease; reports managed drift, unmanaged objects, pending artifacts, interrupted attempts, and incompatible requirements | Recovery, validation, drift, and capability policy are distinct failures |
75
- | `qubu migrate apply [--dry-run]` | Applies the complete verified pending chain; dry-run performs status/preflight only | It never limits discovery to Git-added or branch-diff files |
76
- | `qubu migrate baseline <id> --confirm <fact>... [--dry-run]` | Without dry-run, strictly compares the live managed schema, initializes an empty journal, records baseline, then writes the artifact | Requires an empty artifact repository and all seven exact confirmations; dry-run does not inspect the database |
77
- | `qubu migrate reconcile <attempt-id> --outcome applied\|rolled_back --reason <text>` | Runs application-owned verification, then records the explicit outcome | Requires `verifyReconciliation` in config; no automatic inference |
78
- | `qubu schema bootstrap [--approve <operation-id=reason>...] [--dry-run]` | Plans an empty SQLite or PostgreSQL snapshot through diff/plan/program; executes through the normal executor unless dry-run | Rejects other dialects; unsafe or incomplete facts still require exact approvals or custom programs |
70
+ | Syntax | Reads or writes | Important failure behavior |
71
+ | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
72
+ | `qubu migrate create <id> [--approve <operation-id=reason>...] [--approved-by <actor>] [--dry-run]` | Verifies the full repository, plans from its embedded final snapshot, seals, then writes one canonical artifact unless dry-run | Unknown operation IDs or missing exact approvals fail policy |
73
+ | `qubu migrate verify` | Strictly decodes and verifies every artifact and the complete chain | Any malformed, tampered, forked, gapped, or mismatched artifact fails validation |
74
+ | `qubu migrate status` | Opens a session and lease; reports managed drift, unmanaged objects, pending artifacts, interrupted attempts, and incompatible requirements | Recovery, validation, drift, and capability policy are distinct failures |
75
+ | `qubu migrate apply [--dry-run]` | Applies the complete verified pending chain; dry-run performs status/preflight only | It never limits discovery to Git-added or branch-diff files |
76
+ | `qubu migrate baseline-capture --out <path>` | Strictly reads live managed schema and writes a new candidate snapshot outside the artifact repository | Strict inspection failures block capture; existing candidate files are not overwritten |
77
+ | `qubu migrate baseline <id> --candidate <path> [--confirm <fact>...] [--dry-run]` | Reinspects the reviewed candidate; acceptance records baseline then writes its artifact | Empty repository and adapter history required; acceptance requires seven confirmations; dry-run inspects without recording |
78
+ | `qubu migrate reconcile <attempt-id> --outcome applied\|rolled_back --reason <text>` | Runs application-owned verification, then records the explicit outcome | Requires `verifyReconciliation` in config; no automatic inference |
79
+ | `qubu schema bootstrap [--approve <operation-id=reason>...] [--dry-run]` | Plans an empty SQLite or PostgreSQL snapshot through diff/plan/program; executes through the normal executor unless dry-run | Rejects other dialects; unsafe or incomplete facts still require exact approvals or custom programs |
79
80
 
80
81
  ## Output and exit codes
81
82
 
@@ -128,34 +129,9 @@ The dry run prints the ordered phases without opening the adapter. Remove
128
129
  an application-owned custom program. Bootstrap does not import or replay
129
130
  Drizzle migration history.
130
131
 
131
- ## Baseline and cutover checklist
132
+ ## Adopt an existing database
132
133
 
133
- A baseline is a statement about the live database now, not a replay of its
134
- history. Before supplying all seven confirmations, the operator must verify:
135
-
136
- - `database-target`: the connection names the intended environment;
137
- - `snapshot-source`: the reviewed snapshot is the intended source of truth;
138
- - `zero-managed-drift`: strict inspection reports no managed mismatch;
139
- - `backup-restore-ready`: backup and restore procedures are ready;
140
- - `other-migrators-stopped`: no other migration runner can race the cutover;
141
- - `application-compatible`: deployed code is compatible with the live schema;
142
- - `legacy-history-cutover`: the team accepts the new baseline as the lineage start.
143
-
144
- For example, repeat `--confirm` once per exact value. The CLI rejects missing
145
- or unknown confirmation names even outside production; `environment` is
146
- reported as context rather than used to weaken the policy.
147
-
148
- ```bash
149
- qubu migrate baseline lotta-cutover \
150
- --confirm database-target \
151
- --confirm snapshot-source \
152
- --confirm zero-managed-drift \
153
- --confirm backup-restore-ready \
154
- --confirm other-migrators-stopped \
155
- --confirm application-compatible \
156
- --confirm legacy-history-cutover \
157
- --format json --non-interactive
158
- ```
159
-
160
- After success, preserve the written baseline artifact with the repository. Its
161
- sequence is zero, its parent is null, and later migrations extend its digest.
134
+ Follow the [adoption guide](adopt.md) to capture a live candidate, review its
135
+ scope and facts, run preflight, and explicitly accept it.
136
+ Keep the configured application snapshot as the desired schema for subsequent
137
+ migration planning. Baseline acceptance does not certify application compatibility.
@@ -45,7 +45,7 @@
45
45
  | `@qubu/migrate/repository` | Runtime | Strict full-chain and journal-prefix verification |
46
46
  | `@qubu/migrate/journal` | Runtime | Storage-neutral journal records, transitions, validation, and reference storage |
47
47
  | `@qubu/migrate/executor` | Runtime | Portable execution, structured errors, checkpointing, and explicit reconciliation |
48
- | `@qubu/migrate/baseline` | Runtime | Strict live baseline verification and physical managed-schema comparison |
48
+ | `@qubu/migrate/baseline` | Runtime | Live candidate capture, exact baseline verification, and physical managed-schema comparison |
49
49
  | `@qubu/migrate/status` | Runtime | Pending chain, managed drift, unmanaged objects, interrupted attempts, and incompatible requirements |
50
50
  | `@qubu/migrate/bootstrap` | Runtime | Shared bootstrap preparation, result types, and generic planning with a caller-supplied schema dialect |
51
51
  | `@qubu/migrate/bootstrap/postgres` | Runtime | Fresh PostgreSQL schema planning through the normal diff, plan, and program compiler |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qubu",
3
- "version": "0.6.3",
3
+ "version": "0.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/aleclarson/qubu"
@@ -1 +0,0 @@
1
- export {}
@@ -1,61 +0,0 @@
1
- # Lotta Games adoption
2
-
3
- > Move Lotta to Qubu migrations while keeping deployment decisions in Lotta.
4
-
5
- Adopt the released `@qubu/migrate`, `@qubu/cli`, and libSQL migration entrypoint
6
- as a hard cutover. Do not add an upstream decoder for Lotta's provisional JSON,
7
- FNV artifact digests, journal, or broad unsafe flags.
8
-
9
- ## Establish the starting state
10
-
11
- Before changing downstream state, inspect every environment for a provisional
12
- journal or baseline row. Regenerate unreleased migrations in the Qubu artifact
13
- format. For an existing database, create one standard baseline only after strict
14
- live introspection matches the intended Qubu snapshot. That baseline records a
15
- verified starting state; it does not claim that old migrations ran through
16
- Qubu.
17
-
18
- ## Keep deployment policy in Lotta
19
-
20
- Keep these concerns in Lotta:
21
-
22
- - Turso credentials and environment selection;
23
- - Cloudflare deployment waiting and migrate-first/migrate-last prompts;
24
- - the destructive-deny approval policy and product-specific custom programs;
25
- - rollout timing and the one-time legacy journal cutover decision.
26
-
27
- Replace the private migration and runner modules with thin configuration and
28
- CLI/library invocation. Make the release script apply the complete pending
29
- repository chain and preserve non-zero failures. Generate fresh local test
30
- databases with `schema bootstrap`; keep connection PRAGMAs in the test harness.
31
-
32
- > [!WARNING]
33
- > Keep Drizzle migration SQL and snapshots read-only. Do not import or replay
34
- > Drizzle history. A verified baseline is the handoff from historical state to
35
- > Qubu lineage.
36
-
37
- ## Verify the cutover
38
-
39
- Cover these scenarios downstream:
40
-
41
- - A fresh bootstrap.
42
- - An already baselined database.
43
- - A deploy with no pending migrations.
44
- - Pending migrations in both deployment timing modes.
45
- - Refusal when the schema has drifted.
46
- - Concurrent migration attempts.
47
- - Rollback and explicit recovery.
48
-
49
- ## Combo-matrix release blocker
50
-
51
- The main repository currently pins the `combos` submodule gitlink to
52
- `2e2856e5692ef5cbef03a055fa71e5baab8ec10a`. Commit `d9d2e02` added and verified
53
- migration profiles in the main repository without advancing that gitlink, so
54
- the orphan-branch adapter × environment matrix is not yet synchronized with the
55
- new profile claims. This is an unresolved pinned-SHA issue, not evidence that
56
- the matrix has verified the new migration entrypoints.
57
-
58
- Do not edit the gitlink or matrix as part of Lotta adoption. Before release,
59
- update the `combos` branch in its own review, run the declared environments and
60
- real database round trips, classify every candidate pair, then advance the main
61
- repository gitlink to that reviewed commit in a separate change.