@sequenceholdings/orm 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +40 -1
  2. package/dist/authoring.cjs +1619 -121
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +252 -8
  5. package/dist/authoring.d.ts +252 -8
  6. package/dist/authoring.js +1607 -123
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.cjs +713 -41
  9. package/dist/canonical.cjs.map +1 -1
  10. package/dist/canonical.d.cts +1520 -51
  11. package/dist/canonical.d.ts +1520 -51
  12. package/dist/canonical.js +693 -42
  13. package/dist/canonical.js.map +1 -1
  14. package/dist/cli.cjs +7103 -3901
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +7104 -3902
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.cjs +122 -40
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +85 -25
  21. package/dist/client.d.ts +85 -25
  22. package/dist/client.js +119 -41
  23. package/dist/client.js.map +1 -1
  24. package/dist/compiler.cjs +2464 -450
  25. package/dist/compiler.cjs.map +1 -1
  26. package/dist/compiler.d.cts +79 -4
  27. package/dist/compiler.d.ts +79 -4
  28. package/dist/compiler.js +2457 -451
  29. package/dist/compiler.js.map +1 -1
  30. package/dist/constants-C6EG6Wq7.d.cts +99 -0
  31. package/dist/constants-C6EG6Wq7.d.ts +99 -0
  32. package/dist/definition-DjfC7Lll.d.cts +91 -0
  33. package/dist/definition-DjfC7Lll.d.ts +91 -0
  34. package/dist/dynamic-input.cjs +2 -1
  35. package/dist/dynamic-input.cjs.map +1 -1
  36. package/dist/dynamic-input.d.cts +9 -1
  37. package/dist/dynamic-input.d.ts +9 -1
  38. package/dist/dynamic-input.js +2 -1
  39. package/dist/dynamic-input.js.map +1 -1
  40. package/dist/index.cjs +2656 -418
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +693 -116
  43. package/dist/index.d.ts +693 -116
  44. package/dist/index.js +2622 -420
  45. package/dist/index.js.map +1 -1
  46. package/dist/ir.cjs +811 -48
  47. package/dist/ir.cjs.map +1 -1
  48. package/dist/ir.d.cts +670 -27
  49. package/dist/ir.d.ts +670 -27
  50. package/dist/ir.js +802 -49
  51. package/dist/ir.js.map +1 -1
  52. package/dist/{naming-DCn94LJ4.d.ts → naming-CPfx7EfF.d.ts} +14 -1
  53. package/dist/{naming-DPglwzkB.d.cts → naming-CU9ThP_E.d.cts} +14 -1
  54. package/dist/policy-1iZbGnZZ.d.cts +24 -0
  55. package/dist/policy-1iZbGnZZ.d.ts +24 -0
  56. package/dist/predicate-v2.cjs +804 -51
  57. package/dist/predicate-v2.cjs.map +1 -1
  58. package/dist/predicate-v2.d.cts +2 -1
  59. package/dist/predicate-v2.d.ts +2 -1
  60. package/dist/predicate-v2.js +804 -51
  61. package/dist/predicate-v2.js.map +1 -1
  62. package/dist/sdl.cjs +1014 -75
  63. package/dist/sdl.cjs.map +1 -1
  64. package/dist/sdl.d.cts +14 -3
  65. package/dist/sdl.d.ts +14 -3
  66. package/dist/sdl.js +1012 -76
  67. package/dist/sdl.js.map +1 -1
  68. package/package.json +13 -7
  69. package/src/codegen-gql/server-fns.cjs +2 -2
  70. package/templates/orm-namespace/AGENTS.md +10 -0
  71. package/templates/orm-namespace/CLAUDE.md +1 -82
  72. package/templates/orm-namespace/codegen.preset.d.cts +7 -0
  73. package/templates/orm-namespace/codegen.ts +2 -1
  74. package/templates/orm-namespace/graphql/example/queries.ts +4 -3
  75. package/templates/orm-namespace/package.json +2 -1
  76. package/templates/orm-namespace/schema/tables.ts +3 -2
  77. package/templates/orm-namespace/sequence.config.ts +7 -11
package/dist/index.d.ts CHANGED
@@ -1,13 +1,16 @@
1
- export { AuthoringContext, AuthoringRegistration, COLUMN_BRAND, COLUMN_DEFAULT_FNS, ColumnBuilder, ColumnDefaultFn, ColumnDefaultLiteral, ColumnTypeSpec, CowMutationInput, DrizzleRelation, ENUM_BRAND, EnumRef, ForeignKeyInput, IndexInput, LINK_BRAND, LinkKind, LoadNamespaceOptions, LoadedNamespaceV2, NAMESPACE_CONFIG_BRAND, NAMESPACE_CONFIG_FILE, NamespaceCapabilitiesInput, NamespaceConfigInput, ORM_TO_PIPELINE_TYPE, OrmContractColumnMap, OrmContractPipelineColumn, OrmSyncedTableContract, OrmToPipelineType, OverlayTableRef, OverlayWinsUnionInput, OverrideRowMutationInput, PolicyInput, PolicyVariantInput, PolicyWithVariantsInput, RelationRef, RevertOverlayMutationInput, SCHEMA_DIR, SYNCED_CONTRACT_HASH_DOMAIN, SeqLink, SeqNamespaceConfig, SeqTable, SeqView, SerializeNamespaceInput, SyncedTableConfig, SyncedTablePoliciesInput, TABLE_BRAND, TableConfig, TablePoliciesInput, TableRef, ToManyOptions, ToOneOptions, ToPlatformUserOptions, TypedSyncedTableConfig, VIEW_BRAND, ViewConfig, ViewPoliciesInput, ViewQueryContext, ViewSelectQuery, activeAuthoringContext, beginAuthoringContext, computeCanonicalHash, computeSyncedContractHash, defineEnum, defineNamespace, defineSyncedTable, defineTable, defineView, deriveColumnName, endAuthoringContext, extractOrmSyncedTableContract, isColumnBuilder, isEnumRef, isSeqLink, isSeqNamespaceConfig, isSeqTable, isSeqView, loadNamespaceFromDir, overlayWinsUnion, overrideRowMutation, revertOverlayMutation, serializeNamespace, syncedContractSurface, t, toMany, toOne, toPlatformUser } from './authoring.js';
1
+ export { AuthoringContext, AuthoringRegistration, COLUMN_BRAND, COLUMN_DEFAULT_FNS, CatalogFolders, CheckInput, ColumnBuilder, ColumnDefaultFn, ColumnDefaultLiteral, ColumnTypeSpec, Comparator, CowMutationInput, DrizzleRelation, DurationInput, ENUM_BRAND, EnumRef, EtlSourceInput, ExternalObjectRef, ForeignKeyInput, FunctionRef, IndexInput, LINK_BRAND, LinkKind, LoadNamespaceOptions, LoadedNamespaceV2, ManualSourceInput, NAMESPACE_CONFIG_BRAND, NAMESPACE_CONFIG_FILE, NamespaceCapabilitiesInput, NamespaceCatalog, NamespaceConfigInput, ORM_TO_PIPELINE_TYPE, OrmContractColumnMap, OrmContractPipelineColumn, OrmSyncedTableContract, OrmToPipelineType, OverlayTableRef, OverlayWinsUnionInput, OverrideRowMutationInput, PolicyInput, PolicyVariantInput, PolicyWithVariantsInput, PrefetchSourceInput, ReferentialAction, RelationRef, ResolvedSourceInput, ResolvedTableConfig, ResolvedTablePoliciesInput, RevertOverlayMutationInput, SCHEMA_DIR, SYNCED_CONTRACT_HASH_DOMAIN, SeqLink, SeqNamespaceConfig, SeqTable, SeqView, SerializeNamespaceInput, SyncedTableConfig, SyncedTablePoliciesInput, TABLE_BRAND, TableConfig, TablePoliciesInput, TableRef, ToManyOptions, ToOneOptions, ToPlatformUserOptions, TypedSyncedTableConfig, VIEW_BRAND, ViewConfig, ViewPoliciesInput, ViewQueryContext, ViewSelectQuery, activeAuthoringContext, beginAuthoringContext, computeCanonicalHash, computeSyncedContractHash, custom, defineEnum, defineNamespace, defineResolvedTable, defineSyncedTable, defineTable, defineView, deriveColumnName, endAuthoringContext, etlSource, extractOrmSyncedTableContract, highest, isColumnBuilder, isEnumRef, isSeqLink, isSeqNamespaceConfig, isSeqTable, isSeqView, latest, loadNamespaceFromDir, lowest, managedFn, manualSource, nonNullFirst, objectRef, overlayWinsUnion, overrideRowMutation, prefetchSource, priority, revertOverlayMutation, serializeNamespace, syncedContractSurface, t, toMany, toOne, toPlatformUser, validateNamespaceCatalog } from './authoring.js';
2
+ export { S as SqlOperationDefinition, d as defineOperation } from './definition-DjfC7Lll.js';
2
3
  import { CanonicalDefinition } from './canonical.js';
3
- export { CANONICAL_FORMAT, CanonicalColumn, CanonicalEnum, CanonicalLink, CanonicalTable, CanonicalView, IDENTIFIER_RE, PolicyExpression, canonicalActionSchema, canonicalColumnSchema, canonicalDefinitionSchema, canonicalEnumSchema, canonicalIndexSchema, canonicalLinkSchema, canonicalPoliciesSchema, canonicalRelations, canonicalTableSchema, canonicalViewSchema, normalizeCanonical, policyExpressionSchema, policyVariantSchema } from './canonical.js';
4
+ export { CANONICAL_FORMAT, CanonicalColumn, CanonicalEnum, CanonicalLink, CanonicalTable, CanonicalView, IDENTIFIER_RE, OntologyContract, canonicalActionSchema, canonicalColumnSchema, canonicalDefinitionSchema, canonicalEnumSchema, canonicalIndexSchema, canonicalLinkSchema, canonicalPoliciesSchema, canonicalRelations, canonicalTableSchema, canonicalViewSchema, normalizeCanonical, ontologyContractSchema, readOntologyContract } from './canonical.js';
4
5
  import { CustomRolesBlock } from '@sequenceholdings/custom-roles-manifest';
5
6
  export { CustomRolesBlock, capabilityPinsSchema, customRolesBlockSchema, customRolesDeclared, parseCapabilityPin, validateCapabilityPins } from '@sequenceholdings/custom-roles-manifest';
6
7
  import { z } from 'zod';
7
8
  import { PredIr } from './ir.js';
8
- export { CLAIMS_CONTRACT, CMP_OPS, ClaimKey, CmpOp, CompiledArtifact, CompiledOperation, DATE_BUCKETS, DateBucket, GroupByKeyIr, INPUT_REF_KINDS, IR_VERSION, InputRefKind, IrVersionError, LEGACY_IR_VERSION, LimitIr, OrderIr, RootIr, SelectionIr, TableMetaIr, ValueIr, VariableDefaultIr, VariableIr, compiledArtifactSchema, compiledOperationSchema, indexByHash, limitIrSchema, normalizeIr, orderIrSchema, predIrSchema, requiredArtifactIrVersion, rootIrSchema, selectionIrSchema, tableMetaIrSchema, valueIrSchema, variableDefaultIrSchema, variableIrSchema } from './ir.js';
9
+ export { CLAIMS_CONTRACT, CMP_OPS, COMPOSED_IR_VERSION, CellSelectionIr, ClaimKey, CmpOp, CompiledArtifact, CompiledOperation, DATE_BUCKETS, DateBucket, GUARDED_IR_VERSION, GroupByKeyIr, INPUT_REF_KINDS, IR_VERSION, InputRefKind, IrVersionError, LEGACY_IR_VERSION, LimitIr, OrderIr, PrefetchPlanIr, RUNTIME_SQL_IR_VERSION, ResolvedMetaIr, ResolvedSourceIr, RootIr, SQL_IR_VERSION, SelectionIr, TableMetaIr, ValueIr, VariableDefaultIr, VariableIr, compiledArtifactSchema, compiledOperationSchema, indexByHash, limitIrSchema, normalizeIr, orderIrSchema, predIrSchema, prefetchPlanIrSchema, requiredArtifactIrVersion, resolvedMetaIrSchema, resolvedSourceIrSchema, rootIrSchema, selectionIrSchema, tableMetaIrSchema, valueIrSchema, variableDefaultIrSchema, variableIrSchema } from './ir.js';
10
+ export { e as CAPABILITY_KEY_PATTERN, C as CELLS_FIELD, a as CELL_PARTS, f as CELL_PART_SUFFIX, g as CLAIM_KEY_PATTERN, h as COLUMN_IDENTIFIER_PATTERN, i as CONSUMER_ROLE_SUFFIX, b as CellPart, D as DEFINITION_FILE_EXTENSIONS, H as HASH_DOMAIN, I as IDENTIFIER_PATTERN, M as MATERIALIZE_ACTOR, j as MATERIALIZE_CLAIMS_JSON, k as MAX_DEFINITION_FILE_BYTES, l as MAX_GENERATED_SDL_BYTES, m as MAX_IDENTIFIER_LENGTH, n as MAX_TRACKED_COLUMN_NAME, o as NAMESPACE_CONFIG_FILENAMES, N as NAMESPACE_PATTERN, O as ORM_DATA_TOKEN_HEADER, p as ORM_REGISTRATION_MAX_BYTES, q as ORM_SCHEMA_PREFIX, d as ORM_SERVICE_DATA_TOKEN_HEADER, Q as QUALIFIED_TABLE_PATTERN, R as RESERVED_COLUMN_NAMES, r as RESERVED_TABLE_NAMES, S as SYNCED_SOURCE_PATTERN, c as cellColumnName, s as consumerRoleName, t as materializeLockKey, u as materializedRefreshFunctionName, v as ormSchemaName } from './constants-C6EG6Wq7.js';
9
11
  import { generateDrizzleJson } from 'drizzle-kit/api';
10
12
  import { PgTableWithColumns } from 'drizzle-orm/pg-core';
13
+ export { P as PolicyExpression, p as policyExpressionSchema, a as policyVariantSchema } from './policy-1iZbGnZZ.js';
11
14
  import 'drizzle-orm';
12
15
  import 'drizzle-orm/query-builders/query-builder';
13
16
 
@@ -49,14 +52,14 @@ declare const actionParamSchema: z.ZodObject<{
49
52
  type: z.ZodEnum<{
50
53
  bigint: "bigint";
51
54
  boolean: "boolean";
52
- uuid: "uuid";
55
+ date: "date";
53
56
  text: "text";
57
+ timestamptz: "timestamptz";
58
+ jsonb: "jsonb";
59
+ uuid: "uuid";
54
60
  integer: "integer";
55
61
  numeric: "numeric";
56
62
  double: "double";
57
- timestamptz: "timestamptz";
58
- date: "date";
59
- jsonb: "jsonb";
60
63
  }>;
61
64
  optional: z.ZodOptional<z.ZodBoolean>;
62
65
  description: z.ZodOptional<z.ZodString>;
@@ -74,14 +77,14 @@ declare const actionSchema: z.ZodObject<{
74
77
  type: z.ZodEnum<{
75
78
  bigint: "bigint";
76
79
  boolean: "boolean";
77
- uuid: "uuid";
80
+ date: "date";
78
81
  text: "text";
82
+ timestamptz: "timestamptz";
83
+ jsonb: "jsonb";
84
+ uuid: "uuid";
79
85
  integer: "integer";
80
86
  numeric: "numeric";
81
87
  double: "double";
82
- timestamptz: "timestamptz";
83
- date: "date";
84
- jsonb: "jsonb";
85
88
  }>;
86
89
  optional: z.ZodOptional<z.ZodBoolean>;
87
90
  description: z.ZodOptional<z.ZodString>;
@@ -91,14 +94,14 @@ declare const actionSchema: z.ZodObject<{
91
94
  returns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
92
95
  bigint: "bigint";
93
96
  boolean: "boolean";
94
- uuid: "uuid";
97
+ date: "date";
95
98
  text: "text";
99
+ timestamptz: "timestamptz";
100
+ jsonb: "jsonb";
101
+ uuid: "uuid";
96
102
  integer: "integer";
97
103
  numeric: "numeric";
98
104
  double: "double";
99
- timestamptz: "timestamptz";
100
- date: "date";
101
- jsonb: "jsonb";
102
105
  }>>>;
103
106
  audit: z.ZodOptional<z.ZodObject<{
104
107
  action: z.ZodEnum<{
@@ -126,14 +129,14 @@ type ColumnType = (typeof COLUMN_TYPES)[number];
126
129
  declare const columnTypeSchema: z.ZodEnum<{
127
130
  bigint: "bigint";
128
131
  boolean: "boolean";
129
- uuid: "uuid";
132
+ date: "date";
130
133
  text: "text";
134
+ timestamptz: "timestamptz";
135
+ jsonb: "jsonb";
136
+ uuid: "uuid";
131
137
  integer: "integer";
132
138
  numeric: "numeric";
133
139
  double: "double";
134
- timestamptz: "timestamptz";
135
- date: "date";
136
- jsonb: "jsonb";
137
140
  }>;
138
141
  /**
139
142
  * True when the default is one of the allowlisted SQL function calls for its
@@ -158,14 +161,14 @@ declare const columnSchema: z.ZodObject<{
158
161
  type: z.ZodEnum<{
159
162
  bigint: "bigint";
160
163
  boolean: "boolean";
161
- uuid: "uuid";
164
+ date: "date";
162
165
  text: "text";
166
+ timestamptz: "timestamptz";
167
+ jsonb: "jsonb";
168
+ uuid: "uuid";
163
169
  integer: "integer";
164
170
  numeric: "numeric";
165
171
  double: "double";
166
- timestamptz: "timestamptz";
167
- date: "date";
168
- jsonb: "jsonb";
169
172
  }>;
170
173
  primary_key: z.ZodOptional<z.ZodBoolean>;
171
174
  nullable: z.ZodOptional<z.ZodBoolean>;
@@ -208,14 +211,14 @@ declare const tableFileSchema: z.ZodObject<{
208
211
  type: z.ZodEnum<{
209
212
  bigint: "bigint";
210
213
  boolean: "boolean";
211
- uuid: "uuid";
214
+ date: "date";
212
215
  text: "text";
216
+ timestamptz: "timestamptz";
217
+ jsonb: "jsonb";
218
+ uuid: "uuid";
213
219
  integer: "integer";
214
220
  numeric: "numeric";
215
221
  double: "double";
216
- timestamptz: "timestamptz";
217
- date: "date";
218
- jsonb: "jsonb";
219
222
  }>;
220
223
  primary_key: z.ZodOptional<z.ZodBoolean>;
221
224
  nullable: z.ZodOptional<z.ZodBoolean>;
@@ -259,14 +262,14 @@ declare const tableFileSchema: z.ZodObject<{
259
262
  type: z.ZodEnum<{
260
263
  bigint: "bigint";
261
264
  boolean: "boolean";
262
- uuid: "uuid";
265
+ date: "date";
263
266
  text: "text";
267
+ timestamptz: "timestamptz";
268
+ jsonb: "jsonb";
269
+ uuid: "uuid";
264
270
  integer: "integer";
265
271
  numeric: "numeric";
266
272
  double: "double";
267
- timestamptz: "timestamptz";
268
- date: "date";
269
- jsonb: "jsonb";
270
273
  }>;
271
274
  optional: z.ZodOptional<z.ZodBoolean>;
272
275
  description: z.ZodOptional<z.ZodString>;
@@ -276,14 +279,14 @@ declare const tableFileSchema: z.ZodObject<{
276
279
  returns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
277
280
  bigint: "bigint";
278
281
  boolean: "boolean";
279
- uuid: "uuid";
282
+ date: "date";
280
283
  text: "text";
284
+ timestamptz: "timestamptz";
285
+ jsonb: "jsonb";
286
+ uuid: "uuid";
281
287
  integer: "integer";
282
288
  numeric: "numeric";
283
289
  double: "double";
284
- timestamptz: "timestamptz";
285
- date: "date";
286
- jsonb: "jsonb";
287
290
  }>>>;
288
291
  audit: z.ZodOptional<z.ZodObject<{
289
292
  action: z.ZodEnum<{
@@ -358,6 +361,11 @@ type SyncedColumnType = ColumnType | {
358
361
  };
359
362
  type SyncedPredicateColumnTypes = Readonly<Record<string, SyncedColumnType>>;
360
363
  interface CompilePredIrToSqlOptions {
364
+ readonly alias?: string;
365
+ readonly exists?: (predicate: Extract<PredIr, {
366
+ kind: 'exists';
367
+ }>) => string;
368
+ readonly namespace?: string;
361
369
  /** Column name → declared type, for claim casts in comparisons. */
362
370
  readonly columnTypes?: SyncedPredicateColumnTypes;
363
371
  /** Logical column name → physical column name for the synced backing. */
@@ -423,74 +431,9 @@ declare const ROLES_CLAIM_KEY = "roles";
423
431
  declare const quoteIdentifier: (name: string) => string;
424
432
  declare const quoteLiteral: (value: string) => string;
425
433
  declare const claimExpression: (key: string) => string;
426
- /** NULL claims (or a missing capabilities array) coalesce to false — capability checks fail closed. */
427
- declare const capabilityExpression: (key: string) => string;
434
+ declare const capabilityExpression: (key: string, namespace?: string) => string;
428
435
  /** NULL claims (or a missing roles array) coalesce to false — role checks fail closed. */
429
- declare const roleExpression: (key: string) => string;
430
-
431
- /** Namespace names become Postgres identifiers (`orm_<ns>` schema, `orm_<ns>_consumer` role) — the tight grammar is a security control, not cosmetics. */
432
- declare const NAMESPACE_PATTERN: RegExp;
433
- declare const IDENTIFIER_PATTERN: RegExp;
434
- /** Native source columns may have one leading underscore; relation names may not. */
435
- declare const COLUMN_IDENTIFIER_PATTERN: RegExp;
436
- declare const MAX_IDENTIFIER_LENGTH = 63;
437
- /**
438
- * The Data API carries a delegated, attenuated data token on this header (not
439
- * `Authorization`, which stays the app-user/session bearer). One definition
440
- * shared by the client transport, the server's caller resolver, and the
441
- * function-invoke minter, so all three agree.
442
- */
443
- declare const ORM_DATA_TOKEN_HEADER = "x-sequence-data-token";
444
- /**
445
- * The SEPARATE header the invoke proxy uses to hand a managed function its
446
- * *service* data token — the escalation path. A function receives BOTH this and
447
- * `ORM_DATA_TOKEN_HEADER`; the default `createOrmClient` reads the user token,
448
- * the deliberately-named `createServiceOrmClient` reads THIS one. Two distinct
449
- * headers so reaching for the service identity is always an explicit act, never
450
- * an accidental default. Both are sent to the Data API on `ORM_DATA_TOKEN_HEADER`
451
- * — the server stays mode-agnostic and resolves whatever sub the token carries.
452
- */
453
- declare const ORM_SERVICE_DATA_TOKEN_HEADER = "x-sequence-data-token-service";
454
- /**
455
- * Custom Roles & Capabilities claim keys as policies reference them: a
456
- * host-scoped registry key, or an org pin's `org/<key>`. Matches the registry
457
- * key grammar EXACTLY (`[a-z0-9-]`, 1–64 chars, no `_` — the FGA object-id
458
- * delimiter) so any capability that's declarable/attachable in namespace.yaml
459
- * can also be referenced here — a stricter pattern would let a valid key
460
- * register yet fail at apply (e.g. `org/2fa`, a one-char or digit-led key).
461
- */
462
- declare const CAPABILITY_KEY_PATTERN: RegExp;
463
- declare const CLAIM_KEY_PATTERN: RegExp;
464
- /** Qualified reference to a table outside the defining file: `<schema>.<table>`. */
465
- declare const QUALIFIED_TABLE_PATTERN: RegExp;
466
- /** Synced reflected sources are restricted to the gold layer. */
467
- declare const SYNCED_SOURCE_PATTERN: RegExp;
468
- declare const ORM_SCHEMA_PREFIX = "orm_";
469
- declare const CONSUMER_ROLE_SUFFIX = "_consumer";
470
- declare const ormSchemaName: (namespace: string) => string;
471
- declare const consumerRoleName: (namespace: string) => string;
472
- declare const DEFINITION_FILE_EXTENSIONS: readonly [".yml", ".yaml"];
473
- /** Reserved basenames for the namespace-level config file (description, org capability pins). */
474
- declare const NAMESPACE_CONFIG_FILENAMES: Set<string>;
475
- declare const HASH_DOMAIN = "sequence-orm-definitions\0";
476
- /**
477
- * A per-file byte cap where the loader reads untrusted YAML into memory — a real failure mode, not a product
478
- * limit. Counts of tables/indexes/params and policy/SQL lengths are
479
- * deliberately uncapped; Postgres enforces its own limits loudly at apply.
480
- */
481
- declare const MAX_DEFINITION_FILE_BYTES: number;
482
- /** Generated SDL aggregates every table/view; it is not an individual source file. */
483
- declare const MAX_GENERATED_SDL_BYTES: number;
484
- /** Registration and reviewed exports carry SDL, canonical metadata, snapshots and migrations. */
485
- declare const ORM_REGISTRATION_MAX_BYTES: number;
486
- /** `/api/data/<ns>/actions/…` and `/api/data/<ns>/query` share the table path segment. */
487
- declare const RESERVED_TABLE_NAMES: Set<string>;
488
- /**
489
- * The Data API's query-string grammar owns these parameter names — a column
490
- * with one of them could never be filtered over the wire, so definitions
491
- * refuse it up front ("validate rejects only what can never work").
492
- */
493
- declare const RESERVED_COLUMN_NAMES: Set<string>;
436
+ declare const roleExpression: (key: string, namespace?: string) => string;
494
437
 
495
438
  /** drizzle-kit's serialized schema — the diff/replay artifact the registry stores. */
496
439
  type NamespaceSnapshot = ReturnType<typeof generateDrizzleJson>;
@@ -741,11 +684,32 @@ declare function applyMigrationHintsV2(previous: NamespaceSnapshot, definition:
741
684
  * action function statements. v2 enforces row policies inside compiled
742
685
  * operations (no PG RLS policies) and executes actions on the data plane
743
686
  * (no plpgsql functions), so a v2 plan is hints + kit DDL only.
687
+ *
688
+ * Managed views are dropped and recreated only when the migration reaches
689
+ * them: their own definition changed, they read a relation whose change is not
690
+ * provably view-safe, or they depend on a view that is recreated. Every other
691
+ * view stays in place, keeping its grants, owner, and outside dependents.
744
692
  */
745
- declare function planMigrationV2({ canonical, previousSnapshot, }: {
693
+ declare function planMigrationV2(input: {
746
694
  canonical: CanonicalDefinition;
747
695
  previousSnapshot?: NamespaceSnapshot;
748
696
  }): Promise<PlannedMigration>;
697
+ /**
698
+ * The plan a committed (reviewed) migration was authored as: the current
699
+ * planner when it reproduces the migration, otherwise the legacy one for a
700
+ * migration written before view recreation was narrowed. `reproduces` decides
701
+ * a match — rendered SQL for the CLI's tip gate, statement lists for Atlas's
702
+ * replay gate. When neither reproduces it, the current plan comes back with
703
+ * `reproduced: false`, so callers report the mismatch exactly as before.
704
+ */
705
+ declare function planCommittedMigrationV2({ canonical, previousSnapshot, reproduces, }: {
706
+ canonical: CanonicalDefinition;
707
+ previousSnapshot?: NamespaceSnapshot;
708
+ reproduces: (plan: PlannedMigration) => boolean;
709
+ }): Promise<{
710
+ plan: PlannedMigration;
711
+ reproduced: boolean;
712
+ }>;
749
713
  /**
750
714
  * Drizzle's manual-view snapshot stores declared columns, but PostgreSQL names
751
715
  * and types the live view from the SELECT itself. Assert the live catalog in
@@ -797,6 +761,7 @@ declare const ormMigrationExportSchema: z.ZodObject<{
797
761
  }, z.core.$strip>>>;
798
762
  tables: z.ZodArray<z.ZodObject<{
799
763
  table: z.ZodString;
764
+ displayName: z.ZodOptional<z.ZodString>;
800
765
  description: z.ZodOptional<z.ZodString>;
801
766
  renamedFrom: z.ZodOptional<z.ZodString>;
802
767
  source: z.ZodOptional<z.ZodString>;
@@ -806,14 +771,14 @@ declare const ormMigrationExportSchema: z.ZodObject<{
806
771
  type: z.ZodUnion<readonly [z.ZodEnum<{
807
772
  bigint: "bigint";
808
773
  boolean: "boolean";
809
- uuid: "uuid";
774
+ date: "date";
810
775
  text: "text";
776
+ timestamptz: "timestamptz";
777
+ jsonb: "jsonb";
778
+ uuid: "uuid";
811
779
  integer: "integer";
812
780
  numeric: "numeric";
813
781
  double: "double";
814
- timestamptz: "timestamptz";
815
- date: "date";
816
- jsonb: "jsonb";
817
782
  }>, z.ZodObject<{
818
783
  enum: z.ZodString;
819
784
  }, z.core.$strip>]>;
@@ -831,6 +796,16 @@ declare const ormMigrationExportSchema: z.ZodObject<{
831
796
  renamedFrom: z.ZodOptional<z.ZodString>;
832
797
  cast: z.ZodOptional<z.ZodString>;
833
798
  deprecated: z.ZodDefault<z.ZodBoolean>;
799
+ cell: z.ZodOptional<z.ZodObject<{
800
+ of: z.ZodString;
801
+ part: z.ZodEnum<{
802
+ at: "at";
803
+ by: "by";
804
+ rev: "rev";
805
+ source: "source";
806
+ conflicts: "conflicts";
807
+ }>;
808
+ }, z.core.$strict>>;
834
809
  }, z.core.$strip>>>;
835
810
  primaryKey: z.ZodOptional<z.ZodArray<z.ZodString>>;
836
811
  links: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -841,9 +816,24 @@ declare const ormMigrationExportSchema: z.ZodObject<{
841
816
  toPlatformUser: "toPlatformUser";
842
817
  }>;
843
818
  target: z.ZodOptional<z.ZodString>;
819
+ namespace: z.ZodOptional<z.ZodString>;
844
820
  on: z.ZodString;
845
821
  references: z.ZodOptional<z.ZodString>;
846
822
  enforce: z.ZodDefault<z.ZodBoolean>;
823
+ onDelete: z.ZodOptional<z.ZodEnum<{
824
+ cascade: "cascade";
825
+ restrict: "restrict";
826
+ "no action": "no action";
827
+ "set null": "set null";
828
+ "set default": "set default";
829
+ }>>;
830
+ onUpdate: z.ZodOptional<z.ZodEnum<{
831
+ cascade: "cascade";
832
+ restrict: "restrict";
833
+ "no action": "no action";
834
+ "set null": "set null";
835
+ "set default": "set default";
836
+ }>>;
847
837
  description: z.ZodOptional<z.ZodString>;
848
838
  }, z.core.$strip>>>;
849
839
  indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -851,6 +841,10 @@ declare const ormMigrationExportSchema: z.ZodObject<{
851
841
  unique: z.ZodDefault<z.ZodBoolean>;
852
842
  name: z.ZodOptional<z.ZodString>;
853
843
  }, z.core.$strip>>>;
844
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
845
+ name: z.ZodString;
846
+ expression: z.ZodString;
847
+ }, z.core.$strict>>>;
854
848
  policies: z.ZodDefault<z.ZodObject<{
855
849
  read: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
856
850
  default: z.ZodString;
@@ -892,14 +886,14 @@ declare const ormMigrationExportSchema: z.ZodObject<{
892
886
  type: z.ZodEnum<{
893
887
  bigint: "bigint";
894
888
  boolean: "boolean";
895
- uuid: "uuid";
889
+ date: "date";
896
890
  text: "text";
891
+ timestamptz: "timestamptz";
892
+ jsonb: "jsonb";
893
+ uuid: "uuid";
897
894
  integer: "integer";
898
895
  numeric: "numeric";
899
896
  double: "double";
900
- timestamptz: "timestamptz";
901
- date: "date";
902
- jsonb: "jsonb";
903
897
  }>;
904
898
  nullable: z.ZodDefault<z.ZodBoolean>;
905
899
  }, z.core.$strip>>>;
@@ -934,7 +928,24 @@ declare const ormMigrationExportSchema: z.ZodObject<{
934
928
  "initially-immediate": "initially-immediate";
935
929
  "initially-deferred": "initially-deferred";
936
930
  }>>;
931
+ onDelete: z.ZodOptional<z.ZodEnum<{
932
+ cascade: "cascade";
933
+ restrict: "restrict";
934
+ "no action": "no action";
935
+ "set null": "set null";
936
+ "set default": "set default";
937
+ }>>;
938
+ onUpdate: z.ZodOptional<z.ZodEnum<{
939
+ cascade: "cascade";
940
+ restrict: "restrict";
941
+ "no action": "no action";
942
+ "set null": "set null";
943
+ "set default": "set default";
944
+ }>>;
937
945
  }, z.core.$strict>>>;
946
+ cellMetadata: z.ZodOptional<z.ZodLiteral<true>>;
947
+ internal: z.ZodOptional<z.ZodLiteral<true>>;
948
+ materializes: z.ZodOptional<z.ZodString>;
938
949
  }, z.core.$strip>>;
939
950
  views: z.ZodOptional<z.ZodArray<z.ZodObject<{
940
951
  view: z.ZodString;
@@ -945,14 +956,14 @@ declare const ormMigrationExportSchema: z.ZodObject<{
945
956
  type: z.ZodUnion<readonly [z.ZodEnum<{
946
957
  bigint: "bigint";
947
958
  boolean: "boolean";
948
- uuid: "uuid";
959
+ date: "date";
949
960
  text: "text";
961
+ timestamptz: "timestamptz";
962
+ jsonb: "jsonb";
963
+ uuid: "uuid";
950
964
  integer: "integer";
951
965
  numeric: "numeric";
952
966
  double: "double";
953
- timestamptz: "timestamptz";
954
- date: "date";
955
- jsonb: "jsonb";
956
967
  }>, z.ZodObject<{
957
968
  enum: z.ZodString;
958
969
  }, z.core.$strip>]>;
@@ -970,6 +981,16 @@ declare const ormMigrationExportSchema: z.ZodObject<{
970
981
  renamedFrom: z.ZodOptional<z.ZodString>;
971
982
  cast: z.ZodOptional<z.ZodString>;
972
983
  deprecated: z.ZodDefault<z.ZodBoolean>;
984
+ cell: z.ZodOptional<z.ZodObject<{
985
+ of: z.ZodString;
986
+ part: z.ZodEnum<{
987
+ at: "at";
988
+ by: "by";
989
+ rev: "rev";
990
+ source: "source";
991
+ conflicts: "conflicts";
992
+ }>;
993
+ }, z.core.$strict>>;
973
994
  }, z.core.$strip>>;
974
995
  primaryKey: z.ZodOptional<z.ZodArray<z.ZodString>>;
975
996
  links: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -980,9 +1001,24 @@ declare const ormMigrationExportSchema: z.ZodObject<{
980
1001
  toPlatformUser: "toPlatformUser";
981
1002
  }>;
982
1003
  target: z.ZodOptional<z.ZodString>;
1004
+ namespace: z.ZodOptional<z.ZodString>;
983
1005
  on: z.ZodString;
984
1006
  references: z.ZodOptional<z.ZodString>;
985
1007
  enforce: z.ZodDefault<z.ZodBoolean>;
1008
+ onDelete: z.ZodOptional<z.ZodEnum<{
1009
+ cascade: "cascade";
1010
+ restrict: "restrict";
1011
+ "no action": "no action";
1012
+ "set null": "set null";
1013
+ "set default": "set default";
1014
+ }>>;
1015
+ onUpdate: z.ZodOptional<z.ZodEnum<{
1016
+ cascade: "cascade";
1017
+ restrict: "restrict";
1018
+ "no action": "no action";
1019
+ "set null": "set null";
1020
+ "set default": "set default";
1021
+ }>>;
986
1022
  description: z.ZodOptional<z.ZodString>;
987
1023
  }, z.core.$strip>>>;
988
1024
  policies: z.ZodObject<{
@@ -997,11 +1033,501 @@ declare const ormMigrationExportSchema: z.ZodObject<{
997
1033
  }, z.core.$strict>;
998
1034
  query: z.ZodString;
999
1035
  dependencies: z.ZodArray<z.ZodString>;
1036
+ resolved: z.ZodOptional<z.ZodObject<{
1037
+ sources: z.ZodArray<z.ZodObject<{
1038
+ name: z.ZodString;
1039
+ kind: z.ZodEnum<{
1040
+ manual: "manual";
1041
+ prefetch: "prefetch";
1042
+ etl: "etl";
1043
+ }>;
1044
+ table: z.ZodString;
1045
+ columns: z.ZodArray<z.ZodString>;
1046
+ updatedAt: z.ZodOptional<z.ZodString>;
1047
+ key: z.ZodOptional<z.ZodString>;
1048
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1049
+ shape: z.ZodLiteral<"single">;
1050
+ }, z.core.$strict>, z.ZodObject<{
1051
+ shape: z.ZodLiteral<"batch">;
1052
+ maxKeys: z.ZodNumber;
1053
+ }, z.core.$strict>]>>;
1054
+ function: z.ZodOptional<z.ZodObject<{
1055
+ kind: z.ZodEnum<{
1056
+ managed: "managed";
1057
+ native: "native";
1058
+ }>;
1059
+ id: z.ZodString;
1060
+ }, z.core.$strict>>;
1061
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1062
+ maxStalenessMs: z.ZodNumber;
1063
+ timeoutMs: z.ZodNumber;
1064
+ onError: z.ZodEnum<{
1065
+ fallback: "fallback";
1066
+ fail: "fail";
1067
+ }>;
1068
+ }, z.core.$strict>>;
1069
+ writeback: z.ZodOptional<z.ZodObject<{
1070
+ columns: z.ZodArray<z.ZodString>;
1071
+ defaultMode: z.ZodEnum<{
1072
+ sync: "sync";
1073
+ async: "async";
1074
+ }>;
1075
+ timeoutMs: z.ZodNumber;
1076
+ clearManualOnConfirm: z.ZodBoolean;
1077
+ }, z.core.$strict>>;
1078
+ }, z.core.$strict>>;
1079
+ resolve: z.ZodArray<z.ZodObject<{
1080
+ column: z.ZodString;
1081
+ comparator: z.ZodEnum<{
1082
+ custom: "custom";
1083
+ latest: "latest";
1084
+ highest: "highest";
1085
+ lowest: "lowest";
1086
+ priority: "priority";
1087
+ nonNullFirst: "nonNullFirst";
1088
+ }>;
1089
+ candidates: z.ZodArray<z.ZodString>;
1090
+ orderBy: z.ZodOptional<z.ZodString>;
1091
+ }, z.core.$strict>>;
1092
+ deletedBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
1093
+ materialized: z.ZodOptional<z.ZodObject<{
1094
+ table: z.ZodString;
1095
+ compute: z.ZodString;
1096
+ }, z.core.$strict>>;
1097
+ policies: z.ZodDefault<z.ZodObject<{
1098
+ write: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1099
+ default: z.ZodString;
1100
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1101
+ when: z.ZodString;
1102
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1103
+ policy: z.ZodOptional<z.ZodString>;
1104
+ }, z.core.$strip>>>;
1105
+ }, z.core.$strip>]>>;
1106
+ insert: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1107
+ default: z.ZodString;
1108
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1109
+ when: z.ZodString;
1110
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1111
+ policy: z.ZodOptional<z.ZodString>;
1112
+ }, z.core.$strip>>>;
1113
+ }, z.core.$strip>]>>;
1114
+ update: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1115
+ default: z.ZodString;
1116
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1117
+ when: z.ZodString;
1118
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1119
+ policy: z.ZodOptional<z.ZodString>;
1120
+ }, z.core.$strip>>>;
1121
+ }, z.core.$strip>]>>;
1122
+ }, z.core.$strict>>;
1123
+ }, z.core.$strict>>;
1124
+ internal: z.ZodOptional<z.ZodLiteral<true>>;
1000
1125
  }, z.core.$strip>>>;
1126
+ exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1127
+ read: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1128
+ capability: z.ZodString;
1129
+ }, z.core.$strict>, z.ZodObject<{
1130
+ role: z.ZodString;
1131
+ }, z.core.$strict>]>;
1132
+ write: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1133
+ capability: z.ZodString;
1134
+ }, z.core.$strict>, z.ZodObject<{
1135
+ role: z.ZodString;
1136
+ }, z.core.$strict>]>>;
1137
+ }, z.core.$strict>>>;
1001
1138
  capabilities: z.ZodDefault<z.ZodObject<{
1002
1139
  roles: z.ZodOptional<z.ZodUnknown>;
1003
1140
  uses: z.ZodDefault<z.ZodArray<z.ZodString>>;
1004
1141
  }, z.core.$strip>>;
1142
+ imports: z.ZodOptional<z.ZodArray<z.ZodObject<{
1143
+ definition_format: z.ZodLiteral<2>;
1144
+ namespace: z.ZodString;
1145
+ description: z.ZodOptional<z.ZodString>;
1146
+ enums: z.ZodDefault<z.ZodArray<z.ZodObject<{
1147
+ name: z.ZodString;
1148
+ values: z.ZodArray<z.ZodString>;
1149
+ }, z.core.$strip>>>;
1150
+ tables: z.ZodArray<z.ZodObject<{
1151
+ table: z.ZodString;
1152
+ displayName: z.ZodOptional<z.ZodString>;
1153
+ description: z.ZodOptional<z.ZodString>;
1154
+ renamedFrom: z.ZodOptional<z.ZodString>;
1155
+ source: z.ZodOptional<z.ZodString>;
1156
+ columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
1157
+ name: z.ZodString;
1158
+ columnName: z.ZodString;
1159
+ type: z.ZodUnion<readonly [z.ZodEnum<{
1160
+ bigint: "bigint";
1161
+ boolean: "boolean";
1162
+ date: "date";
1163
+ text: "text";
1164
+ timestamptz: "timestamptz";
1165
+ jsonb: "jsonb";
1166
+ uuid: "uuid";
1167
+ integer: "integer";
1168
+ numeric: "numeric";
1169
+ double: "double";
1170
+ }>, z.ZodObject<{
1171
+ enum: z.ZodString;
1172
+ }, z.core.$strip>]>;
1173
+ nullable: z.ZodDefault<z.ZodBoolean>;
1174
+ unique: z.ZodDefault<z.ZodBoolean>;
1175
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
1176
+ defaultFn: z.ZodOptional<z.ZodEnum<{
1177
+ "gen_random_uuid()": "gen_random_uuid()";
1178
+ "now()": "now()";
1179
+ }>>;
1180
+ onUpdateFn: z.ZodOptional<z.ZodEnum<{
1181
+ "now()": "now()";
1182
+ }>>;
1183
+ description: z.ZodOptional<z.ZodString>;
1184
+ renamedFrom: z.ZodOptional<z.ZodString>;
1185
+ cast: z.ZodOptional<z.ZodString>;
1186
+ deprecated: z.ZodDefault<z.ZodBoolean>;
1187
+ cell: z.ZodOptional<z.ZodObject<{
1188
+ of: z.ZodString;
1189
+ part: z.ZodEnum<{
1190
+ at: "at";
1191
+ by: "by";
1192
+ rev: "rev";
1193
+ source: "source";
1194
+ conflicts: "conflicts";
1195
+ }>;
1196
+ }, z.core.$strict>>;
1197
+ }, z.core.$strip>>>;
1198
+ primaryKey: z.ZodOptional<z.ZodArray<z.ZodString>>;
1199
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
1200
+ name: z.ZodString;
1201
+ kind: z.ZodEnum<{
1202
+ toOne: "toOne";
1203
+ toMany: "toMany";
1204
+ toPlatformUser: "toPlatformUser";
1205
+ }>;
1206
+ target: z.ZodOptional<z.ZodString>;
1207
+ namespace: z.ZodOptional<z.ZodString>;
1208
+ on: z.ZodString;
1209
+ references: z.ZodOptional<z.ZodString>;
1210
+ enforce: z.ZodDefault<z.ZodBoolean>;
1211
+ onDelete: z.ZodOptional<z.ZodEnum<{
1212
+ cascade: "cascade";
1213
+ restrict: "restrict";
1214
+ "no action": "no action";
1215
+ "set null": "set null";
1216
+ "set default": "set default";
1217
+ }>>;
1218
+ onUpdate: z.ZodOptional<z.ZodEnum<{
1219
+ cascade: "cascade";
1220
+ restrict: "restrict";
1221
+ "no action": "no action";
1222
+ "set null": "set null";
1223
+ "set default": "set default";
1224
+ }>>;
1225
+ description: z.ZodOptional<z.ZodString>;
1226
+ }, z.core.$strip>>>;
1227
+ indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
1228
+ columns: z.ZodArray<z.ZodString>;
1229
+ unique: z.ZodDefault<z.ZodBoolean>;
1230
+ name: z.ZodOptional<z.ZodString>;
1231
+ }, z.core.$strip>>>;
1232
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1233
+ name: z.ZodString;
1234
+ expression: z.ZodString;
1235
+ }, z.core.$strict>>>;
1236
+ policies: z.ZodDefault<z.ZodObject<{
1237
+ read: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1238
+ default: z.ZodString;
1239
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1240
+ when: z.ZodString;
1241
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1242
+ policy: z.ZodOptional<z.ZodString>;
1243
+ }, z.core.$strip>>>;
1244
+ }, z.core.$strip>]>>;
1245
+ write: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1246
+ default: z.ZodString;
1247
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1248
+ when: z.ZodString;
1249
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1250
+ policy: z.ZodOptional<z.ZodString>;
1251
+ }, z.core.$strip>>>;
1252
+ }, z.core.$strip>]>>;
1253
+ insert: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1254
+ default: z.ZodString;
1255
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1256
+ when: z.ZodString;
1257
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1258
+ policy: z.ZodOptional<z.ZodString>;
1259
+ }, z.core.$strip>>>;
1260
+ }, z.core.$strip>]>>;
1261
+ update: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1262
+ default: z.ZodString;
1263
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1264
+ when: z.ZodString;
1265
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1266
+ policy: z.ZodOptional<z.ZodString>;
1267
+ }, z.core.$strip>>>;
1268
+ }, z.core.$strip>]>>;
1269
+ }, z.core.$strip>>;
1270
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1271
+ name: z.ZodString;
1272
+ requires: z.ZodOptional<z.ZodString>;
1273
+ params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
1274
+ type: z.ZodEnum<{
1275
+ bigint: "bigint";
1276
+ boolean: "boolean";
1277
+ date: "date";
1278
+ text: "text";
1279
+ timestamptz: "timestamptz";
1280
+ jsonb: "jsonb";
1281
+ uuid: "uuid";
1282
+ integer: "integer";
1283
+ numeric: "numeric";
1284
+ double: "double";
1285
+ }>;
1286
+ nullable: z.ZodDefault<z.ZodBoolean>;
1287
+ }, z.core.$strip>>>;
1288
+ executes: z.ZodString;
1289
+ returns: z.ZodDefault<z.ZodEnum<{
1290
+ rows: "rows";
1291
+ rowsAffected: "rowsAffected";
1292
+ scalar: "scalar";
1293
+ }>>;
1294
+ audit: z.ZodOptional<z.ZodObject<{
1295
+ action: z.ZodString;
1296
+ resource: z.ZodString;
1297
+ }, z.core.$strip>>;
1298
+ }, z.core.$strip>>>;
1299
+ cowMutations: z.ZodOptional<z.ZodArray<z.ZodObject<{
1300
+ kind: z.ZodEnum<{
1301
+ override: "override";
1302
+ revert: "revert";
1303
+ }>;
1304
+ name: z.ZodString;
1305
+ synced: z.ZodString;
1306
+ pk: z.ZodString;
1307
+ copy: z.ZodDefault<z.ZodArray<z.ZodString>>;
1308
+ set: z.ZodDefault<z.ZodArray<z.ZodString>>;
1309
+ }, z.core.$strip>>>;
1310
+ foreignKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
1311
+ name: z.ZodString;
1312
+ columns: z.ZodArray<z.ZodString>;
1313
+ target: z.ZodString;
1314
+ references: z.ZodArray<z.ZodString>;
1315
+ deferrable: z.ZodOptional<z.ZodEnum<{
1316
+ "initially-immediate": "initially-immediate";
1317
+ "initially-deferred": "initially-deferred";
1318
+ }>>;
1319
+ onDelete: z.ZodOptional<z.ZodEnum<{
1320
+ cascade: "cascade";
1321
+ restrict: "restrict";
1322
+ "no action": "no action";
1323
+ "set null": "set null";
1324
+ "set default": "set default";
1325
+ }>>;
1326
+ onUpdate: z.ZodOptional<z.ZodEnum<{
1327
+ cascade: "cascade";
1328
+ restrict: "restrict";
1329
+ "no action": "no action";
1330
+ "set null": "set null";
1331
+ "set default": "set default";
1332
+ }>>;
1333
+ }, z.core.$strict>>>;
1334
+ cellMetadata: z.ZodOptional<z.ZodLiteral<true>>;
1335
+ internal: z.ZodOptional<z.ZodLiteral<true>>;
1336
+ materializes: z.ZodOptional<z.ZodString>;
1337
+ }, z.core.$strip>>;
1338
+ views: z.ZodOptional<z.ZodArray<z.ZodObject<{
1339
+ view: z.ZodString;
1340
+ description: z.ZodOptional<z.ZodString>;
1341
+ columns: z.ZodArray<z.ZodObject<{
1342
+ name: z.ZodString;
1343
+ columnName: z.ZodString;
1344
+ type: z.ZodUnion<readonly [z.ZodEnum<{
1345
+ bigint: "bigint";
1346
+ boolean: "boolean";
1347
+ date: "date";
1348
+ text: "text";
1349
+ timestamptz: "timestamptz";
1350
+ jsonb: "jsonb";
1351
+ uuid: "uuid";
1352
+ integer: "integer";
1353
+ numeric: "numeric";
1354
+ double: "double";
1355
+ }>, z.ZodObject<{
1356
+ enum: z.ZodString;
1357
+ }, z.core.$strip>]>;
1358
+ nullable: z.ZodDefault<z.ZodBoolean>;
1359
+ unique: z.ZodDefault<z.ZodBoolean>;
1360
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
1361
+ defaultFn: z.ZodOptional<z.ZodEnum<{
1362
+ "gen_random_uuid()": "gen_random_uuid()";
1363
+ "now()": "now()";
1364
+ }>>;
1365
+ onUpdateFn: z.ZodOptional<z.ZodEnum<{
1366
+ "now()": "now()";
1367
+ }>>;
1368
+ description: z.ZodOptional<z.ZodString>;
1369
+ renamedFrom: z.ZodOptional<z.ZodString>;
1370
+ cast: z.ZodOptional<z.ZodString>;
1371
+ deprecated: z.ZodDefault<z.ZodBoolean>;
1372
+ cell: z.ZodOptional<z.ZodObject<{
1373
+ of: z.ZodString;
1374
+ part: z.ZodEnum<{
1375
+ at: "at";
1376
+ by: "by";
1377
+ rev: "rev";
1378
+ source: "source";
1379
+ conflicts: "conflicts";
1380
+ }>;
1381
+ }, z.core.$strict>>;
1382
+ }, z.core.$strip>>;
1383
+ primaryKey: z.ZodOptional<z.ZodArray<z.ZodString>>;
1384
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
1385
+ name: z.ZodString;
1386
+ kind: z.ZodEnum<{
1387
+ toOne: "toOne";
1388
+ toMany: "toMany";
1389
+ toPlatformUser: "toPlatformUser";
1390
+ }>;
1391
+ target: z.ZodOptional<z.ZodString>;
1392
+ namespace: z.ZodOptional<z.ZodString>;
1393
+ on: z.ZodString;
1394
+ references: z.ZodOptional<z.ZodString>;
1395
+ enforce: z.ZodDefault<z.ZodBoolean>;
1396
+ onDelete: z.ZodOptional<z.ZodEnum<{
1397
+ cascade: "cascade";
1398
+ restrict: "restrict";
1399
+ "no action": "no action";
1400
+ "set null": "set null";
1401
+ "set default": "set default";
1402
+ }>>;
1403
+ onUpdate: z.ZodOptional<z.ZodEnum<{
1404
+ cascade: "cascade";
1405
+ restrict: "restrict";
1406
+ "no action": "no action";
1407
+ "set null": "set null";
1408
+ "set default": "set default";
1409
+ }>>;
1410
+ description: z.ZodOptional<z.ZodString>;
1411
+ }, z.core.$strip>>>;
1412
+ policies: z.ZodObject<{
1413
+ read: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1414
+ default: z.ZodString;
1415
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1416
+ when: z.ZodString;
1417
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1418
+ policy: z.ZodOptional<z.ZodString>;
1419
+ }, z.core.$strip>>>;
1420
+ }, z.core.$strip>]>;
1421
+ }, z.core.$strict>;
1422
+ query: z.ZodString;
1423
+ dependencies: z.ZodArray<z.ZodString>;
1424
+ resolved: z.ZodOptional<z.ZodObject<{
1425
+ sources: z.ZodArray<z.ZodObject<{
1426
+ name: z.ZodString;
1427
+ kind: z.ZodEnum<{
1428
+ manual: "manual";
1429
+ prefetch: "prefetch";
1430
+ etl: "etl";
1431
+ }>;
1432
+ table: z.ZodString;
1433
+ columns: z.ZodArray<z.ZodString>;
1434
+ updatedAt: z.ZodOptional<z.ZodString>;
1435
+ key: z.ZodOptional<z.ZodString>;
1436
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1437
+ shape: z.ZodLiteral<"single">;
1438
+ }, z.core.$strict>, z.ZodObject<{
1439
+ shape: z.ZodLiteral<"batch">;
1440
+ maxKeys: z.ZodNumber;
1441
+ }, z.core.$strict>]>>;
1442
+ function: z.ZodOptional<z.ZodObject<{
1443
+ kind: z.ZodEnum<{
1444
+ managed: "managed";
1445
+ native: "native";
1446
+ }>;
1447
+ id: z.ZodString;
1448
+ }, z.core.$strict>>;
1449
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1450
+ maxStalenessMs: z.ZodNumber;
1451
+ timeoutMs: z.ZodNumber;
1452
+ onError: z.ZodEnum<{
1453
+ fallback: "fallback";
1454
+ fail: "fail";
1455
+ }>;
1456
+ }, z.core.$strict>>;
1457
+ writeback: z.ZodOptional<z.ZodObject<{
1458
+ columns: z.ZodArray<z.ZodString>;
1459
+ defaultMode: z.ZodEnum<{
1460
+ sync: "sync";
1461
+ async: "async";
1462
+ }>;
1463
+ timeoutMs: z.ZodNumber;
1464
+ clearManualOnConfirm: z.ZodBoolean;
1465
+ }, z.core.$strict>>;
1466
+ }, z.core.$strict>>;
1467
+ resolve: z.ZodArray<z.ZodObject<{
1468
+ column: z.ZodString;
1469
+ comparator: z.ZodEnum<{
1470
+ custom: "custom";
1471
+ latest: "latest";
1472
+ highest: "highest";
1473
+ lowest: "lowest";
1474
+ priority: "priority";
1475
+ nonNullFirst: "nonNullFirst";
1476
+ }>;
1477
+ candidates: z.ZodArray<z.ZodString>;
1478
+ orderBy: z.ZodOptional<z.ZodString>;
1479
+ }, z.core.$strict>>;
1480
+ deletedBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
1481
+ materialized: z.ZodOptional<z.ZodObject<{
1482
+ table: z.ZodString;
1483
+ compute: z.ZodString;
1484
+ }, z.core.$strict>>;
1485
+ policies: z.ZodDefault<z.ZodObject<{
1486
+ write: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1487
+ default: z.ZodString;
1488
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1489
+ when: z.ZodString;
1490
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1491
+ policy: z.ZodOptional<z.ZodString>;
1492
+ }, z.core.$strip>>>;
1493
+ }, z.core.$strip>]>>;
1494
+ insert: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1495
+ default: z.ZodString;
1496
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1497
+ when: z.ZodString;
1498
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1499
+ policy: z.ZodOptional<z.ZodString>;
1500
+ }, z.core.$strip>>>;
1501
+ }, z.core.$strip>]>>;
1502
+ update: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1503
+ default: z.ZodString;
1504
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1505
+ when: z.ZodString;
1506
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1507
+ policy: z.ZodOptional<z.ZodString>;
1508
+ }, z.core.$strip>>>;
1509
+ }, z.core.$strip>]>>;
1510
+ }, z.core.$strict>>;
1511
+ }, z.core.$strict>>;
1512
+ internal: z.ZodOptional<z.ZodLiteral<true>>;
1513
+ }, z.core.$strip>>>;
1514
+ exports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1515
+ read: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1516
+ capability: z.ZodString;
1517
+ }, z.core.$strict>, z.ZodObject<{
1518
+ role: z.ZodString;
1519
+ }, z.core.$strict>]>;
1520
+ write: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1521
+ capability: z.ZodString;
1522
+ }, z.core.$strict>, z.ZodObject<{
1523
+ role: z.ZodString;
1524
+ }, z.core.$strict>]>>;
1525
+ }, z.core.$strict>>>;
1526
+ capabilities: z.ZodDefault<z.ZodObject<{
1527
+ roles: z.ZodOptional<z.ZodUnknown>;
1528
+ uses: z.ZodDefault<z.ZodArray<z.ZodString>>;
1529
+ }, z.core.$strip>>;
1530
+ }, z.core.$strip>>>;
1005
1531
  }, z.core.$strip>;
1006
1532
  documents: z.ZodArray<z.ZodObject<{
1007
1533
  path: z.ZodString;
@@ -1270,4 +1796,55 @@ declare function parseCanonicalDefinition(value: unknown): NamespaceDefinition;
1270
1796
 
1271
1797
  declare const parsedPredicateSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ParsedPredicate, string>>;
1272
1798
 
1273
- export { ACTION_REQUIRES_DENIED_SQLSTATE, ACTION_VALIDATES_FAILED_SQLSTATE, AUDIT_ACTIONS, type ActionDefinition, CAPABILITIES_CLAIM_KEY, CAPABILITY_KEY_PATTERN, CLAIMS_SETTING, CLAIM_KEY_PATTERN, COLUMN_IDENTIFIER_PATTERN, COLUMN_TYPES, COMPARE_OPS, CONSUMER_ROLE_SUFFIX, CanonicalDefinition, type ColumnDefault, type ColumnDefinition, type ColumnType, type CommittedChainEntry, type CommittedMigration, type CompareOp, type CompilePredIrToSqlOptions, type CompiledStatement, DEFINITION_FILE_EXTENSIONS, type DefinitionFile, type DefinitionSource, type DestructiveStatement, type DiffOptions, type DrizzleEntities, HASH_DOMAIN, IDENTIFIER_PATTERN, type IndexDefinition, type JournalEntry, type LinkDefinition, type LoadedNamespace, MAX_DEFINITION_FILE_BYTES, MAX_GENERATED_SDL_BYTES, MAX_IDENTIFIER_LENGTH, MIGRATIONS_DIRNAME, type MigrationJournal, type MigrationWorkspace, NAMESPACE_CONFIG_FILENAMES, NAMESPACE_PATTERN, type NamespaceCapabilities, type NamespaceConfig, type NamespaceDefinition, type NamespaceSnapshot, ORM_DATA_TOKEN_HEADER, ORM_MIGRATION_EXPORT_FILE, ORM_MIGRATION_EXPORT_MAX_BYTES, ORM_REGISTRATION_MAX_BYTES, ORM_SCHEMA_PREFIX, ORM_SERVICE_DATA_TOKEN_HEADER, type Operand, OrmDefinitionError, type OrmMigrationExport, type ParsedPredicate, type PlannedMigration, PredIr, type Predicate, type PredicateColumnTypes, PredicateParseError, QUALIFIED_TABLE_PATTERN, RESERVED_COLUMN_NAMES, RESERVED_TABLE_NAMES, ROLES_CLAIM_KEY, type RebaseEntry, type RebaseEntryInput, type RebaseNoopOptions, STATEMENT_KINDS, SYNCED_SOURCE_PATTERN, SYNCED_VIEW_EXECUTION_OWNER_ROLE, type StatementKind, type SyncedBacking, type SyncedColumnType, type SyncedPredicateColumnTypes, type TableFile, type ValidatesEntry, type WrittenMigration, actionFunctionName, actionFunctionStatements, actionParamArg, actionParamOrder, actionParamSchema, actionPrepareChecks, actionSchema, actionWriteTargets, actionsInterfaceName, applyMigrationHints, applyMigrationHintsV2, buildActionParamsSchema, buildDrizzleEntities, buildDrizzleEntitiesV2, buildNamespaceDefinition, buildRebaseJournalEntry, canonicalizeDefinition, capabilityExpression, castParts, checksumOf, claimExpression, classifyDestructive, columnSchema, columnTypeSchema, compileActionRequires, compileActionStatements, compileNamespace, compilePredIrToSql, compilePredicate, computeDefinitionHash, consumerRoleName, convertV1DefinitionToCanonical, createOrmMigrationExport, declaredCapabilityKeys, diffCommand, diffStatements, emptyJournal, emptySnapshot, extractNamedParams, generateNamespaceTypes, generateSnapshot, generateSnapshotV2, identifierSchema, isFunctionDefault, isOwnedStatement, isOwnedStatementV2, isQualifiedReference, loadCommittedMigrations, loadCommittedTipMigration, loadNamespaceDefinition, migrationName, namespaceConfigSchema, namespaceSchema, normalizeSnapshot, ormMigrationExportSchema, ormSchemaName, parseCanonicalDefinition, parseDefinitionSources, parseOrmMigrationExport, parsePredicate, parseTableFile, parsedPredicateSchema, pendingKitStatements, pendingKitStatementsV2, planMigration, planMigrationV2, predicateOperands, quoteIdentifier, quoteLiteral, readMigrationSql, readMigrationWorkspace, readSnapshot, rebaseViolations, referencedCapabilities, referencedColumns, renderMigrationSql, renderOrmMigrationExport, rewriteSyncedSourceRelationsInViewQuery, roleExpression, securityStatements, sqlTypeName, stableJson, syncedBackingRevokeStatements, syncedTables, syncedViewDropStatements, syncedViewStatements, tableFileSchema, tableReferenceSchema, typesInterfaceName, validateViewCatalogStatement, verifyRebaseIsNoop, walkPredicate, writeMigration };
1799
+ /** How a re-run treats a source key that is already in the ORM table. */
1800
+ declare const IMPORT_CONFLICT_MODES: readonly ["error", "skip", "update"];
1801
+ type ImportConflictMode = (typeof IMPORT_CONFLICT_MODES)[number];
1802
+ /**
1803
+ * Copy one Lakebase/Postgres relation into an owned ORM table.
1804
+ * The relation is where a warehouse table already lands after sync; this
1805
+ * spec never accepts SQL text.
1806
+ */
1807
+ declare const importSpecSchema: z.ZodObject<{
1808
+ table: z.ZodString;
1809
+ from: z.ZodString;
1810
+ columns: z.ZodArray<z.ZodObject<{
1811
+ target: z.ZodString;
1812
+ source: z.ZodString;
1813
+ nullDefault: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1814
+ }, z.core.$strict>>;
1815
+ onConflict: z.ZodDefault<z.ZodEnum<{
1816
+ error: "error";
1817
+ update: "update";
1818
+ skip: "skip";
1819
+ }>>;
1820
+ batchSize: z.ZodDefault<z.ZodNumber>;
1821
+ }, z.core.$strict>;
1822
+ type ImportSpec = z.infer<typeof importSpecSchema>;
1823
+ type ImportPlan = {
1824
+ readonly probeSql: string;
1825
+ readonly script: string;
1826
+ readonly batchSize: number;
1827
+ readonly onConflict: ImportConflictMode;
1828
+ readonly warnings: readonly string[];
1829
+ };
1830
+ type ImportPlanResult = {
1831
+ ok: true;
1832
+ plan: ImportPlan;
1833
+ } | {
1834
+ ok: false;
1835
+ errors: readonly string[];
1836
+ };
1837
+
1838
+ /**
1839
+ * Plan a set-based copy from an existing Postgres relation into an owned ORM
1840
+ * table. The relation is the Lakebase landing of a warehouse table. The plan
1841
+ * is SQL text: identifiers are allowlisted, constants are typed literals, and
1842
+ * no caller SQL is interpolated.
1843
+ */
1844
+ declare function planTableImport({ definition, spec, after, }: {
1845
+ definition: unknown;
1846
+ spec: unknown;
1847
+ after?: string;
1848
+ }): ImportPlanResult;
1849
+
1850
+ export { ACTION_REQUIRES_DENIED_SQLSTATE, ACTION_VALIDATES_FAILED_SQLSTATE, AUDIT_ACTIONS, type ActionDefinition, CAPABILITIES_CLAIM_KEY, CLAIMS_SETTING, COLUMN_TYPES, COMPARE_OPS, CanonicalDefinition, type ColumnDefault, type ColumnDefinition, type ColumnType, type CommittedChainEntry, type CommittedMigration, type CompareOp, type CompilePredIrToSqlOptions, type CompiledStatement, type DefinitionFile, type DefinitionSource, type DestructiveStatement, type DiffOptions, type DrizzleEntities, IMPORT_CONFLICT_MODES, type ImportConflictMode, type ImportPlan, type ImportPlanResult, type ImportSpec, type IndexDefinition, type JournalEntry, type LinkDefinition, type LoadedNamespace, MIGRATIONS_DIRNAME, type MigrationJournal, type MigrationWorkspace, type NamespaceCapabilities, type NamespaceConfig, type NamespaceDefinition, type NamespaceSnapshot, ORM_MIGRATION_EXPORT_FILE, ORM_MIGRATION_EXPORT_MAX_BYTES, type Operand, OrmDefinitionError, type OrmMigrationExport, type ParsedPredicate, type PlannedMigration, PredIr, type Predicate, type PredicateColumnTypes, PredicateParseError, ROLES_CLAIM_KEY, type RebaseEntry, type RebaseEntryInput, type RebaseNoopOptions, STATEMENT_KINDS, SYNCED_VIEW_EXECUTION_OWNER_ROLE, type StatementKind, type SyncedBacking, type SyncedColumnType, type SyncedPredicateColumnTypes, type TableFile, type ValidatesEntry, type WrittenMigration, actionFunctionName, actionFunctionStatements, actionParamArg, actionParamOrder, actionParamSchema, actionPrepareChecks, actionSchema, actionWriteTargets, actionsInterfaceName, applyMigrationHints, applyMigrationHintsV2, buildActionParamsSchema, buildDrizzleEntities, buildDrizzleEntitiesV2, buildNamespaceDefinition, buildRebaseJournalEntry, canonicalizeDefinition, capabilityExpression, castParts, checksumOf, claimExpression, classifyDestructive, columnSchema, columnTypeSchema, compileActionRequires, compileActionStatements, compileNamespace, compilePredIrToSql, compilePredicate, computeDefinitionHash, convertV1DefinitionToCanonical, createOrmMigrationExport, declaredCapabilityKeys, diffCommand, diffStatements, emptyJournal, emptySnapshot, extractNamedParams, generateNamespaceTypes, generateSnapshot, generateSnapshotV2, identifierSchema, importSpecSchema, isFunctionDefault, isOwnedStatement, isOwnedStatementV2, isQualifiedReference, loadCommittedMigrations, loadCommittedTipMigration, loadNamespaceDefinition, migrationName, namespaceConfigSchema, namespaceSchema, normalizeSnapshot, ormMigrationExportSchema, parseCanonicalDefinition, parseDefinitionSources, parseOrmMigrationExport, parsePredicate, parseTableFile, parsedPredicateSchema, pendingKitStatements, pendingKitStatementsV2, planCommittedMigrationV2, planMigration, planMigrationV2, planTableImport, predicateOperands, quoteIdentifier, quoteLiteral, readMigrationSql, readMigrationWorkspace, readSnapshot, rebaseViolations, referencedCapabilities, referencedColumns, renderMigrationSql, renderOrmMigrationExport, rewriteSyncedSourceRelationsInViewQuery, roleExpression, securityStatements, sqlTypeName, stableJson, syncedBackingRevokeStatements, syncedTables, syncedViewDropStatements, syncedViewStatements, tableFileSchema, tableReferenceSchema, typesInterfaceName, validateViewCatalogStatement, verifyRebaseIsNoop, walkPredicate, writeMigration };