@sequenceholdings/orm 2.1.1 → 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 (68) hide show
  1. package/README.md +3 -1
  2. package/dist/authoring.cjs +284 -99
  3. package/dist/authoring.cjs.map +1 -1
  4. package/dist/authoring.d.cts +31 -8
  5. package/dist/authoring.d.ts +31 -8
  6. package/dist/authoring.js +282 -100
  7. package/dist/authoring.js.map +1 -1
  8. package/dist/canonical.cjs +51 -3
  9. package/dist/canonical.cjs.map +1 -1
  10. package/dist/canonical.d.cts +838 -12
  11. package/dist/canonical.d.ts +838 -12
  12. package/dist/canonical.js +47 -4
  13. package/dist/canonical.js.map +1 -1
  14. package/dist/cli.cjs +5838 -4197
  15. package/dist/cli.cjs.map +1 -1
  16. package/dist/cli.js +5838 -4197
  17. package/dist/cli.js.map +1 -1
  18. package/dist/client.cjs +49 -32
  19. package/dist/client.cjs.map +1 -1
  20. package/dist/client.d.cts +49 -6
  21. package/dist/client.d.ts +49 -6
  22. package/dist/client.js +49 -32
  23. package/dist/client.js.map +1 -1
  24. package/dist/compiler.cjs +1237 -263
  25. package/dist/compiler.cjs.map +1 -1
  26. package/dist/compiler.d.cts +57 -3
  27. package/dist/compiler.d.ts +57 -3
  28. package/dist/compiler.js +1230 -264
  29. package/dist/compiler.js.map +1 -1
  30. package/dist/{constants-YoFGjIBM.d.cts → constants-C6EG6Wq7.d.cts} +1 -1
  31. package/dist/{constants-YoFGjIBM.d.ts → constants-C6EG6Wq7.d.ts} +1 -1
  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 -2
  37. package/dist/dynamic-input.d.ts +9 -2
  38. package/dist/dynamic-input.js +2 -1
  39. package/dist/dynamic-input.js.map +1 -1
  40. package/dist/index.cjs +1094 -321
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +479 -19
  43. package/dist/index.d.ts +479 -19
  44. package/dist/index.js +1083 -322
  45. package/dist/index.js.map +1 -1
  46. package/dist/ir.cjs +84 -10
  47. package/dist/ir.cjs.map +1 -1
  48. package/dist/ir.d.cts +138 -13
  49. package/dist/ir.d.ts +138 -13
  50. package/dist/ir.js +81 -11
  51. package/dist/ir.js.map +1 -1
  52. package/dist/predicate-v2.cjs +78 -9
  53. package/dist/predicate-v2.cjs.map +1 -1
  54. package/dist/predicate-v2.d.cts +1 -1
  55. package/dist/predicate-v2.d.ts +1 -1
  56. package/dist/predicate-v2.js +78 -9
  57. package/dist/predicate-v2.js.map +1 -1
  58. package/dist/sdl.cjs +156 -21
  59. package/dist/sdl.cjs.map +1 -1
  60. package/dist/sdl.d.cts +8 -1
  61. package/dist/sdl.d.ts +8 -1
  62. package/dist/sdl.js +156 -21
  63. package/dist/sdl.js.map +1 -1
  64. package/package.json +5 -4
  65. package/src/codegen-gql/server-fns.cjs +2 -2
  66. package/templates/orm-namespace/AGENTS.md +10 -0
  67. package/templates/orm-namespace/CLAUDE.md +1 -84
  68. package/templates/orm-namespace/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
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';
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, canonicalActionSchema, canonicalColumnSchema, canonicalDefinitionSchema, canonicalEnumSchema, canonicalIndexSchema, canonicalLinkSchema, canonicalPoliciesSchema, canonicalRelations, canonicalTableSchema, canonicalViewSchema, normalizeCanonical } 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, 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
+ 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';
10
11
  import { generateDrizzleJson } from 'drizzle-kit/api';
11
12
  import { PgTableWithColumns } from 'drizzle-orm/pg-core';
12
13
  export { P as PolicyExpression, p as policyExpressionSchema, a as policyVariantSchema } from './policy-1iZbGnZZ.js';
@@ -51,8 +52,8 @@ declare const actionParamSchema: z.ZodObject<{
51
52
  type: z.ZodEnum<{
52
53
  bigint: "bigint";
53
54
  boolean: "boolean";
54
- text: "text";
55
55
  date: "date";
56
+ text: "text";
56
57
  timestamptz: "timestamptz";
57
58
  jsonb: "jsonb";
58
59
  uuid: "uuid";
@@ -76,8 +77,8 @@ declare const actionSchema: z.ZodObject<{
76
77
  type: z.ZodEnum<{
77
78
  bigint: "bigint";
78
79
  boolean: "boolean";
79
- text: "text";
80
80
  date: "date";
81
+ text: "text";
81
82
  timestamptz: "timestamptz";
82
83
  jsonb: "jsonb";
83
84
  uuid: "uuid";
@@ -93,8 +94,8 @@ declare const actionSchema: z.ZodObject<{
93
94
  returns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
94
95
  bigint: "bigint";
95
96
  boolean: "boolean";
96
- text: "text";
97
97
  date: "date";
98
+ text: "text";
98
99
  timestamptz: "timestamptz";
99
100
  jsonb: "jsonb";
100
101
  uuid: "uuid";
@@ -128,8 +129,8 @@ type ColumnType = (typeof COLUMN_TYPES)[number];
128
129
  declare const columnTypeSchema: z.ZodEnum<{
129
130
  bigint: "bigint";
130
131
  boolean: "boolean";
131
- text: "text";
132
132
  date: "date";
133
+ text: "text";
133
134
  timestamptz: "timestamptz";
134
135
  jsonb: "jsonb";
135
136
  uuid: "uuid";
@@ -160,8 +161,8 @@ declare const columnSchema: z.ZodObject<{
160
161
  type: z.ZodEnum<{
161
162
  bigint: "bigint";
162
163
  boolean: "boolean";
163
- text: "text";
164
164
  date: "date";
165
+ text: "text";
165
166
  timestamptz: "timestamptz";
166
167
  jsonb: "jsonb";
167
168
  uuid: "uuid";
@@ -210,8 +211,8 @@ declare const tableFileSchema: z.ZodObject<{
210
211
  type: z.ZodEnum<{
211
212
  bigint: "bigint";
212
213
  boolean: "boolean";
213
- text: "text";
214
214
  date: "date";
215
+ text: "text";
215
216
  timestamptz: "timestamptz";
216
217
  jsonb: "jsonb";
217
218
  uuid: "uuid";
@@ -261,8 +262,8 @@ declare const tableFileSchema: z.ZodObject<{
261
262
  type: z.ZodEnum<{
262
263
  bigint: "bigint";
263
264
  boolean: "boolean";
264
- text: "text";
265
265
  date: "date";
266
+ text: "text";
266
267
  timestamptz: "timestamptz";
267
268
  jsonb: "jsonb";
268
269
  uuid: "uuid";
@@ -278,8 +279,8 @@ declare const tableFileSchema: z.ZodObject<{
278
279
  returns: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
279
280
  bigint: "bigint";
280
281
  boolean: "boolean";
281
- text: "text";
282
282
  date: "date";
283
+ text: "text";
283
284
  timestamptz: "timestamptz";
284
285
  jsonb: "jsonb";
285
286
  uuid: "uuid";
@@ -360,6 +361,11 @@ type SyncedColumnType = ColumnType | {
360
361
  };
361
362
  type SyncedPredicateColumnTypes = Readonly<Record<string, SyncedColumnType>>;
362
363
  interface CompilePredIrToSqlOptions {
364
+ readonly alias?: string;
365
+ readonly exists?: (predicate: Extract<PredIr, {
366
+ kind: 'exists';
367
+ }>) => string;
368
+ readonly namespace?: string;
363
369
  /** Column name → declared type, for claim casts in comparisons. */
364
370
  readonly columnTypes?: SyncedPredicateColumnTypes;
365
371
  /** Logical column name → physical column name for the synced backing. */
@@ -425,10 +431,9 @@ declare const ROLES_CLAIM_KEY = "roles";
425
431
  declare const quoteIdentifier: (name: string) => string;
426
432
  declare const quoteLiteral: (value: string) => string;
427
433
  declare const claimExpression: (key: string) => string;
428
- /** NULL claims (or a missing capabilities array) coalesce to false — capability checks fail closed. */
429
- declare const capabilityExpression: (key: string) => string;
434
+ declare const capabilityExpression: (key: string, namespace?: string) => string;
430
435
  /** NULL claims (or a missing roles array) coalesce to false — role checks fail closed. */
431
- declare const roleExpression: (key: string) => string;
436
+ declare const roleExpression: (key: string, namespace?: string) => string;
432
437
 
433
438
  /** drizzle-kit's serialized schema — the diff/replay artifact the registry stores. */
434
439
  type NamespaceSnapshot = ReturnType<typeof generateDrizzleJson>;
@@ -756,6 +761,7 @@ declare const ormMigrationExportSchema: z.ZodObject<{
756
761
  }, z.core.$strip>>>;
757
762
  tables: z.ZodArray<z.ZodObject<{
758
763
  table: z.ZodString;
764
+ displayName: z.ZodOptional<z.ZodString>;
759
765
  description: z.ZodOptional<z.ZodString>;
760
766
  renamedFrom: z.ZodOptional<z.ZodString>;
761
767
  source: z.ZodOptional<z.ZodString>;
@@ -765,8 +771,8 @@ declare const ormMigrationExportSchema: z.ZodObject<{
765
771
  type: z.ZodUnion<readonly [z.ZodEnum<{
766
772
  bigint: "bigint";
767
773
  boolean: "boolean";
768
- text: "text";
769
774
  date: "date";
775
+ text: "text";
770
776
  timestamptz: "timestamptz";
771
777
  jsonb: "jsonb";
772
778
  uuid: "uuid";
@@ -810,6 +816,7 @@ declare const ormMigrationExportSchema: z.ZodObject<{
810
816
  toPlatformUser: "toPlatformUser";
811
817
  }>;
812
818
  target: z.ZodOptional<z.ZodString>;
819
+ namespace: z.ZodOptional<z.ZodString>;
813
820
  on: z.ZodString;
814
821
  references: z.ZodOptional<z.ZodString>;
815
822
  enforce: z.ZodDefault<z.ZodBoolean>;
@@ -879,8 +886,8 @@ declare const ormMigrationExportSchema: z.ZodObject<{
879
886
  type: z.ZodEnum<{
880
887
  bigint: "bigint";
881
888
  boolean: "boolean";
882
- text: "text";
883
889
  date: "date";
890
+ text: "text";
884
891
  timestamptz: "timestamptz";
885
892
  jsonb: "jsonb";
886
893
  uuid: "uuid";
@@ -949,8 +956,8 @@ declare const ormMigrationExportSchema: z.ZodObject<{
949
956
  type: z.ZodUnion<readonly [z.ZodEnum<{
950
957
  bigint: "bigint";
951
958
  boolean: "boolean";
952
- text: "text";
953
959
  date: "date";
960
+ text: "text";
954
961
  timestamptz: "timestamptz";
955
962
  jsonb: "jsonb";
956
963
  uuid: "uuid";
@@ -994,6 +1001,7 @@ declare const ormMigrationExportSchema: z.ZodObject<{
994
1001
  toPlatformUser: "toPlatformUser";
995
1002
  }>;
996
1003
  target: z.ZodOptional<z.ZodString>;
1004
+ namespace: z.ZodOptional<z.ZodString>;
997
1005
  on: z.ZodString;
998
1006
  references: z.ZodOptional<z.ZodString>;
999
1007
  enforce: z.ZodDefault<z.ZodBoolean>;
@@ -1115,10 +1123,411 @@ declare const ormMigrationExportSchema: z.ZodObject<{
1115
1123
  }, z.core.$strict>>;
1116
1124
  internal: z.ZodOptional<z.ZodLiteral<true>>;
1117
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>>>;
1118
1138
  capabilities: z.ZodDefault<z.ZodObject<{
1119
1139
  roles: z.ZodOptional<z.ZodUnknown>;
1120
1140
  uses: z.ZodDefault<z.ZodArray<z.ZodString>>;
1121
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>>>;
1122
1531
  }, z.core.$strip>;
1123
1532
  documents: z.ZodArray<z.ZodObject<{
1124
1533
  path: z.ZodString;
@@ -1387,4 +1796,55 @@ declare function parseCanonicalDefinition(value: unknown): NamespaceDefinition;
1387
1796
 
1388
1797
  declare const parsedPredicateSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ParsedPredicate, string>>;
1389
1798
 
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 };
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 };