@sequenceholdings/orm 2.0.0 → 2.1.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 (69) hide show
  1. package/README.md +94 -2
  2. package/dist/authoring.cjs +1474 -54
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +242 -4
  5. package/dist/authoring.d.ts +242 -4
  6. package/dist/authoring.js +1465 -56
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.cjs +740 -42
  9. package/dist/canonical.cjs.map +1 -1
  10. package/dist/canonical.d.cts +742 -53
  11. package/dist/canonical.d.ts +742 -53
  12. package/dist/canonical.js +724 -43
  13. package/dist/canonical.js.map +1 -1
  14. package/dist/cli.cjs +2478 -328
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +2480 -330
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.cjs +90 -25
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +39 -22
  21. package/dist/client.d.ts +39 -22
  22. package/dist/client.js +87 -26
  23. package/dist/client.js.map +1 -1
  24. package/dist/compiler.cjs +1755 -329
  25. package/dist/compiler.cjs.map +1 -1
  26. package/dist/compiler.d.cts +56 -3
  27. package/dist/compiler.d.ts +56 -3
  28. package/dist/compiler.js +1756 -330
  29. package/dist/compiler.js.map +1 -1
  30. package/dist/constants-YoFGjIBM.d.cts +99 -0
  31. package/dist/constants-YoFGjIBM.d.ts +99 -0
  32. package/dist/dynamic-input.d.cts +1 -0
  33. package/dist/dynamic-input.d.ts +1 -0
  34. package/dist/index.cjs +1973 -164
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +474 -100
  37. package/dist/index.d.ts +474 -100
  38. package/dist/index.js +1940 -167
  39. package/dist/index.js.map +1 -1
  40. package/dist/ir.cjs +869 -46
  41. package/dist/ir.cjs.map +1 -1
  42. package/dist/ir.d.cts +699 -25
  43. package/dist/ir.d.ts +699 -25
  44. package/dist/ir.js +861 -47
  45. package/dist/ir.js.map +1 -1
  46. package/dist/{naming-CTvWSRTf.d.ts → naming-CPfx7EfF.d.ts} +28 -1
  47. package/dist/{naming-DRyinU4u.d.cts → naming-CU9ThP_E.d.cts} +28 -1
  48. package/dist/policy-1iZbGnZZ.d.cts +24 -0
  49. package/dist/policy-1iZbGnZZ.d.ts +24 -0
  50. package/dist/predicate-v2.cjs +852 -49
  51. package/dist/predicate-v2.cjs.map +1 -1
  52. package/dist/predicate-v2.d.cts +2 -1
  53. package/dist/predicate-v2.d.ts +2 -1
  54. package/dist/predicate-v2.js +852 -49
  55. package/dist/predicate-v2.js.map +1 -1
  56. package/dist/sdl.cjs +1309 -58
  57. package/dist/sdl.cjs.map +1 -1
  58. package/dist/sdl.d.cts +7 -3
  59. package/dist/sdl.d.ts +7 -3
  60. package/dist/sdl.js +1305 -59
  61. package/dist/sdl.js.map +1 -1
  62. package/package.json +11 -6
  63. package/templates/orm-namespace/CLAUDE.md +6 -4
  64. package/templates/orm-namespace/codegen.preset.d.cts +7 -0
  65. package/templates/orm-namespace/codegen.ts +2 -1
  66. package/templates/orm-namespace/graphql/example/queries.ts +4 -3
  67. package/templates/orm-namespace/package.json +2 -1
  68. package/templates/orm-namespace/schema/tables.ts +3 -2
  69. package/templates/orm-namespace/sequence.config.ts +7 -11
package/dist/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
- export { AuthoringContext, AuthoringRegistration, COLUMN_BRAND, COLUMN_DEFAULT_FNS, ColumnBuilder, ColumnDefaultFn, ColumnDefaultLiteral, ColumnTypeSpec, CowMutationInput, DrizzleRelation, ENUM_BRAND, EnumRef, 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, CheckInput, ColumnBuilder, ColumnDefaultFn, ColumnDefaultLiteral, ColumnTypeSpec, Comparator, CowMutationInput, DrizzleRelation, DurationInput, ENUM_BRAND, EnumRef, EtlSourceInput, ForeignKeyInput, FunctionRef, IndexInput, LINK_BRAND, LinkKind, LoadNamespaceOptions, LoadedNamespaceV2, ManualSourceInput, NAMESPACE_CONFIG_BRAND, NAMESPACE_CONFIG_FILE, NamespaceCapabilitiesInput, 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, overlayWinsUnion, overrideRowMutation, prefetchSource, priority, revertOverlayMutation, serializeNamespace, syncedContractSurface, t, toMany, toOne, toPlatformUser } from './authoring.js';
2
2
  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';
3
+ export { CANONICAL_FORMAT, CanonicalColumn, CanonicalEnum, CanonicalLink, CanonicalTable, CanonicalView, IDENTIFIER_RE, canonicalActionSchema, canonicalColumnSchema, canonicalDefinitionSchema, canonicalEnumSchema, canonicalIndexSchema, canonicalLinkSchema, canonicalPoliciesSchema, canonicalRelations, canonicalTableSchema, canonicalViewSchema, normalizeCanonical } from './canonical.js';
4
4
  import { CustomRolesBlock } from '@sequenceholdings/custom-roles-manifest';
5
5
  export { CustomRolesBlock, capabilityPinsSchema, customRolesBlockSchema, customRolesDeclared, parseCapabilityPin, validateCapabilityPins } from '@sequenceholdings/custom-roles-manifest';
6
6
  import { z } from 'zod';
7
7
  import { PredIr } from './ir.js';
8
- export { CLAIMS_CONTRACT, CMP_OPS, ClaimKey, CmpOp, CompiledArtifact, CompiledOperation, INPUT_REF_KINDS, IR_VERSION, InputRefKind, IrVersionError, LimitIr, OrderIr, RootIr, SelectionIr, TableMetaIr, ValueIr, VariableDefaultIr, VariableIr, compiledArtifactSchema, compiledOperationSchema, indexByHash, limitIrSchema, normalizeIr, orderIrSchema, predIrSchema, rootIrSchema, selectionIrSchema, tableMetaIrSchema, valueIrSchema, variableDefaultIrSchema, variableIrSchema } from './ir.js';
8
+ export { CLAIMS_CONTRACT, CMP_OPS, CellSelectionIr, ClaimKey, CmpOp, CompiledArtifact, CompiledOperation, DATE_BUCKETS, DateBucket, GroupByKeyIr, INPUT_REF_KINDS, IR_VERSION, InputRefKind, IrVersionError, LEGACY_IR_VERSION, LimitIr, OrderIr, PrefetchPlanIr, ResolvedMetaIr, ResolvedSourceIr, RootIr, 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';
9
+ 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-YoFGjIBM.js';
9
10
  import { generateDrizzleJson } from 'drizzle-kit/api';
10
11
  import { PgTableWithColumns } from 'drizzle-orm/pg-core';
12
+ export { P as PolicyExpression, p as policyExpressionSchema, a as policyVariantSchema } from './policy-1iZbGnZZ.js';
11
13
  import 'drizzle-orm';
12
14
  import 'drizzle-orm/query-builders/query-builder';
13
15
 
@@ -49,14 +51,14 @@ declare const actionParamSchema: z.ZodObject<{
49
51
  type: z.ZodEnum<{
50
52
  bigint: "bigint";
51
53
  boolean: "boolean";
52
- uuid: "uuid";
53
54
  text: "text";
55
+ date: "date";
56
+ timestamptz: "timestamptz";
57
+ jsonb: "jsonb";
58
+ uuid: "uuid";
54
59
  integer: "integer";
55
60
  numeric: "numeric";
56
61
  double: "double";
57
- timestamptz: "timestamptz";
58
- date: "date";
59
- jsonb: "jsonb";
60
62
  }>;
61
63
  optional: z.ZodOptional<z.ZodBoolean>;
62
64
  description: z.ZodOptional<z.ZodString>;
@@ -74,14 +76,14 @@ declare const actionSchema: z.ZodObject<{
74
76
  type: z.ZodEnum<{
75
77
  bigint: "bigint";
76
78
  boolean: "boolean";
77
- uuid: "uuid";
78
79
  text: "text";
80
+ date: "date";
81
+ timestamptz: "timestamptz";
82
+ jsonb: "jsonb";
83
+ uuid: "uuid";
79
84
  integer: "integer";
80
85
  numeric: "numeric";
81
86
  double: "double";
82
- timestamptz: "timestamptz";
83
- date: "date";
84
- jsonb: "jsonb";
85
87
  }>;
86
88
  optional: z.ZodOptional<z.ZodBoolean>;
87
89
  description: z.ZodOptional<z.ZodString>;
@@ -91,14 +93,14 @@ declare const actionSchema: z.ZodObject<{
91
93
  returns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
92
94
  bigint: "bigint";
93
95
  boolean: "boolean";
94
- uuid: "uuid";
95
96
  text: "text";
97
+ date: "date";
98
+ timestamptz: "timestamptz";
99
+ jsonb: "jsonb";
100
+ uuid: "uuid";
96
101
  integer: "integer";
97
102
  numeric: "numeric";
98
103
  double: "double";
99
- timestamptz: "timestamptz";
100
- date: "date";
101
- jsonb: "jsonb";
102
104
  }>>>;
103
105
  audit: z.ZodOptional<z.ZodObject<{
104
106
  action: z.ZodEnum<{
@@ -126,14 +128,14 @@ type ColumnType = (typeof COLUMN_TYPES)[number];
126
128
  declare const columnTypeSchema: z.ZodEnum<{
127
129
  bigint: "bigint";
128
130
  boolean: "boolean";
129
- uuid: "uuid";
130
131
  text: "text";
132
+ date: "date";
133
+ timestamptz: "timestamptz";
134
+ jsonb: "jsonb";
135
+ uuid: "uuid";
131
136
  integer: "integer";
132
137
  numeric: "numeric";
133
138
  double: "double";
134
- timestamptz: "timestamptz";
135
- date: "date";
136
- jsonb: "jsonb";
137
139
  }>;
138
140
  /**
139
141
  * True when the default is one of the allowlisted SQL function calls for its
@@ -158,14 +160,14 @@ declare const columnSchema: z.ZodObject<{
158
160
  type: z.ZodEnum<{
159
161
  bigint: "bigint";
160
162
  boolean: "boolean";
161
- uuid: "uuid";
162
163
  text: "text";
164
+ date: "date";
165
+ timestamptz: "timestamptz";
166
+ jsonb: "jsonb";
167
+ uuid: "uuid";
163
168
  integer: "integer";
164
169
  numeric: "numeric";
165
170
  double: "double";
166
- timestamptz: "timestamptz";
167
- date: "date";
168
- jsonb: "jsonb";
169
171
  }>;
170
172
  primary_key: z.ZodOptional<z.ZodBoolean>;
171
173
  nullable: z.ZodOptional<z.ZodBoolean>;
@@ -208,14 +210,14 @@ declare const tableFileSchema: z.ZodObject<{
208
210
  type: z.ZodEnum<{
209
211
  bigint: "bigint";
210
212
  boolean: "boolean";
211
- uuid: "uuid";
212
213
  text: "text";
214
+ date: "date";
215
+ timestamptz: "timestamptz";
216
+ jsonb: "jsonb";
217
+ uuid: "uuid";
213
218
  integer: "integer";
214
219
  numeric: "numeric";
215
220
  double: "double";
216
- timestamptz: "timestamptz";
217
- date: "date";
218
- jsonb: "jsonb";
219
221
  }>;
220
222
  primary_key: z.ZodOptional<z.ZodBoolean>;
221
223
  nullable: z.ZodOptional<z.ZodBoolean>;
@@ -259,14 +261,14 @@ declare const tableFileSchema: z.ZodObject<{
259
261
  type: z.ZodEnum<{
260
262
  bigint: "bigint";
261
263
  boolean: "boolean";
262
- uuid: "uuid";
263
264
  text: "text";
265
+ date: "date";
266
+ timestamptz: "timestamptz";
267
+ jsonb: "jsonb";
268
+ uuid: "uuid";
264
269
  integer: "integer";
265
270
  numeric: "numeric";
266
271
  double: "double";
267
- timestamptz: "timestamptz";
268
- date: "date";
269
- jsonb: "jsonb";
270
272
  }>;
271
273
  optional: z.ZodOptional<z.ZodBoolean>;
272
274
  description: z.ZodOptional<z.ZodString>;
@@ -276,14 +278,14 @@ declare const tableFileSchema: z.ZodObject<{
276
278
  returns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
277
279
  bigint: "bigint";
278
280
  boolean: "boolean";
279
- uuid: "uuid";
280
281
  text: "text";
282
+ date: "date";
283
+ timestamptz: "timestamptz";
284
+ jsonb: "jsonb";
285
+ uuid: "uuid";
281
286
  integer: "integer";
282
287
  numeric: "numeric";
283
288
  double: "double";
284
- timestamptz: "timestamptz";
285
- date: "date";
286
- jsonb: "jsonb";
287
289
  }>>>;
288
290
  audit: z.ZodOptional<z.ZodObject<{
289
291
  action: z.ZodEnum<{
@@ -428,65 +430,6 @@ declare const capabilityExpression: (key: string) => string;
428
430
  /** NULL claims (or a missing roles array) coalesce to false — role checks fail closed. */
429
431
  declare const roleExpression: (key: string) => string;
430
432
 
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
- declare const MAX_IDENTIFIER_LENGTH = 63;
435
- /**
436
- * The Data API carries a delegated, attenuated data token on this header (not
437
- * `Authorization`, which stays the app-user/session bearer). One definition
438
- * shared by the client transport, the server's caller resolver, and the
439
- * function-invoke minter, so all three agree.
440
- */
441
- declare const ORM_DATA_TOKEN_HEADER = "x-sequence-data-token";
442
- /**
443
- * The SEPARATE header the invoke proxy uses to hand a managed function its
444
- * *service* data token — the escalation path. A function receives BOTH this and
445
- * `ORM_DATA_TOKEN_HEADER`; the default `createOrmClient` reads the user token,
446
- * the deliberately-named `createServiceOrmClient` reads THIS one. Two distinct
447
- * headers so reaching for the service identity is always an explicit act, never
448
- * an accidental default. Both are sent to the Data API on `ORM_DATA_TOKEN_HEADER`
449
- * — the server stays mode-agnostic and resolves whatever sub the token carries.
450
- */
451
- declare const ORM_SERVICE_DATA_TOKEN_HEADER = "x-sequence-data-token-service";
452
- /**
453
- * Custom Roles & Capabilities claim keys as policies reference them: a
454
- * host-scoped registry key, or an org pin's `org/<key>`. Matches the registry
455
- * key grammar EXACTLY (`[a-z0-9-]`, 1–64 chars, no `_` — the FGA object-id
456
- * delimiter) so any capability that's declarable/attachable in namespace.yaml
457
- * can also be referenced here — a stricter pattern would let a valid key
458
- * register yet fail at apply (e.g. `org/2fa`, a one-char or digit-led key).
459
- */
460
- declare const CAPABILITY_KEY_PATTERN: RegExp;
461
- declare const CLAIM_KEY_PATTERN: RegExp;
462
- /** Qualified reference to a table outside the defining file: `<schema>.<table>`. */
463
- declare const QUALIFIED_TABLE_PATTERN: RegExp;
464
- /** Synced reflected sources are restricted to the gold layer. */
465
- declare const SYNCED_SOURCE_PATTERN: RegExp;
466
- declare const ORM_SCHEMA_PREFIX = "orm_";
467
- declare const CONSUMER_ROLE_SUFFIX = "_consumer";
468
- declare const ormSchemaName: (namespace: string) => string;
469
- declare const consumerRoleName: (namespace: string) => string;
470
- declare const DEFINITION_FILE_EXTENSIONS: readonly [".yml", ".yaml"];
471
- /** Reserved basenames for the namespace-level config file (description, org capability pins). */
472
- declare const NAMESPACE_CONFIG_FILENAMES: Set<string>;
473
- declare const HASH_DOMAIN = "sequence-orm-definitions\0";
474
- /**
475
- * The one size guard the package owns: a per-file byte cap where the loader
476
- * reads untrusted YAML into memory — a real failure mode, not a product
477
- * limit. Counts of tables/indexes/params and policy/SQL lengths are
478
- * deliberately uncapped; Postgres enforces its own limits loudly at apply.
479
- */
480
- declare const MAX_DEFINITION_FILE_BYTES: number;
481
- /** `/api/data/<ns>/actions/…` and `/api/data/<ns>/query` share the table path segment. */
482
- declare const RESERVED_TABLE_NAMES: Set<string>;
483
- /**
484
- * The Data API's query-string grammar owns these parameter names — a column
485
- * with one of them could never be filtered over the wire, so definitions
486
- * refuse it up front ("validate rejects only what can never work").
487
- */
488
- declare const RESERVED_COLUMN_NAMES: Set<string>;
489
-
490
433
  /** drizzle-kit's serialized schema — the diff/replay artifact the registry stores. */
491
434
  type NamespaceSnapshot = ReturnType<typeof generateDrizzleJson>;
492
435
  declare function generateSnapshot(definition: NamespaceDefinition, previousId?: string): NamespaceSnapshot;
@@ -626,11 +569,11 @@ interface SyncedBacking {
626
569
  */
627
570
  /**
628
571
  * Atlas reassigns every relation in `orm_<ns>` to this role after apply.
629
- * Synced views resolve backing access as their owner, so the emitter must
630
- * grant this role narrow SELECT on each physical relation before CREATE VIEW.
572
+ * Synced views resolve backing access as their owner. Grant this role narrow
573
+ * SELECT before CREATE VIEW, or preserve a separately verified publisher grant.
631
574
  */
632
575
  declare const SYNCED_VIEW_EXECUTION_OWNER_ROLE = "orm_exec";
633
- declare function syncedViewStatements({ definition, backings, readPolicyIrByTable, columnNamesByTable, columnTypesByTable, executionOwnerRole, }: {
576
+ declare function syncedViewStatements({ definition, backings, readPolicyIrByTable, columnNamesByTable, columnTypesByTable, executionOwnerRole, backingPrivileges, }: {
634
577
  definition: NamespaceDefinition;
635
578
  backings: readonly SyncedBacking[];
636
579
  /** v2 compiled read policies (preserves capability/role variants). */
@@ -645,6 +588,11 @@ declare function syncedViewStatements({ definition, backings, readPolicyIrByTabl
645
588
  columnTypesByTable?: ReadonlyMap<string, SyncedPredicateColumnTypes>;
646
589
  /** Role that will own the view after ensureExecutionOwner (default orm_exec). */
647
590
  executionOwnerRole?: string;
591
+ /** Preserve privileges managed by a separate immutable backing publisher.
592
+ * The caller must verify the owner's existing SELECT/USAGE grants and create
593
+ * the views as that owner. This option does not grant backing access.
594
+ */
595
+ backingPrivileges?: 'grant' | 'preserve';
648
596
  }): string[];
649
597
  /**
650
598
  * Drop synced views — idempotent cleanup for apply retries and removal.
@@ -696,7 +644,9 @@ declare const compileNamespace: (definition: NamespaceDefinition) => Promise<Pla
696
644
  * Canonical v2 → the in-memory schema bag drizzle-kit snapshots plus typed
697
645
  * table handles — the same `DrizzleEntities` shape engine/snapshot.ts consumes.
698
646
  */
699
- declare function buildDrizzleEntitiesV2(definition: CanonicalDefinition): DrizzleEntities;
647
+ declare function buildDrizzleEntitiesV2(definition: CanonicalDefinition, options?: {
648
+ introspection?: boolean;
649
+ }): DrizzleEntities;
700
650
  declare function rewriteSyncedSourceRelationsInViewQuery({ query, canonical, schemaName, dependencies, }: {
701
651
  query: string;
702
652
  canonical: CanonicalDefinition;
@@ -729,11 +679,32 @@ declare function applyMigrationHintsV2(previous: NamespaceSnapshot, definition:
729
679
  * action function statements. v2 enforces row policies inside compiled
730
680
  * operations (no PG RLS policies) and executes actions on the data plane
731
681
  * (no plpgsql functions), so a v2 plan is hints + kit DDL only.
682
+ *
683
+ * Managed views are dropped and recreated only when the migration reaches
684
+ * them: their own definition changed, they read a relation whose change is not
685
+ * provably view-safe, or they depend on a view that is recreated. Every other
686
+ * view stays in place, keeping its grants, owner, and outside dependents.
732
687
  */
733
- declare function planMigrationV2({ canonical, previousSnapshot, }: {
688
+ declare function planMigrationV2(input: {
734
689
  canonical: CanonicalDefinition;
735
690
  previousSnapshot?: NamespaceSnapshot;
736
691
  }): Promise<PlannedMigration>;
692
+ /**
693
+ * The plan a committed (reviewed) migration was authored as: the current
694
+ * planner when it reproduces the migration, otherwise the legacy one for a
695
+ * migration written before view recreation was narrowed. `reproduces` decides
696
+ * a match — rendered SQL for the CLI's tip gate, statement lists for Atlas's
697
+ * replay gate. When neither reproduces it, the current plan comes back with
698
+ * `reproduced: false`, so callers report the mismatch exactly as before.
699
+ */
700
+ declare function planCommittedMigrationV2({ canonical, previousSnapshot, reproduces, }: {
701
+ canonical: CanonicalDefinition;
702
+ previousSnapshot?: NamespaceSnapshot;
703
+ reproduces: (plan: PlannedMigration) => boolean;
704
+ }): Promise<{
705
+ plan: PlannedMigration;
706
+ reproduced: boolean;
707
+ }>;
737
708
  /**
738
709
  * Drizzle's manual-view snapshot stores declared columns, but PostgreSQL names
739
710
  * and types the live view from the SELECT itself. Assert the live catalog in
@@ -769,6 +740,409 @@ declare function stableJson(value: unknown): string;
769
740
  declare function canonicalizeDefinition(definition: NamespaceDefinition): JsonValue;
770
741
  declare function computeDefinitionHash(definition: NamespaceDefinition): string;
771
742
 
743
+ declare const ORM_MIGRATION_EXPORT_FILE = "orm.migration.json";
744
+ declare const ORM_MIGRATION_EXPORT_MAX_BYTES: number;
745
+ declare const ormMigrationExportSchema: z.ZodObject<{
746
+ schema_version: z.ZodLiteral<1>;
747
+ schema_hash: z.ZodString;
748
+ payload: z.ZodObject<{
749
+ canonical_definition: z.ZodObject<{
750
+ definition_format: z.ZodLiteral<2>;
751
+ namespace: z.ZodString;
752
+ description: z.ZodOptional<z.ZodString>;
753
+ enums: z.ZodDefault<z.ZodArray<z.ZodObject<{
754
+ name: z.ZodString;
755
+ values: z.ZodArray<z.ZodString>;
756
+ }, z.core.$strip>>>;
757
+ tables: z.ZodArray<z.ZodObject<{
758
+ table: z.ZodString;
759
+ description: z.ZodOptional<z.ZodString>;
760
+ renamedFrom: z.ZodOptional<z.ZodString>;
761
+ source: z.ZodOptional<z.ZodString>;
762
+ columns: z.ZodDefault<z.ZodArray<z.ZodObject<{
763
+ name: z.ZodString;
764
+ columnName: z.ZodString;
765
+ type: z.ZodUnion<readonly [z.ZodEnum<{
766
+ bigint: "bigint";
767
+ boolean: "boolean";
768
+ text: "text";
769
+ date: "date";
770
+ timestamptz: "timestamptz";
771
+ jsonb: "jsonb";
772
+ uuid: "uuid";
773
+ integer: "integer";
774
+ numeric: "numeric";
775
+ double: "double";
776
+ }>, z.ZodObject<{
777
+ enum: z.ZodString;
778
+ }, z.core.$strip>]>;
779
+ nullable: z.ZodDefault<z.ZodBoolean>;
780
+ unique: z.ZodDefault<z.ZodBoolean>;
781
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
782
+ defaultFn: z.ZodOptional<z.ZodEnum<{
783
+ "gen_random_uuid()": "gen_random_uuid()";
784
+ "now()": "now()";
785
+ }>>;
786
+ onUpdateFn: z.ZodOptional<z.ZodEnum<{
787
+ "now()": "now()";
788
+ }>>;
789
+ description: z.ZodOptional<z.ZodString>;
790
+ renamedFrom: z.ZodOptional<z.ZodString>;
791
+ cast: z.ZodOptional<z.ZodString>;
792
+ deprecated: z.ZodDefault<z.ZodBoolean>;
793
+ cell: z.ZodOptional<z.ZodObject<{
794
+ of: z.ZodString;
795
+ part: z.ZodEnum<{
796
+ at: "at";
797
+ by: "by";
798
+ rev: "rev";
799
+ source: "source";
800
+ conflicts: "conflicts";
801
+ }>;
802
+ }, z.core.$strict>>;
803
+ }, z.core.$strip>>>;
804
+ primaryKey: z.ZodOptional<z.ZodArray<z.ZodString>>;
805
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
806
+ name: z.ZodString;
807
+ kind: z.ZodEnum<{
808
+ toOne: "toOne";
809
+ toMany: "toMany";
810
+ toPlatformUser: "toPlatformUser";
811
+ }>;
812
+ target: z.ZodOptional<z.ZodString>;
813
+ on: z.ZodString;
814
+ references: z.ZodOptional<z.ZodString>;
815
+ enforce: z.ZodDefault<z.ZodBoolean>;
816
+ onDelete: z.ZodOptional<z.ZodEnum<{
817
+ cascade: "cascade";
818
+ restrict: "restrict";
819
+ "no action": "no action";
820
+ "set null": "set null";
821
+ "set default": "set default";
822
+ }>>;
823
+ onUpdate: 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
+ description: z.ZodOptional<z.ZodString>;
831
+ }, z.core.$strip>>>;
832
+ indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
833
+ columns: z.ZodArray<z.ZodString>;
834
+ unique: z.ZodDefault<z.ZodBoolean>;
835
+ name: z.ZodOptional<z.ZodString>;
836
+ }, z.core.$strip>>>;
837
+ checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
838
+ name: z.ZodString;
839
+ expression: z.ZodString;
840
+ }, z.core.$strict>>>;
841
+ policies: z.ZodDefault<z.ZodObject<{
842
+ read: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
843
+ default: z.ZodString;
844
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
845
+ when: z.ZodString;
846
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
847
+ policy: z.ZodOptional<z.ZodString>;
848
+ }, z.core.$strip>>>;
849
+ }, z.core.$strip>]>>;
850
+ write: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
851
+ default: z.ZodString;
852
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
853
+ when: z.ZodString;
854
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
855
+ policy: z.ZodOptional<z.ZodString>;
856
+ }, z.core.$strip>>>;
857
+ }, z.core.$strip>]>>;
858
+ insert: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
859
+ default: z.ZodString;
860
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
861
+ when: z.ZodString;
862
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
863
+ policy: z.ZodOptional<z.ZodString>;
864
+ }, z.core.$strip>>>;
865
+ }, z.core.$strip>]>>;
866
+ update: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
867
+ default: z.ZodString;
868
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
869
+ when: z.ZodString;
870
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
871
+ policy: z.ZodOptional<z.ZodString>;
872
+ }, z.core.$strip>>>;
873
+ }, z.core.$strip>]>>;
874
+ }, z.core.$strip>>;
875
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
876
+ name: z.ZodString;
877
+ requires: z.ZodOptional<z.ZodString>;
878
+ params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
879
+ type: z.ZodEnum<{
880
+ bigint: "bigint";
881
+ boolean: "boolean";
882
+ text: "text";
883
+ date: "date";
884
+ timestamptz: "timestamptz";
885
+ jsonb: "jsonb";
886
+ uuid: "uuid";
887
+ integer: "integer";
888
+ numeric: "numeric";
889
+ double: "double";
890
+ }>;
891
+ nullable: z.ZodDefault<z.ZodBoolean>;
892
+ }, z.core.$strip>>>;
893
+ executes: z.ZodString;
894
+ returns: z.ZodDefault<z.ZodEnum<{
895
+ rows: "rows";
896
+ rowsAffected: "rowsAffected";
897
+ scalar: "scalar";
898
+ }>>;
899
+ audit: z.ZodOptional<z.ZodObject<{
900
+ action: z.ZodString;
901
+ resource: z.ZodString;
902
+ }, z.core.$strip>>;
903
+ }, z.core.$strip>>>;
904
+ cowMutations: z.ZodOptional<z.ZodArray<z.ZodObject<{
905
+ kind: z.ZodEnum<{
906
+ override: "override";
907
+ revert: "revert";
908
+ }>;
909
+ name: z.ZodString;
910
+ synced: z.ZodString;
911
+ pk: z.ZodString;
912
+ copy: z.ZodDefault<z.ZodArray<z.ZodString>>;
913
+ set: z.ZodDefault<z.ZodArray<z.ZodString>>;
914
+ }, z.core.$strip>>>;
915
+ foreignKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{
916
+ name: z.ZodString;
917
+ columns: z.ZodArray<z.ZodString>;
918
+ target: z.ZodString;
919
+ references: z.ZodArray<z.ZodString>;
920
+ deferrable: z.ZodOptional<z.ZodEnum<{
921
+ "initially-immediate": "initially-immediate";
922
+ "initially-deferred": "initially-deferred";
923
+ }>>;
924
+ onDelete: z.ZodOptional<z.ZodEnum<{
925
+ cascade: "cascade";
926
+ restrict: "restrict";
927
+ "no action": "no action";
928
+ "set null": "set null";
929
+ "set default": "set default";
930
+ }>>;
931
+ onUpdate: 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
+ }, z.core.$strict>>>;
939
+ cellMetadata: z.ZodOptional<z.ZodLiteral<true>>;
940
+ internal: z.ZodOptional<z.ZodLiteral<true>>;
941
+ materializes: z.ZodOptional<z.ZodString>;
942
+ }, z.core.$strip>>;
943
+ views: z.ZodOptional<z.ZodArray<z.ZodObject<{
944
+ view: z.ZodString;
945
+ description: z.ZodOptional<z.ZodString>;
946
+ columns: z.ZodArray<z.ZodObject<{
947
+ name: z.ZodString;
948
+ columnName: z.ZodString;
949
+ type: z.ZodUnion<readonly [z.ZodEnum<{
950
+ bigint: "bigint";
951
+ boolean: "boolean";
952
+ text: "text";
953
+ date: "date";
954
+ timestamptz: "timestamptz";
955
+ jsonb: "jsonb";
956
+ uuid: "uuid";
957
+ integer: "integer";
958
+ numeric: "numeric";
959
+ double: "double";
960
+ }>, z.ZodObject<{
961
+ enum: z.ZodString;
962
+ }, z.core.$strip>]>;
963
+ nullable: z.ZodDefault<z.ZodBoolean>;
964
+ unique: z.ZodDefault<z.ZodBoolean>;
965
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
966
+ defaultFn: z.ZodOptional<z.ZodEnum<{
967
+ "gen_random_uuid()": "gen_random_uuid()";
968
+ "now()": "now()";
969
+ }>>;
970
+ onUpdateFn: z.ZodOptional<z.ZodEnum<{
971
+ "now()": "now()";
972
+ }>>;
973
+ description: z.ZodOptional<z.ZodString>;
974
+ renamedFrom: z.ZodOptional<z.ZodString>;
975
+ cast: z.ZodOptional<z.ZodString>;
976
+ deprecated: z.ZodDefault<z.ZodBoolean>;
977
+ cell: z.ZodOptional<z.ZodObject<{
978
+ of: z.ZodString;
979
+ part: z.ZodEnum<{
980
+ at: "at";
981
+ by: "by";
982
+ rev: "rev";
983
+ source: "source";
984
+ conflicts: "conflicts";
985
+ }>;
986
+ }, z.core.$strict>>;
987
+ }, z.core.$strip>>;
988
+ primaryKey: z.ZodOptional<z.ZodArray<z.ZodString>>;
989
+ links: z.ZodDefault<z.ZodArray<z.ZodObject<{
990
+ name: z.ZodString;
991
+ kind: z.ZodEnum<{
992
+ toOne: "toOne";
993
+ toMany: "toMany";
994
+ toPlatformUser: "toPlatformUser";
995
+ }>;
996
+ target: z.ZodOptional<z.ZodString>;
997
+ on: z.ZodString;
998
+ references: z.ZodOptional<z.ZodString>;
999
+ enforce: z.ZodDefault<z.ZodBoolean>;
1000
+ onDelete: z.ZodOptional<z.ZodEnum<{
1001
+ cascade: "cascade";
1002
+ restrict: "restrict";
1003
+ "no action": "no action";
1004
+ "set null": "set null";
1005
+ "set default": "set default";
1006
+ }>>;
1007
+ onUpdate: z.ZodOptional<z.ZodEnum<{
1008
+ cascade: "cascade";
1009
+ restrict: "restrict";
1010
+ "no action": "no action";
1011
+ "set null": "set null";
1012
+ "set default": "set default";
1013
+ }>>;
1014
+ description: z.ZodOptional<z.ZodString>;
1015
+ }, z.core.$strip>>>;
1016
+ policies: z.ZodObject<{
1017
+ read: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1018
+ default: z.ZodString;
1019
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1020
+ when: z.ZodString;
1021
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1022
+ policy: z.ZodOptional<z.ZodString>;
1023
+ }, z.core.$strip>>>;
1024
+ }, z.core.$strip>]>;
1025
+ }, z.core.$strict>;
1026
+ query: z.ZodString;
1027
+ dependencies: z.ZodArray<z.ZodString>;
1028
+ resolved: z.ZodOptional<z.ZodObject<{
1029
+ sources: z.ZodArray<z.ZodObject<{
1030
+ name: z.ZodString;
1031
+ kind: z.ZodEnum<{
1032
+ manual: "manual";
1033
+ prefetch: "prefetch";
1034
+ etl: "etl";
1035
+ }>;
1036
+ table: z.ZodString;
1037
+ columns: z.ZodArray<z.ZodString>;
1038
+ updatedAt: z.ZodOptional<z.ZodString>;
1039
+ key: z.ZodOptional<z.ZodString>;
1040
+ fetch: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1041
+ shape: z.ZodLiteral<"single">;
1042
+ }, z.core.$strict>, z.ZodObject<{
1043
+ shape: z.ZodLiteral<"batch">;
1044
+ maxKeys: z.ZodNumber;
1045
+ }, z.core.$strict>]>>;
1046
+ function: z.ZodOptional<z.ZodObject<{
1047
+ kind: z.ZodEnum<{
1048
+ managed: "managed";
1049
+ native: "native";
1050
+ }>;
1051
+ id: z.ZodString;
1052
+ }, z.core.$strict>>;
1053
+ prefetchDefaults: z.ZodOptional<z.ZodObject<{
1054
+ maxStalenessMs: z.ZodNumber;
1055
+ timeoutMs: z.ZodNumber;
1056
+ onError: z.ZodEnum<{
1057
+ fallback: "fallback";
1058
+ fail: "fail";
1059
+ }>;
1060
+ }, z.core.$strict>>;
1061
+ writeback: z.ZodOptional<z.ZodObject<{
1062
+ columns: z.ZodArray<z.ZodString>;
1063
+ defaultMode: z.ZodEnum<{
1064
+ sync: "sync";
1065
+ async: "async";
1066
+ }>;
1067
+ timeoutMs: z.ZodNumber;
1068
+ clearManualOnConfirm: z.ZodBoolean;
1069
+ }, z.core.$strict>>;
1070
+ }, z.core.$strict>>;
1071
+ resolve: z.ZodArray<z.ZodObject<{
1072
+ column: z.ZodString;
1073
+ comparator: z.ZodEnum<{
1074
+ custom: "custom";
1075
+ latest: "latest";
1076
+ highest: "highest";
1077
+ lowest: "lowest";
1078
+ priority: "priority";
1079
+ nonNullFirst: "nonNullFirst";
1080
+ }>;
1081
+ candidates: z.ZodArray<z.ZodString>;
1082
+ orderBy: z.ZodOptional<z.ZodString>;
1083
+ }, z.core.$strict>>;
1084
+ deletedBy: z.ZodDefault<z.ZodArray<z.ZodString>>;
1085
+ materialized: z.ZodOptional<z.ZodObject<{
1086
+ table: z.ZodString;
1087
+ compute: z.ZodString;
1088
+ }, z.core.$strict>>;
1089
+ policies: z.ZodDefault<z.ZodObject<{
1090
+ write: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1091
+ default: z.ZodString;
1092
+ variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
1093
+ when: z.ZodString;
1094
+ allow: z.ZodOptional<z.ZodLiteral<true>>;
1095
+ policy: z.ZodOptional<z.ZodString>;
1096
+ }, z.core.$strip>>>;
1097
+ }, z.core.$strip>]>>;
1098
+ insert: 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
+ update: 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
+ }, z.core.$strict>>;
1115
+ }, z.core.$strict>>;
1116
+ internal: z.ZodOptional<z.ZodLiteral<true>>;
1117
+ }, z.core.$strip>>>;
1118
+ capabilities: z.ZodDefault<z.ZodObject<{
1119
+ roles: z.ZodOptional<z.ZodUnknown>;
1120
+ uses: z.ZodDefault<z.ZodArray<z.ZodString>>;
1121
+ }, z.core.$strip>>;
1122
+ }, z.core.$strip>;
1123
+ documents: z.ZodArray<z.ZodObject<{
1124
+ path: z.ZodString;
1125
+ contents: z.ZodString;
1126
+ }, z.core.$strict>>;
1127
+ client_manifest: z.ZodObject<{
1128
+ ops_hash: z.ZodString;
1129
+ operations: z.ZodRecord<z.ZodString, z.ZodString>;
1130
+ }, z.core.$strict>;
1131
+ sdl: z.ZodString;
1132
+ schema_snapshot: z.ZodJSONSchema;
1133
+ migration: z.ZodOptional<z.ZodJSONSchema>;
1134
+ }, z.core.$strict>;
1135
+ checksum: z.ZodString;
1136
+ }, z.core.$strict>;
1137
+ type OrmMigrationExport = z.infer<typeof ormMigrationExportSchema>;
1138
+ declare function createOrmMigrationExport({ schemaHash, payload }: {
1139
+ schemaHash: string;
1140
+ payload: unknown;
1141
+ }): OrmMigrationExport;
1142
+ /** Git pins provenance; this checksum detects inconsistent bytes, not authorship. */
1143
+ declare function parseOrmMigrationExport(text: string): OrmMigrationExport;
1144
+ declare function renderOrmMigrationExport(exported: OrmMigrationExport): string;
1145
+
772
1146
  interface LoadedNamespace {
773
1147
  readonly definition: NamespaceDefinition;
774
1148
  readonly contentHash: string;
@@ -1013,4 +1387,4 @@ declare function parseCanonicalDefinition(value: unknown): NamespaceDefinition;
1013
1387
 
1014
1388
  declare const parsedPredicateSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ParsedPredicate, string>>;
1015
1389
 
1016
- 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_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_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_SCHEMA_PREFIX, ORM_SERVICE_DATA_TOKEN_HEADER, type Operand, OrmDefinitionError, 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, declaredCapabilityKeys, diffCommand, diffStatements, emptyJournal, emptySnapshot, extractNamedParams, generateNamespaceTypes, generateSnapshot, generateSnapshotV2, identifierSchema, isFunctionDefault, isOwnedStatement, isOwnedStatementV2, isQualifiedReference, loadCommittedMigrations, loadCommittedTipMigration, loadNamespaceDefinition, migrationName, namespaceConfigSchema, namespaceSchema, normalizeSnapshot, ormSchemaName, parseCanonicalDefinition, parseDefinitionSources, parsePredicate, parseTableFile, parsedPredicateSchema, pendingKitStatements, pendingKitStatementsV2, planMigration, planMigrationV2, predicateOperands, quoteIdentifier, quoteLiteral, readMigrationSql, readMigrationWorkspace, readSnapshot, rebaseViolations, referencedCapabilities, referencedColumns, renderMigrationSql, rewriteSyncedSourceRelationsInViewQuery, roleExpression, securityStatements, sqlTypeName, stableJson, syncedBackingRevokeStatements, syncedTables, syncedViewDropStatements, syncedViewStatements, tableFileSchema, tableReferenceSchema, typesInterfaceName, validateViewCatalogStatement, verifyRebaseIsNoop, walkPredicate, writeMigration };
1390
+ 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, 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, isFunctionDefault, isOwnedStatement, isOwnedStatementV2, isQualifiedReference, loadCommittedMigrations, loadCommittedTipMigration, loadNamespaceDefinition, migrationName, namespaceConfigSchema, namespaceSchema, normalizeSnapshot, ormMigrationExportSchema, parseCanonicalDefinition, parseDefinitionSources, parseOrmMigrationExport, parsePredicate, parseTableFile, parsedPredicateSchema, pendingKitStatements, pendingKitStatementsV2, planCommittedMigrationV2, 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 };