qubu 0.3.4 → 0.4.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.
Files changed (56) hide show
  1. package/dist/codegen.d.mts +1 -1
  2. package/dist/codegen.mjs +1 -1
  3. package/dist/column-D-8OqGuV.mjs +328 -0
  4. package/dist/{table-llv9tsZ8.mjs → column-LV7oGQde.mjs} +9 -97
  5. package/dist/{complete-types-BdFqUfbb.d.mts → complete-types-BavBtv8J.d.mts} +1 -1
  6. package/dist/core.d.mts +1 -1
  7. package/dist/core.mjs +3 -3
  8. package/dist/ddl.d.mts +1 -1
  9. package/dist/ddl.mjs +3 -3
  10. package/dist/diff.d.mts +1 -1
  11. package/dist/drizzle-mysql.d.mts +2 -2
  12. package/dist/drizzle-mysql.mjs +2 -2
  13. package/dist/drizzle-postgres.d.mts +2 -2
  14. package/dist/drizzle-postgres.mjs +2 -2
  15. package/dist/drizzle-sqlite.d.mts +36 -3
  16. package/dist/drizzle-sqlite.mjs +30 -4
  17. package/dist/drizzle.d.mts +1 -1
  18. package/dist/{index-Dug5HnLB.d.mts → index-D3ZOwPT-.d.mts} +2 -2
  19. package/dist/{index-Ds7-mhJi.d.mts → index-DH0qV6aS.d.mts} +2 -2
  20. package/dist/index.d.mts +2 -2
  21. package/dist/index.mjs +64 -34
  22. package/dist/introspection.d.mts +2 -2
  23. package/dist/introspection.mjs +1 -1
  24. package/dist/migration.d.mts +2 -2
  25. package/dist/{mysql-DqkqXB6A.mjs → mysql-CKEKGnj4.mjs} +3 -3
  26. package/dist/mysql.d.mts +1 -1
  27. package/dist/{on-conflict-BxnxubMb.mjs → on-conflict-4MOBl51J.mjs} +4 -3
  28. package/dist/{postgres-DEBBeh52.mjs → postgres-BK2APkKP.mjs} +3 -2
  29. package/dist/postgres.d.mts +1 -1
  30. package/dist/postgres.mjs +3 -3
  31. package/dist/{registry-BufIskVN.mjs → registry-CXV8u7Pt.mjs} +3 -108
  32. package/dist/{relational-DCZrrNia.mjs → relational-DuQ9IHSb.mjs} +4 -4
  33. package/dist/{runtime-BTr-MTlo.mjs → runtime-Cn_Xgzta.mjs} +1 -1
  34. package/dist/schema.d.mts +2 -2
  35. package/dist/schema.mjs +6 -4
  36. package/dist/{serialize-PF1cfH2P.mjs → serialize-CFtYYAdk.mjs} +2 -2
  37. package/dist/{snapshot-CWPgzxNx.mjs → snapshot-DJpfmxhQ.mjs} +1 -1
  38. package/dist/snapshot.d.mts +3 -3
  39. package/dist/snapshot.mjs +4 -4
  40. package/dist/{source-DUoJVXmL.mjs → source-DGO3DRgg.mjs} +3 -3
  41. package/dist/{sqlite-BU6DBxef.mjs → sqlite-CrsK0Fza.mjs} +3 -3
  42. package/dist/sqlite.d.mts +1 -1
  43. package/dist/sqlite.mjs +1 -1
  44. package/dist/table-D6rcs8SB.mjs +96 -0
  45. package/dist/{types-BX0mckiU.d.mts → types-CSNJTYaM.d.mts} +1 -1
  46. package/dist/{types-H4vyCw8_.d.mts → types-DZsueVoI.d.mts} +1 -1
  47. package/dist/{types-4Q076HKo.d.mts → types-Deo_q43Y.d.mts} +1442 -916
  48. package/dist/{types-Cec0xzo4.mjs → types-g-vVvj1B.mjs} +4 -3
  49. package/dist/{value-BvilP0oz.mjs → value-b6OFZXVS.mjs} +1 -1
  50. package/dist/vite/ambient.d.ts +13 -61
  51. package/docs/dialects-and-execution.md +84 -34
  52. package/docs/guides/drizzle.md +27 -0
  53. package/docs/reference/supported-surface.md +7 -7
  54. package/package.json +1 -1
  55. package/dist/column-CXMxx8Hq.mjs +0 -118
  56. package/dist/naming-QVCOnSj2.mjs +0 -20
@@ -1,7 +1,27 @@
1
- import { t as createSqliteSchemaSnapshot } from "./sqlite-BU6DBxef.mjs";
2
- import { t as convertDrizzleSchema } from "./runtime-BTr-MTlo.mjs";
1
+ import { l as nativeColumn } from "./column-LV7oGQde.mjs";
2
+ import { t as createSqliteSchemaSnapshot } from "./sqlite-CrsK0Fza.mjs";
3
+ import { t as convertDrizzleSchema } from "./runtime-Cn_Xgzta.mjs";
3
4
  import { blob, check, customType, foreignKey, index, integer, primaryKey, sqliteTable, text, unique, uniqueIndex } from "drizzle-orm/sqlite-core";
4
5
  //#region src/drizzle/sqlite.ts
6
+ const sqliteTimestampRuntime = /* @__PURE__ */ new WeakMap();
7
+ /**
8
+ * Declare a SQLite `INTEGER` timestamp that retains Drizzle's Date codec.
9
+ *
10
+ * @remarks `defaultFn` is runtime-only. Snapshots and emitted DDL retain the
11
+ * native `INTEGER` storage but do not serialize the callback.
12
+ */
13
+ function sqliteTimestamp(options) {
14
+ const definition = nativeColumn("sqlite", "INTEGER", {
15
+ nullable: options?.nullable === true,
16
+ hasDefault: options?.defaultFn !== void 0,
17
+ sqlName: options?.sqlName
18
+ }).$type();
19
+ sqliteTimestampRuntime.set(definition, Object.freeze({
20
+ mode: options?.mode ?? "timestamp",
21
+ ...options?.defaultFn === void 0 ? {} : { defaultFn: options.defaultFn }
22
+ }));
23
+ return definition;
24
+ }
5
25
  const sqliteAdapter = {
6
26
  dialect: "sqlite",
7
27
  createSnapshot: createSqliteSchemaSnapshot,
@@ -47,7 +67,13 @@ const sqliteAdapter = {
47
67
  function toSqliteDrizzleSchema(schema) {
48
68
  return convertDrizzleSchema(schema, sqliteAdapter);
49
69
  }
50
- function createSqliteStorageBuilder(type, name, declaration) {
70
+ function createSqliteStorageBuilder(type, name, declaration, definition) {
71
+ const timestampRuntime = sqliteTimestampRuntime.get(definition);
72
+ if (timestampRuntime !== void 0) {
73
+ let builder = integer(name, { mode: timestampRuntime.mode });
74
+ if (timestampRuntime.defaultFn !== void 0) builder = builder.$defaultFn(timestampRuntime.defaultFn);
75
+ return builder;
76
+ }
51
77
  return (() => {
52
78
  switch (type) {
53
79
  case "integer": return integer(name);
@@ -79,4 +105,4 @@ function createSqliteStorageBuilder(type, name, declaration) {
79
105
  })();
80
106
  }
81
107
  //#endregion
82
- export { toSqliteDrizzleSchema };
108
+ export { sqliteTimestamp, toSqliteDrizzleSchema };
@@ -1,4 +1,4 @@
1
- import { n as DrizzleDialect } from "./types-H4vyCw8_.mjs";
1
+ import { n as DrizzleDialect } from "./types-DZsueVoI.mjs";
2
2
  //#region src/drizzle/errors.d.ts
3
3
  /** Stable failure categories raised while building a Drizzle schema. */
4
4
  type DrizzleSchemaConversionErrorCode = 'missing-storage' | 'unsupported-metadata';
@@ -1,5 +1,5 @@
1
- import { T as SnapshotJsonValue, m as SnapshotDialect, n as SchemaSnapshot } from "./types-4Q076HKo.mjs";
2
- import { S as CompleteSnapshotObjectKind, t as CompleteSchemaSnapshot } from "./complete-types-BdFqUfbb.mjs";
1
+ import { T as SnapshotJsonValue, m as SnapshotDialect, n as SchemaSnapshot } from "./types-Deo_q43Y.mjs";
2
+ import { S as CompleteSnapshotObjectKind, t as CompleteSchemaSnapshot } from "./complete-types-BavBtv8J.mjs";
3
3
  //#region src/diff/types.d.ts
4
4
  /** Object families understood by the snapshot diff engine. */
5
5
  type SnapshotDiffObjectKind = CompleteSnapshotObjectKind;
@@ -1,5 +1,5 @@
1
- import { Mr as SchemaDialect, T as SnapshotJsonValue, Xr as Schema, f as SnapshotDiagnostic, i as SchemaSnapshotInput, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter, u as SnapshotDecodeResult } from "./types-4Q076HKo.mjs";
2
- import { n as CompleteSchemaSnapshotInput, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult } from "./complete-types-BdFqUfbb.mjs";
1
+ import { Ir as SchemaDialect, T as SnapshotJsonValue, ei as Schema, f as SnapshotDiagnostic, i as SchemaSnapshotInput, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter, u as SnapshotDecodeResult } from "./types-Deo_q43Y.mjs";
2
+ import { n as CompleteSchemaSnapshotInput, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult } from "./complete-types-BavBtv8J.mjs";
3
3
  //#region src/snapshot/canonical.d.ts
4
4
  /** Error raised when a value cannot cross the canonical JSON boundary. */
5
5
  declare class SnapshotCanonicalError extends TypeError {
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as PaginationKind, $a as ExplainReadOptions, $c as ColumnReference, $i as lower, $l as SubqueryMeta, $n as RequiredOuterScope, $o as SourceConstraint, $r as SchemaOptions, $s as boolean, $t as SqliteIndexExtension, Aa as between, Ac as ResolvedColumnBehavior, Ai as offset, Al as HasSubquery, An as UpdateAssignments, Ao as QueryValidationError, Ar as SelectionSqlTypes, As as ColumnStorageDeclarationOf, B as CastTarget, Ba as asValue, Bc as SchemaDialectName, Bi as subtract, Bl as ProvidesOuterSourceMeta, Bn as MutationSqlTypes, Bo as ConstraintTiming, Br as SchemaRenderContext, Ca as isDistinctFrom, Cc as GeneratedColumnMode, Ci as omit, Cl as ExpressionMeta, Co as qubu, Cr as leftJoin, Cs as ColumnIsGenerated, Ct as SourceIdentity, Cu as SqlTypeSatisfies, Da as lte, Dc as IdentityGeneration, Di as rowLock, Dl as GroupingKeysOf, Do as RenderedQuery, Dr as Selection, Ds as ColumnOutput, Dt as SourceSqlTypeMap, Ea as lt, Ec as IdentityDialectExtension, Ei as RowLockOptions, El as GroupingDependenciesOf, Eo as RenderOptions, Er as groupBy, Es as ColumnOptions, Et as SourceRow, Fa as isTrue, Fc as externalGeneratedColumn, Fi as SelectClause, Fl as NullabilityOf, Fn as MutationQuery, Fo as CatalogCheckSql, Fr as RenderedSchemaExpression, Ft as Table, G as DialectJson, Ga as DriverValueEncoder, Gi as jsonPath, Gl as RequiresCapabilityMeta, Gn as returning, Go as ForeignKeyOptions, Gt as table, H as DialectCapability, Ha as value, Hi as jsonBoolean, Hl as QueryCardinality, Hn as ReturningClause, Ho as FieldLikeOptions, Hr as UnsafeSchemaSqlExpression, Hs as PortableColumnStorage, Ht as TableRow, Ic as generatedColumn, Ii as add, Il as NullableSourceMeta, In as MutationReturning, Io as CheckConstraint, Is as ColumnStorageTypeOf, It as TableColumns, J as DialectRowLocking, Ja as ExecutionResult, Ji as over, Jl as RequiresOuterOf, Jn as AvailableOuterScope, Jo as KeyConstraint, Jt as IndexTerm, K as DialectOptions, Ka as ExecutionOptions, Ki as jsonText, Kl as RequiresOf, Kn as correlate, Ko as ForeignKeyTarget, Kt as IndexDialectExtension, Lc as identityColumn, Li as divide, Ll as NullableSourcesOf, Ln as MutationReturningClause, Lo as CheckConstraintOptions, Lr as SchemaExpressionErrorCode, Ls as ColumnUpdateInput, Lt as TableDefinitions, Ma as notIn, Mc as SqliteIdentityExtension, Mi as distinct, Ml as InheritedMetadata, Mn as AllowAllClause, Mo as QueryValidationIssue, Mr as SchemaDialect, Ms as ColumnStorageDialectOf, Na as isNotNull, Ni as AnySelectClause, Nl as InheritedMetadataOf, Nn as MutationClause, No as AnyKeyColumn, Nr as SchemaDialectHooks, Ns as ColumnStorageKindOf, Oa as ne, Oc as LiteralDefaultDescriptor, Oi as fetchFirst, Ol as GroupingMeta, Oo as render, Or as SelectionObject, Os as ColumnSqlType, Pa as isNull, Pc as externalDefault, Pi as ClausePlacement, Pl as MetadataOf, Pn as MutationKind, Po as CatalogCheckExpression, Ps as ColumnStorageOf, Pt as AnyTable, Q as NamedCastTarget, Qa as ExplainPlanRow, Qc as ColumnDependency, Qi as concat, Ql as SqlTypeOf, Qn as MissingScope, Qo as ReferentialAction, Qr as SchemaNamingPolicy, Qs as binary, Qt as SourceIndexesRecord, Ri as modulo, Rl as OutputOf, Rn as MutationRow, Ro as ConstraintDialectExtension, Rr as SchemaExpressionInput, Rt as TableIdentity, Sa as gte, Sc as GeneratedColumnDescriptor, Si as SelectPart, Sl as DependenciesOf, So as explain, Sr as innerJoin, Ss as ColumnInsertInput, St as SourceConstraints, Su as SqlTimestamp, Ta as like, Tc as IdentityDescriptor, Ti as RowLockClause, Tl as FragmentMeta, Tr as rightJoin, Ts as ColumnOnUpdateOf, Tt as SourceProvision, Tu as SqlUuid, U as DialectCastTypes, Ua as cast, Uc as SchemaObjectIdentity, Ui as jsonExists, Ul as RenderContext, Un as ReturningRow, Uo as ForeignKeyConstraint, Ut as TableSqlTypes, V as Dialect, Vc as SchemaMetadataDiagnostic, Vi as JsonPath, Vl as ProvidesSourceMeta, Vn as allowAll, Vo as FieldLike, Vr as SchemaRenderOptions, W as DialectExplain, Wc as SchemaObjectNameOptions, Wi as jsonNumber, Wl as RenderFunction, Wn as ReturningSqlTypes, Wo as ForeignKeyMatch, Wt as TableUpdateInput, X as ExplainRenderOptions, Xa as ExplainOptions, Xi as rowNumber, Xl as RequiresSourceMeta, Xn as ClauseScope, Xo as MysqlConstraintExtension, Xr as Schema, Xt as PostgresIndexExtension, Y as ExplainFormat, Ya as ExplainMutationOptions, Yi as rank, Yl as RequiresOuterSourceMeta, Yn as AvailableScope, Yo as KeyConstraintOptions, Yr as unsafeSchemaSql, Yt as MysqlIndexExtension, Z as JsonScalarKind, Za as ExplainOptionsFor, Zi as coalesce, Zl as ResultMeta, Zn as GroupingValidation, Zo as PostgresConstraintExtension, Zr as SchemaDiagnostic, Zs as bigint, Zt as SourceIndex, _a as notExists, _c as DefaultDescriptor, _i as and, _l as AnyFragment, _n as insertSelect, _o as StreamingTransactionalQueryAdapter, _r as FromScope, _s as ColumnDefinition, _u as SqlOrderCompatible, aa as count, ac as nativeStorage, al as ExpressionNullability, an as desc, ao as QubuExplainableStreamingTransactionalClient, ar as RecursiveCteSource, as as UniqueConstraintOptions, at as SchemaLiteralRenderer, ba as eq, bc as ExternalDefaultDescriptor, bi as Omit, bl as CardinalityMeta, bo as execute, br as crossJoin, bs as ColumnHasDefault, bt as Source, bu as SqlText, ca as min, cc as portableStorage, cl as ExpressionSqlType, cn as order, co as QubuStreamingExplainableClient, cr as recursiveCte, cs as catalogForeignKey, cu as SqlBinary, da as SqlTag, dc as uuid, di as LateralIdentity, dn as DefaultValuesSource, do as QubuTransaction, dr as SetQuery, ds as primaryKey, dt as QueryKind, du as SqlDecimal, ea as upper, ec as column, ei as SchemaTableEntry, en as TableIndex, eo as ExplainRequest, er as RequiredScope, es as SourceConstraintsRecord, et as PaginationPart, eu as VisibleDependenciesOf, fa as TypedSqlTag, fc as CanonicalLiteral, fi as LateralSource, fn as InsertSelectSource, fo as QubuTransactionalClient, fr as except, fs as references, ft as QueryRow, fu as SqlEqualityComparable, ga as inQuery, gc as ColumnDefaultInput, gi as lateral, gl as AggregateMeta, gn as insertInto, go as StreamingQueryAdapter, gr as FromClause, gs as ColumnDefaultOf, gu as SqlNumericLike, ha as exists, hc as ColumnDefault, hi as alias, hl as AggregateDependenciesOf, hn as defaultValues, ho as StreamableQuery, hr as unionAll, ht as AnySource, hu as SqlJson, ia as avg, ic as nativeColumn, il as ExpressionKind, in as asc, io as QubuExplainableClient, ir as CteSource, is as UniqueConstraint, it as RowLockWaitPolicy, ja as inList, jc as SchemaLiteralValue, ji as having, jl as HasWindow, jn as update, jo as QueryValidationErrorCode, jr as all, ka as notLike, kc as MysqlIdentityExtension, ki as fetchNext, kl as HasAggregate, kn as UpdateAssignmentValue, ko as QueryTypeValidation, kr as SelectionOutput, ks as ColumnStorage, la as sum, lc as text, li as AliasIdentity, ll as ExpressionWithOutput, ln as orderBy, lo as QubuStreamingTransaction, lr as withCte, ls as check, lt as AnyQuery, lu as SqlBoolean, ma as caseWhen, mc as ColumnBehaviorErrorCode, mi as QuerySource, mn as ValuesSource, mo as QueryExecutor, mr as union, ms as uniqueConstraint, mt as Row, mu as SqlInteger, na as schemaCall, nc as integer, ni as SchemaTableRecord, nl as AnySchemaExpression, no as ExplainableQueryAdapter, nr as SelectCardinality, ns as SqliteConstraintExtension, nt as PortableCastType, oa as countDistinct, oc as nullable, ol as ExpressionOutput, on as nullsFirst, oo as QubuExplainableTransactionalClient, or as WithClause, os as UniqueNullSemantics, ou as AnySqlType, pa as sql, pc as ColumnBehaviorError, pi as QueryAliasIdentity, pn as InsertSource, po as QueryAdapter, pr as intersect, ps as unique, pt as QuerySqlTypeMap, pu as SqlEqualityCompatible, q as DialectPagination, qa as ExecutionRequest, qi as denseRank, ql as RequiresOuterMetadataOf, qn as select, qo as ForeignKeyTargetInput, qt as IndexOptions, rc as json, ri as SchemaTableRegistry, rl as Expression, rn as OrderTerm, ro as QubuClient, rr as SelectQuery, rs as TableLike, rt as RowLockMode, sa as max, sc as numeric, si as schema, sl as ExpressionRequires, sn as nullsLast, so as QubuStreamingClient, sr as cte, ss as catalogCheck, su as SqlBigInt, ta as call, tc as date, ti as SchemaTableNames, tl as AnyExpression, tn as index, to as ExplainResult, tr as ScopeValidation, ts as SourceLike, tt as PortableCastTarget, tu as WindowMeta, ua as SqlFragment, uc as timestamp, ui as AliasedSource, ul as SchemaExpression, un as deleteFrom, uo as QubuStreamingTransactionalClient, ur as SetOperator, us as foreignKey, ut as Query, uu as SqlDate, va as scalar, vc as ExpressionDefaultDescriptor, vi as not, vl as CapabilitiesOf, vn as values, vo as TransactionOptions, vr as FromSource, vt as ProvidedSourceIdentity, vu as SqlOrderable, wa as isNotDistinctFrom, wc as GeneratedDescriptor, wi as where, wl as Fragment, wo as stream, wr as naturalJoin, wt as SourceKind, wu as SqlUnknown, xa as gt, xc as ExternalGeneratedColumnDescriptor, xi as OmittableSelectClause, xl as CardinalityOf, xo as executeRows, xr as fullJoin, xs as ColumnIdentityOf, xt as SourceColumns, xu as SqlTextLike, yc as ExpressionGeneratedColumnDescriptor, yi as or, yl as CapabilityMetadataOf, yo as TransactionalQueryAdapter, yr as from, ys as ColumnGeneratedOf, yt as ProvidedSourceRow, yu as SqlSemanticType, zc as SchemaDialectExtension, zi as multiply, zl as ProvidesOuterOf, zn as MutationScopeValidation, zo as ConstraintOptions, zr as SchemaExpressionMode, zs as NativeColumnStorage, zt as TableInsertInput } from "./types-4Q076HKo.mjs";
2
- export { 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 ColumnDefault, type ColumnDefaultInput, type ColumnDefaultOf, type ColumnDefinition, type ColumnDependency, type ColumnGeneratedOf, type ColumnHasDefault, 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 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 IdentityDescriptor, type IdentityDialectExtension, type IdentityGeneration, type IndexDialectExtension, type IndexOptions, type IndexTerm, type InheritedMetadata, type InheritedMetadataOf, type InsertSelectSource, type InsertSource, 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 MutationReturning, type MutationReturningClause, type MutationRow, type MutationScopeValidation, type MutationSqlTypes, type MysqlConstraintExtension, type MysqlIdentityExtension, type MysqlIndexExtension, type NamedCastTarget, type NativeColumnStorage, type NullabilityOf, type NullableSourceMeta, type NullableSourcesOf, type Omit, type OmittableSelectClause, 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 QubuStreamingClient, type QubuStreamingExplainableClient, type QubuStreamingTransaction, type QubuStreamingTransactionalClient, type QubuTransaction, type QubuTransactionalClient, type Query, type QueryAdapter, type QueryAliasIdentity, type QueryCardinality, type QueryExecutor, type QueryKind, type QueryRow, type QuerySource, type QuerySqlTypeMap, type QueryTypeValidation, QueryValidationError, type QueryValidationErrorCode, type QueryValidationIssue, 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 ResultMeta, 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 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 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 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, binary, boolean, call, caseWhen, cast, catalogCheck, catalogForeignKey, check, coalesce, column, concat, correlate, count, countDistinct, crossJoin, cte, date, 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, jsonBoolean, jsonExists, jsonNumber, jsonPath, jsonText, lateral, leftJoin, like, lower, lt, lte, 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, union, unionAll, unique, uniqueConstraint, unsafeSchemaSql, update, upper, uuid, value, values, where, withCte };
1
+ import { $ as PaginationKind, $a as ExecutionRequest, $c as SchemaObjectNameOptions, $i as rank, $l as InheritedMetadata, $n as AvailableScope, $o as ForeignKeyTargetInput, $r as unsafeSchemaSql, $t as PostgresIndexExtension, Aa as lt, Ac as ExternalGeneratedColumnDescriptor, Ai as RowLockOptions, Al as ResultField, Ao as stream, Ar as groupBy, As as ColumnInsertInput, At as SourceSqlTypeMap, Au as SqlBoolean, B as CastTarget, Bc as SchemaLiteralValue, Bi as add, Bl as CapabilityMetadataOf, Bn as MutationReturning, Bo as CatalogCheckExpression, Bs as ColumnStorageDialectOf, Bt as TableDefinitions, Bu as SqlSemanticType, Cc as ColumnBehaviorErrorCode, Ci as or, Co as StreamingTransactionalQueryAdapter, Cr as from, Cs as ColumnDefaultOf, Ct as SourceColumns, Da as isDistinctFrom, Dc as ExpressionDefaultDescriptor, Di as omit, Dl as ResultDecoder, Do as executeRows, Dr as leftJoin, Ds as ColumnGeneratedOf, Dt as SourceKind, Du as AnySqlType, Ea as gte, Ec as DefaultDescriptor, Ei as SelectPart, El as ResultDecodeContext, Eo as execute, Er as innerJoin, Et as SourceIdentity, Fa as inList, Fc as IdentityDialectExtension, Fi as having, Fl as timestampResultDecoder, Fn as AllowAllClause, Fo as QueryTypeValidation, Fr as all, Fs as ColumnOutput, Fu as SqlInteger, G as DialectJson, Gc as generatedColumn, Gi as JsonPath, Gl as Fragment, Gn as allowAll, Go as ConstraintOptions, Gr as SchemaRenderOptions, Gs as ColumnUpdateInput, Gt as TableRow, Gu as SqlUnknown, H as DialectCapability, Hi as modulo, Hl as CardinalityOf, Hn as MutationRow, Ho as CheckConstraint, Hr as SchemaExpressionInput, Hs as ColumnStorageOf, Ht as TableInsertInput, Hu as SqlTextLike, Ia as notIn, Ic as IdentityGeneration, Ii as distinct, Il as AggregateDependenciesOf, In as MutationClause, Io as QueryValidationError, Ir as SchemaDialect, Is as ColumnSqlType, Iu as SqlJson, J as DialectRowLocking, Ja as cast, Jc as SchemaDialectExtension, Ji as jsonNumber, Jl as GroupingKeysOf, Jn as ReturningSqlTypes, Jo as FieldLikeOptions, Jt as table, K as DialectOptions, Ka as value, Kc as identityColumn, Ki as jsonBoolean, Kl as FragmentMeta, Kn as ReturningClause, Ko as ConstraintTiming, Kr as UnsafeSchemaSqlExpression, Kt as TableSqlTypes, Ku as SqlUuid, La as isNotNull, Lc as LiteralDefaultDescriptor, Li as AnySelectClause, Ll as AggregateMeta, Ln as MutationKind, Lo as QueryValidationErrorCode, Lr as SchemaDialectHooks, Ls as ColumnStorage, Lt as AnyTable, Lu as SqlNumericLike, Ma as ne, Mc as GeneratedColumnMode, Mi as fetchFirst, Ml as booleanResultDecoder, Mn as UpdateAssignmentValue, Mo as RenderOptions, Mr as SelectionObject, Mu as SqlDecimal, Na as notLike, Nc as GeneratedDescriptor, Ni as fetchNext, Nl as dateResultDecoder, Nn as UpdateAssignments, No as RenderedQuery, Nr as SelectionOutput, Ns as ColumnOnUpdateOf, Nu as SqlEqualityComparable, Oa as isNotDistinctFrom, Oc as ExpressionGeneratedColumnDescriptor, Oi as where, Ol as ResultDecoders, Oo as explain, Or as naturalJoin, Os as ColumnHasDefault, Ot as SourceProvision, Ou as SqlBigInt, Pa as between, Pc as IdentityDescriptor, Pi as offset, Pl as jsonTextResultDecoder, Pn as update, Po as render, Pr as SelectionSqlTypes, Ps as ColumnOptions, Pu as SqlEqualityCompatible, Q as NamedCastTarget, Qa as ExecutionOptions, Qc as SchemaObjectIdentity, Qi as over, Ql as HasWindow, Qn as AvailableOuterScope, Qo as ForeignKeyTarget, Qt as MysqlIndexExtension, Ra as isNull, Rc as MysqlIdentityExtension, Ri as ClausePlacement, Rl as AnyFragment, Rn as MutationQuery, Ro as QueryValidationIssue, Rs as ColumnStorageDeclarationOf, Rt as Table, Ru as SqlOrderCompatible, Sa as scalar, Sc as ColumnBehaviorError, Si as not, So as StreamingQueryAdapter, Sr as FromSource, Ss as DeclaredColumnNullability, St as Source, Su as WindowMeta, Ta as gt, Tc as ColumnDefaultInput, Ti as OmittableSelectClause, Tl as DecodableResultType, To as TransactionalQueryAdapter, Tr as fullJoin, Ts as ColumnDefinitionConfig, Tt as SourceConstraints, U as DialectCastTypes, Uc as externalDefault, Ui as multiply, Ul as DependenciesOf, Un as MutationScopeValidation, Uo as CheckConstraintOptions, Ur as SchemaExpressionMode, Uu as SqlTimestamp, V as Dialect, Vc as SqliteIdentityExtension, Vi as divide, Vl as CardinalityMeta, Vn as MutationReturningClause, Vo as CatalogCheckSql, Vr as SchemaExpressionErrorCode, Vs as ColumnStorageKindOf, Vt as TableIdentity, Vu as SqlText, W as DialectExplain, Wa as asValue, Wc as externalGeneratedColumn, Wi as subtract, Wl as ExpressionMeta, Wn as MutationSqlTypes, Wo as ConstraintDialectExtension, Wr as SchemaRenderContext, Ws as ColumnStorageTypeOf, Wu as SqlTypeSatisfies, X as ExplainRenderOptions, Xa as AdapterExecutionResult, Xc as SchemaMetadataDiagnostic, Xi as jsonText, Xl as HasAggregate, Xn as correlate, Xo as ForeignKeyMatch, Xs as PortableColumnStorage, Xt as IndexOptions, Y as ExplainFormat, Yc as SchemaDialectName, Yi as jsonPath, Yl as GroupingMeta, Yn as returning, Yo as ForeignKeyConstraint, Yt as IndexDialectExtension, Z as JsonScalarKind, Za as DriverValueEncoder, Zi as denseRank, Zl as HasSubquery, Zn as select, Zo as ForeignKeyOptions, Zt as IndexTerm, _a as sql, _c as portableStorage, _i as QueryAliasIdentity, _l as ExpressionSqlType, _n as ValuesSource, _o as QubuTransaction, _r as intersect, _s as primaryKey, _t as AnySource, _u as RequiresSourceMeta, aa as call, ac as bigint, ai as SchemaTableNames, ao as ExplainReadOptions, ar as ScopeValidation, as as SourceConstraint, at as SchemaLiteralRenderer, au as OutputOf, ba as inQuery, bc as uuid, bi as lateral, bl as SchemaExpressionBrand, bn as insertSelect, bo as QueryExecutor, br as FromClause, bs as uniqueConstraint, bt as ProvidedSourceIdentity, bu as SubqueryMeta, ca as avg, cc as column, cl as ColumnReference, cn as desc, co as ExplainableQueryAdapter, cr as CteSource, cs as SqliteConstraintExtension, cu as ProvidesSourceMeta, da as max, dc as integer, di as schema, dl as AnySchemaExpression, dn as order, do as QubuExplainableStreamingTransactionalClient, dr as cte, ds as UniqueConstraintOptions, dt as QueryConfig, du as RenderFunction, ea as rowNumber, ei as Schema, en as SourceIndex, eo as ExecutionResult, er as ClauseScope, es as KeyConstraint, et as PaginationPart, eu as InheritedMetadataOf, fa as min, fc as json, fl as Expression, fn as orderBy, fo as QubuExplainableTransactionalClient, fr as recursiveCte, fs as UniqueNullSemantics, ft as QueryKind, fu as RequiresCapabilityMeta, ga as TypedSqlTag, gc as numeric, gi as LateralSource, gl as ExpressionRequires, gn as InsertSource, go as QubuStreamingTransactionalClient, gr as except, gs as foreignKey, gt as Row, gu as RequiresOuterSourceMeta, ha as SqlTag, hc as nullable, hi as LateralIdentity, hl as ExpressionOutput, hn as InsertSelectSource, ho as QubuStreamingTransaction, hr as SetQuery, hs as check, ht as QueryWithRow, hu as RequiresOuterOf, ia as upper, ii as SchemaTableEntry, in as index, io as ExplainPlanRow, ir as RequiredScope, is as ReferentialAction, it as RowLockWaitPolicy, iu as NullableSourcesOf, ja as lte, jc as GeneratedColumnDescriptor, ji as rowLock, jl as ResultShape, jr as Selection, js as ColumnIsGenerated, ju as SqlDate, ka as like, kc as ExternalDefaultDescriptor, ki as RowLockClause, kl as ResultDecodingError, ko as qubu, kr as rightJoin, ks as ColumnIdentityOf, kt as SourceRow, ku as SqlBinary, la as count, ln as nullsFirst, lo as QubuClient, lr as RecursiveCteSource, ls as TableLike, lt as AnyQuery, lu as QueryCardinality, ma as SqlFragment, mc as nativeStorage, mi as AliasedSource, ml as ExpressionNullability, mn as DefaultValuesSource, mo as QubuStreamingExplainableClient, mr as SetOperator, ms as catalogForeignKey, mt as QuerySqlTypeMap, mu as RequiresOuterMetadataOf, na as concat, ni as SchemaNamingPolicy, nn as SqliteIndexExtension, no as ExplainOptions, nr as MissingScope, ns as MysqlConstraintExtension, nt as PortableCastType, nu as NullabilityOf, oa as schemaCall, oc as binary, oi as SchemaTableRecord, on as OrderTerm, oo as ExplainRequest, or as SelectCardinality, os as SourceConstraintsRecord, ou as ProvidesOuterOf, pa as sum, pc as nativeColumn, pi as AliasIdentity, pl as ExpressionKind, pn as deleteFrom, po as QubuStreamingClient, pr as withCte, ps as catalogCheck, pt as QueryRow, pu as RequiresOf, q as DialectPagination, qa as mapResult, qi as jsonExists, ql as GroupingDependenciesOf, qn as ReturningRow, qo as FieldLike, qs as NativeColumnStorage, qt as TableUpdateInput, ra as lower, ri as SchemaOptions, rn as TableIndex, ro as ExplainOptionsFor, rr as RequiredOuterScope, rs as PostgresConstraintExtension, rt as RowLockMode, ru as NullableSourceMeta, sc as boolean, si as SchemaTableRegistry, sl as ColumnDependency, sn as asc, so as ExplainResult, sr as SelectQuery, ss as SourceLike, su as ProvidesOuterSourceMeta, ta as coalesce, ti as SchemaDiagnostic, tn as SourceIndexesRecord, to as ExplainMutationOptions, tr as GroupingValidation, ts as KeyConstraintOptions, tt as PortableCastTarget, tu as MetadataOf, ua as countDistinct, uc as date, ul as AnyExpression, un as nullsLast, uo as QubuExplainableClient, ur as WithClause, us as UniqueConstraint, ut as Query, uu as RenderContext, va as caseWhen, vc as text, vi as QuerySource, vl as ExpressionWithOutput, vn as defaultValues, vo as QubuTransactionalClient, vr as union, vs as references, vu as ResultMeta, wa as eq, wc as ColumnDefault, wi as Omit, wo as TransactionOptions, wr as crossJoin, ws as ColumnDefinition, wt as SourceConfig, xa as notExists, xc as CanonicalLiteral, xi as and, xn as values, xo as StreamableQuery, xr as FromScope, xt as ProvidedSourceRow, xu as VisibleDependenciesOf, ya as exists, yc as timestamp, yi as alias, yl as SchemaExpression, yn as insertInto, yo as QueryAdapter, yr as unionAll, ys as unique, yu as SqlTypeOf, za as isTrue, zc as ResolvedColumnBehavior, zi as SelectClause, zl as CapabilitiesOf, zn as MutationQueryConfig, zo as AnyKeyColumn, zr as RenderedSchemaExpression, zt as TableColumns, zu as SqlOrderable } from "./types-Deo_q43Y.mjs";
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 ColumnDefault, type ColumnDefaultInput, type ColumnDefaultOf, type ColumnDefinition, type ColumnDefinitionConfig, type ColumnDependency, type ColumnGeneratedOf, type ColumnHasDefault, 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 IdentityDescriptor, type IdentityDialectExtension, type IdentityGeneration, type IndexDialectExtension, type IndexOptions, type IndexTerm, type InheritedMetadata, type InheritedMetadataOf, type InsertSelectSource, type InsertSource, 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 NullabilityOf, type NullableSourceMeta, type NullableSourcesOf, type Omit, type OmittableSelectClause, 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 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 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, 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, jsonBoolean, jsonExists, jsonNumber, 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 };
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import { a as assertDialectCapability } from "./json-CUZlv4HT.mjs";
2
- import { c as render, n as call, o as cast, r as schemaCall, t as createClause } from "./types-Cec0xzo4.mjs";
2
+ import { c as render, n as call, o as cast, r as schemaCall, t as createClause } from "./types-g-vVvj1B.mjs";
3
3
  import { n as queryValidationError, t as QueryValidationError } from "./errors-Dxv73YJu.mjs";
4
- import { c as makeExpression, h as parenthesize, i as identifier, l as makeSchemaExpression, m as isFragment, o as isExpression, p as fragment, t as createColumnReference, u as markExpressionCategory } from "./column-CXMxx8Hq.mjs";
5
- import { i as value, t as asValue } from "./value-BvilP0oz.mjs";
6
- import { a as isDistinctFrom, c as lt, d as notLike, f as expressionOperand, i as gte, l as lte, m as renderOperands, n as eq, o as isNotDistinctFrom, p as isNullOperand, r as gt, s as like, u as ne } from "./relational-DCZrrNia.mjs";
4
+ import { A as dateResultDecoder, C as fragment, D as ResultDecodingError, F as resultValueOf, I as timestampResultDecoder, M as jsonTextResultDecoder, N as resultShapeValue, O as booleanResultDecoder, P as resultValue, T as parenthesize, _ as isSchemaExpression, b as markExpressionCategory, g as isExpression, h as snakeCaseIdentifier, i as identifier, j as decodeResultRow, k as createResultShape, m as resolveSqlNames, t as createColumnReference, v as makeExpression, w as isFragment, x as markSchemaExpression, y as makeSchemaExpression } from "./column-D-8OqGuV.mjs";
5
+ import { S as identityColumn, b as externalGeneratedColumn, c as json, d as nullable, f as numeric, g as uuid, h as timestamp, i as column, l as nativeColumn, m as text, n as binary, o as date, p as portableStorage, r as boolean, s as integer, t as bigint, u as nativeStorage, x as generatedColumn, y as externalDefault } from "./column-LV7oGQde.mjs";
6
+ import { i as value, t as asValue } from "./value-b6OFZXVS.mjs";
7
+ import { a as isDistinctFrom, c as lt, d as notLike, f as expressionOperand, i as gte, l as lte, m as renderOperands, n as eq, o as isNotDistinctFrom, p as isNullOperand, r as gt, s as like, u as ne } from "./relational-DuQ9IHSb.mjs";
7
8
  import { t as omit } from "./omit-OxV58AwX.mjs";
8
- import { n as snakeCaseIdentifier, t as resolveSqlNames } from "./naming-QVCOnSj2.mjs";
9
- import { r as exposeColumns, t as createSource } from "./source-DUoJVXmL.mjs";
10
- import { S as identityColumn, T as lateral, a as column, b as externalGeneratedColumn, c as json, d as nullable, f as numeric, g as uuid, h as timestamp, i as boolean, l as nativeColumn, m as text, n as bigint, o as date, p as portableStorage, r as binary, s as integer, t as table, u as nativeStorage, w as alias, x as generatedColumn, y as externalDefault } from "./table-llv9tsZ8.mjs";
11
- import { C as index, S as unsafeSchemaSql, c as check, d as references, f as unique, i as schema, l as foreignKey, o as catalogCheck, p as uniqueConstraint, s as catalogForeignKey, u as primaryKey } from "./registry-BufIskVN.mjs";
9
+ import { r as exposeColumns, t as createSource } from "./source-DGO3DRgg.mjs";
10
+ import { n as alias, r as lateral, t as table } from "./table-D6rcs8SB.mjs";
11
+ import { C as index, S as unsafeSchemaSql, c as check, d as references, f as unique, i as schema, l as foreignKey, o as catalogCheck, p as uniqueConstraint, s as catalogForeignKey, u as primaryKey } from "./registry-CXV8u7Pt.mjs";
12
12
  //#region src/execution.ts
13
13
  function qubu(adapter) {
14
14
  const client = createClient(adapter);
@@ -67,22 +67,34 @@ function stream(first, second, options = {}) {
67
67
  const query = isQuery(first) ? first : second;
68
68
  const adapter = isQuery(first) ? second : first;
69
69
  assertStreamableQuery(query);
70
- return adapter.stream(createExecutionRequest(query, adapter, options));
70
+ const request = createExecutionRequest(query, adapter, options);
71
+ const dialect = options.dialect ?? adapter.dialect;
72
+ return decodeResultStream(adapter.stream(request), request, adapter, dialect);
71
73
  }
72
74
  async function executeInternal(first, second, options) {
73
75
  const query = isQuery(first) ? first : second;
74
76
  const adapter = isQuery(first) ? second : first;
75
77
  const request = createExecutionRequest(query, adapter, options);
76
- return adapter.execute(request);
78
+ const result = await adapter.execute(request);
79
+ const dialect = options.dialect ?? adapter.dialect;
80
+ return {
81
+ ...result,
82
+ rows: result.rows.map((row, rowIndex) => decodeResultRow(row, request.resultShape, adapter.decoders, dialect, rowIndex))
83
+ };
77
84
  }
78
85
  function createExecutionRequest(query, adapter, options) {
79
86
  const statement = render(query, { dialect: options.dialect ?? adapter.dialect });
80
87
  return Object.freeze({
81
88
  statement,
82
89
  queryKind: query.queryKind,
90
+ resultShape: query.resultShape,
83
91
  ...options.signal === void 0 ? {} : { signal: options.signal }
84
92
  });
85
93
  }
94
+ async function* decodeResultStream(rows, request, adapter, dialect) {
95
+ let rowIndex = 0;
96
+ for await (const row of rows) yield decodeResultRow(row, request.resultShape, adapter.decoders, dialect, rowIndex++);
97
+ }
86
98
  function createExplainRequest(query, adapter, options) {
87
99
  const request = createExecutionRequest(query, adapter, options);
88
100
  if (options.analyze === true && query.queryKind !== "select" && query.queryKind !== "set") throw queryValidationError({
@@ -123,6 +135,13 @@ function isQuery(value) {
123
135
  return "render" in value && typeof value.render === "function";
124
136
  }
125
137
  //#endregion
138
+ //#region src/expressions/map-result.ts
139
+ /** Attach an application decoder to an expression without changing its SQL. */
140
+ function mapResult(expression, decoder) {
141
+ const mapped = makeExpression(expression.expressionKind, (context) => context.render(expression), expression.expressionCategory, resultValue(resultValueOf(expression)?.type, decoder));
142
+ return isSchemaExpression(expression) ? markSchemaExpression(mapped) : mapped;
143
+ }
144
+ //#endregion
126
145
  //#region src/expressions/case.ts
127
146
  function caseWhen(condition, thenValue, elseValue) {
128
147
  const thenExpression = asValue(thenValue);
@@ -264,7 +283,7 @@ function scalar(query) {
264
283
  message: "scalar() requires a query with exactly one selected column",
265
284
  hint: "Select exactly one named field before wrapping the query in scalar()."
266
285
  });
267
- return makeExpression("subquery", (context) => context.renderRelation(parenthesize(query)));
286
+ return makeExpression("subquery", (context) => context.renderRelation(parenthesize(query)), "subquery", resultShapeValue(query.resultShape, Object.keys(query.row)[0]));
268
287
  }
269
288
  //#endregion
270
289
  //#region src/expressions/json.ts
@@ -293,7 +312,7 @@ function jsonScalar(document, path, kind) {
293
312
  assertDialectCapability(context.dialect, "json");
294
313
  if (!context.dialect.json) throw new Error(`Dialect "${context.dialect.name}" advertises JSON support without a JSON renderer`);
295
314
  context.dialect.json.renderScalar(context, document, path.segments, kind);
296
- });
315
+ }, kind === "boolean" ? resultValue("boolean") : void 0);
297
316
  }
298
317
  /** Extract a JSON string, returning SQL NULL for missing, null, or non-string values. */
299
318
  function jsonText(document, path) {
@@ -313,7 +332,7 @@ function jsonExists(document, path) {
313
332
  assertDialectCapability(context.dialect, "json");
314
333
  if (!context.dialect.json) throw new Error(`Dialect "${context.dialect.name}" advertises JSON support without a JSON renderer`);
315
334
  context.dialect.json.renderExists(context, document, path.segments);
316
- });
335
+ }, resultValue("boolean"));
317
336
  }
318
337
  //#endregion
319
338
  //#region src/expressions/operators/arithmetic.ts
@@ -348,7 +367,7 @@ function composeConditions(conditions, separator, name) {
348
367
  context.append("(");
349
368
  renderOperands(context, presentConditions, separator);
350
369
  context.append(")");
351
- });
370
+ }, resultValue("boolean"));
352
371
  }
353
372
  function and(...conditions) {
354
373
  return composeConditions(conditions, " AND ", "and");
@@ -361,7 +380,7 @@ function not(condition) {
361
380
  context.append("(NOT ");
362
381
  context.render(condition);
363
382
  context.append(")");
364
- });
383
+ }, resultValue("boolean"));
365
384
  }
366
385
  //#endregion
367
386
  //#region src/expressions/operators/comparison/range.ts
@@ -377,7 +396,7 @@ function between(expression, lower, upper) {
377
396
  context.append(" AND ");
378
397
  context.render(upperExpression);
379
398
  context.append(")");
380
- });
399
+ }, resultValue("boolean"));
381
400
  }
382
401
  function inList(expression, values) {
383
402
  const valueExpressions = values.map(expressionOperand);
@@ -394,7 +413,7 @@ function inList(expression, values) {
394
413
  context.render(value);
395
414
  });
396
415
  context.append("))");
397
- });
416
+ }, resultValue("boolean"));
398
417
  }
399
418
  function notIn(expression, values) {
400
419
  const valueExpressions = values.map(expressionOperand);
@@ -411,7 +430,7 @@ function notIn(expression, values) {
411
430
  context.render(value);
412
431
  });
413
432
  context.append("))");
414
- });
433
+ }, resultValue("boolean"));
415
434
  }
416
435
  //#endregion
417
436
  //#region src/expressions/operators/comparison/subquery.ts
@@ -422,19 +441,19 @@ function inQuery(expression, query) {
422
441
  context.append(" IN ");
423
442
  context.renderRelation(parenthesize(query));
424
443
  context.append(")");
425
- });
444
+ }, "subquery", resultValue("boolean"));
426
445
  }
427
446
  function exists(query) {
428
447
  return makeExpression("subquery", (context) => {
429
448
  context.append("EXISTS ");
430
449
  context.renderRelation(parenthesize(query));
431
- });
450
+ }, "subquery", resultValue("boolean"));
432
451
  }
433
452
  function notExists(query) {
434
453
  return makeExpression("subquery", (context) => {
435
454
  context.append("NOT EXISTS ");
436
455
  context.renderRelation(parenthesize(query));
437
- });
456
+ }, "subquery", resultValue("boolean"));
438
457
  }
439
458
  //#endregion
440
459
  //#region src/expressions/operators/comparison/null.ts
@@ -443,20 +462,20 @@ function isNull(expression) {
443
462
  context.append("(");
444
463
  context.render(expression);
445
464
  context.append(" IS NULL)");
446
- });
465
+ }, resultValue("boolean"));
447
466
  }
448
467
  function isNotNull(expression) {
449
468
  return makeSchemaExpression("operator", (context) => {
450
469
  context.append("(");
451
470
  context.render(expression);
452
471
  context.append(" IS NOT NULL)");
453
- });
472
+ }, resultValue("boolean"));
454
473
  }
455
474
  function isTrue(expression) {
456
475
  return makeSchemaExpression("operator", (context) => {
457
476
  context.render(expression);
458
477
  context.append(" IS TRUE");
459
- });
478
+ }, resultValue("boolean"));
460
479
  }
461
480
  //#endregion
462
481
  //#region src/query/selection.ts
@@ -469,12 +488,20 @@ function isTrue(expression) {
469
488
  function all(source) {
470
489
  return Object.freeze({ ...source.columns });
471
490
  }
491
+ /** Build the runtime field metadata for a named projection. */
492
+ function selectionResultShape(selection) {
493
+ return createResultShape(Object.entries(selection).filter(([, expression]) => expression !== omit).map(([name, expression]) => ({
494
+ name,
495
+ ...resultValueOf(expression)
496
+ })));
497
+ }
472
498
  //#endregion
473
499
  //#region src/query/types.ts
474
- function createQuery(queryKind, row, render) {
500
+ function createQuery(queryKind, row, resultShape, render) {
475
501
  return Object.freeze({
476
502
  queryKind,
477
503
  row,
504
+ resultShape,
478
505
  ...fragment(render)
479
506
  });
480
507
  }
@@ -628,7 +655,7 @@ function select(selection, ...parts) {
628
655
  clause,
629
656
  index
630
657
  })).sort((left, right) => left.clause.order - right.clause.order || left.index - right.index).map(({ clause }) => clause);
631
- return createQuery("select", selectionRow(selection), (context) => {
658
+ return createQuery("select", selectionRow(selection), selectionResultShape(selection), (context) => {
632
659
  const beforeSelect = orderedClauses.filter((clause) => clause.placement === "before-select");
633
660
  const afterSelect = orderedClauses.filter((clause) => clause.placement === "after-select");
634
661
  const paginationClauses = afterSelect.filter((clause) => clause.clauseKind === "offset" || clause.clauseKind === "fetch");
@@ -666,6 +693,7 @@ function setOperation(operator, left, right) {
666
693
  return {
667
694
  queryKind: "set",
668
695
  row: left.row,
696
+ resultShape: left.resultShape,
669
697
  render: (context) => {
670
698
  context.render(parenthesize(left));
671
699
  context.append(` ${operator} `);
@@ -888,7 +916,7 @@ function cte(name, query) {
888
916
  const reference = identifier(name);
889
917
  const source = createSource("cte", (context) => context.render(reference), reference);
890
918
  const sqlNames = resolveSqlNames(Object.keys(query.row).map((fieldName) => ({ fieldName })));
891
- const columns = Object.fromEntries(Object.keys(query.row).map((fieldName) => [fieldName, createColumnReference(sqlNames[fieldName], reference, fieldName)]));
919
+ const columns = Object.fromEntries(Object.keys(query.row).map((fieldName) => [fieldName, createColumnReference(sqlNames[fieldName], reference, fieldName, resultShapeValue(query.resultShape, fieldName))]));
892
920
  Object.assign(source, {
893
921
  cteName: name,
894
922
  query,
@@ -906,7 +934,7 @@ function recursiveCte(name, anchor, member) {
906
934
  const reference = identifier(name);
907
935
  const source = createSource("cte", (context) => context.render(reference), reference);
908
936
  const sqlNames = resolveSqlNames(Object.keys(anchor.row).map((fieldName) => ({ fieldName })));
909
- const columns = Object.fromEntries(Object.keys(anchor.row).map((fieldName) => [fieldName, createColumnReference(sqlNames[fieldName], reference, fieldName)]));
937
+ const columns = Object.fromEntries(Object.keys(anchor.row).map((fieldName) => [fieldName, createColumnReference(sqlNames[fieldName], reference, fieldName, resultShapeValue(anchor.resultShape, fieldName))]));
910
938
  Object.assign(source, {
911
939
  cteName: name,
912
940
  query: anchor,
@@ -915,7 +943,7 @@ function recursiveCte(name, anchor, member) {
915
943
  exposeColumns(source, columns);
916
944
  const memberQuery = member(source);
917
945
  const query = Object.freeze({
918
- ...createQuery("set", anchor.row, (context) => {
946
+ ...createQuery("set", anchor.row, anchor.resultShape, (context) => {
919
947
  context.render(anchor);
920
948
  context.append(" UNION ALL ");
921
949
  context.render(memberQuery);
@@ -950,10 +978,11 @@ function withCte(...ctes) {
950
978
  }
951
979
  //#endregion
952
980
  //#region src/query/mutation/types.ts
953
- function createMutation(queryKind, row, render) {
981
+ function createMutation(queryKind, row, resultShape, render) {
954
982
  return {
955
983
  queryKind,
956
984
  row,
985
+ resultShape,
957
986
  render
958
987
  };
959
988
  }
@@ -1024,7 +1053,7 @@ function insertSelect(query, columns) {
1024
1053
  function insertInto(table, source, ...clauses) {
1025
1054
  validateInsert(table, source);
1026
1055
  const insertClauses = clauses;
1027
- return createMutation("insert", insertClauses.find((clause) => clause.clauseKind === "returning")?.row ?? {}, (context) => {
1056
+ return createMutation("insert", insertClauses.find((clause) => clause.clauseKind === "returning")?.row ?? {}, insertClauses.find((clause) => clause.clauseKind === "returning")?.resultShape ?? { fields: [] }, (context) => {
1028
1057
  context.append("INSERT INTO ");
1029
1058
  context.render(table.reference);
1030
1059
  if (source.insertKind === "values") {
@@ -1186,7 +1215,7 @@ function update(table, assignments, ...clauses) {
1186
1215
  const entries = validateUpdate(table, assignments);
1187
1216
  const whereClause = normalizedClauses.find((clause) => clause.clauseKind === "where");
1188
1217
  const returningClause = normalizedClauses.find((clause) => clause.clauseKind === "returning");
1189
- return createMutation("update", returningClause?.row ?? {}, (context) => {
1218
+ return createMutation("update", returningClause?.row ?? {}, returningClause?.resultShape ?? { fields: [] }, (context) => {
1190
1219
  context.append("UPDATE ");
1191
1220
  context.render(table.reference);
1192
1221
  context.append(" SET ");
@@ -1246,7 +1275,7 @@ function deleteFrom(table, ...clauses) {
1246
1275
  validateMutationClauses("DELETE", normalizedClauses);
1247
1276
  const whereClause = normalizedClauses.find((clause) => clause.clauseKind === "where");
1248
1277
  const returningClause = normalizedClauses.find((clause) => clause.clauseKind === "returning");
1249
- return createMutation("delete", returningClause?.row ?? {}, (context) => {
1278
+ return createMutation("delete", returningClause?.row ?? {}, returningClause?.resultShape ?? { fields: [] }, (context) => {
1250
1279
  context.append("DELETE FROM ");
1251
1280
  context.render(table.reference);
1252
1281
  if (whereClause) {
@@ -1266,6 +1295,7 @@ function returning(selection) {
1266
1295
  clauseKind: "returning",
1267
1296
  selection,
1268
1297
  row: selectionRow(selection),
1298
+ resultShape: selectionResultShape(selection),
1269
1299
  render(context) {
1270
1300
  context.append("RETURNING ");
1271
1301
  renderSelection(selection, context);
@@ -1273,4 +1303,4 @@ function returning(selection) {
1273
1303
  });
1274
1304
  }
1275
1305
  //#endregion
1276
- export { QueryValidationError, add, alias, all, allowAll, and, asValue, asc, avg, between, bigint, binary, boolean, call, caseWhen, cast, catalogCheck, catalogForeignKey, check, coalesce, column, concat, correlate, count, countDistinct, crossJoin, cte, date, 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, jsonBoolean, jsonExists, jsonNumber, jsonPath, jsonText, lateral, leftJoin, like, lower, lt, lte, 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, union, unionAll, unique, uniqueConstraint, unsafeSchemaSql, update, upper, uuid, value, values, where, withCte };
1306
+ export { QueryValidationError, ResultDecodingError, add, alias, all, allowAll, and, asValue, asc, avg, between, bigint, 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, jsonBoolean, jsonExists, jsonNumber, 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,5 +1,5 @@
1
- import { $ as CatalogTrigger, A as CatalogNamespace, At as CatalogQuery, B as CatalogPrimaryKeyConstraint, C as CatalogForeignKeyTarget, Ct as IntrospectionDiagnosticCode, D as CatalogIndexTerm, Dt as createIntrospectionDiagnostic, E as CatalogIndex, Et as IntrospectionError, F as CatalogOpaqueObject, G as CatalogRoutine, H as CatalogProvenanceKind, I as CatalogOwnership, J as CatalogSequence, K as CatalogRoutineParameter, L as CatalogPartition, M as CatalogObjectBase, N as CatalogObjectMetadata, O as CatalogIntrospector, Ot as hasIntrospectionErrors, P as CatalogObjectReference, Q as CatalogTable, R as CatalogPolicy, S as CatalogForeignKeyConstraint, St as IntrospectionDiagnostic, T as CatalogIdentity, Tt as IntrospectionDiagnosticSeverity, U as CatalogQueryRow, V as CatalogProvenance, W as CatalogReference, X as CatalogSqlExpression, Y as CatalogServerInfo, Z as CatalogStorageType, _ as CatalogEntityReference, _t as CatalogIdentityPolicy, a as CatalogCollation, at as CatalogView, b as CatalogExpressionFact, bt as CatalogResolvedIdentity, c as CatalogCompleteObject, ct as IntrospectionFailure, d as CatalogDeferredObject, dt as IntrospectionResult, et as CatalogUniqueConstraint, f as CatalogDeferredObjectKind, ft as IntrospectionSuccess, g as CatalogEntityKind, gt as CatalogIdentityHints, h as CatalogDomain, ht as CatalogIdentityHint, i as CatalogClassificationConfidence, it as CatalogVersion, j as CatalogObject, jt as CatalogQueryOptions, k as CatalogLiteralFact, kt as CatalogConnection, l as CatalogConstraint, lt as IntrospectionMode, m as CatalogDialectExtension, mt as CatalogIdentityFallback, n as CatalogCatalogReference, nt as CatalogUnknownObject, o as CatalogColumn, ot as CompleteIntrospectionCatalog, p as CatalogDialect, pt as CatalogIdentityEntityKind, q as CatalogScalar, r as CatalogCheckConstraint, rt as CatalogValueFact, s as CatalogComment, st as IntrospectionCatalog, t as CatalogCapabilities, tt as CatalogUnknownField, u as CatalogData, ut as IntrospectionOptions, v as CatalogEnum, vt as CatalogIdentitySource, w as CatalogGeneratedColumn, wt as IntrospectionDiagnosticInput, x as CatalogExtensionObject, xt as introspectedPhysicalIdentityPolicy, y as CatalogEnumValue, yt as CatalogPreviousSnapshotIdentitySource, z as CatalogPortableStorageType } from "./types-BX0mckiU.mjs";
2
- import { t as CompleteSchemaSnapshot } from "./complete-types-BdFqUfbb.mjs";
1
+ import { $ as CatalogTrigger, A as CatalogNamespace, At as CatalogQuery, B as CatalogPrimaryKeyConstraint, C as CatalogForeignKeyTarget, Ct as IntrospectionDiagnosticCode, D as CatalogIndexTerm, Dt as createIntrospectionDiagnostic, E as CatalogIndex, Et as IntrospectionError, F as CatalogOpaqueObject, G as CatalogRoutine, H as CatalogProvenanceKind, I as CatalogOwnership, J as CatalogSequence, K as CatalogRoutineParameter, L as CatalogPartition, M as CatalogObjectBase, N as CatalogObjectMetadata, O as CatalogIntrospector, Ot as hasIntrospectionErrors, P as CatalogObjectReference, Q as CatalogTable, R as CatalogPolicy, S as CatalogForeignKeyConstraint, St as IntrospectionDiagnostic, T as CatalogIdentity, Tt as IntrospectionDiagnosticSeverity, U as CatalogQueryRow, V as CatalogProvenance, W as CatalogReference, X as CatalogSqlExpression, Y as CatalogServerInfo, Z as CatalogStorageType, _ as CatalogEntityReference, _t as CatalogIdentityPolicy, a as CatalogCollation, at as CatalogView, b as CatalogExpressionFact, bt as CatalogResolvedIdentity, c as CatalogCompleteObject, ct as IntrospectionFailure, d as CatalogDeferredObject, dt as IntrospectionResult, et as CatalogUniqueConstraint, f as CatalogDeferredObjectKind, ft as IntrospectionSuccess, g as CatalogEntityKind, gt as CatalogIdentityHints, h as CatalogDomain, ht as CatalogIdentityHint, i as CatalogClassificationConfidence, it as CatalogVersion, j as CatalogObject, jt as CatalogQueryOptions, k as CatalogLiteralFact, kt as CatalogConnection, l as CatalogConstraint, lt as IntrospectionMode, m as CatalogDialectExtension, mt as CatalogIdentityFallback, n as CatalogCatalogReference, nt as CatalogUnknownObject, o as CatalogColumn, ot as CompleteIntrospectionCatalog, p as CatalogDialect, pt as CatalogIdentityEntityKind, q as CatalogScalar, r as CatalogCheckConstraint, rt as CatalogValueFact, s as CatalogComment, st as IntrospectionCatalog, t as CatalogCapabilities, tt as CatalogUnknownField, u as CatalogData, ut as IntrospectionOptions, v as CatalogEnum, vt as CatalogIdentitySource, w as CatalogGeneratedColumn, wt as IntrospectionDiagnosticInput, x as CatalogExtensionObject, xt as introspectedPhysicalIdentityPolicy, y as CatalogEnumValue, yt as CatalogPreviousSnapshotIdentitySource, z as CatalogPortableStorageType } from "./types-CSNJTYaM.mjs";
2
+ import { t as CompleteSchemaSnapshot } from "./complete-types-BavBtv8J.mjs";
3
3
  //#region src/introspection/catalog.d.ts
4
4
  /**
5
5
  * Materialize every optional object-family collection and deeply freeze the
@@ -1,5 +1,5 @@
1
1
  import { a as toSnapshotJsonValue } from "./canonical-BbnqavJm.mjs";
2
- import { a as hasIntrospectionErrors, i as createIntrospectionDiagnostic, n as introspectedPhysicalIdentityPolicy, r as IntrospectionError, t as mapCatalogToSnapshot } from "./snapshot-CWPgzxNx.mjs";
2
+ import { a as hasIntrospectionErrors, i as createIntrospectionDiagnostic, n as introspectedPhysicalIdentityPolicy, r as IntrospectionError, t as mapCatalogToSnapshot } from "./snapshot-DJpfmxhQ.mjs";
3
3
  import { n as assertCompleteSchemaSnapshot } from "./complete-D5Djh-zo.mjs";
4
4
  import "./snapshot.mjs";
5
5
  //#region src/introspection/catalog.ts
@@ -1,5 +1,5 @@
1
- import { T as SnapshotJsonValue, m as SnapshotDialect } from "./types-4Q076HKo.mjs";
2
- import { S as SnapshotDiffPath, _ as SnapshotDiffObjectKind, b as SnapshotDiffOperationType, f as SnapshotDiffDiagnostic, g as SnapshotDiffObject, m as SnapshotDiffEvidence, u as SnapshotDiff } from "./index-Dug5HnLB.mjs";
1
+ import { T as SnapshotJsonValue, m as SnapshotDialect } from "./types-Deo_q43Y.mjs";
2
+ import { S as SnapshotDiffPath, _ as SnapshotDiffObjectKind, b as SnapshotDiffOperationType, f as SnapshotDiffDiagnostic, g as SnapshotDiffObject, m as SnapshotDiffEvidence, u as SnapshotDiff } from "./index-D3ZOwPT-.mjs";
3
3
  //#region src/migration/types.d.ts
4
4
  /** The versioned envelope tag for dialect-neutral migration plans. */
5
5
  declare const migrationPlanFormat: "qubu-migration-plan";
@@ -1,8 +1,8 @@
1
- import { r as isColumnReference } from "./column-CXMxx8Hq.mjs";
2
- import { A as isValidSchemaObjectName, _ as isUnsafeSchemaSql, m as validateConstraintDialect, w as validateIndexDialect, y as renderSchemaExpression } from "./registry-BufIskVN.mjs";
1
+ import { d as isValidSchemaObjectName, r as isColumnReference } from "./column-D-8OqGuV.mjs";
2
+ import { _ as isUnsafeSchemaSql, m as validateConstraintDialect, w as validateIndexDialect, y as renderSchemaExpression } from "./registry-CXV8u7Pt.mjs";
3
3
  import { t as createSchemaDialect } from "./dialect-b2-Z6uBF.mjs";
4
4
  import { a as toSnapshotJsonValue } from "./canonical-BbnqavJm.mjs";
5
- import { n as createSchemaSnapshot, s as tryCreateSchemaSnapshot } from "./serialize-PF1cfH2P.mjs";
5
+ import { n as createSchemaSnapshot, s as tryCreateSchemaSnapshot } from "./serialize-CFtYYAdk.mjs";
6
6
  import { mysqlDialect } from "./mysql.mjs";
7
7
  //#region src/snapshot/mysql.ts
8
8
  /** MySQL's v1 snapshot extension identity. */
package/dist/mysql.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { V as Dialect } from "./types-4Q076HKo.mjs";
1
+ import { V as Dialect } from "./types-Deo_q43Y.mjs";
2
2
  //#region src/dialects/mysql.d.ts
3
3
  declare function mysqlDialect(): Dialect<"json" | "row-locking">;
4
4
  //#endregion
@@ -1,8 +1,9 @@
1
1
  import { a as assertDialectCapability } from "./json-CUZlv4HT.mjs";
2
2
  import { n as queryValidationError } from "./errors-Dxv73YJu.mjs";
3
- import { i as identifier, o as isExpression, p as fragment, t as createColumnReference } from "./column-CXMxx8Hq.mjs";
3
+ import { C as fragment, g as isExpression, i as identifier, t as createColumnReference } from "./column-D-8OqGuV.mjs";
4
+ import { a as columnResultValue } from "./column-LV7oGQde.mjs";
4
5
  import { t as omit } from "./omit-OxV58AwX.mjs";
5
- import { r as exposeColumns, t as createSource } from "./source-DUoJVXmL.mjs";
6
+ import { r as exposeColumns, t as createSource } from "./source-DGO3DRgg.mjs";
6
7
  //#region src/query/mutation/on-conflict.ts
7
8
  /** Columns from the proposed INSERT row, available inside DO UPDATE. */
8
9
  function excluded(table) {
@@ -11,7 +12,7 @@ function excluded(table) {
11
12
  context.append("excluded");
12
13
  });
13
14
  const source = createSource("excluded", (context) => context.render(reference), reference);
14
- const columns = Object.fromEntries(Object.keys(table.definitions).map((fieldName) => [fieldName, createColumnReference(table.sqlNames[fieldName] ?? fieldName, reference, fieldName)]));
15
+ const columns = Object.fromEntries(Object.keys(table.definitions).map((fieldName) => [fieldName, createColumnReference(table.sqlNames[fieldName] ?? fieldName, reference, fieldName, columnResultValue(table.definitions[fieldName]))]));
15
16
  Object.assign(source, { columns });
16
17
  exposeColumns(source, columns);
17
18
  return source;
@@ -1,7 +1,8 @@
1
- import { A as isValidSchemaObjectName, _ as isUnsafeSchemaSql, m as validateConstraintDialect, w as validateIndexDialect, y as renderSchemaExpression } from "./registry-BufIskVN.mjs";
1
+ import { d as isValidSchemaObjectName } from "./column-D-8OqGuV.mjs";
2
+ import { _ as isUnsafeSchemaSql, m as validateConstraintDialect, w as validateIndexDialect, y as renderSchemaExpression } from "./registry-CXV8u7Pt.mjs";
2
3
  import { t as createSchemaDialect } from "./dialect-b2-Z6uBF.mjs";
3
4
  import { a as toSnapshotJsonValue } from "./canonical-BbnqavJm.mjs";
4
- import { n as createSchemaSnapshot, s as tryCreateSchemaSnapshot } from "./serialize-PF1cfH2P.mjs";
5
+ import { n as createSchemaSnapshot, s as tryCreateSchemaSnapshot } from "./serialize-CFtYYAdk.mjs";
5
6
  import { postgresDialect } from "./postgres.mjs";
6
7
  //#region src/snapshot/postgres.ts
7
8
  /** PostgreSQL's v1 snapshot extension identity. */
@@ -1,4 +1,4 @@
1
- import { Cl as ExpressionMeta, Cn as ExcludedSource, Dn as excluded, En as doUpdate, Gl as RequiresCapabilityMeta, Ia as Operand, La as OperandNullability, On as onConflict, Pl as MetadataOf, Ra as OperandSqlType, Sn as DoUpdateAction, Tn as doNothing, V as Dialect, Zl as ResultMeta, bn as ConflictTarget, ll as ExpressionWithOutput, lu as SqlBoolean, ou as AnySqlType, ul as SchemaExpression, wn as OnConflictClause, wu as SqlUnknown, xn as DoNothingAction, xu as SqlTextLike, ya as ComparisonValidation, yn as ConflictAction, za as SqlCapabilityValidation } from "./types-4Q076HKo.mjs";
1
+ import { An as excluded, Au as SqlBoolean, Ba as Operand, Ca as ComparisonValidation, Cn as ConflictTarget, Dn as OnConflictClause, Du as AnySqlType, En as ExcludedSource, Gu as SqlUnknown, Ha as OperandSqlType, Hu as SqlTextLike, On as doNothing, Sn as ConflictAction, Tn as DoUpdateAction, Ua as SqlCapabilityValidation, V as Dialect, Va as OperandNullability, Wl as ExpressionMeta, fu as RequiresCapabilityMeta, jn as onConflict, kn as doUpdate, tu as MetadataOf, vl as ExpressionWithOutput, vu as ResultMeta, wn as DoNothingAction, yl as SchemaExpression } from "./types-Deo_q43Y.mjs";
2
2
  //#region src/dialects/postgres.d.ts
3
3
  /**
4
4
  * PostgreSQL's only core rendering difference is positional parameters.
package/dist/postgres.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { n as postgresJson, o as createDialect } from "./json-CUZlv4HT.mjs";
2
- import { f as withDialectCapability } from "./column-CXMxx8Hq.mjs";
3
- import { t as comparison } from "./relational-DCZrrNia.mjs";
2
+ import { S as withDialectCapability } from "./column-D-8OqGuV.mjs";
3
+ import { t as comparison } from "./relational-DuQ9IHSb.mjs";
4
4
  import { n as postgresExplain } from "./explain-CkIK13L_.mjs";
5
- import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-BxnxubMb.mjs";
5
+ import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-4MOBl51J.mjs";
6
6
  //#region src/dialects/postgres.ts
7
7
  const postgresRowLockModeSql = {
8
8
  update: "UPDATE",