qubu 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{complete-DP7pliuY.mjs → canonical-B5_ouh-c.mjs} +466 -241
- package/dist/codegen.d.mts +2 -2
- package/dist/codegen.mjs +180 -90
- package/dist/column-Cyc2CMnG.mjs +116 -0
- package/dist/column-DDRvD7SF.mjs +721 -0
- package/dist/{constraints-DM_tarXc.mjs → constraints-CAmi18Uk.mjs} +8 -3
- package/dist/core.d.mts +3 -3
- package/dist/core.mjs +4 -4
- package/dist/diff.d.mts +9 -9
- package/dist/diff.mjs +152 -102
- package/dist/{explain-CkIK13L_.mjs → explain-BIqEmZha.mjs} +1 -1
- package/dist/{expressions-BCjc08zw.mjs → expressions-_6JF_J77.mjs} +2 -1
- package/dist/index-CaxrMD1A.d.mts +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +368 -74
- package/dist/introspection/mysql.d.mts +1 -1
- package/dist/introspection/mysql.mjs +156 -23
- package/dist/introspection/postgres.d.mts +6 -3
- package/dist/introspection/postgres.mjs +388 -53
- package/dist/introspection/sqlite.d.mts +1 -1
- package/dist/introspection/sqlite.mjs +198 -12
- package/dist/introspection.d.mts +26 -12
- package/dist/introspection.mjs +2 -672
- package/dist/mysql.d.mts +3 -3
- package/dist/mysql.mjs +6 -5
- package/dist/{errors-Dxv73YJu.mjs → omit-VEr9Ydux.mjs} +5 -1
- package/dist/{on-conflict-CnaY5qso.mjs → on-conflict-B2rFyHGF.mjs} +6 -8
- package/dist/on-duplicate-key-update-Czsw1Yq-.mjs +95 -0
- package/dist/{postgres-Dey7QXPL.mjs → postgres-hFhd0I9n.mjs} +4 -5
- package/dist/postgres.d.mts +2 -2
- package/dist/postgres.mjs +2 -2
- package/dist/{registry-oWDiqD7i.mjs → registry-BXE_4M9P.mjs} +1 -1
- package/dist/{relational-DSAJ-l58.mjs → relational-CoPBETjI.mjs} +3 -2
- package/dist/schema.d.mts +2 -2
- package/dist/schema.mjs +8 -8
- package/dist/{serialize-CE-gw5_s.mjs → serialize-CyobNEx-.mjs} +174 -30
- package/dist/serialize-Du2UPZMt.d.mts +92 -0
- package/dist/snapshot/mysql.d.mts +5 -5
- package/dist/snapshot/mysql.mjs +8 -8
- package/dist/snapshot/postgres.d.mts +3 -3
- package/dist/snapshot/postgres.mjs +9 -9
- package/dist/snapshot/sqlite.d.mts +3 -3
- package/dist/snapshot/sqlite.mjs +7 -7
- package/dist/snapshot-mIb-Zzb5.mjs +1489 -0
- package/dist/snapshot.d.mts +4 -5
- package/dist/snapshot.mjs +3 -4
- package/dist/{source-BDuUXmAk.mjs → source-DYSUqzvb.mjs} +2 -2
- package/dist/sqlite.d.mts +2 -2
- package/dist/sqlite.mjs +6 -6
- package/dist/{table-C1QGNe4P.mjs → table-B8zEq0az.mjs} +4 -4
- package/dist/{types-BLNRatG_.mjs → types-CYHpSPwj.mjs} +10 -5
- package/dist/{types-BEn0N_al.d.mts → types-CiMvKi5V.d.mts} +14 -4
- package/dist/{types-DUe6eeI0.d.mts → types-Dqr4o2I1.d.mts} +590 -168
- package/dist/value-CpaUFtjw.mjs +45 -0
- package/dist/vite/ambient.d.ts +2 -0
- package/dist/vite.d.mts +1 -1
- package/dist/vite.mjs +2 -0
- package/docs/dialects-and-execution.md +61 -11
- package/docs/getting-started.md +1 -1
- package/docs/guides/extensions/typed-expressions.md +5 -3
- package/docs/guides/json.md +95 -2
- package/docs/guides/mutations.md +36 -0
- package/docs/index.md +1 -1
- package/docs/migrations/adapters.md +58 -21
- package/docs/migrations/recovery.md +7 -1
- package/docs/query-model/fragments.md +21 -1
- package/docs/reference/introspection-support.md +16 -18
- package/docs/reference/supported-surface.md +8 -7
- package/docs/schema/catalog-model.md +20 -7
- package/docs/schema/code-generation.md +1 -1
- package/docs/schema/diff.md +2 -2
- package/docs/schema/introspection.md +21 -14
- package/docs/schema/snapshots.md +18 -8
- package/docs/schema/storage-and-schema-sql.md +7 -2
- package/package.json +2 -1
- package/dist/canonical-DMvR9yBe.mjs +0 -972
- package/dist/column-BzN8KFJa.mjs +0 -364
- package/dist/column-CFvSbil0.mjs +0 -309
- package/dist/complete-types-CNMWBWap.d.mts +0 -371
- package/dist/index-CGui70hi.d.mts +0 -32
- package/dist/json-Db7XRD91.mjs +0 -169
- package/dist/omit-OxV58AwX.mjs +0 -5
- package/dist/serialize-OvXCLzjm.d.mts +0 -66
- package/dist/snapshot-DgsOhf_8.mjs +0 -354
package/dist/mysql.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
1
|
+
import { K as mysqlJson, Z as createDialect } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { r as queryValidationError } from "./omit-VEr9Ydux.mjs";
|
|
3
|
+
import { r as onDuplicateKeyUpdate, t as incoming } from "./on-duplicate-key-update-Czsw1Yq-.mjs";
|
|
4
|
+
import { t as mysqlExplain } from "./explain-BIqEmZha.mjs";
|
|
4
5
|
//#region src/dialects/mysql.ts
|
|
5
6
|
const mysqlRowLocking = { render(context, mode, wait) {
|
|
6
7
|
if (mode !== "update" && mode !== "share") throw queryValidationError({
|
|
@@ -33,7 +34,7 @@ function mysqlDialect() {
|
|
|
33
34
|
pagination: { render: renderPagination },
|
|
34
35
|
rowLocking: mysqlRowLocking,
|
|
35
36
|
json: mysqlJson,
|
|
36
|
-
capabilities: ["row-locking"],
|
|
37
|
+
capabilities: ["row-locking", "on-duplicate-key-update"],
|
|
37
38
|
castTypes: {
|
|
38
39
|
integer: "SIGNED",
|
|
39
40
|
text: "CHAR",
|
|
@@ -47,4 +48,4 @@ function mysqlDialect() {
|
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
//#endregion
|
|
50
|
-
export { mysqlDialect };
|
|
51
|
+
export { incoming, mysqlDialect, onDuplicateKeyUpdate };
|
|
@@ -23,4 +23,8 @@ function queryValidationError(issue) {
|
|
|
23
23
|
return new QueryValidationError(issue);
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
|
-
|
|
26
|
+
//#region src/query/omit.ts
|
|
27
|
+
/** An explicit placeholder for a safely omitted SELECT clause or projection field. */
|
|
28
|
+
const omit = Symbol("qubu.omit");
|
|
29
|
+
//#endregion
|
|
30
|
+
export { QueryValidationError as n, queryValidationError as r, omit as t };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { r as exposeColumns, t as createSource } from "./source-BDuUXmAk.mjs";
|
|
7
|
-
import { a as renderSchemaExpression, t as SchemaExpressionError } from "./expressions-BCjc08zw.mjs";
|
|
1
|
+
import { A as fragment, C as isExpression, X as assertDialectCapability, i as identifier, t as createColumnReference } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { r as queryValidationError, t as omit } from "./omit-VEr9Ydux.mjs";
|
|
3
|
+
import { a as columnResultValue, c as encodeColumnParameter, o as columnSqlType } from "./column-Cyc2CMnG.mjs";
|
|
4
|
+
import { r as exposeColumns, t as createSource } from "./source-DYSUqzvb.mjs";
|
|
5
|
+
import { a as renderSchemaExpression, t as SchemaExpressionError } from "./expressions-_6JF_J77.mjs";
|
|
8
6
|
//#region src/query/mutation/on-conflict.ts
|
|
9
7
|
/** Columns from the proposed INSERT row, available inside DO UPDATE. */
|
|
10
8
|
function excluded(table) {
|
|
@@ -80,7 +78,7 @@ function onConflict(...args) {
|
|
|
80
78
|
if (isExpression(value)) context.render(value);
|
|
81
79
|
else {
|
|
82
80
|
const definition = table?.definitions[columnName];
|
|
83
|
-
context.parameter(definition === void 0 ? value : encodeColumnParameter(definition, value));
|
|
81
|
+
context.parameter(definition === void 0 ? value : encodeColumnParameter(definition, value), definition === void 0 ? void 0 : columnSqlType(definition));
|
|
84
82
|
}
|
|
85
83
|
});
|
|
86
84
|
if (action.where !== void 0) {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { A as fragment, C as isExpression, X as assertDialectCapability, i as identifier, t as createColumnReference } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { r as queryValidationError, t as omit } from "./omit-VEr9Ydux.mjs";
|
|
3
|
+
import { a as columnResultValue, c as encodeColumnParameter, o as columnSqlType } from "./column-Cyc2CMnG.mjs";
|
|
4
|
+
//#region src/query/mutation/on-duplicate-key-update.ts
|
|
5
|
+
const assignmentTargets = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function renderDuplicateKeyUpdate(context, clause, columns) {
|
|
7
|
+
assignmentTargets.set(context, {
|
|
8
|
+
table: clause.table,
|
|
9
|
+
columns
|
|
10
|
+
});
|
|
11
|
+
try {
|
|
12
|
+
clause.render(context);
|
|
13
|
+
} finally {
|
|
14
|
+
assignmentTargets.delete(context);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function incomingAlias(table) {
|
|
18
|
+
return table.tableName.toLowerCase() === "__qubu_incoming" ? "__qubu_incoming_row" : "__qubu_incoming";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Reference the incoming row in MySQL duplicate-key assignments. INSERT SELECT exposes only its
|
|
22
|
+
* explicit target columns; other references fail during rendering. These references cannot be used
|
|
23
|
+
* as a FROM source.
|
|
24
|
+
*/
|
|
25
|
+
function incoming(table) {
|
|
26
|
+
const reference = fragment((context) => {
|
|
27
|
+
assertDialectCapability(context.dialect, "on-duplicate-key-update");
|
|
28
|
+
if (assignmentTargets.get(context)?.table !== table) throw invalid("Incoming columns require duplicate-key assignments for the same target table");
|
|
29
|
+
context.render(identifier(incomingAlias(table)));
|
|
30
|
+
});
|
|
31
|
+
return Object.freeze(Object.fromEntries(Object.keys(table.definitions).map((field) => [field, (() => {
|
|
32
|
+
const column = createColumnReference(table.sqlNames[field] ?? field, reference, field, columnResultValue(table.definitions[field]));
|
|
33
|
+
return Object.freeze({
|
|
34
|
+
...column,
|
|
35
|
+
render(context) {
|
|
36
|
+
const scope = assignmentTargets.get(context);
|
|
37
|
+
if (scope?.columns && !scope.columns.includes(field)) throw invalid(`Incoming column "${field}" is not projected by INSERT SELECT`, field);
|
|
38
|
+
column.render(context);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
})()])));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Update writable columns when a MySQL INSERT row conflicts with a key. Raw values use target
|
|
45
|
+
* column encoders. Expressions may reference the target table or incoming(table). At least one
|
|
46
|
+
* non-omitted assignment is required.
|
|
47
|
+
*/
|
|
48
|
+
function onDuplicateKeyUpdate(table, assignments) {
|
|
49
|
+
const entries = Object.entries(assignments).filter(([, value]) => value !== omit);
|
|
50
|
+
if (entries.length === 0) throw invalid("Duplicate-key updates require at least one assignment");
|
|
51
|
+
for (const [field] of entries) if (!Object.hasOwn(table.definitions, field) || table.definitions[field].generated) throw invalid(`Column "${field}" is not a writable target column`, field);
|
|
52
|
+
return Object.freeze({
|
|
53
|
+
clauseKind: "on-duplicate-key-update",
|
|
54
|
+
table,
|
|
55
|
+
render(context) {
|
|
56
|
+
assertDialectCapability(context.dialect, "on-duplicate-key-update");
|
|
57
|
+
const scope = assignmentTargets.get(context);
|
|
58
|
+
if (scope?.table !== table) throw invalid("Duplicate-key clauses require their matching INSERT target");
|
|
59
|
+
context.append("ON DUPLICATE KEY UPDATE ");
|
|
60
|
+
const scoped = {
|
|
61
|
+
...context,
|
|
62
|
+
render(part) {
|
|
63
|
+
part.render(scoped);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
assignmentTargets.set(scoped, scope);
|
|
67
|
+
try {
|
|
68
|
+
entries.forEach(([field, value], index) => {
|
|
69
|
+
if (index) context.append(", ");
|
|
70
|
+
context.render(identifier(table.sqlNames[field] ?? field));
|
|
71
|
+
context.append(" = ");
|
|
72
|
+
if (isExpression(value)) scoped.render(value);
|
|
73
|
+
else context.parameter(encodeColumnParameter(table.definitions[field], value), columnSqlType(table.definitions[field]));
|
|
74
|
+
});
|
|
75
|
+
} finally {
|
|
76
|
+
assignmentTargets.delete(scoped);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function invalid(message, field) {
|
|
82
|
+
return queryValidationError({
|
|
83
|
+
code: "invalid-update",
|
|
84
|
+
context: "upsert.duplicate-key.assignments",
|
|
85
|
+
path: [
|
|
86
|
+
"onDuplicateKeyUpdate",
|
|
87
|
+
"assignments",
|
|
88
|
+
...field ? [field] : []
|
|
89
|
+
],
|
|
90
|
+
message,
|
|
91
|
+
hint: "Use writable columns and incoming values from the INSERT target table."
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { renderDuplicateKeyUpdate as i, incomingAlias as n, onDuplicateKeyUpdate as r, incoming as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as postgresExplain } from "./explain-CkIK13L_.mjs";
|
|
1
|
+
import { X as assertDialectCapability, Z as createDialect, k as withDialectCapability, q as postgresJson } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { t as comparison } from "./relational-CoPBETjI.mjs";
|
|
3
|
+
import { n as postgresExplain } from "./explain-BIqEmZha.mjs";
|
|
5
4
|
//#region src/query/mutation/update-from.ts
|
|
6
5
|
/** Introduce one or more PostgreSQL sources to an UPDATE statement. */
|
|
7
6
|
function updateFrom(...sources) {
|
|
@@ -37,7 +36,7 @@ const postgresPagination = { render(context, parts) {
|
|
|
37
36
|
}).forEach((part, index) => {
|
|
38
37
|
if (index > 0) context.append(" ");
|
|
39
38
|
context.append(part.kind === "fetch" ? "LIMIT " : "OFFSET ");
|
|
40
|
-
context.parameter(part.rows);
|
|
39
|
+
context.parameter(part.rows, "integer");
|
|
41
40
|
});
|
|
42
41
|
} };
|
|
43
42
|
/**
|
package/dist/postgres.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ad as MetadataOf, Dr as UpdateFromClause, Gu as ExpressionWithOutput, Ku as SchemaExpression, Ms as OperandNullability, Ns as OperandSqlType, Or as UpdateFromScope, Ps as SqlCapabilityValidation, Pt as Dialect, Vd as RequiresCapabilityMeta, _f as SqlTextLike, _r as excluded, af as SqlBoolean, dr as DoNothingAction, fr as DoUpdateAction, gr as doUpdate, hr as doNothing, js as Operand, kr as updateFrom, lr as ConflictAction, mr as OnConflictClause, ms as ComparisonValidation, nf as AnySqlType, pr as ExcludedSource, qd as ResultMeta, ur as ConflictTarget, vr as onConflict, xf as SqlUnknown, yd as ExpressionMeta } from "./types-Dqr4o2I1.mjs";
|
|
2
2
|
//#region src/dialects/postgres.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* PostgreSQL's only core rendering difference is positional parameters. PostgreSQL-specific
|
|
5
5
|
* expressions and clauses should remain separate modules.
|
|
6
6
|
*/
|
|
7
|
-
declare function postgresDialect(): Dialect<"
|
|
7
|
+
declare function postgresDialect(): Dialect<"row-locking" | "json" | "on-conflict" | "ilike" | "update-from">;
|
|
8
8
|
/** PostgreSQL's case-insensitive pattern-match operator. */
|
|
9
9
|
declare function ilike<TLeft extends ExpressionWithOutput<string>, R extends Operand<string>>(left: TLeft & ComparisonValidation<TLeft, R, "ILIKE">, pattern: R): SchemaExpression<ResultMeta<boolean, ((MetadataOf<TLeft & SqlCapabilityValidation<(MetadataOf<TLeft> extends (infer T) ? T extends MetadataOf<TLeft> ? T extends {
|
|
10
10
|
readonly kind: "result";
|
package/dist/postgres.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-
|
|
2
|
-
import { n as postgresDialect, r as updateFrom, t as ilike } from "./postgres-
|
|
1
|
+
import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-B2rFyHGF.mjs";
|
|
2
|
+
import { n as postgresDialect, r as updateFrom, t as ilike } from "./postgres-hFhd0I9n.mjs";
|
|
3
3
|
export { doNothing, doUpdate, excluded, ilike, onConflict, postgresDialect, updateFrom };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as snakeCaseIdentifier } from "./column-DDRvD7SF.mjs";
|
|
2
2
|
//#region src/schema/registry.ts
|
|
3
3
|
/** The first naming-policy version used by schema metadata. */
|
|
4
4
|
const schemaNamingPolicyVersion = 1;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
1
|
+
import { E as makeSchemaExpression, U as resultValue } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { n as isValueExpression, t as asValue } from "./value-CpaUFtjw.mjs";
|
|
3
|
+
import { r as queryValidationError } from "./omit-VEr9Ydux.mjs";
|
|
3
4
|
//#region src/expressions/operators/shared.ts
|
|
4
5
|
function isNullOperand(value) {
|
|
5
6
|
return value === null || isValueExpression(value) && value.value === null;
|
package/dist/schema.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
export { AliasIdentity, AliasedSource, AnyKeyColumn, AnySource, AnyTable, CanonicalLiteral, CatalogCheckExpression, CatalogCheckSql, CheckConstraint, CheckConstraintOptions, ColumnBehaviorError, ColumnBehaviorErrorCode, ColumnCodec, ColumnDefault, ColumnDefaultInput, ColumnDefaultOf, ColumnDefinition, ColumnDefinitionConfig, ColumnFromOptions, ColumnGeneratedOf, ColumnHasDefault, ColumnHasRuntimeDefault, ColumnIdentityOf, ColumnInsertInput, ColumnIsGenerated, ColumnIsNullable, ColumnOnUpdateOf, ColumnOptions, ColumnOutput, ColumnSqlType, ColumnStorage, ColumnStorageDeclarationOf, ColumnStorageDescriptor, ColumnStorageDialectOf, ColumnStorageKindOf, ColumnStorageOf, ColumnStorageType, ColumnStorageTypeOf, ColumnUpdateInput, ConstraintDialectExtension, ConstraintOptions, ConstraintTiming, CustomSource, CustomSourceOptions, type DeclaredColumnNullability, DefaultDescriptor, DialectNativeStorage, ExpressionDefaultDescriptor, ExpressionGeneratedColumnDescriptor, ExternalDefaultDescriptor, ExternalGeneratedColumnDescriptor, FieldLike, FieldLikeOptions, ForeignKeyConstraint, ForeignKeyMatch, ForeignKeyOptions, ForeignKeyTarget, ForeignKeyTargetInput, GeneratedColumnDescriptor, GeneratedColumnMode, GeneratedDescriptor, IdentityDescriptor, IdentityDialectExtension, IdentityGeneration, 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, SourceConfig, SourceConstraint, SourceConstraints, SourceConstraintsRecord, SourceIdentity, SourceIndex, SourceIndexesRecord, SourceKind, SourceLike, SourceProvision, SourceRow, SourceSqlTypeMap, SourceSqlTypes, SqliteConstraintExtension, SqliteIdentityExtension, SqliteIndexExtension, StorageDeclarationOf, StorageDescriptor, StorageDialectOf, StorageOf, StorageTypeOf, Table, TableColumns, TableDefinitions, TableIdentity, TableIndex, TableInsertInput, TableLike, TableMetadataCallback, TableOptions, TableRow, TableSqlTypes, TableUpdateInput, UniqueConstraint, UniqueConstraintOptions, UniqueNullSemantics, UnknownSourceSqlTypes, UnsafeSchemaSqlExpression, alias, assertSchemaDialectSupport, bigint, binary, boolean, canonicalLiteral, catalogCheck, catalogForeignKey, check, column, columnResultValue, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, encodeColumnParameter, exposeColumns, externalDefault, externalGeneratedColumn, foreignKey, freezeSchemaMetadata, generatedColumn, generatedSchemaObjectName, generatedTableName, identityColumn, index, integer, isUnsafeSchemaSql, isValidSchemaObjectName, json, lateral, materializeSchemaObjectIdentity, materializeSchemaObjectRecord, nativeColumn, nativeStorage, normalizeSchemaSql, nullable, numeric, portableStorage, primaryKey, references, renderSchemaExpression, renderSchemaSql, resolveColumnBehavior, schema, schemaExpression, schemaNamingPolicyVersion, sourceIdentity, table, text, timestamp, unique, uniqueConstraint, unsafeSchemaSql, uuid, validateConstraintDialect, validateIndexDialect };
|
|
1
|
+
import { $a as IndexDialectExtension, $c as GeneratedColumnDescriptor, $i as SchemaTableEntry, $s as ColumnOnUpdateOf, Aa as SourceLike, Ac as columnSqlType, Al as materializeSchemaObjectRecord, An as sourceIdentity, Ba as primaryKey, Bc as text, Bi as SchemaRenderOptions, Bn as TableSqlTypes, Ca as KeyConstraint, Cc as StorageOf, Cl as SchemaObjectNameOptions, Cn as SourceRow, Da as ReferentialAction, Dc as boolean, Dl as generatedSchemaObjectName, Dn as createSource, Ea as PostgresConstraintExtension, Ec as binary, El as freezeSchemaMetadata, En as UnknownSourceSqlTypes, Fa as UniqueNullSemantics, Fc as nativeColumn, Fi as SchemaExpressionError, Fn as TableIdentity, Ga as AliasIdentity, Gc as ColumnBehaviorErrorCode, Gi as renderSchemaExpression, Gs as ColumnFromOptions, Ha as unique, Hc as uuid, Hi as defineSchemaExpression, Hn as table, Hs as ColumnDefaultOf, Ia as catalogCheck, Ic as nativeStorage, Ii as SchemaExpressionErrorCode, In as TableInsertInput, Ja as LateralSource, Jc as DefaultDescriptor, Ji as unsafeSchemaSql, Js as ColumnHasRuntimeDefault, Ka as AliasedSource, Kc as ColumnDefault, Ki as renderSchemaSql, Ks as ColumnGeneratedOf, La as catalogForeignKey, Lc as nullable, Li as SchemaExpressionInput, Ln as TableMetadataCallback, Ma as TableLike, Mc as encodeColumnParameter, Mi as SchemaDialectHooks, Mn as Table, Na as UniqueConstraint, Nc as integer, Ni as createSchemaDialect, Nn as TableColumns, Oa as SourceConstraint, Oc as column, Ol as isValidSchemaObjectName, On as customSource, Pa as UniqueConstraintOptions, Pc as json, Pi as RenderedSchemaExpression, Pn as TableDefinitions, Qa as lateral, Qc as ExternalGeneratedColumnDescriptor, Qi as SchemaOptions, Qs as ColumnIsNullable, Ra as check, Rc as numeric, Ri as SchemaExpressionMode, Rn as TableOptions, Sa as ForeignKeyTargetInput, Sc as StorageDialectOf, Sl as SchemaObjectIdentity, Sn as SourceProvision, Ta as MysqlConstraintExtension, Tc as bigint, Tl as dialectMismatchDiagnostic, Tn as SourceSqlTypes, Ua as uniqueConstraint, Uc as CanonicalLiteral, Ui as isUnsafeSchemaSql, Us as ColumnDefinition, Va as references, Vc as timestamp, Vi as UnsafeSchemaSqlExpression, Vn as TableUpdateInput, Vs as ColumnCodec, Wa as validateConstraintDialect, Wc as ColumnBehaviorError, Wi as normalizeSchemaSql, Ws as ColumnDefinitionConfig, Xa as QuerySource, Xc as ExpressionGeneratedColumnDescriptor, Xi as SchemaDiagnostic, Xs as ColumnInsertInput, Ya as QueryAliasIdentity, Yc as ExpressionDefaultDescriptor, Yi as Schema, Ys as ColumnIdentityOf, Za as alias, Zc as ExternalDefaultDescriptor, Zi as SchemaNamingPolicy, Zs as ColumnIsGenerated, _a as FieldLikeOptions, _c as PortableStorage, _l as resolveColumnBehavior, _n as SourceColumns, aa as generatedTableName, ac as ColumnStorageDescriptor, al as IdentityOptionValue, ao as SourceIndex, ba as ForeignKeyOptions, bc as StorageDeclarationOf, bl as SchemaMetadataDiagnostic, bn as SourceIdentity, ca as AnyKeyColumn, cc as ColumnStorageOf, cl as MysqlIdentityExtension, co as TableIndex, da as CheckConstraint, dc as ColumnUpdateInput, dl as SqliteIdentityExtension, dn as AnySource, do as DeclaredColumnNullability, ea as SchemaTableNames, ec as ColumnOptions, el as GeneratedColumnMode, eo as IndexOptions, fa as CheckConstraintOptions, fc as DialectNativeStorage, fl as canonicalLiteral, fn as CustomSource, ga as FieldLike, gc as PortableColumnStorage, gl as identityColumn, gn as Source, ha as ConstraintTiming, hc as NativeStorageDescriptor, hl as generatedColumn, hn as ProvidedSourceRow, ia as defaultSchemaNamingPolicy, ic as ColumnStorageDeclarationOf, il as IdentityGeneration, io as PostgresIndexExtension, ja as SqliteConstraintExtension, jc as date, ji as SchemaDialect, jn as AnyTable, ka as SourceConstraintsRecord, kc as columnResultValue, kl as materializeSchemaObjectIdentity, kn as exposeColumns, la as CatalogCheckExpression, lc as ColumnStorageType, ll as ResolvedColumnBehavior, lo as index, ma as ConstraintOptions, mc as NativeStorage, ml as externalGeneratedColumn, mn as ProvidedSourceIdentity, na as SchemaTableRegistry, nc as ColumnSqlType, nl as IdentityDescriptor, no as IndexTermOptions, oa as schema, oc as ColumnStorageDialectOf, ol as IdentityOptions, oo as SourceIndexesRecord, pa as ConstraintDialectExtension, pc as NativeColumnStorage, pl as externalDefault, pn as CustomSourceOptions, qa as LateralIdentity, qc as ColumnDefaultInput, qi as schemaExpression, qs as ColumnHasDefault, ra as SchemaValidationError, rc as ColumnStorage, rl as IdentityDialectExtension, ro as MysqlIndexExtension, sa as schemaNamingPolicyVersion, sc as ColumnStorageKindOf, sl as LiteralDefaultDescriptor, so as SqliteIndexExtension, ta as SchemaTableRecord, tc as ColumnOutput, tl as GeneratedDescriptor, to as IndexTerm, ua as CatalogCheckSql, uc as ColumnStorageTypeOf, ul as SchemaLiteralValue, uo as validateIndexDialect, va as ForeignKeyConstraint, vc as PortableStorageDescriptor, vl as SchemaDialectExtension, vn as SourceConfig, wa as KeyConstraintOptions, wc as StorageTypeOf, wl as assertSchemaDialectSupport, wn as SourceSqlTypeMap, xa as ForeignKeyTarget, xc as StorageDescriptor, xl as SchemaMetadataValidationError, xn as SourceKind, ya as ForeignKeyMatch, yc as PortableStorageType, yl as SchemaDialectName, yn as SourceConstraints, za as foreignKey, zc as portableStorage, zi as SchemaRenderContext, zn as TableRow } from "./types-Dqr4o2I1.mjs";
|
|
2
|
+
export { AliasIdentity, AliasedSource, AnyKeyColumn, AnySource, AnyTable, CanonicalLiteral, CatalogCheckExpression, CatalogCheckSql, CheckConstraint, CheckConstraintOptions, ColumnBehaviorError, ColumnBehaviorErrorCode, ColumnCodec, ColumnDefault, ColumnDefaultInput, ColumnDefaultOf, ColumnDefinition, ColumnDefinitionConfig, ColumnFromOptions, ColumnGeneratedOf, ColumnHasDefault, ColumnHasRuntimeDefault, ColumnIdentityOf, ColumnInsertInput, ColumnIsGenerated, ColumnIsNullable, ColumnOnUpdateOf, ColumnOptions, ColumnOutput, ColumnSqlType, ColumnStorage, ColumnStorageDeclarationOf, ColumnStorageDescriptor, ColumnStorageDialectOf, ColumnStorageKindOf, ColumnStorageOf, ColumnStorageType, ColumnStorageTypeOf, ColumnUpdateInput, ConstraintDialectExtension, ConstraintOptions, ConstraintTiming, CustomSource, CustomSourceOptions, type DeclaredColumnNullability, DefaultDescriptor, DialectNativeStorage, ExpressionDefaultDescriptor, ExpressionGeneratedColumnDescriptor, ExternalDefaultDescriptor, ExternalGeneratedColumnDescriptor, FieldLike, FieldLikeOptions, ForeignKeyConstraint, ForeignKeyMatch, ForeignKeyOptions, ForeignKeyTarget, ForeignKeyTargetInput, GeneratedColumnDescriptor, GeneratedColumnMode, GeneratedDescriptor, IdentityDescriptor, IdentityDialectExtension, IdentityGeneration, IdentityOptionValue, IdentityOptions, IndexDialectExtension, IndexOptions, IndexTerm, IndexTermOptions, KeyConstraint, KeyConstraintOptions, LateralIdentity, LateralSource, LiteralDefaultDescriptor, MysqlConstraintExtension, MysqlIdentityExtension, MysqlIndexExtension, NativeColumnStorage, NativeStorage, NativeStorageDescriptor, PortableColumnStorage, PortableStorage, PortableStorageDescriptor, PortableStorageType, PostgresConstraintExtension, PostgresIndexExtension, ProvidedSourceIdentity, ProvidedSourceRow, QueryAliasIdentity, QuerySource, ReferentialAction, RenderedSchemaExpression, ResolvedColumnBehavior, Schema, SchemaDiagnostic, SchemaDialect, SchemaDialectExtension, SchemaDialectHooks, SchemaDialectName, SchemaExpressionError, SchemaExpressionErrorCode, SchemaExpressionInput, SchemaExpressionMode, SchemaLiteralValue, SchemaMetadataDiagnostic, SchemaMetadataValidationError, SchemaNamingPolicy, SchemaObjectIdentity, SchemaObjectNameOptions, SchemaOptions, SchemaRenderContext, SchemaRenderOptions, SchemaTableEntry, SchemaTableNames, SchemaTableRecord, SchemaTableRegistry, SchemaValidationError, Source, SourceColumns, SourceConfig, SourceConstraint, SourceConstraints, SourceConstraintsRecord, SourceIdentity, SourceIndex, SourceIndexesRecord, SourceKind, SourceLike, SourceProvision, SourceRow, SourceSqlTypeMap, SourceSqlTypes, SqliteConstraintExtension, SqliteIdentityExtension, SqliteIndexExtension, StorageDeclarationOf, StorageDescriptor, StorageDialectOf, StorageOf, StorageTypeOf, Table, TableColumns, TableDefinitions, TableIdentity, TableIndex, TableInsertInput, TableLike, TableMetadataCallback, TableOptions, TableRow, TableSqlTypes, TableUpdateInput, UniqueConstraint, UniqueConstraintOptions, UniqueNullSemantics, UnknownSourceSqlTypes, UnsafeSchemaSqlExpression, alias, assertSchemaDialectSupport, bigint, binary, boolean, canonicalLiteral, catalogCheck, catalogForeignKey, check, column, columnResultValue, columnSqlType, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, encodeColumnParameter, exposeColumns, externalDefault, externalGeneratedColumn, foreignKey, freezeSchemaMetadata, generatedColumn, generatedSchemaObjectName, generatedTableName, identityColumn, index, integer, isUnsafeSchemaSql, isValidSchemaObjectName, json, lateral, materializeSchemaObjectIdentity, materializeSchemaObjectRecord, nativeColumn, nativeStorage, normalizeSchemaSql, nullable, numeric, portableStorage, primaryKey, references, renderSchemaExpression, renderSchemaSql, resolveColumnBehavior, schema, schemaExpression, schemaNamingPolicyVersion, sourceIdentity, table, text, timestamp, unique, uniqueConstraint, unsafeSchemaSql, uuid, validateConstraintDialect, validateIndexDialect };
|
package/dist/schema.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import {
|
|
3
|
-
import { i as sourceIdentity, n as customSource, r as exposeColumns, t as createSource } from "./source-
|
|
4
|
-
import { n as alias, r as lateral, t as table } from "./table-
|
|
5
|
-
import { a as primaryKey, c as uniqueConstraint, d as validateIndexDialect, i as foreignKey, l as validateConstraintDialect, n as catalogForeignKey, o as references, r as check, s as unique, t as catalogCheck, u as index } from "./constraints-
|
|
6
|
-
import { a as renderSchemaExpression, c as unsafeSchemaSql, i as normalizeSchemaSql, n as defineSchemaExpression, o as renderSchemaSql, r as isUnsafeSchemaSql, s as schemaExpression, t as SchemaExpressionError } from "./expressions-
|
|
7
|
-
import { a as schemaNamingPolicyVersion, i as schema, n as defaultSchemaNamingPolicy, r as generatedTableName, t as SchemaValidationError } from "./registry-
|
|
1
|
+
import { _ as generatedSchemaObjectName, b as materializeSchemaObjectRecord, c as externalDefault, d as identityColumn, f as resolveColumnBehavior, g as freezeSchemaMetadata, h as dialectMismatchDiagnostic, l as externalGeneratedColumn, m as assertSchemaDialectSupport, o as ColumnBehaviorError, p as SchemaMetadataValidationError, s as canonicalLiteral, u as generatedColumn, v as isValidSchemaObjectName, y as materializeSchemaObjectIdentity } from "./column-DDRvD7SF.mjs";
|
|
2
|
+
import { _ as timestamp, a as columnResultValue, c as encodeColumnParameter, d as nativeColumn, f as nativeStorage, g as text, h as portableStorage, i as column, l as integer, m as numeric, n as binary, o as columnSqlType, p as nullable, r as boolean, s as date, t as bigint, u as json, v as uuid } from "./column-Cyc2CMnG.mjs";
|
|
3
|
+
import { i as sourceIdentity, n as customSource, r as exposeColumns, t as createSource } from "./source-DYSUqzvb.mjs";
|
|
4
|
+
import { n as alias, r as lateral, t as table } from "./table-B8zEq0az.mjs";
|
|
5
|
+
import { a as primaryKey, c as uniqueConstraint, d as validateIndexDialect, i as foreignKey, l as validateConstraintDialect, n as catalogForeignKey, o as references, r as check, s as unique, t as catalogCheck, u as index } from "./constraints-CAmi18Uk.mjs";
|
|
6
|
+
import { a as renderSchemaExpression, c as unsafeSchemaSql, i as normalizeSchemaSql, n as defineSchemaExpression, o as renderSchemaSql, r as isUnsafeSchemaSql, s as schemaExpression, t as SchemaExpressionError } from "./expressions-_6JF_J77.mjs";
|
|
7
|
+
import { a as schemaNamingPolicyVersion, i as schema, n as defaultSchemaNamingPolicy, r as generatedTableName, t as SchemaValidationError } from "./registry-BXE_4M9P.mjs";
|
|
8
8
|
import { t as createSchemaDialect } from "./dialect-wUKrnPMB.mjs";
|
|
9
|
-
export { ColumnBehaviorError, SchemaExpressionError, SchemaMetadataValidationError, SchemaValidationError, alias, assertSchemaDialectSupport, bigint, binary, boolean, canonicalLiteral, catalogCheck, catalogForeignKey, check, column, columnResultValue, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, encodeColumnParameter, exposeColumns, externalDefault, externalGeneratedColumn, foreignKey, freezeSchemaMetadata, generatedColumn, generatedSchemaObjectName, generatedTableName, identityColumn, index, integer, isUnsafeSchemaSql, isValidSchemaObjectName, json, lateral, materializeSchemaObjectIdentity, materializeSchemaObjectRecord, nativeColumn, nativeStorage, normalizeSchemaSql, nullable, numeric, portableStorage, primaryKey, references, renderSchemaExpression, renderSchemaSql, resolveColumnBehavior, schema, schemaExpression, schemaNamingPolicyVersion, sourceIdentity, table, text, timestamp, unique, uniqueConstraint, unsafeSchemaSql, uuid, validateConstraintDialect, validateIndexDialect };
|
|
9
|
+
export { ColumnBehaviorError, SchemaExpressionError, SchemaMetadataValidationError, SchemaValidationError, alias, assertSchemaDialectSupport, bigint, binary, boolean, canonicalLiteral, catalogCheck, catalogForeignKey, check, column, columnResultValue, columnSqlType, createSchemaDialect, createSource, customSource, date, defaultSchemaNamingPolicy, defineSchemaExpression, dialectMismatchDiagnostic, encodeColumnParameter, exposeColumns, externalDefault, externalGeneratedColumn, foreignKey, freezeSchemaMetadata, generatedColumn, generatedSchemaObjectName, generatedTableName, identityColumn, index, integer, isUnsafeSchemaSql, isValidSchemaObjectName, json, lateral, materializeSchemaObjectIdentity, materializeSchemaObjectRecord, nativeColumn, nativeStorage, normalizeSchemaSql, nullable, numeric, portableStorage, primaryKey, references, renderSchemaExpression, renderSchemaSql, resolveColumnBehavior, schema, schemaExpression, schemaNamingPolicyVersion, sourceIdentity, table, text, timestamp, unique, uniqueConstraint, unsafeSchemaSql, uuid, validateConstraintDialect, validateIndexDialect };
|