qubu 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen.d.mts +1 -1
- package/dist/{table-llv9tsZ8.mjs → column-CYMbKbOy.mjs} +3 -97
- package/dist/{complete-types-BdFqUfbb.d.mts → complete-types-B2PO6wQD.d.mts} +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/ddl.d.mts +2 -2
- package/dist/diff.d.mts +1 -1
- package/dist/drizzle-mysql.d.mts +3 -3
- package/dist/drizzle-mysql.mjs +1 -1
- package/dist/drizzle-postgres.d.mts +3 -3
- package/dist/drizzle-postgres.mjs +1 -1
- package/dist/drizzle-sqlite.d.mts +30 -4
- package/dist/drizzle-sqlite.mjs +29 -3
- package/dist/drizzle.d.mts +1 -1
- package/dist/{index-Ds7-mhJi.d.mts → index-7qc6OcIC.d.mts} +2 -2
- package/dist/{index-Dug5HnLB.d.mts → index-CqWnouTK.d.mts} +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -1
- package/dist/introspection.d.mts +2 -2
- package/dist/migration.d.mts +2 -2
- package/dist/mysql.d.mts +1 -1
- package/dist/postgres.d.mts +2 -2
- package/dist/{runtime-BTr-MTlo.mjs → runtime-Cn_Xgzta.mjs} +1 -1
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +2 -1
- package/dist/snapshot.d.mts +3 -3
- package/dist/sqlite.d.mts +1 -1
- package/dist/table-CCUJ60rB.mjs +97 -0
- package/dist/{types-CO1KaRNc.d.mts → types-Ctlxz1ip.d.mts} +2 -3
- package/dist/{types-4Q076HKo.d.mts → types-D8M1yZF4.d.mts} +2 -2
- package/dist/{types-BX0mckiU.d.mts → types-LBt5rclR.d.mts} +1 -1
- package/docs/guides/drizzle.md +34 -6
- package/package.json +3 -3
package/dist/codegen.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { St as IntrospectionDiagnostic, dt as IntrospectionResult, i as CatalogClassificationConfidence, p as CatalogDialect, z as CatalogPortableStorageType } from "./types-
|
|
1
|
+
import { St as IntrospectionDiagnostic, dt as IntrospectionResult, i as CatalogClassificationConfidence, p as CatalogDialect, z as CatalogPortableStorageType } from "./types-LBt5rclR.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';
|
|
@@ -1,55 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as exposeColumns, t as createSource } from "./source-DUoJVXmL.mjs";
|
|
4
|
-
import { M as materializeSchemaObjectRecord, O as freezeSchemaMetadata } from "./registry-BufIskVN.mjs";
|
|
5
|
-
//#region src/schema/alias.ts
|
|
6
|
-
function alias(sourceOrQuery, name) {
|
|
7
|
-
const input = sourceOrQuery;
|
|
8
|
-
const reference = identifier(name);
|
|
9
|
-
const isQuery = "queryKind" in input;
|
|
10
|
-
const source = createSource(isQuery ? "query-alias" : "table-alias", (context) => {
|
|
11
|
-
if (isQuery) context.renderRelation(parenthesize(input));
|
|
12
|
-
else context.render(input);
|
|
13
|
-
context.append(" AS ");
|
|
14
|
-
context.render(reference);
|
|
15
|
-
}, reference);
|
|
16
|
-
const fieldNames = isQuery ? Object.keys(input.row) : Object.keys(input.columns);
|
|
17
|
-
const querySqlNames = isQuery ? resolveSqlNames(fieldNames.map((fieldName) => ({ fieldName }))) : void 0;
|
|
18
|
-
const columns = Object.fromEntries(fieldNames.map((fieldName) => {
|
|
19
|
-
const columnName = isQuery ? querySqlNames[fieldName] : input.columns[fieldName].columnName;
|
|
20
|
-
return [fieldName, createColumnReference(columnName, reference, fieldName)];
|
|
21
|
-
}));
|
|
22
|
-
Object.assign(source, {
|
|
23
|
-
alias: name,
|
|
24
|
-
base: isQuery ? void 0 : input,
|
|
25
|
-
query: isQuery ? input : void 0,
|
|
26
|
-
constraints: isQuery ? {} : input.constraints,
|
|
27
|
-
indexes: isQuery ? {} : "indexes" in input ? input.indexes : {},
|
|
28
|
-
columns
|
|
29
|
-
});
|
|
30
|
-
exposeColumns(source, columns);
|
|
31
|
-
return source;
|
|
32
|
-
}
|
|
33
|
-
/** Render a query as a LATERAL source whose outer requirements stay visible. */
|
|
34
|
-
function lateral(query, name) {
|
|
35
|
-
const reference = identifier(name);
|
|
36
|
-
const source = createSource("lateral", (context) => {
|
|
37
|
-
context.append("LATERAL ");
|
|
38
|
-
context.renderRelation(parenthesize(query));
|
|
39
|
-
context.append(" AS ");
|
|
40
|
-
context.render(reference);
|
|
41
|
-
}, reference);
|
|
42
|
-
const sqlNames = resolveSqlNames(Object.keys(query.row).map((fieldName) => ({ fieldName })));
|
|
43
|
-
const columns = Object.fromEntries(Object.keys(query.row).map((fieldName) => [fieldName, createColumnReference(sqlNames[fieldName], reference, fieldName)]));
|
|
44
|
-
Object.assign(source, {
|
|
45
|
-
alias: name,
|
|
46
|
-
query,
|
|
47
|
-
columns
|
|
48
|
-
});
|
|
49
|
-
exposeColumns(source, columns);
|
|
50
|
-
return source;
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
1
|
+
import { s as isSchemaExpression } from "./column-CXMxx8Hq.mjs";
|
|
2
|
+
import { O as freezeSchemaMetadata } from "./registry-BufIskVN.mjs";
|
|
53
3
|
//#region src/schema/column-behavior.ts
|
|
54
4
|
/** A column behavior error with a stable code and optional property path. */
|
|
55
5
|
var ColumnBehaviorError = class extends TypeError {
|
|
@@ -337,48 +287,4 @@ function binary(options) {
|
|
|
337
287
|
return withPortableStorage(withPortableCast(column(options), "binary"), "binary");
|
|
338
288
|
}
|
|
339
289
|
//#endregion
|
|
340
|
-
|
|
341
|
-
function table(name, definitions, metadata) {
|
|
342
|
-
const source = createSource("table", (context) => context.render(identifier(name)), identifier(name));
|
|
343
|
-
const sqlNames = resolveSqlNames(Object.entries(definitions).map(([fieldName, definition]) => ({
|
|
344
|
-
fieldName,
|
|
345
|
-
sqlName: definition.sqlName
|
|
346
|
-
})));
|
|
347
|
-
const columns = Object.fromEntries(Object.keys(definitions).map((fieldName) => {
|
|
348
|
-
const sqlName = sqlNames[fieldName];
|
|
349
|
-
return [fieldName, createColumnReference(sqlName, source.reference, fieldName)];
|
|
350
|
-
}));
|
|
351
|
-
Object.assign(source, {
|
|
352
|
-
tableName: name,
|
|
353
|
-
definitions,
|
|
354
|
-
sqlNames,
|
|
355
|
-
columns,
|
|
356
|
-
constraints: {},
|
|
357
|
-
indexes: {}
|
|
358
|
-
});
|
|
359
|
-
exposeColumns(source, columns);
|
|
360
|
-
const resolvedMetadata = metadata ? metadata(source) : {
|
|
361
|
-
constraints: {},
|
|
362
|
-
indexes: {}
|
|
363
|
-
};
|
|
364
|
-
const constraints = materializeSchemaObjectRecord(resolvedMetadata.constraints, "constraint");
|
|
365
|
-
const indexes = Object.fromEntries(Object.entries(resolvedMetadata.indexes).map(([indexName, tableIndex]) => {
|
|
366
|
-
const candidateKey = tableIndex.unique && tableIndex.predicate === void 0 && tableIndex.terms.every((term) => {
|
|
367
|
-
const expression = "orderKind" in term ? term.expression : term;
|
|
368
|
-
return expression.expressionKind === "column" && definitions[expression.fieldName]?.nullable === false;
|
|
369
|
-
});
|
|
370
|
-
return [indexName, Object.freeze({
|
|
371
|
-
...tableIndex,
|
|
372
|
-
candidateKey
|
|
373
|
-
})];
|
|
374
|
-
}));
|
|
375
|
-
const namedIndexes = materializeSchemaObjectRecord(indexes, "index");
|
|
376
|
-
Object.assign(source, {
|
|
377
|
-
...resolvedMetadata,
|
|
378
|
-
constraints,
|
|
379
|
-
indexes: namedIndexes
|
|
380
|
-
});
|
|
381
|
-
return source;
|
|
382
|
-
}
|
|
383
|
-
//#endregion
|
|
384
|
-
export { resolveColumnBehavior as C, identityColumn as S, lateral as T, ColumnBehaviorError as _, column as a, externalGeneratedColumn as b, json as c, nullable as d, numeric as f, uuid as g, timestamp as h, boolean as i, nativeColumn as l, text as m, bigint as n, date as o, portableStorage as p, binary as r, integer as s, table as t, nativeStorage as u, canonicalLiteral as v, alias as w, generatedColumn as x, externalDefault as y };
|
|
290
|
+
export { resolveColumnBehavior as S, canonicalLiteral as _, date as a, generatedColumn as b, nativeColumn as c, numeric as d, portableStorage as f, ColumnBehaviorError as g, uuid as h, column as i, nativeStorage as l, timestamp as m, binary as n, integer as o, text as p, boolean as r, json as s, bigint as t, nullable as u, externalDefault as v, identityColumn as x, externalGeneratedColumn as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as SnapshotStorage, D as SnapshotLiteral, O as SnapshotNamingPolicy, T as SnapshotJsonValue, b as SnapshotGeneratedColumn, d as SnapshotDefault, f as SnapshotDiagnostic, g as SnapshotExpression, h as SnapshotDialectExtension, i as SchemaSnapshotInput, m as SnapshotDialect } from "./types-
|
|
1
|
+
import { A as SnapshotStorage, D as SnapshotLiteral, O as SnapshotNamingPolicy, T as SnapshotJsonValue, b as SnapshotGeneratedColumn, d as SnapshotDefault, f as SnapshotDiagnostic, g as SnapshotExpression, h as SnapshotDialectExtension, i as SchemaSnapshotInput, m as SnapshotDialect } from "./types-D8M1yZF4.mjs";
|
|
2
2
|
//#region src/snapshot/complete-types.d.ts
|
|
3
3
|
/** The stable envelope tag shared by Snapshot v1 and the complete model. */
|
|
4
4
|
declare const completeSchemaSnapshotFormat: "qubu-schema";
|
package/dist/core.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as PaginationKind, $l as
|
|
1
|
+
import { $ as PaginationKind, $l as ResultMeta, Al as GroupingMeta, B as CastTarget, Bl as OutputOf, Cl as CardinalityOf, Cu as SqlTextLike, Dl as FragmentMeta, Do as RenderedQuery, Du as SqlUuid, El as Fragment, Eo as RenderOptions, Eu as SqlUnknown, Fi as SelectClause, Fl as InheritedMetadataOf, G as DialectJson, Gl as RenderContext, H as DialectCapability, Hl as ProvidesOuterSourceMeta, Il as MetadataOf, J as DialectRowLocking, Jl as RequiresOf, K as DialectOptions, Kl as RenderFunction, Ll as NullabilityOf, Ml as HasSubquery, Nl as HasWindow, Ol as GroupingDependenciesOf, Oo as render, Pi as ClausePlacement, Pl as InheritedMetadata, Q as NamedCastTarget, Ql as RequiresSourceMeta, Rl as NullableSourceMeta, Sl as CardinalityMeta, Su as SqlText, Tl as ExpressionMeta, To as RenderCapabilityValidation, Tu as SqlTypeSatisfies, U as DialectCastTypes, Ul as ProvidesSourceMeta, V as Dialect, Va as typedValue, Vl as ProvidesOuterOf, W as DialectExplain, Wa as typedCast, Wl as QueryCardinality, X as ExplainRenderOptions, Xl as RequiresOuterOf, Y as ExplainFormat, Yl as RequiresOuterMetadataOf, Z as JsonScalarKind, Zl as RequiresOuterSourceMeta, _l as AggregateDependenciesOf, _u as SqlJson, at as SchemaLiteralRenderer, au as isFragment, bl as CapabilitiesOf, bu as SqlOrderable, ct as resolveCastTarget, cu as AnySqlType, du as SqlBoolean, et as PaginationPart, eu as SqlTypeOf, fu as SqlDate, gl as withDialectCapability, gu as SqlInteger, hl as markExpressionCategory, hu as SqlEqualityCompatible, il as Expression, it as RowLockWaitPolicy, iu as fragment, jl as HasAggregate, kl as GroupingKeysOf, lu as SqlBigInt, ml as makeExpression, mu as SqlEqualityComparable, nt as PortableCastType, nu as VisibleDependenciesOf, ot as assertDialectCapability, ou as parenthesize, pl as isExpression, pu as SqlDecimal, q as DialectPagination, ql as RequiresCapabilityMeta, ra as typedCall, rt as RowLockMode, ru as WindowMeta, st as createDialect, su as sequence, tl as expressionFragment, tt as PortableCastTarget, tu as SubqueryMeta, uu as SqlBinary, vl as AggregateMeta, vu as SqlNumericLike, wl as DependenciesOf, wu as SqlTimestamp, xl as CapabilityMetadataOf, xu as SqlSemanticType, yl as AnyFragment, yu as SqlOrderCompatible, zl as NullableSourcesOf } from "./types-D8M1yZF4.mjs";
|
|
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/ddl.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mr as SchemaDialect } from "./types-
|
|
1
|
+
import { Mr as SchemaDialect } from "./types-D8M1yZF4.mjs";
|
|
2
2
|
import { MigrationLockRequirement, MigrationOperation, MigrationPlan, MigrationTransactionRequirement } from "./migration.mjs";
|
|
3
3
|
//#region src/ddl/types.d.ts
|
|
4
4
|
/** Stable diagnostic categories produced before a migration is rendered. */
|
|
@@ -110,7 +110,7 @@ declare function ddlEmitterForDialect(dialect: SchemaDialect): DdlEmitter;
|
|
|
110
110
|
declare function emitMigrationPlan(plan: MigrationPlan, dialect: SchemaDialect, options?: DdlEmissionOptions): DdlEmission;
|
|
111
111
|
/** Convenient defaults for callers that already selected a plan dialect. */
|
|
112
112
|
declare const ddlDialects: Readonly<{
|
|
113
|
-
postgresql: SchemaDialect<"
|
|
113
|
+
postgresql: SchemaDialect<"json" | "ilike" | "on-conflict" | "row-locking">;
|
|
114
114
|
sqlite: SchemaDialect<"json" | "on-conflict">;
|
|
115
115
|
mysql: SchemaDialect<"json" | "row-locking">;
|
|
116
116
|
}>;
|
package/dist/diff.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SnapshotDiffPropertyChange, D as SnapshotRenameTarget, E as SnapshotRenameSuggestion, S as SnapshotDiffPath, T as SnapshotRenameHintResult, _ as SnapshotDiffObjectKind, a as diffSnapshots, b as SnapshotDiffOperationType, c as validateRenameHints, d as SnapshotDiffDecodeResult, f as SnapshotDiffDiagnostic, g as SnapshotDiffObject, h as SnapshotDiffInput, i as decodeSnapshotRenameHints, l as validateSnapshotRenameHints, m as SnapshotDiffEvidence, n as decodeRenameHints, o as encodeRenameHints, p as SnapshotDiffDiagnosticCode, r as decodeSnapshotForDiff, s as encodeSnapshotRenameHints, t as compareSnapshots, u as SnapshotDiff, v as SnapshotDiffObjectReference, w as SnapshotRenameHint, x as SnapshotDiffOptions, y as SnapshotDiffOperation } from "./index-
|
|
1
|
+
import { C as SnapshotDiffPropertyChange, D as SnapshotRenameTarget, E as SnapshotRenameSuggestion, S as SnapshotDiffPath, T as SnapshotRenameHintResult, _ as SnapshotDiffObjectKind, a as diffSnapshots, b as SnapshotDiffOperationType, c as validateRenameHints, d as SnapshotDiffDecodeResult, f as SnapshotDiffDiagnostic, g as SnapshotDiffObject, h as SnapshotDiffInput, i as decodeSnapshotRenameHints, l as validateSnapshotRenameHints, m as SnapshotDiffEvidence, n as decodeRenameHints, o as encodeRenameHints, p as SnapshotDiffDiagnosticCode, r as decodeSnapshotForDiff, s as encodeSnapshotRenameHints, t as compareSnapshots, u as SnapshotDiff, v as SnapshotDiffObjectReference, w as SnapshotRenameHint, x as SnapshotDiffOptions, y as SnapshotDiffOperation } from "./index-CqWnouTK.mjs";
|
|
2
2
|
export { SnapshotDiff, SnapshotDiffDecodeResult, SnapshotDiffDiagnostic, SnapshotDiffDiagnosticCode, SnapshotDiffEvidence, SnapshotDiffInput, SnapshotDiffObject, SnapshotDiffObjectKind, SnapshotDiffObjectReference, SnapshotDiffOperation, SnapshotDiffOperationType, SnapshotDiffOptions, SnapshotDiffPath, SnapshotDiffPropertyChange, SnapshotRenameHint, SnapshotRenameHintResult, SnapshotRenameSuggestion, SnapshotRenameTarget, compareSnapshots, decodeRenameHints, decodeSnapshotForDiff, decodeSnapshotRenameHints, diffSnapshots, encodeRenameHints, encodeSnapshotRenameHints, validateRenameHints, validateSnapshotRenameHints };
|
package/dist/drizzle-mysql.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-
|
|
2
|
-
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-
|
|
1
|
+
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-D8M1yZF4.mjs";
|
|
2
|
+
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-Ctlxz1ip.mjs";
|
|
3
3
|
import { MySqlColumn, MySqlTableWithColumns } from "drizzle-orm/mysql-core";
|
|
4
4
|
//#region src/drizzle/mysql.d.ts
|
|
5
|
-
type MysqlDrizzleColumn<TTableName extends string, TDefinition> = MySqlColumn<DrizzleColumnConfig<TTableName, TDefinition
|
|
5
|
+
type MysqlDrizzleColumn<TTableName extends string, TDefinition> = MySqlColumn<DrizzleColumnConfig<TTableName, TDefinition>>;
|
|
6
6
|
type MysqlDrizzleColumns<TTable extends AnyTable> = { [TKey in keyof TTable['definitions']]: MysqlDrizzleColumn<TTable['tableName'], TTable['definitions'][TKey]>; };
|
|
7
7
|
/** The Drizzle MySQL table produced for one Qubu table. */
|
|
8
8
|
type MysqlDrizzleTable<TTable extends AnyTable> = MySqlTableWithColumns<{
|
package/dist/drizzle-mysql.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createMysqlSchemaSnapshot } from "./mysql-DqkqXB6A.mjs";
|
|
2
|
-
import { i as stringExtension, n as extensionData, t as convertDrizzleSchema } from "./runtime-
|
|
2
|
+
import { i as stringExtension, n as extensionData, t as convertDrizzleSchema } from "./runtime-Cn_Xgzta.mjs";
|
|
3
3
|
import { bigint, boolean, char, check, customType, date, datetime, decimal, foreignKey, index, int, json, mysqlSchema, mysqlTable, primaryKey, text, unique, uniqueIndex } from "drizzle-orm/mysql-core";
|
|
4
4
|
//#region src/drizzle/mysql.ts
|
|
5
5
|
const mysqlAdapter = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-
|
|
2
|
-
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-
|
|
1
|
+
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-D8M1yZF4.mjs";
|
|
2
|
+
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-Ctlxz1ip.mjs";
|
|
3
3
|
import { PgColumn, PgTableWithColumns } from "drizzle-orm/pg-core";
|
|
4
4
|
//#region src/drizzle/postgres.d.ts
|
|
5
|
-
type PostgresDrizzleColumn<TTableName extends string, TDefinition> = PgColumn<DrizzleColumnConfig<TTableName, TDefinition
|
|
5
|
+
type PostgresDrizzleColumn<TTableName extends string, TDefinition> = PgColumn<'custom', DrizzleColumnConfig<TTableName, TDefinition>>;
|
|
6
6
|
type PostgresDrizzleColumns<TTable extends AnyTable> = { [TKey in keyof TTable['definitions']]: PostgresDrizzleColumn<TTable['tableName'], TTable['definitions'][TKey]>; };
|
|
7
7
|
/** The Drizzle PostgreSQL table produced for one Qubu table. */
|
|
8
8
|
type PostgresDrizzleTable<TTable extends AnyTable> = PgTableWithColumns<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as createPostgresSchemaSnapshot } from "./postgres-DEBBeh52.mjs";
|
|
2
|
-
import { i as stringExtension, n as extensionData, r as recordExtension, t as convertDrizzleSchema } from "./runtime-
|
|
2
|
+
import { i as stringExtension, n as extensionData, r as recordExtension, t as convertDrizzleSchema } from "./runtime-Cn_Xgzta.mjs";
|
|
3
3
|
import { bigint, boolean, check, customType, date, foreignKey, index, integer, jsonb, numeric, pgSchema, pgTable, primaryKey, text, timestamp, unique, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
4
4
|
//#region src/drizzle/postgres.ts
|
|
5
5
|
const postgresAdapter = {
|
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-
|
|
2
|
-
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-
|
|
1
|
+
import { Bs as NativeColumnStorage, Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord, vs as ColumnDefinition, wu as SqlTimestamp, xc as ExternalDefaultDescriptor } from "./types-D8M1yZF4.mjs";
|
|
2
|
+
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-Ctlxz1ip.mjs";
|
|
3
3
|
import { SQLiteColumn, SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
|
|
4
4
|
//#region src/drizzle/sqlite.d.ts
|
|
5
|
-
type SqliteDrizzleColumn<TTableName extends string, TDefinition> = SQLiteColumn<DrizzleColumnConfig<TTableName, TDefinition
|
|
5
|
+
type SqliteDrizzleColumn<TTableName extends string, TDefinition> = SQLiteColumn<DrizzleColumnConfig<TTableName, TDefinition>>;
|
|
6
6
|
type SqliteDrizzleColumns<TTable extends AnyTable> = { [TKey in keyof TTable['definitions']]: SqliteDrizzleColumn<TTable['tableName'], TTable['definitions'][TKey]>; };
|
|
7
|
+
/** Integer encoding used by Drizzle's SQLite timestamp column builder. */
|
|
8
|
+
type SqliteTimestampMode = 'timestamp' | 'timestamp_ms';
|
|
9
|
+
/** Runtime options for a Drizzle-compatible SQLite integer timestamp. */
|
|
10
|
+
interface SqliteTimestampOptions {
|
|
11
|
+
/** Store Unix seconds by default, or milliseconds with `timestamp_ms`. */
|
|
12
|
+
readonly mode?: SqliteTimestampMode;
|
|
13
|
+
readonly nullable?: boolean;
|
|
14
|
+
readonly sqlName?: string;
|
|
15
|
+
/** Supply an application value when a Drizzle insert omits this column. */
|
|
16
|
+
readonly defaultFn?: () => Date;
|
|
17
|
+
}
|
|
18
|
+
type SqliteTimestampNullable<TOptions extends SqliteTimestampOptions> = TOptions extends {
|
|
19
|
+
readonly nullable: true;
|
|
20
|
+
} ? true : false;
|
|
21
|
+
type SqliteTimestampHasDefault<TOptions extends SqliteTimestampOptions> = TOptions extends {
|
|
22
|
+
readonly defaultFn: () => Date;
|
|
23
|
+
} ? true : false;
|
|
24
|
+
/** Qubu definition produced by {@link sqliteTimestamp}. */
|
|
25
|
+
type SqliteTimestampColumn<TOptions extends SqliteTimestampOptions = {}> = ColumnDefinition<Date, SqliteTimestampNullable<TOptions>, Date, Date, SqliteTimestampHasDefault<TOptions>, false, SqlTimestamp, NativeColumnStorage<'sqlite', 'INTEGER'>, SqliteTimestampHasDefault<TOptions> extends true ? ExternalDefaultDescriptor : undefined, undefined, undefined, undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* Declare a SQLite `INTEGER` timestamp that retains Drizzle's Date codec.
|
|
28
|
+
*
|
|
29
|
+
* @remarks `defaultFn` is runtime-only. Snapshots and emitted DDL retain the
|
|
30
|
+
* native `INTEGER` storage but do not serialize the callback.
|
|
31
|
+
*/
|
|
32
|
+
declare function sqliteTimestamp<const TOptions extends SqliteTimestampOptions = {}>(options?: TOptions): SqliteTimestampColumn<TOptions>;
|
|
7
33
|
/** The Drizzle SQLite table produced for one Qubu table. */
|
|
8
34
|
type SqliteDrizzleTable<TTable extends AnyTable> = SQLiteTableWithColumns<{
|
|
9
35
|
name: TTable['tableName'];
|
|
@@ -21,4 +47,4 @@ type SqliteDrizzleSchema<TSchema extends Schema<any>> = { readonly [TKey in keyo
|
|
|
21
47
|
*/
|
|
22
48
|
declare function toSqliteDrizzleSchema<const TTables extends SchemaTableRecord>(schema: Schema<TTables> & DrizzleSchemaValidation<TTables, 'sqlite'>): SqliteDrizzleSchema<Schema<TTables>>;
|
|
23
49
|
//#endregion
|
|
24
|
-
export { SqliteDrizzleSchema, SqliteDrizzleTable, toSqliteDrizzleSchema };
|
|
50
|
+
export { SqliteDrizzleSchema, SqliteDrizzleTable, SqliteTimestampColumn, SqliteTimestampMode, SqliteTimestampOptions, sqliteTimestamp, toSqliteDrizzleSchema };
|
package/dist/drizzle-sqlite.mjs
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
|
+
import { c as nativeColumn } from "./column-CYMbKbOy.mjs";
|
|
1
2
|
import { t as createSqliteSchemaSnapshot } from "./sqlite-BU6DBxef.mjs";
|
|
2
|
-
import { t as convertDrizzleSchema } from "./runtime-
|
|
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 };
|
package/dist/drizzle.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DrizzleDialect } from "./types-
|
|
1
|
+
import { n as DrizzleDialect } from "./types-Ctlxz1ip.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 { 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-
|
|
2
|
-
import { n as CompleteSchemaSnapshotInput, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult } from "./complete-types-
|
|
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-D8M1yZF4.mjs";
|
|
2
|
+
import { n as CompleteSchemaSnapshotInput, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult } from "./complete-types-B2PO6wQD.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 {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as SnapshotJsonValue, m as SnapshotDialect, n as SchemaSnapshot } from "./types-
|
|
2
|
-
import { S as CompleteSnapshotObjectKind, t as CompleteSchemaSnapshot } from "./complete-types-
|
|
1
|
+
import { T as SnapshotJsonValue, m as SnapshotDialect, n as SchemaSnapshot } from "./types-D8M1yZF4.mjs";
|
|
2
|
+
import { S as CompleteSnapshotObjectKind, t as CompleteSchemaSnapshot } from "./complete-types-B2PO6wQD.mjs";
|
|
3
3
|
//#region src/diff/types.d.ts
|
|
4
4
|
/** Object families understood by the snapshot diff engine. */
|
|
5
5
|
type SnapshotDiffObjectKind = CompleteSnapshotObjectKind;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as PaginationKind, $a as ExplainReadOptions, $c as
|
|
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 ExplainReadOptions, $c as ColumnDependency, $i as lower, $l as ResultMeta, $n as RequiredOuterScope, $o as SourceConstraint, $r as SchemaOptions, $s as binary, $t as SqliteIndexExtension, Aa as between, Ac as MysqlIdentityExtension, Ai as offset, Al as GroupingMeta, An as UpdateAssignments, Ao as QueryValidationError, Ar as SelectionSqlTypes, As as ColumnStorage, B as CastTarget, Ba as asValue, Bc as SchemaDialectExtension, Bi as subtract, Bl as OutputOf, Bn as MutationSqlTypes, Bo as ConstraintTiming, Br as SchemaRenderContext, Bs as NativeColumnStorage, Ca as isDistinctFrom, Cc as GeneratedColumnDescriptor, Ci as omit, Cl as CardinalityOf, Co as qubu, Cr as leftJoin, Cs as ColumnInsertInput, Ct as SourceIdentity, Cu as SqlTextLike, Da as lte, Dc as IdentityDialectExtension, Di as rowLock, Dl as FragmentMeta, Do as RenderedQuery, Dr as Selection, Ds as ColumnOptions, Dt as SourceSqlTypeMap, Du as SqlUuid, Ea as lt, Ec as IdentityDescriptor, Ei as RowLockOptions, El as Fragment, Eo as RenderOptions, Er as groupBy, Es as ColumnOnUpdateOf, Et as SourceRow, Eu as SqlUnknown, Fa as isTrue, Fc as externalDefault, Fi as SelectClause, Fl as InheritedMetadataOf, Fn as MutationQuery, Fo as CatalogCheckSql, Fr as RenderedSchemaExpression, Fs as ColumnStorageOf, Ft as Table, G as DialectJson, Ga as DriverValueEncoder, Gc as SchemaObjectNameOptions, Gi as jsonPath, Gl as RenderContext, Gn as returning, Go as ForeignKeyOptions, Gt as table, H as DialectCapability, Ha as value, Hc as SchemaMetadataDiagnostic, Hi as jsonBoolean, Hl as ProvidesOuterSourceMeta, Hn as ReturningClause, Ho as FieldLikeOptions, Hr as UnsafeSchemaSqlExpression, Ht as TableRow, Ic as externalGeneratedColumn, Ii as add, Il as MetadataOf, In as MutationReturning, Io as CheckConstraint, It as TableColumns, J as DialectRowLocking, Ja as ExecutionResult, Ji as over, Jl as RequiresOf, Jn as AvailableOuterScope, Jo as KeyConstraint, Jt as IndexTerm, K as DialectOptions, Ka as ExecutionOptions, Ki as jsonText, Kl as RenderFunction, Kn as correlate, Ko as ForeignKeyTarget, Kt as IndexDialectExtension, Lc as generatedColumn, Li as divide, Ll as NullabilityOf, Ln as MutationReturningClause, Lo as CheckConstraintOptions, Lr as SchemaExpressionErrorCode, Ls as ColumnStorageTypeOf, Lt as TableDefinitions, Ma as notIn, Mc as SchemaLiteralValue, Mi as distinct, Ml as HasSubquery, Mn as AllowAllClause, Mo as QueryValidationIssue, Mr as SchemaDialect, Na as isNotNull, Nc as SqliteIdentityExtension, Ni as AnySelectClause, Nl as HasWindow, Nn as MutationClause, No as AnyKeyColumn, Nr as SchemaDialectHooks, Ns as ColumnStorageDialectOf, Oa as ne, Oc as IdentityGeneration, Oi as fetchFirst, Ol as GroupingDependenciesOf, Oo as render, Or as SelectionObject, Os as ColumnOutput, Pa as isNull, Pi as ClausePlacement, Pl as InheritedMetadata, Pn as MutationKind, Po as CatalogCheckExpression, Ps as ColumnStorageKindOf, Pt as AnyTable, Q as NamedCastTarget, Qa as ExplainPlanRow, Qi as concat, Ql as RequiresSourceMeta, Qn as MissingScope, Qo as ReferentialAction, Qr as SchemaNamingPolicy, Qs as bigint, Qt as SourceIndexesRecord, Rc as identityColumn, Ri as modulo, Rl as NullableSourceMeta, Rn as MutationRow, Ro as ConstraintDialectExtension, Rr as SchemaExpressionInput, Rs as ColumnUpdateInput, Rt as TableIdentity, Sa as gte, Sc as ExternalGeneratedColumnDescriptor, Si as SelectPart, Sl as CardinalityMeta, So as explain, Sr as innerJoin, Ss as ColumnIdentityOf, St as SourceConstraints, Su as SqlText, Ta as like, Tc as GeneratedDescriptor, Ti as RowLockClause, Tl as ExpressionMeta, Tr as rightJoin, Tt as SourceProvision, Tu as SqlTypeSatisfies, U as DialectCastTypes, Ua as cast, Ui as jsonExists, Ul as ProvidesSourceMeta, Un as ReturningRow, Uo as ForeignKeyConstraint, Us as PortableColumnStorage, Ut as TableSqlTypes, V as Dialect, Vc as SchemaDialectName, Vi as JsonPath, Vl as ProvidesOuterOf, Vn as allowAll, Vo as FieldLike, Vr as SchemaRenderOptions, W as DialectExplain, Wc as SchemaObjectIdentity, Wi as jsonNumber, Wl as QueryCardinality, Wn as ReturningSqlTypes, Wo as ForeignKeyMatch, Wt as TableUpdateInput, X as ExplainRenderOptions, Xa as ExplainOptions, Xi as rowNumber, Xl as RequiresOuterOf, Xn as ClauseScope, Xo as MysqlConstraintExtension, Xr as Schema, Xt as PostgresIndexExtension, Y as ExplainFormat, Ya as ExplainMutationOptions, Yi as rank, Yl as RequiresOuterMetadataOf, Yn as AvailableScope, Yo as KeyConstraintOptions, Yr as unsafeSchemaSql, Yt as MysqlIndexExtension, Z as JsonScalarKind, Za as ExplainOptionsFor, Zi as coalesce, Zl as RequiresOuterSourceMeta, Zn as GroupingValidation, Zo as PostgresConstraintExtension, Zr as SchemaDiagnostic, Zt as SourceIndex, _a as notExists, _c as ColumnDefaultInput, _i as and, _l as AggregateDependenciesOf, _n as insertSelect, _o as StreamingTransactionalQueryAdapter, _r as FromScope, _s as ColumnDefaultOf, _u as SqlJson, aa as count, ac as nativeColumn, al as ExpressionKind, an as desc, ao as QubuExplainableStreamingTransactionalClient, ar as RecursiveCteSource, as as UniqueConstraintOptions, at as SchemaLiteralRenderer, ba as eq, bc as ExpressionGeneratedColumnDescriptor, bi as Omit, bl as CapabilitiesOf, bo as execute, br as crossJoin, bs as ColumnGeneratedOf, bt as Source, bu as SqlOrderable, ca as min, cc as numeric, cl as ExpressionRequires, cn as order, co as QubuStreamingExplainableClient, cr as recursiveCte, cs as catalogForeignKey, cu as AnySqlType, da as SqlTag, dc as timestamp, di as LateralIdentity, dl as SchemaExpression, dn as DefaultValuesSource, do as QubuTransaction, dr as SetQuery, ds as primaryKey, dt as QueryKind, du as SqlBoolean, ea as upper, ec as boolean, ei as SchemaTableEntry, el as ColumnReference, en as TableIndex, eo as ExplainRequest, er as RequiredScope, es as SourceConstraintsRecord, et as PaginationPart, eu as SqlTypeOf, fa as TypedSqlTag, fc as uuid, fi as LateralSource, fl as SchemaExpressionBrand, fn as InsertSelectSource, fo as QubuTransactionalClient, fr as except, fs as references, ft as QueryRow, fu as SqlDate, ga as inQuery, gc as ColumnDefault, gi as lateral, gn as insertInto, go as StreamingQueryAdapter, gr as FromClause, gs as DeclaredColumnNullability, gu as SqlInteger, ha as exists, hc as ColumnBehaviorErrorCode, hi as alias, hn as defaultValues, ho as StreamableQuery, hr as unionAll, ht as AnySource, hu as SqlEqualityCompatible, ia as avg, ic as json, il as Expression, in as asc, io as QubuExplainableClient, ir as CteSource, is as UniqueConstraint, it as RowLockWaitPolicy, ja as inList, jc as ResolvedColumnBehavior, ji as having, jl as HasAggregate, jn as update, jo as QueryValidationErrorCode, jr as all, js as ColumnStorageDeclarationOf, ka as notLike, kc as LiteralDefaultDescriptor, ki as fetchNext, kl as GroupingKeysOf, kn as UpdateAssignmentValue, ko as QueryTypeValidation, kr as SelectionOutput, ks as ColumnSqlType, la as sum, lc as portableStorage, li as AliasIdentity, ll as ExpressionSqlType, ln as orderBy, lo as QubuStreamingTransaction, lr as withCte, ls as check, lt as AnyQuery, lu as SqlBigInt, ma as caseWhen, mc as ColumnBehaviorError, mi as QuerySource, mn as ValuesSource, mo as QueryExecutor, mr as union, ms as uniqueConstraint, mt as Row, mu as SqlEqualityComparable, na as schemaCall, nc as date, ni as SchemaTableRecord, nl as AnyExpression, no as ExplainableQueryAdapter, nr as SelectCardinality, ns as SqliteConstraintExtension, nt as PortableCastType, nu as VisibleDependenciesOf, oa as countDistinct, oc as nativeStorage, ol as ExpressionNullability, on as nullsFirst, oo as QubuExplainableTransactionalClient, or as WithClause, os as UniqueNullSemantics, pa as sql, pc as CanonicalLiteral, pi as QueryAliasIdentity, pn as InsertSource, po as QueryAdapter, pr as intersect, ps as unique, pt as QuerySqlTypeMap, pu as SqlDecimal, q as DialectPagination, qa as ExecutionRequest, qi as denseRank, ql as RequiresCapabilityMeta, qn as select, qo as ForeignKeyTargetInput, qt as IndexOptions, rc as integer, ri as SchemaTableRegistry, rl as AnySchemaExpression, rn as OrderTerm, ro as QubuClient, rr as SelectQuery, rs as TableLike, rt as RowLockMode, ru as WindowMeta, sa as max, sc as nullable, si as schema, sl as ExpressionOutput, sn as nullsLast, so as QubuStreamingClient, sr as cte, ss as catalogCheck, ta as call, tc as column, ti as SchemaTableNames, tn as index, to as ExplainResult, tr as ScopeValidation, ts as SourceLike, tt as PortableCastTarget, tu as SubqueryMeta, ua as SqlFragment, uc as text, ui as AliasedSource, ul as ExpressionWithOutput, un as deleteFrom, uo as QubuStreamingTransactionalClient, ur as SetOperator, us as foreignKey, ut as Query, uu as SqlBinary, va as scalar, vc as DefaultDescriptor, vi as not, vl as AggregateMeta, vn as values, vo as TransactionOptions, vr as FromSource, vs as ColumnDefinition, vt as ProvidedSourceIdentity, vu as SqlNumericLike, wa as isNotDistinctFrom, wc as GeneratedColumnMode, wi as where, wl as DependenciesOf, wo as stream, wr as naturalJoin, ws as ColumnIsGenerated, wt as SourceKind, wu as SqlTimestamp, xa as gt, xc as ExternalDefaultDescriptor, xi as OmittableSelectClause, xl as CapabilityMetadataOf, xo as executeRows, xr as fullJoin, xs as ColumnHasDefault, xt as SourceColumns, xu as SqlSemanticType, yc as ExpressionDefaultDescriptor, yi as or, yl as AnyFragment, yo as TransactionalQueryAdapter, yr as from, yt as ProvidedSourceRow, yu as SqlOrderCompatible, zi as multiply, zl as NullableSourcesOf, zn as MutationScopeValidation, zo as ConstraintOptions, zr as SchemaExpressionMode, zt as TableInsertInput } from "./types-D8M1yZF4.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 DeclaredColumnNullability, 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 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 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -7,8 +7,9 @@ import { a as isDistinctFrom, c as lt, d as notLike, f as expressionOperand, i a
|
|
|
7
7
|
import { t as omit } from "./omit-OxV58AwX.mjs";
|
|
8
8
|
import { n as snakeCaseIdentifier, t as resolveSqlNames } from "./naming-QVCOnSj2.mjs";
|
|
9
9
|
import { r as exposeColumns, t as createSource } from "./source-DUoJVXmL.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { n as alias, r as lateral, t as table } from "./table-CCUJ60rB.mjs";
|
|
11
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";
|
|
12
|
+
import { a as date, b as generatedColumn, c as nativeColumn, d as numeric, f as portableStorage, h as uuid, i as column, l as nativeStorage, m as timestamp, n as binary, o as integer, p as text, r as boolean, s as json, t as bigint, u as nullable, v as externalDefault, x as identityColumn, y as externalGeneratedColumn } from "./column-CYMbKbOy.mjs";
|
|
12
13
|
//#region src/execution.ts
|
|
13
14
|
function qubu(adapter) {
|
|
14
15
|
const client = createClient(adapter);
|
package/dist/introspection.d.mts
CHANGED
|
@@ -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-
|
|
2
|
-
import { t as CompleteSchemaSnapshot } from "./complete-types-
|
|
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-LBt5rclR.mjs";
|
|
2
|
+
import { t as CompleteSchemaSnapshot } from "./complete-types-B2PO6wQD.mjs";
|
|
3
3
|
//#region src/introspection/catalog.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Materialize every optional object-family collection and deeply freeze the
|
package/dist/migration.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as SnapshotJsonValue, m as SnapshotDialect } from "./types-
|
|
2
|
-
import { S as SnapshotDiffPath, _ as SnapshotDiffObjectKind, b as SnapshotDiffOperationType, f as SnapshotDiffDiagnostic, g as SnapshotDiffObject, m as SnapshotDiffEvidence, u as SnapshotDiff } from "./index-
|
|
1
|
+
import { T as SnapshotJsonValue, m as SnapshotDialect } from "./types-D8M1yZF4.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-CqWnouTK.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";
|
package/dist/mysql.d.mts
CHANGED
package/dist/postgres.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $l as ResultMeta, Cn as ExcludedSource, Cu as SqlTextLike, Dn as excluded, En as doUpdate, Eu as SqlUnknown, Ia as Operand, Il as MetadataOf, La as OperandNullability, On as onConflict, Ra as OperandSqlType, Sn as DoUpdateAction, Tl as ExpressionMeta, Tn as doNothing, V as Dialect, bn as ConflictTarget, cu as AnySqlType, dl as SchemaExpression, du as SqlBoolean, ql as RequiresCapabilityMeta, ul as ExpressionWithOutput, wn as OnConflictClause, xn as DoNothingAction, ya as ComparisonValidation, yn as ConflictAction, za as SqlCapabilityValidation } from "./types-D8M1yZF4.mjs";
|
|
2
2
|
//#region src/dialects/postgres.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* PostgreSQL's only core rendering difference is positional parameters.
|
|
5
5
|
* PostgreSQL-specific expressions and clauses should remain separate modules.
|
|
6
6
|
*/
|
|
7
|
-
declare function postgresDialect(): Dialect<"
|
|
7
|
+
declare function postgresDialect(): Dialect<"json" | "ilike" | "on-conflict" | "row-locking">;
|
|
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";
|
|
@@ -40,7 +40,7 @@ function createColumnBuilder(definition, column, table, adapter) {
|
|
|
40
40
|
"storage"
|
|
41
41
|
]);
|
|
42
42
|
const portableType = definition.storage?.kind === "portable" ? definition.storage.type : void 0;
|
|
43
|
-
let builder = adapter.createStorageBuilder(portableType, column.physicalName, declaration);
|
|
43
|
+
let builder = adapter.createStorageBuilder(portableType, column.physicalName, declaration, definition);
|
|
44
44
|
if (!column.nullable) builder = builder.notNull();
|
|
45
45
|
if (column.default?.kind === "literal") builder = builder.default(decodeSnapshotLiteral(column.default.value));
|
|
46
46
|
else if (column.default?.kind === "expression") builder = builder.default(sql.raw(column.default.expression.sql));
|
package/dist/schema.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $o as SourceConstraint, $r as SchemaOptions, $s as
|
|
2
|
-
export { AliasIdentity, AliasedSource, AnyKeyColumn, AnySource, AnyTable, CanonicalLiteral, CatalogCheckExpression, CatalogCheckSql, CheckConstraint, CheckConstraintOptions, ColumnBehaviorError, ColumnBehaviorErrorCode, ColumnDefault, ColumnDefaultInput, ColumnDefaultOf, ColumnDefinition, ColumnFromOptions, ColumnGeneratedOf, ColumnHasDefault, ColumnIdentityOf, ColumnInsertInput, ColumnIsGenerated, ColumnIsNullable, ColumnOnUpdateOf, ColumnOptions, ColumnOutput, ColumnSqlType, ColumnStorage, ColumnStorageDeclarationOf, ColumnStorageDescriptor, ColumnStorageDialectOf, ColumnStorageKindOf, ColumnStorageOf, ColumnStorageType, ColumnStorageTypeOf, ColumnUpdateInput, ConstraintDialectExtension, ConstraintOptions, ConstraintTiming, CustomSource, CustomSourceOptions, DefaultDescriptor, DialectNativeStorage, ExpressionDefaultDescriptor, ExpressionGeneratedColumnDescriptor, ExternalDefaultDescriptor, ExternalGeneratedColumnDescriptor, FieldLike, FieldLikeOptions, ForeignKeyConstraint, ForeignKeyMatch, ForeignKeyOptions, ForeignKeyTarget, ForeignKeyTargetInput, GeneratedColumnDescriptor, GeneratedColumnMode, GeneratedDescriptor, IdentityDescriptor, IdentityDialectExtension, IdentityGeneration, IndexDialectExtension, IndexOptions, IndexTerm, 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, 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, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, 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
|
+
import { $o as SourceConstraint, $r as SchemaOptions, $s as binary, $t as SqliteIndexExtension, Ac as MysqlIdentityExtension, As as ColumnStorage, At as createSource, Bc as SchemaDialectExtension, Bo as ConstraintTiming, Br as SchemaRenderContext, Bs as NativeColumnStorage, Bt as TableMetadataCallback, Cc as GeneratedColumnDescriptor, Cs as ColumnInsertInput, Ct as SourceIdentity, Dc as IdentityDialectExtension, Ds as ColumnOptions, Dt as SourceSqlTypeMap, Ec as IdentityDescriptor, Es as ColumnOnUpdateOf, Et as SourceRow, Fc as externalDefault, Fo as CatalogCheckSql, Fr as RenderedSchemaExpression, Fs as ColumnStorageOf, Ft as Table, Gc as SchemaObjectNameOptions, Go as ForeignKeyOptions, Gr as normalizeSchemaSql, Gs as PortableStorageDescriptor, Gt as table, Hc as SchemaMetadataDiagnostic, Ho as FieldLikeOptions, Hr as UnsafeSchemaSqlExpression, Hs as NativeStorageDescriptor, Ht as TableRow, Ic as externalGeneratedColumn, Io as CheckConstraint, Ir as SchemaExpressionError, Is as ColumnStorageType, It as TableColumns, Jc as freezeSchemaMetadata, Jo as KeyConstraint, Jr as schemaExpression, Js as StorageDescriptor, Jt as IndexTerm, Kc as assertSchemaDialectSupport, Ko as ForeignKeyTarget, Kr as renderSchemaExpression, Ks as PortableStorageType, Kt as IndexDialectExtension, Lc as generatedColumn, Lo as CheckConstraintOptions, Lr as SchemaExpressionErrorCode, Ls as ColumnStorageTypeOf, Lt as TableDefinitions, Mc as SchemaLiteralValue, Mr as SchemaDialect, Ms as ColumnStorageDescriptor, Mt as exposeColumns, Nc as SqliteIdentityExtension, No as AnyKeyColumn, Nr as SchemaDialectHooks, Ns as ColumnStorageDialectOf, Nt as sourceIdentity, Oc as IdentityGeneration, Os as ColumnOutput, Ot as SourceSqlTypes, Pc as canonicalLiteral, Po as CatalogCheckExpression, Pr as createSchemaDialect, Ps as ColumnStorageKindOf, Pt as AnyTable, Qc as materializeSchemaObjectRecord, Qo as ReferentialAction, Qr as SchemaNamingPolicy, Qs as bigint, Qt as SourceIndexesRecord, Rc as identityColumn, Ro as ConstraintDialectExtension, Rr as SchemaExpressionInput, Rs as ColumnUpdateInput, Rt as TableIdentity, Sc as ExternalGeneratedColumnDescriptor, Ss as ColumnIdentityOf, St as SourceConstraints, Tc as GeneratedDescriptor, Ts as ColumnIsNullable, Tt as SourceProvision, Uc as SchemaMetadataValidationError, Uo as ForeignKeyConstraint, Ur as defineSchemaExpression, Us as PortableColumnStorage, Ut as TableSqlTypes, Vc as SchemaDialectName, Vo as FieldLike, Vr as SchemaRenderOptions, Vs as NativeStorage, Vt as TableOptions, Wc as SchemaObjectIdentity, Wo as ForeignKeyMatch, Wr as isUnsafeSchemaSql, Ws as PortableStorage, Wt as TableUpdateInput, Xc as isValidSchemaObjectName, Xo as MysqlConstraintExtension, Xr as Schema, Xs as StorageOf, Xt as PostgresIndexExtension, Yc as generatedSchemaObjectName, Yo as KeyConstraintOptions, Yr as unsafeSchemaSql, Ys as StorageDialectOf, Yt as MysqlIndexExtension, Zc as materializeSchemaObjectIdentity, Zo as PostgresConstraintExtension, Zr as SchemaDiagnostic, Zs as StorageTypeOf, Zt as SourceIndex, _c as ColumnDefaultInput, _s as ColumnDefaultOf, _t as CustomSourceOptions, ac as nativeColumn, ai as defaultSchemaNamingPolicy, as as UniqueConstraintOptions, bc as ExpressionGeneratedColumnDescriptor, bs as ColumnGeneratedOf, bt as Source, cc as numeric, ci as schemaNamingPolicyVersion, cs as catalogForeignKey, dc as timestamp, di as LateralIdentity, ds as primaryKey, ec as boolean, ei as SchemaTableEntry, en as TableIndex, es as SourceConstraintsRecord, fc as uuid, fi as LateralSource, fs as references, gc as ColumnDefault, gi as lateral, gs as DeclaredColumnNullability, gt as CustomSource, hc as ColumnBehaviorErrorCode, hi as alias, hs as validateConstraintDialect, ht as AnySource, ic as json, ii as SchemaValidationError, is as UniqueConstraint, jc as ResolvedColumnBehavior, js as ColumnStorageDeclarationOf, jt as customSource, kc as LiteralDefaultDescriptor, ks as ColumnSqlType, kt as UnknownSourceSqlTypes, lc as portableStorage, li as AliasIdentity, ls as check, mc as ColumnBehaviorError, mi as QuerySource, ms as uniqueConstraint, nc as date, ni as SchemaTableRecord, nn as validateIndexDialect, ns as SqliteConstraintExtension, oc as nativeStorage, oi as generatedTableName, os as UniqueNullSemantics, pc as CanonicalLiteral, pi as QueryAliasIdentity, ps as unique, qc as dialectMismatchDiagnostic, qo as ForeignKeyTargetInput, qr as renderSchemaSql, qs as StorageDeclarationOf, qt as IndexOptions, rc as integer, ri as SchemaTableRegistry, rs as TableLike, sc as nullable, si as schema, ss as catalogCheck, tc as column, ti as SchemaTableNames, tn as index, ts as SourceLike, uc as text, ui as AliasedSource, us as foreignKey, vc as DefaultDescriptor, vs as ColumnDefinition, vt as ProvidedSourceIdentity, wc as GeneratedColumnMode, ws as ColumnIsGenerated, wt as SourceKind, xc as ExternalDefaultDescriptor, xs as ColumnHasDefault, xt as SourceColumns, yc as ExpressionDefaultDescriptor, ys as ColumnFromOptions, yt as ProvidedSourceRow, zc as resolveColumnBehavior, zo as ConstraintOptions, zr as SchemaExpressionMode, zs as DialectNativeStorage, zt as TableInsertInput } from "./types-D8M1yZF4.mjs";
|
|
2
|
+
export { AliasIdentity, AliasedSource, AnyKeyColumn, AnySource, AnyTable, CanonicalLiteral, CatalogCheckExpression, CatalogCheckSql, CheckConstraint, CheckConstraintOptions, ColumnBehaviorError, ColumnBehaviorErrorCode, ColumnDefault, ColumnDefaultInput, ColumnDefaultOf, ColumnDefinition, ColumnFromOptions, ColumnGeneratedOf, ColumnHasDefault, 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, IndexDialectExtension, IndexOptions, IndexTerm, 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, 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, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, 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 };
|
package/dist/schema.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { i as sourceIdentity, n as customSource, r as exposeColumns, t as createSource } from "./source-DUoJVXmL.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as alias, r as lateral, t as table } from "./table-CCUJ60rB.mjs";
|
|
3
3
|
import { A as isValidSchemaObjectName, C as index, D as dialectMismatchDiagnostic, E as assertSchemaDialectSupport, M as materializeSchemaObjectRecord, O as freezeSchemaMetadata, S as unsafeSchemaSql, T as SchemaMetadataValidationError, _ as isUnsafeSchemaSql, a as schemaNamingPolicyVersion, b as renderSchemaSql, c as check, d as references, f as unique, g as defineSchemaExpression, h as SchemaExpressionError, i as schema, j as materializeSchemaObjectIdentity, k as generatedSchemaObjectName, l as foreignKey, m as validateConstraintDialect, n as defaultSchemaNamingPolicy, o as catalogCheck, p as uniqueConstraint, r as generatedTableName, s as catalogForeignKey, t as SchemaValidationError, u as primaryKey, v as normalizeSchemaSql, w as validateIndexDialect, x as schemaExpression, y as renderSchemaExpression } from "./registry-BufIskVN.mjs";
|
|
4
|
+
import { S as resolveColumnBehavior, _ as canonicalLiteral, a as date, b as generatedColumn, c as nativeColumn, d as numeric, f as portableStorage, g as ColumnBehaviorError, h as uuid, i as column, l as nativeStorage, m as timestamp, n as binary, o as integer, p as text, r as boolean, s as json, t as bigint, u as nullable, v as externalDefault, x as identityColumn, y as externalGeneratedColumn } from "./column-CYMbKbOy.mjs";
|
|
4
5
|
import { t as createSchemaDialect } from "./dialect-b2-Z6uBF.mjs";
|
|
5
6
|
export { ColumnBehaviorError, SchemaExpressionError, SchemaMetadataValidationError, SchemaValidationError, alias, assertSchemaDialectSupport, bigint, binary, boolean, canonicalLiteral, catalogCheck, catalogForeignKey, check, column, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, 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 };
|
package/dist/snapshot.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as SnapshotStorage, C as SnapshotIndexTerm, D as SnapshotLiteral, E as SnapshotKeyConstraint, F as neutralSnapshotDialect,
|
|
2
|
-
import { A as CompleteSnapshotProvenance, B as SchemaSnapshotV2Input, C as CompleteSnapshotObjectMetadata, D as CompleteSnapshotPartition, E as CompleteSnapshotOwnership, F as CompleteSnapshotTrigger, G as schemaSnapshotVersion2, H as completeSchemaSnapshotVersion, I as CompleteSnapshotValueFact, L as CompleteSnapshotView, M as CompleteSnapshotRoutineParameter, N as CompleteSnapshotSequence, O as CompleteSnapshotPhysicalReference, P as CompleteSnapshotTable, R as SchemaSnapshotV2, S as CompleteSnapshotObjectKind, T as CompleteSnapshotOpaqueObject, U as schemaSnapshotCompleteVersion, V as completeSchemaSnapshotFormat, W as schemaSnapshotV2Version, _ as CompleteSnapshotIndex, a as CompleteSnapshotCollation, b as CompleteSnapshotNamespace, c as CompleteSnapshotConstraint, d as CompleteSnapshotDeferredObject, f as CompleteSnapshotDomain, g as CompleteSnapshotIdentity, h as CompleteSnapshotForeignKey, i as CompleteSnapshotCheckConstraint, j as CompleteSnapshotRoutine, k as CompleteSnapshotPolicy, l as CompleteSnapshotCreateResult, m as CompleteSnapshotExtension, n as CompleteSchemaSnapshotInput, o as CompleteSnapshotColumn, p as CompleteSnapshotEnum, r as CompleteSnapshotCapabilities, s as CompleteSnapshotComment, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult, v as CompleteSnapshotIndexTerm, w as CompleteSnapshotObjectReference, x as CompleteSnapshotObject, y as CompleteSnapshotKeyConstraint, z as SchemaSnapshotV2DecodeResult } from "./complete-types-
|
|
3
|
-
import { A as assertSchemaSnapshot, B as decodeCompleteSchemaSnapshot, C as createSchemaSnapshot, D as serializeSchema, E as encodeSnapshot, F as assertCompleteSnapshot, G as encodeCompleteSnapshot, H as decodeSchemaSnapshotV2, I as assertSchemaSnapshotV2, J as SnapshotCanonicalError, K as encodeSchemaSnapshotV2, L as canonicalizeCompleteSchemaSnapshot, M as decodeSchemaSnapshot, N as CompleteSnapshotValidationError, O as tryCreateSchemaSnapshot, P as assertCompleteSchemaSnapshot, Q as toSnapshotJsonValue, R as canonicalizeSchemaSnapshotV2, S as SnapshotSerializationError, T as encodeSchemaSnapshot, U as digestCompleteSchemaSnapshot, V as decodeCompleteSnapshot, W as encodeCompleteSchemaSnapshot, X as encodeCanonicalSnapshot, Y as canonicalJson, Z as schemaSnapshotDigest, _ as postgresSchemaDialect, a as mysqlSnapshotDialect, b as tryCreatePostgresSchemaSnapshot, c as SqliteStorageAffinity, d as sqliteSnapshotAdapter, f as sqliteSnapshotDialect, g as createPostgresSchemaSnapshot, h as PostgresSnapshotOptions, i as mysqlSnapshotAdapter, j as canonicalizeSchemaSnapshot, k as SnapshotValidationError, l as createSqliteSchemaSnapshot, m as tryCreateSqliteSchemaSnapshot, n as createMysqlSchemaSnapshot, o as tryCreateMysqlSchemaSnapshot, p as sqliteStorageAffinity, q as schemaSnapshotV2Digest, r as mysqlSchemaDialect, s as SqliteSnapshotOptions, t as MysqlSnapshotOptions, u as sqliteSchemaDialect, v as postgresSnapshotAdapter, w as digestSchemaSnapshot, x as SchemaSnapshotOptions, y as postgresSnapshotDialect, z as completeSchemaSnapshotDigest } from "./index-
|
|
1
|
+
import { A as SnapshotStorage, Bs as NativeColumnStorage, C as SnapshotIndexTerm, D as SnapshotLiteral, E as SnapshotKeyConstraint, F as neutralSnapshotDialect, I as schemaSnapshotDialectVersion, L as schemaSnapshotFormat, M as SnapshotTable, Mr as SchemaDialect, N as SnapshotUniqueConstraint, Nr as SchemaDialectHooks, O as SnapshotNamingPolicy, P as SnapshotValidationContext, Pr as createSchemaDialect, R as schemaSnapshotNamingPolicyVersion, S as SnapshotIndex, T as SnapshotJsonValue, Us as PortableColumnStorage, _ as SnapshotExpressionContext, a as SnapshotBigInt, b as SnapshotGeneratedColumn, c as SnapshotConstraint, d as SnapshotDefault, f as SnapshotDiagnostic, g as SnapshotExpression, h as SnapshotDialectExtension, i as SchemaSnapshotInput, j as SnapshotStorageContext, k as SnapshotSpecialNumber, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, o as SnapshotCheckConstraint, p as SnapshotDiagnosticCode, r as SchemaSnapshotAdapter, s as SnapshotColumn, t as AnySchema, u as SnapshotDecodeResult, v as SnapshotExtensionContext, w as SnapshotIndexTermExpression, x as SnapshotIdentity, y as SnapshotForeignKey, z as schemaSnapshotVersion } from "./types-D8M1yZF4.mjs";
|
|
2
|
+
import { A as CompleteSnapshotProvenance, B as SchemaSnapshotV2Input, C as CompleteSnapshotObjectMetadata, D as CompleteSnapshotPartition, E as CompleteSnapshotOwnership, F as CompleteSnapshotTrigger, G as schemaSnapshotVersion2, H as completeSchemaSnapshotVersion, I as CompleteSnapshotValueFact, L as CompleteSnapshotView, M as CompleteSnapshotRoutineParameter, N as CompleteSnapshotSequence, O as CompleteSnapshotPhysicalReference, P as CompleteSnapshotTable, R as SchemaSnapshotV2, S as CompleteSnapshotObjectKind, T as CompleteSnapshotOpaqueObject, U as schemaSnapshotCompleteVersion, V as completeSchemaSnapshotFormat, W as schemaSnapshotV2Version, _ as CompleteSnapshotIndex, a as CompleteSnapshotCollation, b as CompleteSnapshotNamespace, c as CompleteSnapshotConstraint, d as CompleteSnapshotDeferredObject, f as CompleteSnapshotDomain, g as CompleteSnapshotIdentity, h as CompleteSnapshotForeignKey, i as CompleteSnapshotCheckConstraint, j as CompleteSnapshotRoutine, k as CompleteSnapshotPolicy, l as CompleteSnapshotCreateResult, m as CompleteSnapshotExtension, n as CompleteSchemaSnapshotInput, o as CompleteSnapshotColumn, p as CompleteSnapshotEnum, r as CompleteSnapshotCapabilities, s as CompleteSnapshotComment, t as CompleteSchemaSnapshot, u as CompleteSnapshotDecodeResult, v as CompleteSnapshotIndexTerm, w as CompleteSnapshotObjectReference, x as CompleteSnapshotObject, y as CompleteSnapshotKeyConstraint, z as SchemaSnapshotV2DecodeResult } from "./complete-types-B2PO6wQD.mjs";
|
|
3
|
+
import { A as assertSchemaSnapshot, B as decodeCompleteSchemaSnapshot, C as createSchemaSnapshot, D as serializeSchema, E as encodeSnapshot, F as assertCompleteSnapshot, G as encodeCompleteSnapshot, H as decodeSchemaSnapshotV2, I as assertSchemaSnapshotV2, J as SnapshotCanonicalError, K as encodeSchemaSnapshotV2, L as canonicalizeCompleteSchemaSnapshot, M as decodeSchemaSnapshot, N as CompleteSnapshotValidationError, O as tryCreateSchemaSnapshot, P as assertCompleteSchemaSnapshot, Q as toSnapshotJsonValue, R as canonicalizeSchemaSnapshotV2, S as SnapshotSerializationError, T as encodeSchemaSnapshot, U as digestCompleteSchemaSnapshot, V as decodeCompleteSnapshot, W as encodeCompleteSchemaSnapshot, X as encodeCanonicalSnapshot, Y as canonicalJson, Z as schemaSnapshotDigest, _ as postgresSchemaDialect, a as mysqlSnapshotDialect, b as tryCreatePostgresSchemaSnapshot, c as SqliteStorageAffinity, d as sqliteSnapshotAdapter, f as sqliteSnapshotDialect, g as createPostgresSchemaSnapshot, h as PostgresSnapshotOptions, i as mysqlSnapshotAdapter, j as canonicalizeSchemaSnapshot, k as SnapshotValidationError, l as createSqliteSchemaSnapshot, m as tryCreateSqliteSchemaSnapshot, n as createMysqlSchemaSnapshot, o as tryCreateMysqlSchemaSnapshot, p as sqliteStorageAffinity, q as schemaSnapshotV2Digest, r as mysqlSchemaDialect, s as SqliteSnapshotOptions, t as MysqlSnapshotOptions, u as sqliteSchemaDialect, v as postgresSnapshotAdapter, w as digestSchemaSnapshot, x as SchemaSnapshotOptions, y as postgresSnapshotDialect, z as completeSchemaSnapshotDigest } from "./index-7qc6OcIC.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, CompleteSnapshotObjectReference, CompleteSnapshotOpaqueObject, CompleteSnapshotOwnership, CompleteSnapshotPartition, CompleteSnapshotPhysicalReference, CompleteSnapshotPolicy, CompleteSnapshotProvenance, CompleteSnapshotRoutine, CompleteSnapshotRoutineParameter, CompleteSnapshotSequence, CompleteSnapshotTable, CompleteSnapshotTrigger, CompleteSnapshotValidationError, CompleteSnapshotValueFact, CompleteSnapshotView, MysqlSnapshotOptions, type NativeColumnStorage, type PortableColumnStorage, PostgresSnapshotOptions, type SchemaDialect, type SchemaDialectHooks, SchemaSnapshot, SchemaSnapshotAdapter, SchemaSnapshotInput, SchemaSnapshotOptions, SchemaSnapshotV2, SchemaSnapshotV2DecodeResult, SchemaSnapshotV2Input, 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, SqliteSnapshotOptions, SqliteStorageAffinity, assertCompleteSchemaSnapshot, assertCompleteSnapshot, assertSchemaSnapshot, assertSchemaSnapshotV2, canonicalJson, canonicalizeCompleteSchemaSnapshot, canonicalizeSchemaSnapshot, canonicalizeSchemaSnapshotV2, completeSchemaSnapshotDigest, completeSchemaSnapshotFormat, completeSchemaSnapshotVersion, createMysqlSchemaSnapshot, createPostgresSchemaSnapshot, createSchemaDialect, createSchemaSnapshot, createSqliteSchemaSnapshot, decodeCompleteSchemaSnapshot, decodeCompleteSnapshot, decodeSchemaSnapshot, decodeSchemaSnapshotV2, digestCompleteSchemaSnapshot, digestSchemaSnapshot, encodeCanonicalSnapshot, encodeCompleteSchemaSnapshot, encodeCompleteSnapshot, encodeSchemaSnapshot, encodeSchemaSnapshotV2, encodeSnapshot, mysqlSchemaDialect, mysqlSnapshotAdapter, mysqlSnapshotDialect, neutralSnapshotDialect, postgresSchemaDialect, postgresSnapshotAdapter, postgresSnapshotDialect, schemaSnapshotCompleteVersion, schemaSnapshotDialectVersion, schemaSnapshotDigest, schemaSnapshotFormat, schemaSnapshotNamingPolicyVersion, schemaSnapshotV2Digest, schemaSnapshotV2Version, schemaSnapshotVersion, schemaSnapshotVersion2, serializeSchema, sqliteSchemaDialect, sqliteSnapshotAdapter, sqliteSnapshotDialect, sqliteStorageAffinity, toSnapshotJsonValue, tryCreateMysqlSchemaSnapshot, tryCreatePostgresSchemaSnapshot, tryCreateSchemaSnapshot, tryCreateSqliteSchemaSnapshot };
|
package/dist/sqlite.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cn as ExcludedSource, Dn as excluded, En as doUpdate, On as onConflict, Sn as DoUpdateAction, Tn as doNothing, V as Dialect, bn as ConflictTarget, wn as OnConflictClause, xn as DoNothingAction, yn as ConflictAction } from "./types-
|
|
1
|
+
import { Cn as ExcludedSource, Dn as excluded, En as doUpdate, On as onConflict, Sn as DoUpdateAction, Tn as doNothing, V as Dialect, bn as ConflictTarget, wn as OnConflictClause, xn as DoNothingAction, yn as ConflictAction } from "./types-D8M1yZF4.mjs";
|
|
2
2
|
//#region src/dialects/sqlite.d.ts
|
|
3
3
|
declare function sqliteDialect(): Dialect<"json" | "on-conflict">;
|
|
4
4
|
//#endregion
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { h as parenthesize, i as identifier, t as createColumnReference } from "./column-CXMxx8Hq.mjs";
|
|
2
|
+
import { t as resolveSqlNames } from "./naming-QVCOnSj2.mjs";
|
|
3
|
+
import { r as exposeColumns, t as createSource } from "./source-DUoJVXmL.mjs";
|
|
4
|
+
import { M as materializeSchemaObjectRecord } from "./registry-BufIskVN.mjs";
|
|
5
|
+
//#region src/schema/alias.ts
|
|
6
|
+
function alias(sourceOrQuery, name) {
|
|
7
|
+
const input = sourceOrQuery;
|
|
8
|
+
const reference = identifier(name);
|
|
9
|
+
const isQuery = "queryKind" in input;
|
|
10
|
+
const source = createSource(isQuery ? "query-alias" : "table-alias", (context) => {
|
|
11
|
+
if (isQuery) context.renderRelation(parenthesize(input));
|
|
12
|
+
else context.render(input);
|
|
13
|
+
context.append(" AS ");
|
|
14
|
+
context.render(reference);
|
|
15
|
+
}, reference);
|
|
16
|
+
const fieldNames = isQuery ? Object.keys(input.row) : Object.keys(input.columns);
|
|
17
|
+
const querySqlNames = isQuery ? resolveSqlNames(fieldNames.map((fieldName) => ({ fieldName }))) : void 0;
|
|
18
|
+
const columns = Object.fromEntries(fieldNames.map((fieldName) => {
|
|
19
|
+
const columnName = isQuery ? querySqlNames[fieldName] : input.columns[fieldName].columnName;
|
|
20
|
+
return [fieldName, createColumnReference(columnName, reference, fieldName)];
|
|
21
|
+
}));
|
|
22
|
+
Object.assign(source, {
|
|
23
|
+
alias: name,
|
|
24
|
+
base: isQuery ? void 0 : input,
|
|
25
|
+
query: isQuery ? input : void 0,
|
|
26
|
+
constraints: isQuery ? {} : input.constraints,
|
|
27
|
+
indexes: isQuery ? {} : "indexes" in input ? input.indexes : {},
|
|
28
|
+
columns
|
|
29
|
+
});
|
|
30
|
+
exposeColumns(source, columns);
|
|
31
|
+
return source;
|
|
32
|
+
}
|
|
33
|
+
/** Render a query as a LATERAL source whose outer requirements stay visible. */
|
|
34
|
+
function lateral(query, name) {
|
|
35
|
+
const reference = identifier(name);
|
|
36
|
+
const source = createSource("lateral", (context) => {
|
|
37
|
+
context.append("LATERAL ");
|
|
38
|
+
context.renderRelation(parenthesize(query));
|
|
39
|
+
context.append(" AS ");
|
|
40
|
+
context.render(reference);
|
|
41
|
+
}, reference);
|
|
42
|
+
const sqlNames = resolveSqlNames(Object.keys(query.row).map((fieldName) => ({ fieldName })));
|
|
43
|
+
const columns = Object.fromEntries(Object.keys(query.row).map((fieldName) => [fieldName, createColumnReference(sqlNames[fieldName], reference, fieldName)]));
|
|
44
|
+
Object.assign(source, {
|
|
45
|
+
alias: name,
|
|
46
|
+
query,
|
|
47
|
+
columns
|
|
48
|
+
});
|
|
49
|
+
exposeColumns(source, columns);
|
|
50
|
+
return source;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/schema/table.ts
|
|
54
|
+
function table(name, definitions, metadata) {
|
|
55
|
+
const source = createSource("table", (context) => context.render(identifier(name)), identifier(name));
|
|
56
|
+
const sqlNames = resolveSqlNames(Object.entries(definitions).map(([fieldName, definition]) => ({
|
|
57
|
+
fieldName,
|
|
58
|
+
sqlName: definition.sqlName
|
|
59
|
+
})));
|
|
60
|
+
const columns = Object.fromEntries(Object.keys(definitions).map((fieldName) => {
|
|
61
|
+
const sqlName = sqlNames[fieldName];
|
|
62
|
+
return [fieldName, createColumnReference(sqlName, source.reference, fieldName)];
|
|
63
|
+
}));
|
|
64
|
+
Object.assign(source, {
|
|
65
|
+
tableName: name,
|
|
66
|
+
definitions,
|
|
67
|
+
sqlNames,
|
|
68
|
+
columns,
|
|
69
|
+
constraints: {},
|
|
70
|
+
indexes: {}
|
|
71
|
+
});
|
|
72
|
+
exposeColumns(source, columns);
|
|
73
|
+
const resolvedMetadata = metadata ? metadata(source) : {
|
|
74
|
+
constraints: {},
|
|
75
|
+
indexes: {}
|
|
76
|
+
};
|
|
77
|
+
const constraints = materializeSchemaObjectRecord(resolvedMetadata.constraints, "constraint");
|
|
78
|
+
const indexes = Object.fromEntries(Object.entries(resolvedMetadata.indexes).map(([indexName, tableIndex]) => {
|
|
79
|
+
const candidateKey = tableIndex.unique && tableIndex.predicate === void 0 && tableIndex.terms.every((term) => {
|
|
80
|
+
const expression = "orderKind" in term ? term.expression : term;
|
|
81
|
+
return expression.expressionKind === "column" && definitions[expression.fieldName]?.nullable === false;
|
|
82
|
+
});
|
|
83
|
+
return [indexName, Object.freeze({
|
|
84
|
+
...tableIndex,
|
|
85
|
+
candidateKey
|
|
86
|
+
})];
|
|
87
|
+
}));
|
|
88
|
+
const namedIndexes = materializeSchemaObjectRecord(indexes, "index");
|
|
89
|
+
Object.assign(source, {
|
|
90
|
+
...resolvedMetadata,
|
|
91
|
+
constraints,
|
|
92
|
+
indexes: namedIndexes
|
|
93
|
+
});
|
|
94
|
+
return source;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { alias as n, lateral as r, table as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bs as NativeColumnStorage, Cs as ColumnInsertInput, Fs as ColumnStorageOf, Os as ColumnOutput, Rs as ColumnUpdateInput, Ss as ColumnIdentityOf, Us as PortableColumnStorage, ni as SchemaTableRecord, ws as ColumnIsGenerated, xs as ColumnHasDefault } from "./types-D8M1yZF4.mjs";
|
|
2
2
|
//#region src/drizzle/types.d.ts
|
|
3
3
|
/** SQL engines supported by the Qubu-to-Drizzle runtime adapter. */
|
|
4
4
|
type DrizzleDialect = 'postgresql' | 'mysql' | 'sqlite';
|
|
@@ -21,11 +21,10 @@ type DrizzleColumnGenerated<TDefinition> = ColumnIsGenerated<TDefinition> extend
|
|
|
21
21
|
readonly type: 'always';
|
|
22
22
|
} : undefined;
|
|
23
23
|
type DrizzleColumnHasDefault<TDefinition> = ColumnIsGenerated<TDefinition> extends true ? true : ColumnHasDefault<TDefinition>;
|
|
24
|
-
type DrizzleColumnConfig<TTableName extends string, TDefinition
|
|
24
|
+
type DrizzleColumnConfig<TTableName extends string, TDefinition> = {
|
|
25
25
|
readonly name: string;
|
|
26
26
|
readonly tableName: TTableName;
|
|
27
27
|
readonly dataType: 'custom';
|
|
28
|
-
readonly columnType: TColumnType;
|
|
29
28
|
readonly data: ColumnOutput<TDefinition>;
|
|
30
29
|
readonly driverParam: ColumnInsertInput<TDefinition>;
|
|
31
30
|
readonly enumValues: undefined;
|
|
@@ -758,7 +758,7 @@ declare function binary<const TOptions extends BuiltInColumnOptions = {}>(option
|
|
|
758
758
|
//#endregion
|
|
759
759
|
//#region src/schema/column-nullability.d.ts
|
|
760
760
|
declare const declaredColumnNullability: unique symbol;
|
|
761
|
-
/**
|
|
761
|
+
/** Compile-time nullability retained by a column from its table declaration. */
|
|
762
762
|
type DeclaredColumnNullability<TNullable extends boolean> = {
|
|
763
763
|
readonly [declaredColumnNullability]: TNullable;
|
|
764
764
|
};
|
|
@@ -3633,4 +3633,4 @@ type SchemaSnapshotInput = SchemaSnapshot | Readonly<Record<string, unknown>>;
|
|
|
3633
3633
|
/** Expose the schema generic in tooling declarations without widening APIs. */
|
|
3634
3634
|
type AnySchema = Schema<any>;
|
|
3635
3635
|
//#endregion
|
|
3636
|
-
export { PaginationKind as $, ExplainReadOptions as $a, ColumnReference as $c, lower as $i, SubqueryMeta as $l, RequiredOuterScope as $n, SourceConstraint as $o, SchemaOptions as $r, boolean as $s, SqliteIndexExtension as $t, SnapshotStorage as A, between as Aa, ResolvedColumnBehavior as Ac, offset as Ai, HasSubquery as Al, UpdateAssignments as An, QueryValidationError as Ao, SelectionSqlTypes as Ar, ColumnStorageDeclarationOf as As, createSource as At, CastTarget as B, asValue as Ba, SchemaDialectName as Bc, subtract as Bi, ProvidesOuterSourceMeta as Bl, MutationSqlTypes as Bn, ConstraintTiming as Bo, SchemaRenderContext as Br, NativeStorage as Bs, TableMetadataCallback as Bt, SnapshotIndexTerm as C, isDistinctFrom as Ca, GeneratedColumnMode as Cc, omit as Ci, ExpressionMeta as Cl, ExcludedSource as Cn, qubu as Co, leftJoin as Cr, ColumnIsGenerated as Cs, SourceIdentity as Ct, SqlTypeSatisfies as Cu, SnapshotLiteral as D, lte as Da, IdentityGeneration as Dc, rowLock as Di, GroupingKeysOf as Dl, excluded as Dn, RenderedQuery as Do, Selection as Dr, ColumnOutput as Ds, SourceSqlTypeMap as Dt, SnapshotKeyConstraint as E, lt as Ea, IdentityDialectExtension as Ec, RowLockOptions as Ei, GroupingDependenciesOf as El, doUpdate as En, RenderOptions as Eo, groupBy as Er, ColumnOptions as Es, SourceRow as Et, neutralSnapshotDialect as F, isTrue as Fa, externalGeneratedColumn as Fc, SelectClause as Fi, NullabilityOf as Fl, MutationQuery as Fn, CatalogCheckSql as Fo, RenderedSchemaExpression as Fr, ColumnStorageType as Fs, Table as Ft, DialectJson as G, DriverValueEncoder as Ga, assertSchemaDialectSupport as Gc, jsonPath as Gi, RequiresCapabilityMeta as Gl, returning as Gn, ForeignKeyOptions as Go, normalizeSchemaSql as Gr, PortableStorageType as Gs, table as Gt, DialectCapability as H, value as Ha, SchemaMetadataValidationError as Hc, jsonBoolean as Hi, QueryCardinality as Hl, ReturningClause as Hn, FieldLikeOptions as Ho, UnsafeSchemaSqlExpression as Hr, PortableColumnStorage as Hs, TableRow as Ht, schemaSnapshotDialectVersion as I, Operand as Ia, generatedColumn as Ic, add as Ii, NullableSourceMeta as Il, MutationReturning as In, CheckConstraint as Io, SchemaExpressionError as Ir, ColumnStorageTypeOf as Is, TableColumns as It, DialectRowLocking as J, ExecutionResult as Ja, generatedSchemaObjectName as Jc, over as Ji, RequiresOuterOf as Jl, AvailableOuterScope as Jn, KeyConstraint as Jo, schemaExpression as Jr, StorageDialectOf as Js, IndexTerm as Jt, DialectOptions as K, ExecutionOptions as Ka, dialectMismatchDiagnostic as Kc, jsonText as Ki, RequiresOf as Kl, correlate as Kn, ForeignKeyTarget as Ko, renderSchemaExpression as Kr, StorageDeclarationOf as Ks, IndexDialectExtension as Kt, schemaSnapshotFormat as L, OperandNullability as La, identityColumn as Lc, divide as Li, NullableSourcesOf as Ll, MutationReturningClause as Ln, CheckConstraintOptions as Lo, SchemaExpressionErrorCode as Lr, ColumnUpdateInput as Ls, TableDefinitions as Lt, SnapshotTable as M, notIn as Ma, SqliteIdentityExtension as Mc, distinct as Mi, InheritedMetadata as Ml, AllowAllClause as Mn, QueryValidationIssue as Mo, SchemaDialect as Mr, ColumnStorageDialectOf as Ms, exposeColumns as Mt, SnapshotUniqueConstraint as N, isNotNull as Na, canonicalLiteral as Nc, AnySelectClause as Ni, InheritedMetadataOf as Nl, MutationClause as Nn, AnyKeyColumn as No, SchemaDialectHooks as Nr, ColumnStorageKindOf as Ns, sourceIdentity as Nt, SnapshotNamingPolicy as O, ne as Oa, LiteralDefaultDescriptor as Oc, fetchFirst as Oi, GroupingMeta as Ol, onConflict as On, render as Oo, SelectionObject as Or, ColumnSqlType as Os, SourceSqlTypes as Ot, SnapshotValidationContext as P, isNull as Pa, externalDefault as Pc, ClausePlacement as Pi, MetadataOf as Pl, MutationKind as Pn, CatalogCheckExpression as Po, createSchemaDialect as Pr, ColumnStorageOf as Ps, AnyTable as Pt, NamedCastTarget as Q, ExplainPlanRow as Qa, ColumnDependency as Qc, concat as Qi, SqlTypeOf as Ql, MissingScope as Qn, ReferentialAction as Qo, SchemaNamingPolicy as Qr, binary as Qs, SourceIndexesRecord as Qt, schemaSnapshotNamingPolicyVersion as R, OperandSqlType as Ra, resolveColumnBehavior as Rc, modulo as Ri, OutputOf as Rl, MutationRow as Rn, ConstraintDialectExtension as Ro, SchemaExpressionInput as Rr, DialectNativeStorage as Rs, TableIdentity as Rt, SnapshotIndex as S, gte as Sa, GeneratedColumnDescriptor as Sc, SelectPart as Si, DependenciesOf as Sl, DoUpdateAction as Sn, explain as So, innerJoin as Sr, ColumnInsertInput as Ss, SourceConstraints as St, SqlTimestamp as Su, SnapshotJsonValue as T, like as Ta, IdentityDescriptor as Tc, RowLockClause as Ti, FragmentMeta as Tl, doNothing as Tn, RenderCapabilityValidation as To, rightJoin as Tr, ColumnOnUpdateOf as Ts, SourceProvision as Tt, SqlUuid as Tu, DialectCastTypes as U, cast as Ua, SchemaObjectIdentity as Uc, jsonExists as Ui, RenderContext as Ul, ReturningRow as Un, ForeignKeyConstraint as Uo, defineSchemaExpression as Ur, PortableStorage as Us, TableSqlTypes as Ut, Dialect as V, typedValue as Va, SchemaMetadataDiagnostic as Vc, JsonPath as Vi, ProvidesSourceMeta as Vl, allowAll as Vn, FieldLike as Vo, SchemaRenderOptions as Vr, NativeStorageDescriptor as Vs, TableOptions as Vt, DialectExplain as W, typedCast as Wa, SchemaObjectNameOptions as Wc, jsonNumber as Wi, RenderFunction as Wl, ReturningSqlTypes as Wn, ForeignKeyMatch as Wo, isUnsafeSchemaSql as Wr, PortableStorageDescriptor as Ws, TableUpdateInput as Wt, ExplainRenderOptions as X, ExplainOptions as Xa, materializeSchemaObjectIdentity as Xc, rowNumber as Xi, RequiresSourceMeta as Xl, ClauseScope as Xn, MysqlConstraintExtension as Xo, Schema as Xr, StorageTypeOf as Xs, PostgresIndexExtension as Xt, ExplainFormat as Y, ExplainMutationOptions as Ya, isValidSchemaObjectName as Yc, rank as Yi, RequiresOuterSourceMeta as Yl, AvailableScope as Yn, KeyConstraintOptions as Yo, unsafeSchemaSql as Yr, StorageOf as Ys, MysqlIndexExtension as Yt, JsonScalarKind as Z, ExplainOptionsFor as Za, materializeSchemaObjectRecord as Zc, coalesce as Zi, ResultMeta as Zl, GroupingValidation as Zn, PostgresConstraintExtension as Zo, SchemaDiagnostic as Zr, bigint as Zs, SourceIndex as Zt, SnapshotExpressionContext as _, notExists as _a, DefaultDescriptor as _c, and as _i, AnyFragment as _l, insertSelect as _n, StreamingTransactionalQueryAdapter as _o, FromScope as _r, ColumnDefinition as _s, CustomSourceOptions as _t, SqlOrderCompatible as _u, SnapshotBigInt as a, count as aa, nativeStorage as ac, defaultSchemaNamingPolicy as ai, ExpressionNullability as al, desc as an, QubuExplainableStreamingTransactionalClient as ao, RecursiveCteSource as ar, UniqueConstraintOptions as as, SchemaLiteralRenderer as at, sequence as au, SnapshotGeneratedColumn as b, eq as ba, ExternalDefaultDescriptor as bc, Omit$1 as bi, CardinalityMeta as bl, ConflictTarget as bn, execute as bo, crossJoin as br, ColumnHasDefault as bs, Source as bt, SqlText as bu, SnapshotConstraint as c, min as ca, portableStorage as cc, schemaNamingPolicyVersion as ci, ExpressionSqlType as cl, order as cn, QubuStreamingExplainableClient as co, recursiveCte as cr, catalogForeignKey as cs, resolveCastTarget as ct, SqlBinary as cu, SnapshotDefault as d, SqlTag as da, uuid as dc, LateralIdentity as di, isExpression as dl, DefaultValuesSource as dn, QubuTransaction as do, SetQuery as dr, primaryKey as ds, QueryKind as dt, SqlDecimal as du, upper as ea, column as ec, SchemaTableEntry as ei, expressionFragment as el, TableIndex as en, ExplainRequest as eo, RequiredScope as er, SourceConstraintsRecord as es, PaginationPart as et, VisibleDependenciesOf as eu, SnapshotDiagnostic as f, TypedSqlTag as fa, CanonicalLiteral as fc, LateralSource as fi, makeExpression as fl, InsertSelectSource as fn, QubuTransactionalClient as fo, except as fr, references as fs, QueryRow as ft, SqlEqualityComparable as fu, SnapshotExpression as g, inQuery as ga, ColumnDefaultInput as gc, lateral as gi, AggregateMeta as gl, insertInto as gn, StreamingQueryAdapter as go, FromClause as gr, ColumnDefaultOf as gs, CustomSource as gt, SqlNumericLike as gu, SnapshotDialectExtension as h, exists as ha, ColumnDefault as hc, alias as hi, AggregateDependenciesOf as hl, defaultValues as hn, StreamableQuery as ho, unionAll as hr, validateConstraintDialect as hs, AnySource as ht, SqlJson as hu, SchemaSnapshotInput as i, avg as ia, nativeColumn as ic, SchemaValidationError as ii, ExpressionKind as il, asc as in, QubuExplainableClient as io, CteSource as ir, UniqueConstraint as is, RowLockWaitPolicy as it, parenthesize as iu, SnapshotStorageContext as j, inList as ja, SchemaLiteralValue as jc, having as ji, HasWindow as jl, update as jn, QueryValidationErrorCode as jo, all as jr, ColumnStorageDescriptor as js, customSource as jt, SnapshotSpecialNumber as k, notLike as ka, MysqlIdentityExtension as kc, fetchNext as ki, HasAggregate as kl, UpdateAssignmentValue as kn, QueryTypeValidation as ko, SelectionOutput as kr, ColumnStorage as ks, UnknownSourceSqlTypes as kt, SnapshotCreateResult as l, sum as la, text as lc, AliasIdentity as li, ExpressionWithOutput as ll, orderBy as ln, QubuStreamingTransaction as lo, withCte as lr, check as ls, AnyQuery as lt, SqlBoolean as lu, SnapshotDialect as m, caseWhen as ma, ColumnBehaviorErrorCode as mc, QuerySource as mi, withDialectCapability as ml, ValuesSource as mn, QueryExecutor as mo, union as mr, uniqueConstraint as ms, Row as mt, SqlInteger as mu, SchemaSnapshot as n, schemaCall as na, integer as nc, SchemaTableRecord as ni, AnySchemaExpression as nl, validateIndexDialect as nn, ExplainableQueryAdapter as no, SelectCardinality as nr, SqliteConstraintExtension as ns, PortableCastType as nt, fragment as nu, SnapshotCheckConstraint as o, countDistinct as oa, nullable as oc, generatedTableName as oi, ExpressionOutput as ol, nullsFirst as on, QubuExplainableTransactionalClient as oo, WithClause as or, UniqueNullSemantics as os, assertDialectCapability as ot, AnySqlType as ou, SnapshotDiagnosticCode as p, sql as pa, ColumnBehaviorError as pc, QueryAliasIdentity as pi, markExpressionCategory as pl, InsertSource as pn, QueryAdapter as po, intersect as pr, unique as ps, QuerySqlTypeMap as pt, SqlEqualityCompatible as pu, DialectPagination as q, ExecutionRequest as qa, freezeSchemaMetadata as qc, denseRank as qi, RequiresOuterMetadataOf as ql, select as qn, ForeignKeyTargetInput as qo, renderSchemaSql as qr, StorageDescriptor as qs, IndexOptions as qt, SchemaSnapshotAdapter as r, typedCall as ra, json as rc, SchemaTableRegistry as ri, Expression as rl, OrderTerm as rn, QubuClient as ro, SelectQuery as rr, TableLike as rs, RowLockMode as rt, isFragment as ru, SnapshotColumn as s, max as sa, numeric as sc, schema as si, ExpressionRequires as sl, nullsLast as sn, QubuStreamingClient as so, cte as sr, catalogCheck as ss, createDialect as st, SqlBigInt as su, AnySchema as t, call as ta, date as tc, SchemaTableNames as ti, AnyExpression as tl, index as tn, ExplainResult as to, ScopeValidation as tr, SourceLike as ts, PortableCastTarget as tt, WindowMeta as tu, SnapshotDecodeResult as u, SqlFragment as ua, timestamp as uc, AliasedSource as ui, SchemaExpression as ul, deleteFrom as un, QubuStreamingTransactionalClient as uo, SetOperator as ur, foreignKey as us, Query as ut, SqlDate as uu, SnapshotExtensionContext as v, scalar as va, ExpressionDefaultDescriptor as vc, not as vi, CapabilitiesOf as vl, values as vn, TransactionOptions as vo, FromSource as vr, ColumnFromOptions as vs, ProvidedSourceIdentity as vt, SqlOrderable as vu, SnapshotIndexTermExpression as w, isNotDistinctFrom as wa, GeneratedDescriptor as wc, where as wi, Fragment as wl, OnConflictClause as wn, stream as wo, naturalJoin as wr, ColumnIsNullable as ws, SourceKind as wt, SqlUnknown as wu, SnapshotIdentity as x, gt as xa, ExternalGeneratedColumnDescriptor as xc, OmittableSelectClause as xi, CardinalityOf as xl, DoNothingAction as xn, executeRows as xo, fullJoin as xr, ColumnIdentityOf as xs, SourceColumns as xt, SqlTextLike as xu, SnapshotForeignKey as y, ComparisonValidation as ya, ExpressionGeneratedColumnDescriptor as yc, or as yi, CapabilityMetadataOf as yl, ConflictAction as yn, TransactionalQueryAdapter as yo, from as yr, ColumnGeneratedOf as ys, ProvidedSourceRow as yt, SqlSemanticType as yu, schemaSnapshotVersion as z, SqlCapabilityValidation as za, SchemaDialectExtension as zc, multiply as zi, ProvidesOuterOf as zl, MutationScopeValidation as zn, ConstraintOptions as zo, SchemaExpressionMode as zr, NativeColumnStorage as zs, TableInsertInput as zt };
|
|
3636
|
+
export { PaginationKind as $, ExplainReadOptions as $a, ColumnDependency as $c, lower as $i, ResultMeta as $l, RequiredOuterScope as $n, SourceConstraint as $o, SchemaOptions as $r, binary as $s, SqliteIndexExtension as $t, SnapshotStorage as A, between as Aa, MysqlIdentityExtension as Ac, offset as Ai, GroupingMeta as Al, UpdateAssignments as An, QueryValidationError as Ao, SelectionSqlTypes as Ar, ColumnStorage as As, createSource as At, CastTarget as B, asValue as Ba, SchemaDialectExtension as Bc, subtract as Bi, OutputOf as Bl, MutationSqlTypes as Bn, ConstraintTiming as Bo, SchemaRenderContext as Br, NativeColumnStorage as Bs, TableMetadataCallback as Bt, SnapshotIndexTerm as C, isDistinctFrom as Ca, GeneratedColumnDescriptor as Cc, omit as Ci, CardinalityOf as Cl, ExcludedSource as Cn, qubu as Co, leftJoin as Cr, ColumnInsertInput as Cs, SourceIdentity as Ct, SqlTextLike as Cu, SnapshotLiteral as D, lte as Da, IdentityDialectExtension as Dc, rowLock as Di, FragmentMeta as Dl, excluded as Dn, RenderedQuery as Do, Selection as Dr, ColumnOptions as Ds, SourceSqlTypeMap as Dt, SqlUuid as Du, SnapshotKeyConstraint as E, lt as Ea, IdentityDescriptor as Ec, RowLockOptions as Ei, Fragment as El, doUpdate as En, RenderOptions as Eo, groupBy as Er, ColumnOnUpdateOf as Es, SourceRow as Et, SqlUnknown as Eu, neutralSnapshotDialect as F, isTrue as Fa, externalDefault as Fc, SelectClause as Fi, InheritedMetadataOf as Fl, MutationQuery as Fn, CatalogCheckSql as Fo, RenderedSchemaExpression as Fr, ColumnStorageOf as Fs, Table as Ft, DialectJson as G, DriverValueEncoder as Ga, SchemaObjectNameOptions as Gc, jsonPath as Gi, RenderContext as Gl, returning as Gn, ForeignKeyOptions as Go, normalizeSchemaSql as Gr, PortableStorageDescriptor as Gs, table as Gt, DialectCapability as H, value as Ha, SchemaMetadataDiagnostic as Hc, jsonBoolean as Hi, ProvidesOuterSourceMeta as Hl, ReturningClause as Hn, FieldLikeOptions as Ho, UnsafeSchemaSqlExpression as Hr, NativeStorageDescriptor as Hs, TableRow as Ht, schemaSnapshotDialectVersion as I, Operand as Ia, externalGeneratedColumn as Ic, add as Ii, MetadataOf as Il, MutationReturning as In, CheckConstraint as Io, SchemaExpressionError as Ir, ColumnStorageType as Is, TableColumns as It, DialectRowLocking as J, ExecutionResult as Ja, freezeSchemaMetadata as Jc, over as Ji, RequiresOf as Jl, AvailableOuterScope as Jn, KeyConstraint as Jo, schemaExpression as Jr, StorageDescriptor as Js, IndexTerm as Jt, DialectOptions as K, ExecutionOptions as Ka, assertSchemaDialectSupport as Kc, jsonText as Ki, RenderFunction as Kl, correlate as Kn, ForeignKeyTarget as Ko, renderSchemaExpression as Kr, PortableStorageType as Ks, IndexDialectExtension as Kt, schemaSnapshotFormat as L, OperandNullability as La, generatedColumn as Lc, divide as Li, NullabilityOf as Ll, MutationReturningClause as Ln, CheckConstraintOptions as Lo, SchemaExpressionErrorCode as Lr, ColumnStorageTypeOf as Ls, TableDefinitions as Lt, SnapshotTable as M, notIn as Ma, SchemaLiteralValue as Mc, distinct as Mi, HasSubquery as Ml, AllowAllClause as Mn, QueryValidationIssue as Mo, SchemaDialect as Mr, ColumnStorageDescriptor as Ms, exposeColumns as Mt, SnapshotUniqueConstraint as N, isNotNull as Na, SqliteIdentityExtension as Nc, AnySelectClause as Ni, HasWindow as Nl, MutationClause as Nn, AnyKeyColumn as No, SchemaDialectHooks as Nr, ColumnStorageDialectOf as Ns, sourceIdentity as Nt, SnapshotNamingPolicy as O, ne as Oa, IdentityGeneration as Oc, fetchFirst as Oi, GroupingDependenciesOf as Ol, onConflict as On, render as Oo, SelectionObject as Or, ColumnOutput as Os, SourceSqlTypes as Ot, SnapshotValidationContext as P, isNull as Pa, canonicalLiteral as Pc, ClausePlacement as Pi, InheritedMetadata as Pl, MutationKind as Pn, CatalogCheckExpression as Po, createSchemaDialect as Pr, ColumnStorageKindOf as Ps, AnyTable as Pt, NamedCastTarget as Q, ExplainPlanRow as Qa, materializeSchemaObjectRecord as Qc, concat as Qi, RequiresSourceMeta as Ql, MissingScope as Qn, ReferentialAction as Qo, SchemaNamingPolicy as Qr, bigint as Qs, SourceIndexesRecord as Qt, schemaSnapshotNamingPolicyVersion as R, OperandSqlType as Ra, identityColumn as Rc, modulo as Ri, NullableSourceMeta as Rl, MutationRow as Rn, ConstraintDialectExtension as Ro, SchemaExpressionInput as Rr, ColumnUpdateInput as Rs, TableIdentity as Rt, SnapshotIndex as S, gte as Sa, ExternalGeneratedColumnDescriptor as Sc, SelectPart as Si, CardinalityMeta as Sl, DoUpdateAction as Sn, explain as So, innerJoin as Sr, ColumnIdentityOf as Ss, SourceConstraints as St, SqlText as Su, SnapshotJsonValue as T, like as Ta, GeneratedDescriptor as Tc, RowLockClause as Ti, ExpressionMeta as Tl, doNothing as Tn, RenderCapabilityValidation as To, rightJoin as Tr, ColumnIsNullable as Ts, SourceProvision as Tt, SqlTypeSatisfies as Tu, DialectCastTypes as U, cast as Ua, SchemaMetadataValidationError as Uc, jsonExists as Ui, ProvidesSourceMeta as Ul, ReturningRow as Un, ForeignKeyConstraint as Uo, defineSchemaExpression as Ur, PortableColumnStorage as Us, TableSqlTypes as Ut, Dialect as V, typedValue as Va, SchemaDialectName as Vc, JsonPath as Vi, ProvidesOuterOf as Vl, allowAll as Vn, FieldLike as Vo, SchemaRenderOptions as Vr, NativeStorage as Vs, TableOptions as Vt, DialectExplain as W, typedCast as Wa, SchemaObjectIdentity as Wc, jsonNumber as Wi, QueryCardinality as Wl, ReturningSqlTypes as Wn, ForeignKeyMatch as Wo, isUnsafeSchemaSql as Wr, PortableStorage as Ws, TableUpdateInput as Wt, ExplainRenderOptions as X, ExplainOptions as Xa, isValidSchemaObjectName as Xc, rowNumber as Xi, RequiresOuterOf as Xl, ClauseScope as Xn, MysqlConstraintExtension as Xo, Schema as Xr, StorageOf as Xs, PostgresIndexExtension as Xt, ExplainFormat as Y, ExplainMutationOptions as Ya, generatedSchemaObjectName as Yc, rank as Yi, RequiresOuterMetadataOf as Yl, AvailableScope as Yn, KeyConstraintOptions as Yo, unsafeSchemaSql as Yr, StorageDialectOf as Ys, MysqlIndexExtension as Yt, JsonScalarKind as Z, ExplainOptionsFor as Za, materializeSchemaObjectIdentity as Zc, coalesce as Zi, RequiresOuterSourceMeta as Zl, GroupingValidation as Zn, PostgresConstraintExtension as Zo, SchemaDiagnostic as Zr, StorageTypeOf as Zs, SourceIndex as Zt, SnapshotExpressionContext as _, notExists as _a, ColumnDefaultInput as _c, and as _i, AggregateDependenciesOf as _l, insertSelect as _n, StreamingTransactionalQueryAdapter as _o, FromScope as _r, ColumnDefaultOf as _s, CustomSourceOptions as _t, SqlJson as _u, SnapshotBigInt as a, count as aa, nativeColumn as ac, defaultSchemaNamingPolicy as ai, ExpressionKind as al, desc as an, QubuExplainableStreamingTransactionalClient as ao, RecursiveCteSource as ar, UniqueConstraintOptions as as, SchemaLiteralRenderer as at, isFragment as au, SnapshotGeneratedColumn as b, eq as ba, ExpressionGeneratedColumnDescriptor as bc, Omit$1 as bi, CapabilitiesOf as bl, ConflictTarget as bn, execute as bo, crossJoin as br, ColumnGeneratedOf as bs, Source as bt, SqlOrderable as bu, SnapshotConstraint as c, min as ca, numeric as cc, schemaNamingPolicyVersion as ci, ExpressionRequires as cl, order as cn, QubuStreamingExplainableClient as co, recursiveCte as cr, catalogForeignKey as cs, resolveCastTarget as ct, AnySqlType as cu, SnapshotDefault as d, SqlTag as da, timestamp as dc, LateralIdentity as di, SchemaExpression as dl, DefaultValuesSource as dn, QubuTransaction as do, SetQuery as dr, primaryKey as ds, QueryKind as dt, SqlBoolean as du, upper as ea, boolean as ec, SchemaTableEntry as ei, ColumnReference as el, TableIndex as en, ExplainRequest as eo, RequiredScope as er, SourceConstraintsRecord as es, PaginationPart as et, SqlTypeOf as eu, SnapshotDiagnostic as f, TypedSqlTag as fa, uuid as fc, LateralSource as fi, SchemaExpressionBrand as fl, InsertSelectSource as fn, QubuTransactionalClient as fo, except as fr, references as fs, QueryRow as ft, SqlDate as fu, SnapshotExpression as g, inQuery as ga, ColumnDefault as gc, lateral as gi, withDialectCapability as gl, insertInto as gn, StreamingQueryAdapter as go, FromClause as gr, DeclaredColumnNullability as gs, CustomSource as gt, SqlInteger as gu, SnapshotDialectExtension as h, exists as ha, ColumnBehaviorErrorCode as hc, alias as hi, markExpressionCategory as hl, defaultValues as hn, StreamableQuery as ho, unionAll as hr, validateConstraintDialect as hs, AnySource as ht, SqlEqualityCompatible as hu, SchemaSnapshotInput as i, avg as ia, json as ic, SchemaValidationError as ii, Expression as il, asc as in, QubuExplainableClient as io, CteSource as ir, UniqueConstraint as is, RowLockWaitPolicy as it, fragment as iu, SnapshotStorageContext as j, inList as ja, ResolvedColumnBehavior as jc, having as ji, HasAggregate as jl, update as jn, QueryValidationErrorCode as jo, all as jr, ColumnStorageDeclarationOf as js, customSource as jt, SnapshotSpecialNumber as k, notLike as ka, LiteralDefaultDescriptor as kc, fetchNext as ki, GroupingKeysOf as kl, UpdateAssignmentValue as kn, QueryTypeValidation as ko, SelectionOutput as kr, ColumnSqlType as ks, UnknownSourceSqlTypes as kt, SnapshotCreateResult as l, sum as la, portableStorage as lc, AliasIdentity as li, ExpressionSqlType as ll, orderBy as ln, QubuStreamingTransaction as lo, withCte as lr, check as ls, AnyQuery as lt, SqlBigInt as lu, SnapshotDialect as m, caseWhen as ma, ColumnBehaviorError as mc, QuerySource as mi, makeExpression as ml, ValuesSource as mn, QueryExecutor as mo, union as mr, uniqueConstraint as ms, Row as mt, SqlEqualityComparable as mu, SchemaSnapshot as n, schemaCall as na, date as nc, SchemaTableRecord as ni, AnyExpression as nl, validateIndexDialect as nn, ExplainableQueryAdapter as no, SelectCardinality as nr, SqliteConstraintExtension as ns, PortableCastType as nt, VisibleDependenciesOf as nu, SnapshotCheckConstraint as o, countDistinct as oa, nativeStorage as oc, generatedTableName as oi, ExpressionNullability as ol, nullsFirst as on, QubuExplainableTransactionalClient as oo, WithClause as or, UniqueNullSemantics as os, assertDialectCapability as ot, parenthesize as ou, SnapshotDiagnosticCode as p, sql as pa, CanonicalLiteral as pc, QueryAliasIdentity as pi, isExpression as pl, InsertSource as pn, QueryAdapter as po, intersect as pr, unique as ps, QuerySqlTypeMap as pt, SqlDecimal as pu, DialectPagination as q, ExecutionRequest as qa, dialectMismatchDiagnostic as qc, denseRank as qi, RequiresCapabilityMeta as ql, select as qn, ForeignKeyTargetInput as qo, renderSchemaSql as qr, StorageDeclarationOf as qs, IndexOptions as qt, SchemaSnapshotAdapter as r, typedCall as ra, integer as rc, SchemaTableRegistry as ri, AnySchemaExpression as rl, OrderTerm as rn, QubuClient as ro, SelectQuery as rr, TableLike as rs, RowLockMode as rt, WindowMeta as ru, SnapshotColumn as s, max as sa, nullable as sc, schema as si, ExpressionOutput as sl, nullsLast as sn, QubuStreamingClient as so, cte as sr, catalogCheck as ss, createDialect as st, sequence as su, AnySchema as t, call as ta, column as tc, SchemaTableNames as ti, expressionFragment as tl, index as tn, ExplainResult as to, ScopeValidation as tr, SourceLike as ts, PortableCastTarget as tt, SubqueryMeta as tu, SnapshotDecodeResult as u, SqlFragment as ua, text as uc, AliasedSource as ui, ExpressionWithOutput as ul, deleteFrom as un, QubuStreamingTransactionalClient as uo, SetOperator as ur, foreignKey as us, Query as ut, SqlBinary as uu, SnapshotExtensionContext as v, scalar as va, DefaultDescriptor as vc, not as vi, AggregateMeta as vl, values as vn, TransactionOptions as vo, FromSource as vr, ColumnDefinition as vs, ProvidedSourceIdentity as vt, SqlNumericLike as vu, SnapshotIndexTermExpression as w, isNotDistinctFrom as wa, GeneratedColumnMode as wc, where as wi, DependenciesOf as wl, OnConflictClause as wn, stream as wo, naturalJoin as wr, ColumnIsGenerated as ws, SourceKind as wt, SqlTimestamp as wu, SnapshotIdentity as x, gt as xa, ExternalDefaultDescriptor as xc, OmittableSelectClause as xi, CapabilityMetadataOf as xl, DoNothingAction as xn, executeRows as xo, fullJoin as xr, ColumnHasDefault as xs, SourceColumns as xt, SqlSemanticType as xu, SnapshotForeignKey as y, ComparisonValidation as ya, ExpressionDefaultDescriptor as yc, or as yi, AnyFragment as yl, ConflictAction as yn, TransactionalQueryAdapter as yo, from as yr, ColumnFromOptions as ys, ProvidedSourceRow as yt, SqlOrderCompatible as yu, schemaSnapshotVersion as z, SqlCapabilityValidation as za, resolveColumnBehavior as zc, multiply as zi, NullableSourcesOf as zl, MutationScopeValidation as zn, ConstraintOptions as zo, SchemaExpressionMode as zr, DialectNativeStorage as zs, TableInsertInput as zt };
|
package/docs/guides/drizzle.md
CHANGED
|
@@ -9,11 +9,11 @@ Install Drizzle next to Qubu. The Drizzle entrypoints use an optional peer
|
|
|
9
9
|
dependency, so importing the rest of Qubu does not load the ORM.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
pnpm add qubu drizzle-orm
|
|
12
|
+
pnpm add qubu drizzle-orm@rc
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The converter supports PostgreSQL, MySQL, and SQLite with Drizzle 0.
|
|
16
|
-
|
|
15
|
+
The converter supports PostgreSQL, MySQL, and SQLite with Drizzle 1.0.0-rc.4
|
|
16
|
+
and later 1.x releases.
|
|
17
17
|
|
|
18
18
|
## Convert the schema
|
|
19
19
|
|
|
@@ -50,13 +50,14 @@ not import a dialect core or provide a universal runtime converter.
|
|
|
50
50
|
physical `user_records` name, `app` namespace, field keys, and physical column
|
|
51
51
|
names all come from the Qubu declaration.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Use the converted tables in ordinary Drizzle queries. Table objects do not need
|
|
54
|
+
to be passed to `drizzle()`:
|
|
54
55
|
|
|
55
56
|
```ts
|
|
56
57
|
import { eq } from 'drizzle-orm'
|
|
57
58
|
import { drizzle } from 'drizzle-orm/node-postgres'
|
|
58
59
|
|
|
59
|
-
const db = drizzle(pool
|
|
60
|
+
const db = drizzle(pool)
|
|
60
61
|
|
|
61
62
|
const rows = await db
|
|
62
63
|
.select({ id: drizzleTables.users.id, name: drizzleTables.users.name })
|
|
@@ -67,6 +68,33 @@ const rows = await db
|
|
|
67
68
|
Existing Qubu queries can keep importing `users`. Move call sites to
|
|
68
69
|
`drizzleTables.users` one at a time without duplicating the table declaration.
|
|
69
70
|
|
|
71
|
+
### Keep SQLite integer timestamps
|
|
72
|
+
|
|
73
|
+
Use `sqliteTimestamp()` when an existing SQLite schema stores dates as integer
|
|
74
|
+
Unix timestamps and Drizzle must continue reading and writing `Date` values:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
import { schema, table } from 'qubu'
|
|
78
|
+
import { sqliteTimestamp, toSqliteDrizzleSchema } from 'qubu/drizzle/sqlite'
|
|
79
|
+
|
|
80
|
+
const events = table('events', {
|
|
81
|
+
createdAt: sqliteTimestamp({
|
|
82
|
+
mode: 'timestamp',
|
|
83
|
+
defaultFn: () => new Date(),
|
|
84
|
+
}),
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const drizzleTables = toSqliteDrizzleSchema(schema({ events }))
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`timestamp` stores Unix seconds and `timestamp_ms` stores Unix milliseconds.
|
|
91
|
+
Both modes expose `Date` values through Drizzle. `defaultFn` runs when a
|
|
92
|
+
Drizzle insert omits the column; it is runtime behavior and is not emitted as a
|
|
93
|
+
database `DEFAULT` or serialized into a Qubu snapshot.
|
|
94
|
+
|
|
95
|
+
Use Qubu's root `timestamp()` helper for portable schemas. SQLite stores that
|
|
96
|
+
portable form as ISO text instead of an integer.
|
|
97
|
+
|
|
70
98
|
## Type behavior
|
|
71
99
|
|
|
72
100
|
The converted columns preserve selected values, nullability, required insert
|
|
@@ -110,7 +138,7 @@ const tables = toPostgresDrizzleSchema(schema({ records }))
|
|
|
110
138
|
```
|
|
111
139
|
|
|
112
140
|
Conversion first runs Qubu's snapshot validation for the selected dialect.
|
|
113
|
-
Metadata that Drizzle 0
|
|
141
|
+
Metadata that Drizzle 1.0 cannot express, such as deferred constraints or
|
|
114
142
|
included index columns, raises `DrizzleSchemaConversionError` with a `code` and
|
|
115
143
|
`path`.
|
|
116
144
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qubu",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/aleclarson/qubu"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@types/bun": "^1.3.0",
|
|
93
93
|
"@types/node": "^24.6.2",
|
|
94
94
|
"@types/pg": "^8.23.1",
|
|
95
|
-
"drizzle-orm": "0.
|
|
95
|
+
"drizzle-orm": "1.0.0-rc.4",
|
|
96
96
|
"lildocs": "^0.1.27",
|
|
97
97
|
"mysql2": "^3.23.4",
|
|
98
98
|
"pg": "^8.23.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@standard-schema/spec": "^1.0.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
|
-
"drizzle-orm": "
|
|
113
|
+
"drizzle-orm": "^1.0.0-rc.4"
|
|
114
114
|
},
|
|
115
115
|
"peerDependenciesMeta": {
|
|
116
116
|
"drizzle-orm": {
|