qubu 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +112 -0
  2. package/dist/codegen.d.mts +1 -1
  3. package/dist/codegen.mjs +1 -1
  4. package/dist/{column-r1Y4ivwt.mjs → column-BzN8KFJa.mjs} +39 -2
  5. package/dist/{column-Da37jYSD.mjs → column-CFvSbil0.mjs} +1 -1
  6. package/dist/{complete-types-CY0KbzNw.d.mts → complete-types-CNMWBWap.d.mts} +1 -1
  7. package/dist/{constraints-YGyNPQ_z.mjs → constraints-DM_tarXc.mjs} +2 -2
  8. package/dist/core.d.mts +1 -1
  9. package/dist/core.mjs +2 -3
  10. package/dist/diagnostics-I9vVtXkc.mjs +40 -0
  11. package/dist/diff.d.mts +2 -2
  12. package/dist/expressions-BCjc08zw.mjs +129 -0
  13. package/dist/{index-B2rZf3-2.d.mts → index-CGui70hi.d.mts} +2 -2
  14. package/dist/index.d.mts +2 -2
  15. package/dist/index.mjs +58 -15
  16. package/dist/introspection/mysql.d.mts +26 -0
  17. package/dist/introspection/mysql.mjs +1145 -0
  18. package/dist/introspection/postgres.d.mts +40 -0
  19. package/dist/introspection/postgres.mjs +1554 -0
  20. package/dist/introspection/sqlite.d.mts +15 -0
  21. package/dist/introspection/sqlite.mjs +986 -0
  22. package/dist/introspection.d.mts +3 -78
  23. package/dist/introspection.mjs +5 -3683
  24. package/dist/mysql.d.mts +1 -1
  25. package/dist/mysql.mjs +2 -2
  26. package/dist/{on-conflict-DZQ85f1t.mjs → on-conflict-CnaY5qso.mjs} +76 -4
  27. package/dist/postgres-Dey7QXPL.mjs +69 -0
  28. package/dist/postgres.d.mts +3 -3
  29. package/dist/postgres.mjs +3 -52
  30. package/dist/registry-oWDiqD7i.mjs +127 -0
  31. package/dist/{relational-CxnLCqZQ.mjs → relational-DSAJ-l58.mjs} +1 -2
  32. package/dist/schema.d.mts +1 -1
  33. package/dist/schema.mjs +7 -6
  34. package/dist/{serialize-BN07IK0v.mjs → serialize-CE-gw5_s.mjs} +3 -3
  35. package/dist/{serialize-CEIIlWhC.d.mts → serialize-OvXCLzjm.d.mts} +1 -1
  36. package/dist/snapshot/mysql.d.mts +2 -2
  37. package/dist/snapshot/mysql.mjs +28 -28
  38. package/dist/snapshot/postgres.d.mts +4 -4
  39. package/dist/snapshot/postgres.mjs +21 -21
  40. package/dist/snapshot/sqlite.d.mts +4 -4
  41. package/dist/snapshot/sqlite.mjs +27 -27
  42. package/dist/{snapshot-Xam8-q0j.mjs → snapshot-DgsOhf_8.mjs} +4 -42
  43. package/dist/snapshot.d.mts +4 -4
  44. package/dist/snapshot.mjs +1 -1
  45. package/dist/{source-SqrKWjFJ.mjs → source-BDuUXmAk.mjs} +2 -2
  46. package/dist/sqlite.d.mts +1 -1
  47. package/dist/sqlite.mjs +6 -6
  48. package/dist/{table-BwflqeAj.mjs → table-C1QGNe4P.mjs} +3 -3
  49. package/dist/{types-CTCqtFlS.d.mts → types-BEn0N_al.d.mts} +1 -1
  50. package/dist/{types-BIJsj2fJ.mjs → types-BLNRatG_.mjs} +2 -4
  51. package/dist/{types-C0VkiwpR.d.mts → types-DUe6eeI0.d.mts} +57 -28
  52. package/docs/guides/compose-queries.md +22 -0
  53. package/docs/guides/drizzle.md +11 -11
  54. package/docs/guides/mutations.md +89 -0
  55. package/docs/guides/valtio-sync.md +113 -0
  56. package/docs/migrations/index.md +50 -12
  57. package/docs/migrations/operations.md +20 -6
  58. package/docs/reference/supported-surface.md +17 -6
  59. package/docs/schema/code-generation.md +3 -2
  60. package/docs/schema/introspection.md +3 -2
  61. package/docs/sql-semantic-types.md +8 -0
  62. package/package.json +13 -1
  63. package/dist/registry-BRcUuazJ.mjs +0 -256
  64. package/dist/standard-DfcZEVOj.mjs +0 -12
  65. package/dist/value-D14I_XgL.mjs +0 -29
package/dist/mysql.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { V as Dialect } from "./types-C0VkiwpR.mjs";
1
+ import { V as Dialect } from "./types-DUe6eeI0.mjs";
2
2
  //#region src/dialects/mysql.d.ts
3
3
  declare function mysqlDialect(): Dialect<"json" | "row-locking">;
4
4
  //#endregion
package/dist/mysql.mjs CHANGED
@@ -14,7 +14,7 @@ const mysqlRowLocking = { render(context, mode, wait) {
14
14
  if (wait === "nowait") context.append(" NOWAIT");
15
15
  if (wait === "skip-locked") context.append(" SKIP LOCKED");
16
16
  } };
17
- function renderMySqlPagination(context, parts) {
17
+ function renderPagination(context, parts) {
18
18
  const fetch = parts.find((part) => part.kind === "fetch");
19
19
  const offset = parts.find((part) => part.kind === "offset");
20
20
  context.append("LIMIT ");
@@ -30,7 +30,7 @@ function mysqlDialect() {
30
30
  name: "mysql",
31
31
  quoteIdentifier: (identifier) => `\`${identifier.replaceAll("`", "``")}\``,
32
32
  placeholder: () => "?",
33
- pagination: { render: renderMySqlPagination },
33
+ pagination: { render: renderPagination },
34
34
  rowLocking: mysqlRowLocking,
35
35
  json: mysqlJson,
36
36
  capabilities: ["row-locking"],
@@ -1,9 +1,10 @@
1
1
  import { a as assertDialectCapability } from "./json-Db7XRD91.mjs";
2
+ import { O as fragment, i as identifier, t as createColumnReference, x as isExpression } from "./column-BzN8KFJa.mjs";
2
3
  import { n as queryValidationError } from "./errors-Dxv73YJu.mjs";
3
- import { C as fragment, g as isExpression, i as identifier, t as createColumnReference } from "./column-r1Y4ivwt.mjs";
4
- import { a as columnResultValue, s as encodeColumnParameter } from "./column-Da37jYSD.mjs";
4
+ import { a as columnResultValue, s as encodeColumnParameter } from "./column-CFvSbil0.mjs";
5
5
  import { t as omit } from "./omit-OxV58AwX.mjs";
6
- import { r as exposeColumns, t as createSource } from "./source-SqrKWjFJ.mjs";
6
+ import { r as exposeColumns, t as createSource } from "./source-BDuUXmAk.mjs";
7
+ import { a as renderSchemaExpression, t as SchemaExpressionError } from "./expressions-BCjc08zw.mjs";
7
8
  //#region src/query/mutation/on-conflict.ts
8
9
  /** Columns from the proposed INSERT row, available inside DO UPDATE. */
9
10
  function excluded(table) {
@@ -41,12 +42,31 @@ function onConflict(...args) {
41
42
  assertDialectCapability(context.dialect, "on-conflict");
42
43
  context.append("ON CONFLICT");
43
44
  if (target !== void 0) {
45
+ if (target.kind === "index" && context.dialect.name !== "postgresql") throw queryValidationError({
46
+ code: "invalid-mutation",
47
+ context: "upsert.conflict.target",
48
+ path: [
49
+ "onConflict",
50
+ "target",
51
+ "dialect"
52
+ ],
53
+ message: "Unique-index conflict targets require the PostgreSQL dialect",
54
+ hint: "Render this query with postgresDialect(), or use a declared key constraint."
55
+ });
44
56
  context.append(" (");
45
- target.columns.forEach((column, index) => {
57
+ if (target.kind === "index") target.terms.forEach((term, index) => {
58
+ if (index > 0) context.append(", ");
59
+ renderConflictIndexTerm(context, term, index);
60
+ });
61
+ else target.columns.forEach((column, index) => {
46
62
  if (index > 0) context.append(", ");
47
63
  context.render(identifier(table?.sqlNames[column.fieldName] ?? column.columnName));
48
64
  });
49
65
  context.append(")");
66
+ if (target.kind === "index" && target.predicate !== void 0) {
67
+ context.append(" WHERE ");
68
+ context.append(renderConflictIndexExpression(context, target.predicate, "predicate"));
69
+ }
50
70
  }
51
71
  if (action.actionKind === "do-nothing") {
52
72
  context.append(" DO NOTHING");
@@ -71,6 +91,35 @@ function onConflict(...args) {
71
91
  });
72
92
  }
73
93
  function validateConflictTarget(table, target) {
94
+ if (target.kind === "index") {
95
+ const indexes = "indexes" in table ? table.indexes : {};
96
+ if (!Object.values(indexes).includes(target)) throw queryValidationError({
97
+ code: "invalid-mutation",
98
+ context: "upsert.conflict.target",
99
+ path: ["onConflict", "target"],
100
+ message: "ON CONFLICT index target must be declared on the target table",
101
+ hint: "Use a unique index from the INSERT target table's indexes record."
102
+ });
103
+ if (!target.unique || target.terms.length === 0) throw queryValidationError({
104
+ code: "invalid-mutation",
105
+ context: "upsert.conflict.target",
106
+ path: ["onConflict", "target"],
107
+ message: "ON CONFLICT index target must be a non-empty unique index",
108
+ hint: "Declare the target with index(terms, { unique: true })."
109
+ });
110
+ if (target.dialect !== void 0 && target.dialect.dialect !== "postgresql") throw queryValidationError({
111
+ code: "invalid-mutation",
112
+ context: "upsert.conflict.target",
113
+ path: [
114
+ "onConflict",
115
+ "target",
116
+ "dialect"
117
+ ],
118
+ message: `ON CONFLICT cannot use an index declared for ${target.dialect.dialect}`,
119
+ hint: "Use a portable unique index or one declared for PostgreSQL."
120
+ });
121
+ return;
122
+ }
74
123
  if (target.kind !== "primary-key" && target.kind !== "unique" || target.columns.length === 0) throw queryValidationError({
75
124
  code: "invalid-mutation",
76
125
  context: "upsert.conflict.target",
@@ -91,6 +140,29 @@ function validateConflictTarget(table, target) {
91
140
  hint: "Use the key constraint declared on the INSERT target table."
92
141
  });
93
142
  }
143
+ function renderConflictIndexTerm(context, term, index) {
144
+ const expression = "orderKind" in term ? term.expression : term;
145
+ const text = renderConflictIndexExpression(context, expression, ["terms", index]);
146
+ context.append(expression.expressionKind === "column" ? text : `(${text})`);
147
+ }
148
+ function renderConflictIndexExpression(context, expression, path) {
149
+ try {
150
+ return renderSchemaExpression(expression, "index", context.dialect).text;
151
+ } catch (error) {
152
+ if (!(error instanceof SchemaExpressionError)) throw error;
153
+ throw queryValidationError({
154
+ code: "invalid-mutation",
155
+ context: "upsert.conflict.target",
156
+ path: [
157
+ "onConflict",
158
+ "target",
159
+ ...typeof path === "string" ? [path] : path
160
+ ],
161
+ message: `ON CONFLICT index target is not representable: ${error.message}`,
162
+ hint: "Use deterministic PostgreSQL index terms and a deterministic partial predicate."
163
+ });
164
+ }
165
+ }
94
166
  function validateConflictAction(table, action) {
95
167
  if (action.actionKind === "do-nothing") {
96
168
  if (table === void 0) return;
@@ -0,0 +1,69 @@
1
+ import { a as assertDialectCapability, n as postgresJson, o as createDialect } from "./json-Db7XRD91.mjs";
2
+ import { D as withDialectCapability } from "./column-BzN8KFJa.mjs";
3
+ import { t as comparison } from "./relational-DSAJ-l58.mjs";
4
+ import { n as postgresExplain } from "./explain-CkIK13L_.mjs";
5
+ //#region src/query/mutation/update-from.ts
6
+ /** Introduce one or more PostgreSQL sources to an UPDATE statement. */
7
+ function updateFrom(...sources) {
8
+ return Object.freeze({
9
+ clauseKind: "update-from",
10
+ sources,
11
+ render(context) {
12
+ assertDialectCapability(context.dialect, "update-from");
13
+ context.append("FROM ");
14
+ sources.forEach((source, index) => {
15
+ if (index > 0) context.append(", ");
16
+ context.render(source);
17
+ });
18
+ }
19
+ });
20
+ }
21
+ //#endregion
22
+ //#region src/dialects/postgres.ts
23
+ const postgresRowLockModeSql = {
24
+ update: "UPDATE",
25
+ "no-key-update": "NO KEY UPDATE",
26
+ share: "SHARE",
27
+ "key-share": "KEY SHARE"
28
+ };
29
+ const postgresRowLocking = { render(context, mode, wait) {
30
+ context.append(`FOR ${postgresRowLockModeSql[mode]}`);
31
+ if (wait === "nowait") context.append(" NOWAIT");
32
+ if (wait === "skip-locked") context.append(" SKIP LOCKED");
33
+ } };
34
+ const postgresPagination = { render(context, parts) {
35
+ [...parts].sort((left, right) => {
36
+ return (left.kind === "fetch" ? 0 : 1) - (right.kind === "fetch" ? 0 : 1);
37
+ }).forEach((part, index) => {
38
+ if (index > 0) context.append(" ");
39
+ context.append(part.kind === "fetch" ? "LIMIT " : "OFFSET ");
40
+ context.parameter(part.rows);
41
+ });
42
+ } };
43
+ /**
44
+ * PostgreSQL's only core rendering difference is positional parameters. PostgreSQL-specific
45
+ * expressions and clauses should remain separate modules.
46
+ */
47
+ function postgresDialect() {
48
+ return createDialect({
49
+ name: "postgresql",
50
+ placeholder: (position) => `$${position}`,
51
+ pagination: postgresPagination,
52
+ rowLocking: postgresRowLocking,
53
+ castTypes: { binary: "BYTEA" },
54
+ capabilities: [
55
+ "ilike",
56
+ "on-conflict",
57
+ "row-locking",
58
+ "update-from"
59
+ ],
60
+ json: postgresJson,
61
+ explain: postgresExplain
62
+ });
63
+ }
64
+ /** PostgreSQL's case-insensitive pattern-match operator. */
65
+ function ilike(left, pattern) {
66
+ return withDialectCapability(comparison("ILIKE", left, pattern), "ilike");
67
+ }
68
+ //#endregion
69
+ export { postgresDialect as n, updateFrom as r, ilike as t };
@@ -1,10 +1,10 @@
1
- import { Do as SqlCapabilityValidation, Eo as OperandSqlType, Fl as SchemaExpression, Ku as SqlBoolean, Ou as RequiresCapabilityMeta, Pl as ExpressionWithOutput, Pu as ResultMeta, To as OperandNullability, Uu as AnySqlType, V as Dialect, _n as doNothing, _u as MetadataOf, bn as onConflict, dn as ConflictAction, fn as ConflictTarget, gn as OnConflictClause, hn as ExcludedSource, id as SqlTextLike, mn as DoUpdateAction, ou as ExpressionMeta, pn as DoNothingAction, sd as SqlUnknown, so as ComparisonValidation, vn as doUpdate, wo as Operand, yn as excluded } from "./types-C0VkiwpR.mjs";
1
+ import { Ao as OperandNullability, Bl as SchemaExpression, Dn as UpdateFromScope, En as UpdateFromClause, Ju as AnySqlType, Mo as SqlCapabilityValidation, Nu as RequiresCapabilityMeta, On as updateFrom, Sn as onConflict, Su as MetadataOf, V as Dialect, Zu as SqlBoolean, _n as ExcludedSource, bn as doUpdate, du as ExpressionMeta, fd as SqlUnknown, fo as ComparisonValidation, gn as DoUpdateAction, hn as DoNothingAction, jo as OperandSqlType, ko as Operand, ld as SqlTextLike, mn as ConflictTarget, pn as ConflictAction, vn as OnConflictClause, xn as excluded, yn as doNothing, zl as ExpressionWithOutput, zu as ResultMeta } from "./types-DUe6eeI0.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<"on-conflict" | "json" | "ilike" | "row-locking">;
7
+ declare function postgresDialect(): Dialect<"on-conflict" | "json" | "ilike" | "row-locking" | "update-from">;
8
8
  /** PostgreSQL's case-insensitive pattern-match operator. */
9
9
  declare function ilike<TLeft extends ExpressionWithOutput<string>, R extends Operand<string>>(left: TLeft & ComparisonValidation<TLeft, R, "ILIKE">, pattern: R): SchemaExpression<ResultMeta<boolean, ((MetadataOf<TLeft & SqlCapabilityValidation<(MetadataOf<TLeft> extends (infer T) ? T extends MetadataOf<TLeft> ? T extends {
10
10
  readonly kind: "result";
@@ -120,4 +120,4 @@ declare function ilike<TLeft extends ExpressionWithOutput<string>, R extends Ope
120
120
  readonly kind: "result" | "cardinality";
121
121
  } ? never : T_54 : never : never) | RequiresCapabilityMeta<"ilike">, "operator">;
122
122
  //#endregion
123
- export { type ConflictAction, type ConflictTarget, type DoNothingAction, type DoUpdateAction, type ExcludedSource, type OnConflictClause, doNothing, doUpdate, excluded, ilike, onConflict, postgresDialect };
123
+ export { type ConflictAction, type ConflictTarget, type DoNothingAction, type DoUpdateAction, type ExcludedSource, type OnConflictClause, type UpdateFromClause, type UpdateFromScope, doNothing, doUpdate, excluded, ilike, onConflict, postgresDialect, updateFrom };
package/dist/postgres.mjs CHANGED
@@ -1,52 +1,3 @@
1
- import { n as postgresJson, o as createDialect } from "./json-Db7XRD91.mjs";
2
- import { S as withDialectCapability } from "./column-r1Y4ivwt.mjs";
3
- import { t as comparison } from "./relational-CxnLCqZQ.mjs";
4
- import { n as postgresExplain } from "./explain-CkIK13L_.mjs";
5
- import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-DZQ85f1t.mjs";
6
- //#region src/dialects/postgres.ts
7
- const postgresRowLockModeSql = {
8
- update: "UPDATE",
9
- "no-key-update": "NO KEY UPDATE",
10
- share: "SHARE",
11
- "key-share": "KEY SHARE"
12
- };
13
- const postgresRowLocking = { render(context, mode, wait) {
14
- context.append(`FOR ${postgresRowLockModeSql[mode]}`);
15
- if (wait === "nowait") context.append(" NOWAIT");
16
- if (wait === "skip-locked") context.append(" SKIP LOCKED");
17
- } };
18
- const postgresPagination = { render(context, parts) {
19
- [...parts].sort((left, right) => {
20
- return (left.kind === "fetch" ? 0 : 1) - (right.kind === "fetch" ? 0 : 1);
21
- }).forEach((part, index) => {
22
- if (index > 0) context.append(" ");
23
- context.append(part.kind === "fetch" ? "LIMIT " : "OFFSET ");
24
- context.parameter(part.rows);
25
- });
26
- } };
27
- /**
28
- * PostgreSQL's only core rendering difference is positional parameters. PostgreSQL-specific
29
- * expressions and clauses should remain separate modules.
30
- */
31
- function postgresDialect() {
32
- return createDialect({
33
- name: "postgresql",
34
- placeholder: (position) => `$${position}`,
35
- pagination: postgresPagination,
36
- rowLocking: postgresRowLocking,
37
- castTypes: { binary: "BYTEA" },
38
- capabilities: [
39
- "ilike",
40
- "on-conflict",
41
- "row-locking"
42
- ],
43
- json: postgresJson,
44
- explain: postgresExplain
45
- });
46
- }
47
- /** PostgreSQL's case-insensitive pattern-match operator. */
48
- function ilike(left, pattern) {
49
- return withDialectCapability(comparison("ILIKE", left, pattern), "ilike");
50
- }
51
- //#endregion
52
- export { doNothing, doUpdate, excluded, ilike, onConflict, postgresDialect };
1
+ import { i as onConflict, n as doUpdate, r as excluded, t as doNothing } from "./on-conflict-CnaY5qso.mjs";
2
+ import { n as postgresDialect, r as updateFrom, t as ilike } from "./postgres-Dey7QXPL.mjs";
3
+ export { doNothing, doUpdate, excluded, ilike, onConflict, postgresDialect, updateFrom };
@@ -0,0 +1,127 @@
1
+ import { b as snakeCaseIdentifier } from "./column-BzN8KFJa.mjs";
2
+ //#region src/schema/registry.ts
3
+ /** The first naming-policy version used by schema metadata. */
4
+ const schemaNamingPolicyVersion = 1;
5
+ /**
6
+ * The built-in naming policy for schema-generated physical names.
7
+ *
8
+ * Explicit names supplied to `table()` remain unchanged. The policy is used by tooling when it
9
+ * needs a physical name for a logical table ID.
10
+ */
11
+ const defaultSchemaNamingPolicy = Object.freeze({
12
+ version: 1,
13
+ tableName: snakeCaseIdentifier
14
+ });
15
+ /** Error thrown when a root schema fails registry or naming validation. */
16
+ var SchemaValidationError = class extends Error {
17
+ name = "SchemaValidationError";
18
+ diagnostics;
19
+ /** Alias matching validation libraries that call findings "issues". */
20
+ issues;
21
+ constructor(diagnostics) {
22
+ const frozenDiagnostics = Object.freeze(diagnostics.map((diagnostic) => Object.freeze({
23
+ ...diagnostic,
24
+ path: Object.freeze([...diagnostic.path]),
25
+ relatedPaths: diagnostic.relatedPaths ? Object.freeze(diagnostic.relatedPaths.map((path) => Object.freeze([...path]))) : void 0
26
+ })));
27
+ super(frozenDiagnostics.map((diagnostic) => diagnostic.message).join("\n"));
28
+ this.diagnostics = frozenDiagnostics;
29
+ this.issues = frozenDiagnostics;
30
+ }
31
+ };
32
+ function entriesOf(input) {
33
+ if (Array.isArray(input)) return input;
34
+ return Object.entries(input);
35
+ }
36
+ function validLogicalId(id) {
37
+ return id.length > 0 && id === id.trim() && !/[.\\/\u0000-\u001f\u007f]/u.test(id);
38
+ }
39
+ function validNamespace(namespace) {
40
+ return namespace.length > 0 && namespace === namespace.trim() && !/[.\\/\u0000-\u001f\u007f"']/u.test(namespace);
41
+ }
42
+ function validateEntries(entries, namespace, namingPolicy) {
43
+ const diagnostics = [];
44
+ const ids = /* @__PURE__ */ new Map();
45
+ const physicalNames = /* @__PURE__ */ new Map();
46
+ const generatedNames = /* @__PURE__ */ new Map();
47
+ for (const [index, [id, table]] of entries.entries()) {
48
+ const path = ["tables", id];
49
+ const previousId = ids.get(id);
50
+ if (previousId !== void 0) diagnostics.push({
51
+ code: "duplicate-table-id",
52
+ message: `Table ID "${id}" is declared more than once`,
53
+ path,
54
+ relatedPaths: [["tables", entries[previousId][0]]]
55
+ });
56
+ else ids.set(id, index);
57
+ if (!validLogicalId(id)) diagnostics.push({
58
+ code: "invalid-table-id",
59
+ message: `Table ID "${id}" must be a non-empty logical identifier`,
60
+ path
61
+ });
62
+ const physicalName = table.tableName || namingPolicy.tableName(id);
63
+ const previousPhysicalName = physicalNames.get(physicalName);
64
+ if (previousPhysicalName !== void 0) diagnostics.push({
65
+ code: "duplicate-physical-name",
66
+ message: `Tables "${entries[previousPhysicalName][0]}" and "${id}" both use physical name "${physicalName}"`,
67
+ path: [...path, "physicalName"],
68
+ relatedPaths: [[
69
+ "tables",
70
+ entries[previousPhysicalName][0],
71
+ "physicalName"
72
+ ]]
73
+ });
74
+ else physicalNames.set(physicalName, index);
75
+ const generatedName = namingPolicy.tableName(id);
76
+ const previousGeneratedName = generatedNames.get(generatedName);
77
+ if (previousGeneratedName !== void 0) diagnostics.push({
78
+ code: "generated-name-collision",
79
+ message: `Logical table IDs "${entries[previousGeneratedName][0]}" and "${id}" generate the same physical name "${generatedName}"`,
80
+ path: [...path, "generatedName"],
81
+ relatedPaths: [[
82
+ "tables",
83
+ entries[previousGeneratedName][0],
84
+ "generatedName"
85
+ ]]
86
+ });
87
+ else generatedNames.set(generatedName, index);
88
+ }
89
+ if (namespace !== void 0 && !validNamespace(namespace)) diagnostics.push({
90
+ code: "invalid-namespace",
91
+ message: `Schema namespace "${namespace}" must be a non-empty identifier without qualification or control characters`,
92
+ path: ["namespace"]
93
+ });
94
+ return Object.freeze(diagnostics);
95
+ }
96
+ function freezeTableNames(entries, namingPolicy) {
97
+ return Object.freeze(Object.fromEntries(entries.map(([id, table]) => [id, table.tableName || namingPolicy.tableName(id)])));
98
+ }
99
+ function createSchema(entries, tables, options = {}) {
100
+ const namingPolicy = options.namingPolicy ?? defaultSchemaNamingPolicy;
101
+ const diagnostics = validateEntries(entries, options.namespace, namingPolicy);
102
+ if (diagnostics.length > 0) throw new SchemaValidationError(diagnostics);
103
+ const tableNames = freezeTableNames(entries, namingPolicy);
104
+ const registry = Object.freeze(Object.fromEntries(entries.map(([id, table]) => [id, Object.freeze({
105
+ id,
106
+ table,
107
+ physicalName: tableNames[id]
108
+ })])));
109
+ return Object.freeze({
110
+ schemaKind: "schema",
111
+ tables: Object.freeze({ ...tables }),
112
+ registry,
113
+ tableNames,
114
+ namespace: options.namespace,
115
+ namingPolicy: Object.freeze({ ...namingPolicy })
116
+ });
117
+ }
118
+ function schema(tables, options) {
119
+ const entries = entriesOf(tables);
120
+ return createSchema(entries, Object.fromEntries(entries), options);
121
+ }
122
+ /** Generate a v1 physical name for a logical table ID. */
123
+ function generatedTableName(logicalId, namingPolicy = defaultSchemaNamingPolicy) {
124
+ return namingPolicy.tableName(logicalId);
125
+ }
126
+ //#endregion
127
+ export { schemaNamingPolicyVersion as a, schema as i, defaultSchemaNamingPolicy as n, generatedTableName as r, SchemaValidationError as t };
@@ -1,6 +1,5 @@
1
+ import { o as asValue, s as isValueExpression, w as makeSchemaExpression, z as resultValue } from "./column-BzN8KFJa.mjs";
1
2
  import { n as queryValidationError } from "./errors-Dxv73YJu.mjs";
2
- import { P as resultValue, y as makeSchemaExpression } from "./column-r1Y4ivwt.mjs";
3
- import { n as isValueExpression, t as asValue } from "./value-D14I_XgL.mjs";
4
3
  //#region src/expressions/operators/shared.ts
5
4
  function isNullOperand(value) {
6
5
  return value === null || isValueExpression(value) && value.value === null;
package/dist/schema.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $i as SourceIndexesRecord, $o as ColumnStorageDialectOf, $r as generatedTableName, $s as ResolvedColumnBehavior, Ai as catalogCheck, Ar as SchemaExpressionErrorCode, As as numeric, At as SourceSqlTypeMap, Bi as AliasedSource, Bo as ColumnHasDefault, Br as renderSchemaSql, Bs as DefaultDescriptor, Bt as TableDefinitions, Ci as SourceConstraintsRecord, Cs as date, Ct as SourceColumns, Di as UniqueConstraint, Dr as createSchemaDialect, Ds as nativeColumn, Dt as SourceKind, Ei as TableLike, Er as SchemaDialectHooks, Es as json, Et as SourceIdentity, Fi as references, Fo as ColumnDefaultOf, Fr as UnsafeSchemaSqlExpression, Fs as CanonicalLiteral, Ft as exposeColumns, Gi as alias, Go as ColumnIsNullable, Gr as SchemaNamingPolicy, Gs as GeneratedColumnDescriptor, Gt as TableRow, Hi as LateralSource, Ho as ColumnIdentityOf, Hr as unsafeSchemaSql, Hs as ExpressionGeneratedColumnDescriptor, Ht as TableInsertInput, Ii as unique, Io as ColumnDefinition, Ir as defineSchemaExpression, Is as ColumnBehaviorError, It as sourceIdentity, Ji as IndexOptions, Jo as ColumnOutput, Jr as SchemaTableNames, Js as IdentityDescriptor, Jt as table, Ki as lateral, Ko as ColumnOnUpdateOf, Kr as SchemaOptions, Ks as GeneratedColumnMode, Kt as TableSqlTypes, Li as uniqueConstraint, Lo as ColumnDefinitionConfig, Lr as isUnsafeSchemaSql, Ls as ColumnBehaviorErrorCode, Lt as AnyTable, Mi as check, Mr as SchemaExpressionMode, Ms as text, Mt as UnknownSourceSqlTypes, Ni as foreignKey, Nr as SchemaRenderContext, Ns as timestamp, Nt as createSource, Oi as UniqueConstraintOptions, Or as RenderedSchemaExpression, Os as nativeStorage, Ot as SourceProvision, Pi as primaryKey, Po as ColumnCodec, Pr as SchemaRenderOptions, Ps as uuid, Pt as customSource, Qi as SourceIndex, Qo as ColumnStorageDescriptor, Qr as defaultSchemaNamingPolicy, Qs as MysqlIdentityExtension, Ri as validateConstraintDialect, Ro as ColumnFromOptions, Rr as normalizeSchemaSql, Rs as ColumnDefault, Rt as Table, Si as SourceConstraint, Ss as columnResultValue, St as Source, Ti as SqliteConstraintExtension, Tr as SchemaDialect, Ts as integer, Tt as SourceConstraints, Ui as QueryAliasIdentity, Uo as ColumnInsertInput, Ur as Schema, Us as ExternalDefaultDescriptor, Ut as TableMetadataCallback, Vi as LateralIdentity, Vo as ColumnHasRuntimeDefault, Vr as schemaExpression, Vs as ExpressionDefaultDescriptor, Vt as TableIdentity, Wi as QuerySource, Wo as ColumnIsGenerated, Wr as SchemaDiagnostic, Ws as ExternalGeneratedColumnDescriptor, Wt as TableOptions, Xi as MysqlIndexExtension, Xo as ColumnStorage, Xr as SchemaTableRegistry, Xs as IdentityGeneration, Yi as IndexTerm, Yo as ColumnSqlType, Yr as SchemaTableRecord, Ys as IdentityDialectExtension, Zi as PostgresIndexExtension, Zo as ColumnStorageDeclarationOf, Zr as SchemaValidationError, Zs as LiteralDefaultDescriptor, _c as generatedSchemaObjectName, _i as KeyConstraint, _s as StorageTypeOf, _t as AnySource, ac as generatedColumn, ai as CheckConstraint, as as DialectNativeStorage, bc as materializeSchemaObjectRecord, bi as PostgresConstraintExtension, bs as boolean, bt as ProvidedSourceIdentity, cc as SchemaDialectExtension, ci as ConstraintOptions, cs as NativeStorageDescriptor, dc as SchemaMetadataValidationError, di as FieldLikeOptions, ds as PortableStorageDescriptor, ea as SqliteIndexExtension, ec as SchemaLiteralValue, ei as schema, es as ColumnStorageKindOf, fc as SchemaObjectIdentity, fi as ForeignKeyConstraint, fs as PortableStorageType, gc as freezeSchemaMetadata, gi as ForeignKeyTargetInput, gs as StorageOf, hc as dialectMismatchDiagnostic, hi as ForeignKeyTarget, hs as StorageDialectOf, ia as DeclaredColumnNullability, ic as externalGeneratedColumn, ii as CatalogCheckSql, is as ColumnUpdateInput, ji as catalogForeignKey, jr as SchemaExpressionInput, js as portableStorage, jt as SourceSqlTypes, ki as UniqueNullSemantics, kr as SchemaExpressionError, ks as nullable, kt as SourceRow, lc as SchemaDialectName, li as ConstraintTiming, ls as PortableColumnStorage, mc as assertSchemaDialectSupport, mi as ForeignKeyOptions, ms as StorageDescriptor, na as index, nc as canonicalLiteral, ni as AnyKeyColumn, ns as ColumnStorageType, oc as identityColumn, oi as CheckConstraintOptions, os as NativeColumnStorage, pc as SchemaObjectNameOptions, pi as ForeignKeyMatch, ps as StorageDeclarationOf, qi as IndexDialectExtension, qo as ColumnOptions, qr as SchemaTableEntry, qs as GeneratedDescriptor, qt as TableUpdateInput, ra as validateIndexDialect, rc as externalDefault, ri as CatalogCheckExpression, rs as ColumnStorageTypeOf, sc as resolveColumnBehavior, si as ConstraintDialectExtension, ss as NativeStorage, ta as TableIndex, tc as SqliteIdentityExtension, ti as schemaNamingPolicyVersion, ts as ColumnStorageOf, uc as SchemaMetadataDiagnostic, ui as FieldLike, us as PortableStorage, vc as isValidSchemaObjectName, vi as KeyConstraintOptions, vs as bigint, vt as CustomSource, wi as SourceLike, ws as encodeColumnParameter, wt as SourceConfig, xi as ReferentialAction, xs as column, xt as ProvidedSourceRow, yc as materializeSchemaObjectIdentity, yi as MysqlConstraintExtension, ys as binary, yt as CustomSourceOptions, zi as AliasIdentity, zo as ColumnGeneratedOf, zr as renderSchemaExpression, zs as ColumnDefaultInput, zt as TableColumns } from "./types-C0VkiwpR.mjs";
1
+ import { $i as IndexOptions, $o as ColumnOutput, $r as SchemaTableNames, $s as IdentityDescriptor, Ai as SqliteConstraintExtension, Ar as SchemaDialect, As as integer, At as SourceSqlTypeMap, Bi as references, Bo as ColumnDefaultOf, Br as UnsafeSchemaSqlExpression, Bs as CanonicalLiteral, Bt as TableDefinitions, Cc as isValidSchemaObjectName, Ci as KeyConstraintOptions, Cs as bigint, Ct as SourceColumns, Di as SourceConstraint, Ds as columnResultValue, Dt as SourceKind, Ei as ReferentialAction, Es as column, Et as SourceIdentity, Fi as catalogCheck, Fr as SchemaExpressionErrorCode, Fs as numeric, Ft as exposeColumns, Gi as AliasedSource, Go as ColumnHasDefault, Gr as renderSchemaSql, Gs as DefaultDescriptor, Gt as TableRow, Hi as uniqueConstraint, Ho as ColumnDefinitionConfig, Hr as isUnsafeSchemaSql, Hs as ColumnBehaviorErrorCode, Ht as TableInsertInput, Ii as catalogForeignKey, Ir as SchemaExpressionInput, Is as portableStorage, It as sourceIdentity, Ji as QueryAliasIdentity, Jo as ColumnInsertInput, Jr as Schema, Js as ExternalDefaultDescriptor, Jt as table, Ki as LateralIdentity, Ko as ColumnHasRuntimeDefault, Kr as schemaExpression, Ks as ExpressionDefaultDescriptor, Kt as TableSqlTypes, Li as check, Lr as SchemaExpressionMode, Ls as text, Lt as AnyTable, Mi as UniqueConstraint, Mr as createSchemaDialect, Ms as nativeColumn, Mt as UnknownSourceSqlTypes, Ni as UniqueConstraintOptions, Nr as RenderedSchemaExpression, Ns as nativeStorage, Nt as createSource, Oi as SourceConstraintsRecord, Os as date, Ot as SourceProvision, Pi as UniqueNullSemantics, Pr as SchemaExpressionError, Ps as nullable, Pt as customSource, Qi as IndexDialectExtension, Qo as ColumnOptions, Qr as SchemaTableEntry, Qs as GeneratedDescriptor, Ri as foreignKey, Rr as SchemaRenderContext, Rs as timestamp, Rt as Table, Sc as generatedSchemaObjectName, Si as KeyConstraint, Ss as StorageTypeOf, St as Source, Tc as materializeSchemaObjectRecord, Ti as PostgresConstraintExtension, Ts as boolean, Tt as SourceConstraints, Ui as validateConstraintDialect, Uo as ColumnFromOptions, Ur as normalizeSchemaSql, Us as ColumnDefault, Ut as TableMetadataCallback, Vi as unique, Vo as ColumnDefinition, Vr as defineSchemaExpression, Vs as ColumnBehaviorError, Vt as TableIdentity, Wi as AliasIdentity, Wo as ColumnGeneratedOf, Wr as renderSchemaExpression, Ws as ColumnDefaultInput, Wt as TableOptions, Xi as alias, Xo as ColumnIsNullable, Xr as SchemaNamingPolicy, Xs as GeneratedColumnDescriptor, Yi as QuerySource, Yo as ColumnIsGenerated, Yr as SchemaDiagnostic, Ys as ExternalGeneratedColumnDescriptor, Zi as lateral, Zo as ColumnOnUpdateOf, Zr as SchemaOptions, Zs as GeneratedColumnMode, _c as SchemaObjectIdentity, _i as ForeignKeyConstraint, _s as PortableStorageType, _t as AnySource, aa as SqliteIndexExtension, ac as SchemaLiteralValue, ai as schema, as as ColumnStorageKindOf, bc as dialectMismatchDiagnostic, bi as ForeignKeyTarget, bs as StorageDialectOf, bt as ProvidedSourceIdentity, ca as validateIndexDialect, cc as externalDefault, ci as CatalogCheckExpression, cs as ColumnStorageTypeOf, dc as identityColumn, di as CheckConstraintOptions, ds as NativeColumnStorage, ea as IndexTerm, ec as IdentityDialectExtension, ei as SchemaTableRecord, es as ColumnSqlType, fc as resolveColumnBehavior, fi as ConstraintDialectExtension, fs as NativeStorage, gc as SchemaMetadataValidationError, gi as FieldLikeOptions, gs as PortableStorageDescriptor, hc as SchemaMetadataDiagnostic, hi as FieldLike, hs as PortableStorage, ia as SourceIndexesRecord, ic as ResolvedColumnBehavior, ii as generatedTableName, is as ColumnStorageDialectOf, ji as TableLike, jr as SchemaDialectHooks, js as json, jt as SourceSqlTypes, ki as SourceLike, ks as encodeColumnParameter, kt as SourceRow, la as DeclaredColumnNullability, lc as externalGeneratedColumn, li as CatalogCheckSql, ls as ColumnUpdateInput, mc as SchemaDialectName, mi as ConstraintTiming, ms as PortableColumnStorage, na as PostgresIndexExtension, nc as LiteralDefaultDescriptor, ni as SchemaValidationError, ns as ColumnStorageDeclarationOf, oa as TableIndex, oc as SqliteIdentityExtension, oi as schemaNamingPolicyVersion, os as ColumnStorageOf, pc as SchemaDialectExtension, pi as ConstraintOptions, ps as NativeStorageDescriptor, qi as LateralSource, qo as ColumnIdentityOf, qr as unsafeSchemaSql, qs as ExpressionGeneratedColumnDescriptor, qt as TableUpdateInput, ra as SourceIndex, rc as MysqlIdentityExtension, ri as defaultSchemaNamingPolicy, rs as ColumnStorageDescriptor, sa as index, sc as canonicalLiteral, si as AnyKeyColumn, ss as ColumnStorageType, ta as MysqlIndexExtension, tc as IdentityGeneration, ti as SchemaTableRegistry, ts as ColumnStorage, uc as generatedColumn, ui as CheckConstraint, us as DialectNativeStorage, vc as SchemaObjectNameOptions, vi as ForeignKeyMatch, vs as StorageDeclarationOf, vt as CustomSource, wc as materializeSchemaObjectIdentity, wi as MysqlConstraintExtension, ws as binary, wt as SourceConfig, xc as freezeSchemaMetadata, xi as ForeignKeyTargetInput, xs as StorageOf, xt as ProvidedSourceRow, yc as assertSchemaDialectSupport, yi as ForeignKeyOptions, ys as StorageDescriptor, yt as CustomSourceOptions, zi as primaryKey, zo as ColumnCodec, zr as SchemaRenderOptions, zs as uuid, zt as TableColumns } from "./types-DUe6eeI0.mjs";
2
2
  export { AliasIdentity, AliasedSource, AnyKeyColumn, AnySource, AnyTable, CanonicalLiteral, CatalogCheckExpression, CatalogCheckSql, CheckConstraint, CheckConstraintOptions, ColumnBehaviorError, ColumnBehaviorErrorCode, ColumnCodec, ColumnDefault, ColumnDefaultInput, ColumnDefaultOf, ColumnDefinition, ColumnDefinitionConfig, ColumnFromOptions, ColumnGeneratedOf, ColumnHasDefault, ColumnHasRuntimeDefault, ColumnIdentityOf, ColumnInsertInput, ColumnIsGenerated, ColumnIsNullable, ColumnOnUpdateOf, ColumnOptions, ColumnOutput, ColumnSqlType, ColumnStorage, ColumnStorageDeclarationOf, ColumnStorageDescriptor, ColumnStorageDialectOf, ColumnStorageKindOf, ColumnStorageOf, ColumnStorageType, ColumnStorageTypeOf, ColumnUpdateInput, ConstraintDialectExtension, ConstraintOptions, ConstraintTiming, CustomSource, CustomSourceOptions, type DeclaredColumnNullability, DefaultDescriptor, DialectNativeStorage, ExpressionDefaultDescriptor, ExpressionGeneratedColumnDescriptor, ExternalDefaultDescriptor, ExternalGeneratedColumnDescriptor, FieldLike, FieldLikeOptions, ForeignKeyConstraint, ForeignKeyMatch, ForeignKeyOptions, ForeignKeyTarget, ForeignKeyTargetInput, GeneratedColumnDescriptor, GeneratedColumnMode, GeneratedDescriptor, IdentityDescriptor, IdentityDialectExtension, IdentityGeneration, 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 };
package/dist/schema.mjs CHANGED
@@ -1,8 +1,9 @@
1
- import { c as dialectMismatchDiagnostic, d as isValidSchemaObjectName, f as materializeSchemaObjectIdentity, l as freezeSchemaMetadata, o as SchemaMetadataValidationError, p as materializeSchemaObjectRecord, s as assertSchemaDialectSupport, u as generatedSchemaObjectName } from "./column-r1Y4ivwt.mjs";
2
- import { C as identityColumn, S as generatedColumn, _ as uuid, a as columnResultValue, b as externalDefault, c as integer, d as nativeStorage, f as nullable, g as timestamp, h as text, i as column, l as json, m as portableStorage, n as binary, o as date, p as numeric, r as boolean, s as encodeColumnParameter, t as bigint, u as nativeColumn, v as ColumnBehaviorError, w as resolveColumnBehavior, x as externalGeneratedColumn, y as canonicalLiteral } from "./column-Da37jYSD.mjs";
3
- import { i as sourceIdentity, n as customSource, r as exposeColumns, t as createSource } from "./source-SqrKWjFJ.mjs";
4
- import { n as alias, r as lateral, t as table } from "./table-BwflqeAj.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-YGyNPQ_z.mjs";
6
- import { a as schemaNamingPolicyVersion, c as isUnsafeSchemaSql, d as renderSchemaSql, f as schemaExpression, i as schema, l as normalizeSchemaSql, n as defaultSchemaNamingPolicy, o as SchemaExpressionError, p as unsafeSchemaSql, r as generatedTableName, s as defineSchemaExpression, t as SchemaValidationError, u as renderSchemaExpression } from "./registry-BRcUuazJ.mjs";
1
+ import { _ as materializeSchemaObjectIdentity, d as SchemaMetadataValidationError, f as assertSchemaDialectSupport, g as isValidSchemaObjectName, h as generatedSchemaObjectName, m as freezeSchemaMetadata, p as dialectMismatchDiagnostic, v as materializeSchemaObjectRecord } from "./column-BzN8KFJa.mjs";
2
+ import { C as identityColumn, S as generatedColumn, _ as uuid, a as columnResultValue, b as externalDefault, c as integer, d as nativeStorage, f as nullable, g as timestamp, h as text, i as column, l as json, m as portableStorage, n as binary, o as date, p as numeric, r as boolean, s as encodeColumnParameter, t as bigint, u as nativeColumn, v as ColumnBehaviorError, w as resolveColumnBehavior, x as externalGeneratedColumn, y as canonicalLiteral } from "./column-CFvSbil0.mjs";
3
+ import { i as sourceIdentity, n as customSource, r as exposeColumns, t as createSource } from "./source-BDuUXmAk.mjs";
4
+ import { n as alias, r as lateral, t as table } from "./table-C1QGNe4P.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-DM_tarXc.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-BCjc08zw.mjs";
7
+ import { a as schemaNamingPolicyVersion, i as schema, n as defaultSchemaNamingPolicy, r as generatedTableName, t as SchemaValidationError } from "./registry-oWDiqD7i.mjs";
7
8
  import { t as createSchemaDialect } from "./dialect-wUKrnPMB.mjs";
8
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 };
@@ -1,6 +1,6 @@
1
- import { t as standardDialect } from "./standard-DfcZEVOj.mjs";
2
- import { r as isColumnReference, u as generatedSchemaObjectName } from "./column-r1Y4ivwt.mjs";
3
- import { c as isUnsafeSchemaSql, n as defaultSchemaNamingPolicy, u as renderSchemaExpression } from "./registry-BRcUuazJ.mjs";
1
+ import { H as standardDialect, h as generatedSchemaObjectName, r as isColumnReference } from "./column-BzN8KFJa.mjs";
2
+ import { a as renderSchemaExpression, r as isUnsafeSchemaSql } from "./expressions-BCjc08zw.mjs";
3
+ import { n as defaultSchemaNamingPolicy } from "./registry-oWDiqD7i.mjs";
4
4
  import { t as createSchemaDialect } from "./dialect-wUKrnPMB.mjs";
5
5
  import { a as toSnapshotJsonValue, f as schemaSnapshotFormat, i as schemaSnapshotFingerprint, o as SnapshotValidationError, r as encodeCanonicalSnapshot, s as assertSchemaSnapshot, u as neutralSnapshotDialect } from "./canonical-DMvR9yBe.mjs";
6
6
  //#region src/snapshot/serialize.ts
@@ -1,4 +1,4 @@
1
- import { T as SnapshotJsonValue, Tr as SchemaDialect, Ur as Schema, f as SnapshotDiagnostic, i as SchemaSnapshotInput, l as SnapshotCreateResult, n as SchemaSnapshot, r as SchemaSnapshotAdapter, u as SnapshotDecodeResult } from "./types-C0VkiwpR.mjs";
1
+ import { Ar as SchemaDialect, Jr as Schema, T as SnapshotJsonValue, f as SnapshotDiagnostic, i as SchemaSnapshotInput, l as SnapshotCreateResult, n as SchemaSnapshot, r as SchemaSnapshotAdapter, u as SnapshotDecodeResult } from "./types-DUe6eeI0.mjs";
2
2
  //#region src/snapshot/canonical.d.ts
3
3
  /** Error raised when a value cannot cross the canonical JSON boundary. */
4
4
  declare class SnapshotCanonicalError extends TypeError {
@@ -1,5 +1,5 @@
1
- import { Tr as SchemaDialect, Ur as Schema, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-C0VkiwpR.mjs";
2
- import { t as SchemaSnapshotOptions } from "../serialize-CEIIlWhC.mjs";
1
+ import { Ar as SchemaDialect, Jr as Schema, l as SnapshotCreateResult, m as SnapshotDialect, n as SchemaSnapshot, r as SchemaSnapshotAdapter } from "../types-DUe6eeI0.mjs";
2
+ import { t as SchemaSnapshotOptions } from "../serialize-OvXCLzjm.mjs";
3
3
  //#region src/snapshot/mysql.d.ts
4
4
  /** MySQL's v1 snapshot extension identity. */
5
5
  declare const mysqlSnapshotDialect: SnapshotDialect;