@dbsp/adapter-pgsql 3.0.0 → 3.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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { IndexInfo, TruncateOptions, VacuumOptions, AlterColumnOptions, CreateIndexOptions, DropIndexOptions, ExpressionRef, ModelIR as ModelIR$1 } from '@dbsp/core';
1
+ import * as _dbsp_core from '@dbsp/core';
2
+ import { IndexInfo, TruncateOptions, VacuumOptions, AlterColumnOptions, CreateIndexOptions, DropIndexOptions, ExpressionRef, ModelIR as ModelIR$1, ExecutionCoordinator, CapabilityDescriptor } from '@dbsp/core';
2
3
  export { normalizeSQL } from '@dbsp/core';
3
4
  import * as _dbsp_types from '@dbsp/types';
4
- import { DialectCapabilities, ModelIR, ColumnListInput, ParamIntent, JsonAggOrderByEntry, IndexIR, HierarchyIR, Adapter, DbCasing, AdapterLogger, AdapterCapabilities, PlanReport, CompiledNqlQuery, CompileOptions, CompiledQuery, CompileResultWithIncludes, SubqueryIncludeInfo, ExpressionIntent, InsertIntent, InsertFromIntent, UpdateIntent, BatchUpdateIntent, DeleteIntent, UpsertIntent, UpsertFromIntent, RecursivePlanReport, CteQueryIntent, SetOperationIntent, DumpMeta, Dump, AdapterStreamOptions, CompileOnlyAdapter, ColumnIR, MutationReturningItem, WhereIntent, QueryIntent } from '@dbsp/types';
5
+ import { DialectCapabilities, ModelIR, ColumnListInput, ParamIntent, JsonAggOrderByEntry, IndexIR, HierarchyIR, Adapter, DbCasing, AdapterLogger, AdapterCapabilities, PlanReport, CompiledNqlQuery, CompileOptions, CompiledQuery, CompileResultWithIncludes, SubqueryIncludeInfo, ExpressionIntent, InsertIntent, InsertFromIntent, UpdateIntent, BatchUpdateIntent, DeleteIntent, UpsertIntent, UpsertFromIntent, RecursivePlanReport, CteQueryIntent, SetOperationIntent, DumpMeta, Dump, AdapterStreamOptions, PinnedConnectionOptions, TransactionOptions, CompileOnlyAdapter, ColumnIR, MutationReturningItem, WhereIntent, OutputDescriptor, QueryIntent, OperationKindRef, SemanticArtifactRef, TransitionRunJournal, ObservationIssuer, ObservationContext, TypeRef, ExpressionValue, CollationRef, LogicalIdentity, PhysicalOperation, OperationEffectAssessment, EvidenceObservation, FingerprintManifest, DurableIntentRecord, IssuedObservation, ApplyGuard, AdvisoryObservation, TransactionalCompletionRecord, StepJournal, UnsafeNativeFragment, ResourceAddress, ExecutableAssertion, Assumption, TransitionRule, TransitionCompositionFact, TrustRoot, RequiredEnumLabelIR } from '@dbsp/types';
5
6
  import * as _pgsql_types from '@pgsql/types';
6
7
  import { Node, OnConflictClause, ParamRef } from '@pgsql/types';
7
8
  import { Pool, PoolClient } from 'pg';
@@ -727,6 +728,39 @@ declare class PlanCompiler {
727
728
  */
728
729
  declare function compilePlan(plan: SimplifiedPlanReport, options?: CompilerOptions): CompiledResult;
729
730
 
731
+ type IndexRenderKey = {
732
+ readonly column?: string | undefined;
733
+ readonly expression?: string | undefined;
734
+ readonly opclass?: string | undefined;
735
+ };
736
+ type IndexRenderSpec = {
737
+ readonly name: string;
738
+ readonly table: string;
739
+ readonly schema?: string | undefined;
740
+ readonly unique: boolean;
741
+ readonly method?: string | undefined;
742
+ readonly keys: readonly IndexRenderKey[];
743
+ readonly include?: readonly string[] | undefined;
744
+ readonly nullsNotDistinct?: boolean | undefined;
745
+ readonly with?: Readonly<Record<string, unknown>> | undefined;
746
+ readonly where?: string | undefined;
747
+ readonly concurrently?: boolean | undefined;
748
+ readonly ifNotExists?: boolean | undefined;
749
+ };
750
+ type IndexCapabilityContext = {
751
+ readonly caps: DialectCapabilities;
752
+ readonly targetVersion?: string | undefined;
753
+ };
754
+ type IndexFeature = 'INCLUDE' | 'PARTIAL INDEX' | 'EXPRESSION INDEX' | 'INDEX METHOD' | 'OPCLASS' | 'NULLS NOT DISTINCT';
755
+ declare class IndexFeatureUnsupportedError extends Error {
756
+ readonly indexName: string;
757
+ readonly unsupportedFeatures: readonly IndexFeature[];
758
+ constructor(indexName: string, unsupportedFeatures: readonly IndexFeature[], message: string);
759
+ }
760
+ declare function assertCreateIndexSupported(spec: IndexRenderSpec, ctx?: IndexCapabilityContext): void;
761
+ declare function assertCreateIndexesSupported(specs: readonly IndexRenderSpec[], ctx?: IndexCapabilityContext): void;
762
+ declare function renderCreateIndex(spec: IndexRenderSpec, ctx?: IndexCapabilityContext): string;
763
+
730
764
  /**
731
765
  * DDL Generator - Generates PostgreSQL DDL statements from ModelIR
732
766
  *
@@ -753,7 +787,7 @@ interface GenerateDDLOptions {
753
787
  readonly fkAutoIndex?: boolean;
754
788
  /** Naming plugin for identifier transformation */
755
789
  readonly naming?: NamingPlugin;
756
- /** Dialect capabilities — DDL passes for unsupported features will be skipped */
790
+ /** Dialect capabilities — unsupported index features throw during DDL generation */
757
791
  readonly dialectCapabilities?: DialectCapabilities;
758
792
  }
759
793
  /**
@@ -769,7 +803,7 @@ interface GenerateDDLOptions {
769
803
  * @returns Array of DDL statements in dependency order
770
804
  */
771
805
  declare function generateDDL(schema: ModelIR, options?: GenerateDDLOptions): string[];
772
- declare function generateCreateIndex(tableName: string, idx: IndexIR, schemaName: string | undefined, naming: NamingPlugin): string;
806
+ declare function generateCreateIndex(tableName: string, idx: IndexIR, schemaName: string | undefined, naming: NamingPlugin, context?: IndexCapabilityContext): string;
773
807
  /**
774
808
  * Returns whether the PostgreSQL DDL generator can emit this IndexIR.
775
809
  *
@@ -843,6 +877,8 @@ interface IntrospectedModelIR extends ModelIR {
843
877
  */
844
878
  declare function introspect(pool: Pool, options?: IntrospectionOptions): Promise<IntrospectedModelIR>;
845
879
 
880
+ type PgsqlTransactionTimeoutParameter = 'lock_timeout' | 'statement_timeout';
881
+
846
882
  /**
847
883
  * PgsqlAdapter - Implements the Adapter interface for PostgreSQL using native pg driver.
848
884
  *
@@ -852,6 +888,16 @@ declare function introspect(pool: Pool, options?: IntrospectionOptions): Promise
852
888
  * @module pgsql-adapter
853
889
  */
854
890
 
891
+ type PgAdvisoryLockKey = bigint | {
892
+ readonly classId: number;
893
+ readonly objId: number;
894
+ };
895
+ type PgAdvisoryLockResult<T> = {
896
+ readonly acquired: true;
897
+ readonly value: T;
898
+ } | {
899
+ readonly acquired: false;
900
+ };
855
901
  declare class PgsqlRawSqlTransactionControlError extends Error {
856
902
  readonly dbspRawSqlTransactionControl = true;
857
903
  constructor(cause: unknown);
@@ -864,6 +910,48 @@ declare class PgsqlTransactionAbortedError extends Error {
864
910
  readonly dbspTransactionAborted = true;
865
911
  constructor(cause: unknown);
866
912
  }
913
+ /**
914
+ * Raised when a pool-owned top-level transaction is aborted through
915
+ * `TransactionOptions.signal`. If the signal aborts while `pool.connect()` is
916
+ * still pending, dbsp honors it only after a client is acquired.
917
+ */
918
+ declare class PgsqlTransactionAbortSignalError extends Error {
919
+ readonly dbspTransactionAbortSignal = true;
920
+ constructor();
921
+ }
922
+ declare class PgsqlPinnedConnectionAbortSignalError extends Error {
923
+ readonly dbspPinnedConnectionAbortSignal = true;
924
+ constructor();
925
+ }
926
+ declare class PgsqlTransactionOptionsError extends Error {
927
+ readonly dbspTransactionOptions = true;
928
+ constructor(message: string);
929
+ }
930
+ declare class PgsqlAdvisoryLockOptionsError extends Error {
931
+ readonly dbspAdvisoryLockOptions = true;
932
+ constructor(message: string);
933
+ }
934
+ /**
935
+ * Raised when a statement inside a dbsp-managed transaction fails with a SQLSTATE
936
+ * that matches a timeout the caller configured for that transaction: `55P03`
937
+ * (`lock_not_available`) when `lockTimeoutMs` was set, or `57014` (`query_canceled`)
938
+ * when `statementTimeoutMs` was set. The original PostgreSQL error is preserved as
939
+ * `cause`.
940
+ *
941
+ * Classification is by SQLSTATE only. PostgreSQL assigns these codes to the OUTCOME,
942
+ * not the cause: `55P03` is also raised by `FOR UPDATE NOWAIT`, and `57014` is also
943
+ * raised by an external cancel (e.g. `pg_cancel_backend`). There is no locale-stable
944
+ * structured field that separates the timeout from the other cause, so the message
945
+ * text is deliberately NOT parsed. dbsp never emits `NOWAIT` itself, so a `55P03`
946
+ * here is the configured `lock_timeout` unless the caller's own raw SQL used
947
+ * `NOWAIT`; a `57014` is the configured `statement_timeout` unless the backend was
948
+ * cancelled from outside. Inspect `cause` when that distinction matters.
949
+ */
950
+ declare class PgsqlTransactionTimeoutError extends Error {
951
+ readonly timeout: PgsqlTransactionTimeoutParameter;
952
+ readonly dbspTransactionTimeout = true;
953
+ constructor(cause: unknown, timeout: PgsqlTransactionTimeoutParameter);
954
+ }
867
955
  /**
868
956
  * Options for PgsqlAdapter.
869
957
  */
@@ -940,6 +1028,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
940
1028
  private readonly borrowedClient;
941
1029
  private readonly managedTransactions;
942
1030
  private readonly adapterManagedTransaction;
1031
+ private readonly adapterManagedPinnedConnection;
943
1032
  private readonly scopeToken;
944
1033
  private readonly scopeState;
945
1034
  private readonly schemaName;
@@ -980,7 +1069,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
980
1069
  private requireNqlCompileModel;
981
1070
  private assertNqlBindingNamesDisjointFromTables;
982
1071
  private compileNqlMutation;
983
- private compileNqlBundleLeaf;
1072
+ private compileNqlBundleLeafEnvelope;
984
1073
  private compileNqlBundle;
985
1074
  /**
986
1075
  * Returns the pool/client executor, or throws if in compile-only mode.
@@ -1030,7 +1119,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1030
1119
  * @param expr - ExpressionIntent to evaluate
1031
1120
  * @returns Compiled SQL and parameters
1032
1121
  */
1033
- compileSelectExpression(expr: ExpressionIntent): CompiledQuery;
1122
+ compileSelectExpression<T = unknown>(expr: ExpressionIntent): CompiledQuery<T>;
1034
1123
  /**
1035
1124
  * Compile an insert intent to executable SQL.
1036
1125
  *
@@ -1075,7 +1164,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1075
1164
  * Compile a recursive CTE plan to executable SQL.
1076
1165
  * Supports adjacency-list and edge-table traversal modes.
1077
1166
  */
1078
- compileRecursive(report: RecursivePlanReport, model: ModelIR, options?: CompileOptions): CompiledQuery;
1167
+ compileRecursive<T = unknown>(report: RecursivePlanReport, model: ModelIR, options?: CompileOptions): CompiledQuery<T>;
1079
1168
  /**
1080
1169
  * Compile a CTE query backed by unnest() arrays (BATCH-001 Block 5).
1081
1170
  *
@@ -1083,11 +1172,11 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1083
1172
  * independently (parameters starting at $1), then renumber outer params
1084
1173
  * to start after CTE params and prepend WITH clause.
1085
1174
  */
1086
- compileCteQuery(intent: CteQueryIntent, options?: CompileOptions): CompiledQuery;
1175
+ compileCteQuery<T = unknown>(intent: CteQueryIntent, options?: CompileOptions): CompiledQuery<T>;
1087
1176
  /**
1088
1177
  * Compile a set operation (UNION / INTERSECT / EXCEPT) to SQL.
1089
1178
  */
1090
- compileSetOperation(intent: SetOperationIntent, model: ModelIR, options?: CompileOptions): CompiledQuery;
1179
+ compileSetOperation<T = unknown>(intent: SetOperationIntent, model: ModelIR, options?: CompileOptions): CompiledQuery<T>;
1091
1180
  private compileSetOperationWithBindings;
1092
1181
  /**
1093
1182
  * Create a dump for observability.
@@ -1098,6 +1187,15 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1098
1187
  * Results are transformed to use model naming convention (e.g., snake_case → camelCase)
1099
1188
  */
1100
1189
  execute<T>(query: CompiledQuery<T>): Promise<T[]>;
1190
+ /**
1191
+ * Execute a query and return rows plus PostgreSQL result metadata.
1192
+ * Results are transformed to use model naming convention (e.g., snake_case → camelCase)
1193
+ */
1194
+ executeWithMeta<T = unknown>(query: CompiledQuery<T>): Promise<{
1195
+ readonly rows: T[];
1196
+ readonly rowCount: number;
1197
+ readonly command?: string;
1198
+ }>;
1101
1199
  /**
1102
1200
  * Transform result rows from database naming to model naming convention.
1103
1201
  * For CamelCaseNamingPlugin: price_cents → priceCents
@@ -1123,6 +1221,9 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1123
1221
  * @returns AsyncIterableIterator that yields rows one by one
1124
1222
  */
1125
1223
  stream<T>(query: CompiledQuery<T>, options?: AdapterStreamOptions): AsyncIterableIterator<T>;
1224
+ /** Stream raw SQL directly using the same cursor machinery as stream(). */
1225
+ streamRaw<T = unknown>(sql: string, parameters?: readonly unknown[], options?: AdapterStreamOptions): AsyncIterableIterator<T>;
1226
+ private streamCursor;
1126
1227
  /**
1127
1228
  * Internal: Stream with an existing client using cursors.
1128
1229
  */
@@ -1144,6 +1245,31 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1144
1245
  * ```
1145
1246
  */
1146
1247
  introspect(options?: IntrospectionOptions): Promise<IntrospectedModelIR>;
1248
+ /**
1249
+ * Acquire an exclusive session-level PostgreSQL advisory lock for the callback.
1250
+ *
1251
+ * The lock, callback, and unlock run on one `withPinnedConnection()` adapter.
1252
+ * dbsp performs one PostgreSQL acquire and one matching unlock per call. It
1253
+ * does not track reentrant depth in v1; PostgreSQL's session-level stacking
1254
+ * still applies when callers deliberately nest on the same pinned adapter.
1255
+ */
1256
+ withAdvisoryLock<T>(key: PgAdvisoryLockKey, fn: (locked: Adapter<DB>) => Promise<T>): Promise<T>;
1257
+ withAdvisoryLock<T>(key: PgAdvisoryLockKey, fn: (locked: Adapter<DB>) => Promise<T>, options: {
1258
+ readonly wait?: 'block';
1259
+ readonly signal?: AbortSignal;
1260
+ }): Promise<T>;
1261
+ withAdvisoryLock<T>(key: PgAdvisoryLockKey, fn: (locked: Adapter<DB>) => Promise<T>, options: {
1262
+ readonly wait: 'try';
1263
+ readonly signal?: AbortSignal;
1264
+ }): Promise<PgAdvisoryLockResult<T>>;
1265
+ withAdvisoryLock<T>(key: PgAdvisoryLockKey, fn: (locked: Adapter<DB>) => Promise<T>, options?: {
1266
+ readonly wait?: 'block' | 'try';
1267
+ readonly signal?: AbortSignal;
1268
+ }): Promise<T | PgAdvisoryLockResult<T>>;
1269
+ private unlockAdvisoryLock;
1270
+ withPinnedConnection<T>(fn: (adapter: Adapter<DB>) => Promise<T>, options?: PinnedConnectionOptions): Promise<T>;
1271
+ private pinnedConnectionReleaseReason;
1272
+ private pinnedConnectionWithClient;
1147
1273
  /**
1148
1274
  * Execute a callback within a database transaction.
1149
1275
  *
@@ -1173,7 +1299,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1173
1299
  * and hand dbsp a `borrowedClient` **without** `managedTransactions`. dbsp will then
1174
1300
  * contain its own statements inside *your* transaction instead of the other way round.
1175
1301
  */
1176
- transaction<T>(fn: (adapter: Adapter<DB>) => Promise<T>): Promise<T>;
1302
+ transaction<T>(fn: (adapter: Adapter<DB>) => Promise<T>, options?: TransactionOptions): Promise<T>;
1177
1303
  /**
1178
1304
  * Execute scratch PostgreSQL work in a scope that always rolls back on success.
1179
1305
  *
@@ -1185,12 +1311,16 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1185
1311
  */
1186
1312
  withScratchScope<T>(fn: (adapter: PgsqlAdapter<DB>) => Promise<T>): Promise<T>;
1187
1313
  private createManagedClientAdapter;
1314
+ private createPinnedConnectionAdapter;
1188
1315
  private createChildTransactionObserver;
1189
1316
  private observeChildTransaction;
1190
1317
  private markChildTransactionObserved;
1191
1318
  private refreshScopeChildrenFailure;
1192
1319
  private transactionWithManagedClient;
1193
1320
  private transactionWithManagedClientSavepointScope;
1321
+ private applyTransactionTimeouts;
1322
+ private captureAndApplySavepointTimeouts;
1323
+ private restoreSavepointTimeouts;
1194
1324
  private transactionWithClientTransaction;
1195
1325
  private releaseClient;
1196
1326
  private rollbackAndReleaseSavepoint;
@@ -1202,9 +1332,11 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1202
1332
  private classifySavepointReleaseFailure;
1203
1333
  private rollbackSavepointAfterReleaseFailure;
1204
1334
  private enterTransactionScope;
1335
+ private enterPinnedConnectionScope;
1205
1336
  private enterSavepointScope;
1206
1337
  private pushClientScope;
1207
1338
  private currentClientScope;
1339
+ private managedScopeEndedMessage;
1208
1340
  private assertCanUseClient;
1209
1341
  private assertUsableScopeAncestors;
1210
1342
  private findClientScope;
@@ -1269,6 +1401,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1269
1401
  */
1270
1402
  get inTransaction(): boolean;
1271
1403
  private adapterManagedScopeIsLive;
1404
+ private shouldProtectBorrowedClientTransaction;
1272
1405
  private executeQueryProtectingOpenTransaction;
1273
1406
  private executeConnectionStatement;
1274
1407
  private executeConnectionStatementUnlocked;
@@ -1318,27 +1451,27 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1318
1451
  * Generate SQL for TRUNCATE TABLE.
1319
1452
  * Implements TableDDLGeneratorAdapter.generateTruncate.
1320
1453
  */
1321
- generateTruncate(table: string, schema?: string, options?: TruncateOptions): string;
1454
+ generateTruncate(table: string, schemaName: string, options?: TruncateOptions): string;
1322
1455
  /**
1323
1456
  * Generate SQL for VACUUM.
1324
1457
  * Implements TableDDLGeneratorAdapter.generateVacuum.
1325
1458
  */
1326
- generateVacuum(table: string, schema?: string, options?: VacuumOptions): string;
1459
+ generateVacuum(table: string, schemaName: string, options?: VacuumOptions): string;
1327
1460
  /**
1328
1461
  * Generate SQL for ALTER TABLE ... ALTER COLUMN.
1329
1462
  * Implements TableDDLGeneratorAdapter.generateAlterColumn.
1330
1463
  */
1331
- generateAlterColumn(table: string, column: string, options: AlterColumnOptions, schema?: string): string;
1464
+ generateAlterColumn(table: string, schemaName: string, column: string, options: AlterColumnOptions): string;
1332
1465
  /**
1333
1466
  * Generate SQL for CREATE INDEX.
1334
1467
  * Implements TableDDLGeneratorAdapter.generateCreateIndex.
1335
1468
  */
1336
- generateCreateIndex(table: string, options: CreateIndexOptions, schema?: string): string;
1469
+ generateCreateIndex(table: string, schemaName: string, options: CreateIndexOptions): string;
1337
1470
  /**
1338
1471
  * Generate SQL for DROP INDEX.
1339
1472
  * Implements TableDDLGeneratorAdapter.generateDropIndex.
1340
1473
  */
1341
- generateDropIndex(name: string, options?: DropIndexOptions): string;
1474
+ generateDropIndex(name: string, schemaName: string, options?: DropIndexOptions): string;
1342
1475
  /**
1343
1476
  * Validate an identifier (table name, column name, schema name).
1344
1477
  */
@@ -1562,7 +1695,7 @@ interface MigrationSQLOptions {
1562
1695
  readonly includeDestructive?: boolean;
1563
1696
  /** Automatically create indexes on FK columns for new tables (default: true) */
1564
1697
  readonly fkAutoIndex?: boolean;
1565
- /** Dialect capabilities — migration SQL for unsupported features will be filtered */
1698
+ /** Dialect capabilities — unsupported index features throw during migration SQL generation */
1566
1699
  readonly dialectCapabilities?: DialectCapabilities;
1567
1700
  }
1568
1701
  /**
@@ -1657,9 +1790,12 @@ interface MigrationRecord {
1657
1790
  readonly destructive: boolean;
1658
1791
  }
1659
1792
  /**
1660
- * Execute a callback under an advisory lock using a dedicated client.
1793
+ * Execute a callback under the migration advisory lock using a pinned client.
1661
1794
  * The lock is held for the duration of the callback.
1662
- * The client is released (and lock freed) after the callback completes.
1795
+ *
1796
+ * Intentional latent-bug fix: session-level advisory locks are not freed by
1797
+ * returning a PoolClient to pg's pool. If unlock fails, PgsqlAdapter destroys the
1798
+ * session instead of returning a possibly lock-holding connection to the pool.
1663
1799
  */
1664
1800
  declare function withMigrationLock<T>(pool: Pool, fn: (client: PoolClient) => Promise<T>): Promise<T>;
1665
1801
  /**
@@ -2341,6 +2477,8 @@ declare function collectAndValidateParamRefs(node: unknown): {
2341
2477
  allValid: boolean;
2342
2478
  };
2343
2479
 
2480
+ declare function derivePostgresqlCapabilitiesForVersion(version: string): DialectCapabilities;
2481
+
2344
2482
  /**
2345
2483
  * Redact sensitive values in a query dump's `params` array before logging.
2346
2484
  *
@@ -2371,6 +2509,28 @@ declare const DEFAULT_REDACTION_PATTERNS: ReadonlyArray<RegExp>;
2371
2509
  */
2372
2510
  declare function redactParams(params: readonly unknown[], config: RedactionConfig): readonly unknown[];
2373
2511
 
2512
+ declare const projectionEnvelopeBrand: unique symbol;
2513
+ type ProjectionEnvelope<T = unknown> = {
2514
+ readonly [projectionEnvelopeBrand]: true;
2515
+ readonly sql: string;
2516
+ readonly parameters: readonly unknown[];
2517
+ readonly ast?: Node;
2518
+ readonly projection: ProjectionState;
2519
+ readonly hydrationPlan?: PlanReport;
2520
+ readonly __resultType?: T;
2521
+ };
2522
+ type ProjectionState = {
2523
+ readonly kind: 'known';
2524
+ readonly outputs: ReadonlyMap<string, OutputProjection>;
2525
+ } | {
2526
+ readonly kind: 'dropped';
2527
+ readonly reason: ProjectionDropReason;
2528
+ readonly hadConvertibleSource: boolean;
2529
+ };
2530
+ type OutputProjection = OutputDescriptor;
2531
+
2532
+ type ProjectionDropReason = 'set-operation-positional-merge' | 'raw-recursive-cte-positional-merge' | 'unknown-raw-sql' | 'unsupported-source';
2533
+
2374
2534
  /**
2375
2535
  * Set operation compiler (UNION / INTERSECT / EXCEPT)
2376
2536
  *
@@ -2379,37 +2539,33 @@ declare function redactParams(params: readonly unknown[], config: RedactionConfi
2379
2539
  */
2380
2540
 
2381
2541
  /**
2382
- * Compiled SQL with positional parameters.
2542
+ * Compiled set-operation SQL with positional parameters.
2383
2543
  */
2384
- interface SetOperationResult {
2385
- readonly sql: string;
2386
- readonly parameters: readonly unknown[];
2387
- }
2544
+ type SetOperationResult<T = unknown> = CompiledQuery<T>;
2388
2545
  /**
2389
- * Function that compiles a single QueryIntent leaf to SQL + parameters.
2546
+ * Function that compiles a single QueryIntent leaf to a projection envelope, or
2547
+ * a compiled query that can be bridged into one.
2390
2548
  * Provided by the caller to decouple from adapter internals.
2391
2549
  */
2392
- type LeafCompileFn = (query: QueryIntent) => {
2393
- sql: string;
2394
- parameters: readonly unknown[];
2395
- };
2550
+ type LeafCompileResult = ProjectionEnvelope | CompiledQuery;
2551
+ type LeafCompileFn = (query: QueryIntent) => LeafCompileResult;
2396
2552
  /**
2397
2553
  * Recursively compile a SetOperationIntent to SQL with merged parameters.
2398
2554
  *
2399
- * Each leaf QueryIntent is compiled via `compileFn`. When merging left and
2400
- * right branches, the right side's `$N` placeholders are renumbered so they
2401
- * don't collide with the left side's parameters.
2555
+ * Each leaf QueryIntent is compiled via `compileFn` to a projection envelope.
2556
+ * When merging left and right branches, the right side's `$N` placeholders are
2557
+ * renumbered so they don't collide with the left side's parameters. The final
2558
+ * set operation drops positional projection provenance through the envelope so
2559
+ * `finalizeEnvelope` owns the set-operation `js` fail-loud behavior.
2402
2560
  *
2403
2561
  * @param intent - The set operation intent (recursive tree)
2404
- * @param compileFn - Compiles a single QueryIntent to SQL + params
2562
+ * @param compileFn - Compiles a single QueryIntent to an envelope-compatible result
2405
2563
  * @returns Combined SQL string and merged parameter array
2406
2564
  *
2407
2565
  * @example
2408
2566
  * ```typescript
2409
- * const result = compileSetOperation(setOpIntent, (query) => {
2410
- * const planReport = plan(query, model, { dialectCapabilities });
2411
- * return adapter.compile(planReport, { model });
2412
- * });
2567
+ * const compileFn = createLeafCompileFn(adapter, model, plan);
2568
+ * const result = compileSetOperation(setOpIntent, compileFn);
2413
2569
  * console.log(result.sql); // (SELECT ...) UNION (SELECT ...)
2414
2570
  * console.log(result.parameters); // [...leftParams, ...rightParams]
2415
2571
  * ```
@@ -2428,10 +2584,7 @@ declare function compileSetOperation(intent: SetOperationIntent, compileFn: Leaf
2428
2584
  declare function createLeafCompileFn(adapter: {
2429
2585
  compile(plan: PlanReport, options: CompileOptions & {
2430
2586
  model: ModelIR$1;
2431
- }): {
2432
- sql: string;
2433
- parameters: readonly unknown[];
2434
- };
2587
+ }): CompiledQuery;
2435
2588
  dialectCapabilities: DialectCapabilities;
2436
2589
  }, model: ModelIR$1, planFn: (intent: QueryIntent, model: ModelIR$1, options: {
2437
2590
  dialectCapabilities: DialectCapabilities;
@@ -2593,6 +2746,550 @@ declare function buildStreamingStatements(query: Node, config?: StreamConfig): {
2593
2746
  close: Node;
2594
2747
  };
2595
2748
 
2749
+ declare const PG_OPERATION_PACK_ARTIFACT: SemanticArtifactRef;
2750
+ declare const PG_RULE_PACK_ARTIFACT: SemanticArtifactRef;
2751
+ declare const PG_INTROSPECTION_ARTIFACT: SemanticArtifactRef;
2752
+ declare const ALTER_COLUMN_SET_NOT_NULL_OPERATION_KIND: OperationKindRef;
2753
+ declare const ALTER_TYPE_ADD_VALUE_OPERATION_KIND: OperationKindRef;
2754
+ declare const ATTACH_LOGICAL_IDENTITY_OPERATION_KIND: OperationKindRef;
2755
+ declare const MANUAL_SQL_OPERATION_KIND: OperationKindRef;
2756
+ declare const SET_NOT_NULL_RULE_ID = "postgresql.column.set-not-null";
2757
+ declare const ADD_CHECK_RULE_ID = "postgresql.table.add-check";
2758
+ declare const ENUM_ADD_VALUE_RULE_ID = "postgresql.enum.add-value";
2759
+ declare const LOGICAL_IDENTITY_ADOPTION_RULE_ID = "postgresql.logical-identity.adopt";
2760
+ declare const DBSP_META_SCHEMA = "dbsp_meta";
2761
+ declare const DBSP_TRANSITION_RUN_TABLE = "dbsp_transition_run";
2762
+ declare const DBSP_TRANSITION_JOURNAL_TABLE = "dbsp_transition_journal";
2763
+ declare const DBSP_LOGICAL_IDENTITY_TABLE = "dbsp_logical_identity";
2764
+ declare const COLUMN_EXISTS_OBSERVATION = "postgresql.column.exists";
2765
+ declare const ENUM_TYPE_EXISTS_OBSERVATION = "postgresql.enum-type.exists";
2766
+ declare const ENUM_LABEL_VISIBLE_OBSERVATION = "postgresql.enum-label.visible";
2767
+ declare const ALTER_AUTHORITY_OBSERVATION = "postgresql.table.alter-authority";
2768
+ declare const ENGINE_VERSION_OBSERVATION = "postgresql.engine.version-supported";
2769
+ declare const LOGICAL_IDENTITY_CARRIER_OBSERVATION = "postgresql.logical-identity.carrier-state";
2770
+ declare const NO_NULLS_GUARD = "NO_NULLS";
2771
+
2772
+ type QueryResultLike = {
2773
+ readonly rows: readonly Record<string, unknown>[];
2774
+ };
2775
+ type TransitionJournalQueryable = {
2776
+ query(sql: string, params?: readonly unknown[]): Promise<QueryResultLike>;
2777
+ };
2778
+ declare function renderCreateDbspMetaSchemaSql(): string;
2779
+ declare function renderCreateTransitionRunTableSql(): string;
2780
+ declare function renderCreateTransitionJournalTableSql(): string;
2781
+ declare function ensureTransitionJournal(executor: TransitionJournalQueryable): Promise<void>;
2782
+ declare function readTransitionJournal(executor: TransitionJournalQueryable, runId: string): Promise<TransitionRunJournal>;
2783
+
2784
+ type ObservationTarget = {
2785
+ readonly table: string;
2786
+ readonly column?: string;
2787
+ readonly constraint?: string;
2788
+ readonly index?: string;
2789
+ readonly schema?: string;
2790
+ };
2791
+ type EnumObservationTarget = {
2792
+ readonly type: string;
2793
+ readonly label?: string;
2794
+ readonly schema?: string;
2795
+ };
2796
+ declare function createPgObservationIssuer(): ObservationIssuer;
2797
+ declare function readPgObservationContext(target: unknown, schema?: string, observationTarget?: ObservationTarget | EnumObservationTarget): Promise<ObservationContext>;
2798
+
2799
+ interface SetNotNullColumnShapeExpectation {
2800
+ readonly kind: 'postgresql.set-not-null.column-shape.v1';
2801
+ readonly name: string;
2802
+ readonly nullability: {
2803
+ readonly from: true;
2804
+ readonly to: boolean;
2805
+ };
2806
+ readonly type: TypeRef;
2807
+ readonly default: ExpressionValue | null;
2808
+ readonly collation: CollationRef;
2809
+ readonly identity: 'always' | 'byDefault' | null;
2810
+ readonly generated: string | null;
2811
+ readonly autoIncrement: boolean;
2812
+ readonly unique: boolean;
2813
+ readonly uniqueConstraintName: string | null;
2814
+ readonly logicalIdentity?: LogicalIdentity | null;
2815
+ readonly comment: string | null;
2816
+ readonly target?: ColumnDefaultAttestationTarget;
2817
+ }
2818
+ interface ColumnDefaultAttestationTarget {
2819
+ readonly database?: string;
2820
+ readonly schema?: string;
2821
+ readonly table: string;
2822
+ readonly column: string;
2823
+ }
2824
+
2825
+ type AlterColumnSetNotNullPayload = {
2826
+ readonly table: string;
2827
+ readonly column: string;
2828
+ readonly schema?: string;
2829
+ readonly expectedColumnShape?: SetNotNullColumnShapeExpectation;
2830
+ };
2831
+ type TransitionExecutionClient$3 = {
2832
+ readonly opaqueClient: unknown;
2833
+ };
2834
+ declare function renderAlterColumnSetNotNullSql(payload: AlterColumnSetNotNullPayload, context: ObservationContext): string;
2835
+ declare function renderSetNotNullLockSql(payload: AlterColumnSetNotNullPayload, context: ObservationContext): string;
2836
+ declare function renderNoNullsCheckSql(payload: AlterColumnSetNotNullPayload, context: ObservationContext): string;
2837
+ declare function beforeAfterFingerprints$3(operation: PhysicalOperation, evidence: readonly EvidenceObservation[], context: ObservationContext): {
2838
+ expectedBefore: FingerprintManifest;
2839
+ expectedAfter: FingerprintManifest;
2840
+ };
2841
+ declare function createAlterColumnSetNotNullOperationRuntime(): {
2842
+ artifact: _dbsp_types.SemanticArtifactRef;
2843
+ supportsOperation(operation: PhysicalOperation): boolean;
2844
+ effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
2845
+ buildFingerprints: typeof beforeAfterFingerprints$3;
2846
+ checkout(target: unknown): Promise<TransitionExecutionClient$3>;
2847
+ release(client: TransitionExecutionClient$3, error?: unknown): void;
2848
+ writeIntentJournal(client: TransitionExecutionClient$3, record: DurableIntentRecord): Promise<void>;
2849
+ begin(client: TransitionExecutionClient$3): Promise<void>;
2850
+ setLockTimeout(client: TransitionExecutionClient$3, maxWaitMs: number): Promise<void>;
2851
+ acquireLocks(client: TransitionExecutionClient$3, operation: PhysicalOperation, _effects: OperationEffectAssessment, context: ObservationContext): Promise<void>;
2852
+ observeContext(client: TransitionExecutionClient$3, operation: PhysicalOperation, _proofContext: ObservationContext): Promise<ObservationContext>;
2853
+ observeOperation(client: TransitionExecutionClient$3, operation: PhysicalOperation, context: ObservationContext, _phase: "before" | "after", issuer: ObservationIssuer): Promise<{
2854
+ observations: IssuedObservation[];
2855
+ fingerprint: FingerprintManifest;
2856
+ }>;
2857
+ checkGuard(client: TransitionExecutionClient$3, operation: PhysicalOperation, guard: ApplyGuard, context: ObservationContext): Promise<{
2858
+ passed: boolean;
2859
+ observations: AdvisoryObservation[];
2860
+ recovery: readonly _dbsp_types.RecoveryArtefact[];
2861
+ }>;
2862
+ executeOperation(client: TransitionExecutionClient$3, operation: PhysicalOperation, context: ObservationContext, duringGuards?: readonly ApplyGuard[]): Promise<{
2863
+ kind: string;
2864
+ }>;
2865
+ writeCompletionJournal(client: TransitionExecutionClient$3, operation: PhysicalOperation, record: TransactionalCompletionRecord): Promise<void>;
2866
+ commit(client: TransitionExecutionClient$3): Promise<void>;
2867
+ rollback(client: TransitionExecutionClient$3): Promise<void>;
2868
+ writeObservedJournal(client: TransitionExecutionClient$3, journal: StepJournal): Promise<void>;
2869
+ isLockTimeout(error: unknown): boolean;
2870
+ };
2871
+
2872
+ type AlterTypeAddValuePayload = {
2873
+ readonly schema: string;
2874
+ readonly type: string;
2875
+ readonly label: string;
2876
+ readonly after?: string;
2877
+ readonly expectedBefore: readonly string[];
2878
+ readonly expectedAfter: readonly string[];
2879
+ };
2880
+ type TransitionExecutionClient$2 = {
2881
+ readonly opaqueClient: unknown;
2882
+ };
2883
+ declare function renderAlterTypeAddValueSql(payload: AlterTypeAddValuePayload, context: ObservationContext): string;
2884
+ declare function beforeAfterFingerprints$2(operation: PhysicalOperation, evidence: readonly EvidenceObservation[], context: ObservationContext): {
2885
+ expectedBefore: FingerprintManifest;
2886
+ expectedAfter: FingerprintManifest;
2887
+ };
2888
+ declare function createAlterTypeAddValueOperationRuntime(): {
2889
+ artifact: _dbsp_types.SemanticArtifactRef;
2890
+ operationKind: _dbsp_types.OperationKindRef;
2891
+ supportsOperation(operation: PhysicalOperation): boolean;
2892
+ effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
2893
+ buildFingerprints: typeof beforeAfterFingerprints$2;
2894
+ checkout(target: unknown): Promise<TransitionExecutionClient$2>;
2895
+ release(client: TransitionExecutionClient$2, error?: unknown): void;
2896
+ writeIntentJournal(client: TransitionExecutionClient$2, record: DurableIntentRecord): Promise<void>;
2897
+ begin(client: TransitionExecutionClient$2): Promise<void>;
2898
+ setLockTimeout(client: TransitionExecutionClient$2, maxWaitMs: number): Promise<void>;
2899
+ acquireLocks(client: TransitionExecutionClient$2, operation: PhysicalOperation): Promise<void>;
2900
+ observeContext(client: TransitionExecutionClient$2, operation: PhysicalOperation, _proofContext: ObservationContext): Promise<ObservationContext>;
2901
+ observeOperation(client: TransitionExecutionClient$2, operation: PhysicalOperation, context: ObservationContext, _phase: "before" | "after", issuer: ObservationIssuer): Promise<{
2902
+ observations: IssuedObservation[];
2903
+ fingerprint: FingerprintManifest;
2904
+ }>;
2905
+ checkGuard(client: TransitionExecutionClient$2, operation: PhysicalOperation, guard: ApplyGuard, context: ObservationContext): Promise<{
2906
+ passed: boolean;
2907
+ observations: EvidenceObservation[];
2908
+ recovery: readonly _dbsp_types.RecoveryArtefact[];
2909
+ }>;
2910
+ executeOperation(client: TransitionExecutionClient$2, operation: PhysicalOperation, context: ObservationContext, duringGuards?: readonly ApplyGuard[]): Promise<{
2911
+ kind: string;
2912
+ }>;
2913
+ writeCompletionJournal(client: TransitionExecutionClient$2, operation: PhysicalOperation, record: TransactionalCompletionRecord): Promise<void>;
2914
+ commit(client: TransitionExecutionClient$2): Promise<void>;
2915
+ rollback(client: TransitionExecutionClient$2): Promise<void>;
2916
+ writeObservedJournal(client: TransitionExecutionClient$2, journal: StepJournal): Promise<void>;
2917
+ isLockTimeout(error: unknown): boolean;
2918
+ };
2919
+
2920
+ type AttachLogicalIdentityPayload = {
2921
+ readonly schema: string;
2922
+ readonly table: string;
2923
+ readonly column?: string;
2924
+ readonly logicalId: string;
2925
+ readonly carrierKind: 'postgresql-side-table';
2926
+ readonly authenticated: false;
2927
+ };
2928
+ type TransitionExecutionClient$1 = {
2929
+ readonly opaqueClient: unknown;
2930
+ };
2931
+ declare function renderAttachLogicalIdentityLockSql(payload: AttachLogicalIdentityPayload): string;
2932
+ declare function renderCreateLogicalIdentitySideTableSql(_schema: string): string;
2933
+ declare function renderCreateLogicalIdentityIndexesSql(_schema: string): readonly string[];
2934
+ declare function renderInsertLogicalIdentitySql(_schema: string): string;
2935
+ declare function beforeAfterFingerprints$1(operation: PhysicalOperation, evidence: readonly EvidenceObservation[], context: ObservationContext): {
2936
+ expectedBefore: FingerprintManifest;
2937
+ expectedAfter: FingerprintManifest;
2938
+ };
2939
+ declare function createAttachLogicalIdentityOperationRuntime(): {
2940
+ artifact: _dbsp_types.SemanticArtifactRef;
2941
+ supportsOperation(operation: PhysicalOperation): boolean;
2942
+ effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
2943
+ buildFingerprints: typeof beforeAfterFingerprints$1;
2944
+ checkout(target: unknown): Promise<TransitionExecutionClient$1>;
2945
+ release(client: TransitionExecutionClient$1, error?: unknown): void;
2946
+ writeIntentJournal(client: TransitionExecutionClient$1, record: DurableIntentRecord): Promise<void>;
2947
+ begin(client: TransitionExecutionClient$1): Promise<void>;
2948
+ setLockTimeout(client: TransitionExecutionClient$1, maxWaitMs: number): Promise<void>;
2949
+ acquireLocks(client: TransitionExecutionClient$1, operation: PhysicalOperation): Promise<void>;
2950
+ observeContext(client: TransitionExecutionClient$1, operation: PhysicalOperation, _proofContext: ObservationContext): Promise<ObservationContext>;
2951
+ observeOperation(client: TransitionExecutionClient$1, operation: PhysicalOperation, context: ObservationContext, phase: "before" | "after", issuer: ObservationIssuer): Promise<{
2952
+ observations: IssuedObservation[];
2953
+ fingerprint: FingerprintManifest;
2954
+ }>;
2955
+ checkGuard(): Promise<{
2956
+ passed: boolean;
2957
+ observations: never[];
2958
+ recovery: never[];
2959
+ }>;
2960
+ executeOperation(client: TransitionExecutionClient$1, operation: PhysicalOperation): Promise<{
2961
+ kind: "completed";
2962
+ }>;
2963
+ writeCompletionJournal(client: TransitionExecutionClient$1, operation: PhysicalOperation, record: TransactionalCompletionRecord): Promise<void>;
2964
+ commit(client: TransitionExecutionClient$1): Promise<void>;
2965
+ rollback(client: TransitionExecutionClient$1): Promise<void>;
2966
+ writeObservedJournal(client: TransitionExecutionClient$1, journal: StepJournal): Promise<void>;
2967
+ isLockTimeout(error: unknown): boolean;
2968
+ };
2969
+
2970
+ type ManualSqlPayload = {
2971
+ readonly statement: UnsafeNativeFragment;
2972
+ readonly blastRadius: readonly ResourceAddress[];
2973
+ readonly preconditions: readonly ExecutableAssertion[];
2974
+ readonly postconditions: readonly ExecutableAssertion[];
2975
+ };
2976
+ type TransitionExecutionClient = {
2977
+ readonly opaqueClient: unknown;
2978
+ };
2979
+ declare function normalizeManualSqlPayload(payload: ManualSqlPayload, context: ObservationContext): ManualSqlPayload;
2980
+ declare function beforeAfterFingerprints(operation: PhysicalOperation, _evidence: readonly EvidenceObservation[], context: ObservationContext): {
2981
+ expectedBefore: FingerprintManifest;
2982
+ expectedAfter: FingerprintManifest;
2983
+ };
2984
+ declare function createManualSqlOperationRuntime(): {
2985
+ artifact: _dbsp_types.SemanticArtifactRef;
2986
+ operationKind: _dbsp_types.OperationKindRef;
2987
+ supportsOperation(operation: PhysicalOperation): boolean;
2988
+ effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
2989
+ buildFingerprints: typeof beforeAfterFingerprints;
2990
+ checkout(target: unknown): Promise<TransitionExecutionClient>;
2991
+ release(client: TransitionExecutionClient, error?: unknown): void;
2992
+ writeIntentJournal(client: TransitionExecutionClient, record: DurableIntentRecord): Promise<void>;
2993
+ begin(client: TransitionExecutionClient): Promise<void>;
2994
+ setLockTimeout(_client: TransitionExecutionClient, _maxWaitMs: number): Promise<void>;
2995
+ acquireLocks(): Promise<void>;
2996
+ observeContext(client: TransitionExecutionClient, _operation: PhysicalOperation, proofContext: ObservationContext): Promise<ObservationContext>;
2997
+ observeOperation(_client: TransitionExecutionClient, operation: PhysicalOperation, context: ObservationContext, phase: "before" | "after"): Promise<{
2998
+ observations: never[];
2999
+ fingerprint: FingerprintManifest;
3000
+ }>;
3001
+ checkGuard(): Promise<{
3002
+ passed: boolean;
3003
+ observations: never[];
3004
+ recovery: never[];
3005
+ }>;
3006
+ executeOperation(client: TransitionExecutionClient, operation: PhysicalOperation, context: ObservationContext): Promise<{
3007
+ kind: "completed";
3008
+ }>;
3009
+ writeCompletionJournal(client: TransitionExecutionClient, operation: PhysicalOperation, record: TransactionalCompletionRecord): Promise<void>;
3010
+ commit(client: TransitionExecutionClient): Promise<void>;
3011
+ rollback(client: TransitionExecutionClient): Promise<void>;
3012
+ writeObservedJournal(client: TransitionExecutionClient, journal: StepJournal): Promise<void>;
3013
+ isLockTimeout(error: unknown): boolean;
3014
+ };
3015
+
3016
+ interface SetNotNullMatch {
3017
+ readonly schema?: string;
3018
+ readonly database?: string;
3019
+ readonly table: string;
3020
+ readonly column: string;
3021
+ readonly expectedColumnShape: SetNotNullColumnShapeExpectation;
3022
+ readonly assumptions?: readonly Assumption[];
3023
+ }
3024
+ interface SetNotNullRuleOptions {
3025
+ readonly naming?: NamingPlugin;
3026
+ }
3027
+ declare function createSetNotNullRule(options?: SetNotNullRuleOptions): TransitionRule<SetNotNullMatch>;
3028
+
3029
+ interface EnumAddValueMatch {
3030
+ readonly schema?: string;
3031
+ readonly database?: string;
3032
+ readonly type: string;
3033
+ readonly label: string;
3034
+ readonly after?: string;
3035
+ readonly expectedBefore: readonly string[];
3036
+ readonly expectedAfter: readonly string[];
3037
+ readonly assumptions?: readonly Assumption[];
3038
+ }
3039
+ interface EnumAddValueRuleOptions {
3040
+ readonly naming?: NamingPlugin;
3041
+ }
3042
+ declare function satisfiesPgEnumLabelVisibleCompositionFact(fact: TransitionCompositionFact, current: ModelIR, _context: ObservationContext): boolean;
3043
+ declare function createEnumAddValueRule(options?: EnumAddValueRuleOptions): TransitionRule<EnumAddValueMatch>;
3044
+
3045
+ interface CreateUniqueIndexConcurrentlyMatch {
3046
+ readonly schema?: string;
3047
+ readonly database?: string;
3048
+ readonly table: string;
3049
+ readonly index: string;
3050
+ readonly columns: readonly string[];
3051
+ readonly assumptions?: readonly Assumption[];
3052
+ }
3053
+
3054
+ type IdentityAdoptionAsserter = Exclude<TrustRoot, {
3055
+ readonly kind: 'pack';
3056
+ }>;
3057
+ interface LogicalIdentityAdoptionMatch {
3058
+ readonly schema?: string;
3059
+ readonly database?: string;
3060
+ readonly table: string;
3061
+ readonly column?: string;
3062
+ readonly logicalId: string;
3063
+ readonly carrierKind: 'postgresql-side-table';
3064
+ readonly authenticated: false;
3065
+ readonly selectionBasis: string;
3066
+ }
3067
+ interface LogicalIdentityAdoptionRuleOptions {
3068
+ readonly naming?: NamingPlugin;
3069
+ readonly asserter?: IdentityAdoptionAsserter;
3070
+ readonly selectionBasis?: string;
3071
+ }
3072
+ declare function createLogicalIdentityAdoptionRule(options?: LogicalIdentityAdoptionRuleOptions): TransitionRule<LogicalIdentityAdoptionMatch>;
3073
+
3074
+ interface AddCheckMatch {
3075
+ readonly schema?: string;
3076
+ readonly database?: string;
3077
+ readonly table: string;
3078
+ readonly constraint: string;
3079
+ readonly expression: string;
3080
+ readonly requiresEnumLabels?: readonly RequiredEnumLabelIR[];
3081
+ readonly assumptions?: readonly Assumption[];
3082
+ }
3083
+
3084
+ interface PgTransitionPackOptions {
3085
+ readonly dbCasing?: DbCasing;
3086
+ readonly naming?: NamingPlugin;
3087
+ readonly identityAdoptionAsserter?: IdentityAdoptionAsserter;
3088
+ readonly identityAdoptionSelectionBasis?: string;
3089
+ }
3090
+ declare function createPgTransitionPack(options?: PgTransitionPackOptions): {
3091
+ rules: (_dbsp_types.TransitionRule<AddCheckMatch> | _dbsp_types.TransitionRule<LogicalIdentityAdoptionMatch> | _dbsp_types.TransitionRule<CreateUniqueIndexConcurrentlyMatch> | _dbsp_types.TransitionRule<EnumAddValueMatch> | _dbsp_types.TransitionRule<SetNotNullMatch>)[];
3092
+ operationSemantics: ({
3093
+ artifact: _dbsp_types.SemanticArtifactRef;
3094
+ supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
3095
+ effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
3096
+ buildFingerprints: (operation: _dbsp_types.PhysicalOperation, evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
3097
+ expectedBefore: _dbsp_types.FingerprintManifest;
3098
+ expectedAfter: _dbsp_types.FingerprintManifest;
3099
+ };
3100
+ checkout(target: unknown): Promise<{
3101
+ readonly opaqueClient: unknown;
3102
+ }>;
3103
+ release(client: {
3104
+ readonly opaqueClient: unknown;
3105
+ }, error?: unknown): void;
3106
+ writeIntentJournal(client: {
3107
+ readonly opaqueClient: unknown;
3108
+ }, record: _dbsp_types.DurableIntentRecord): Promise<void>;
3109
+ begin(client: {
3110
+ readonly opaqueClient: unknown;
3111
+ }): Promise<void>;
3112
+ setLockTimeout(client: {
3113
+ readonly opaqueClient: unknown;
3114
+ }, maxWaitMs: number): Promise<void>;
3115
+ acquireLocks(client: {
3116
+ readonly opaqueClient: unknown;
3117
+ }, operation: _dbsp_types.PhysicalOperation, _effects: _dbsp_types.OperationEffectAssessment, context: _dbsp_types.ObservationContext): Promise<void>;
3118
+ observeContext(client: {
3119
+ readonly opaqueClient: unknown;
3120
+ }, operation: _dbsp_types.PhysicalOperation, _proofContext: _dbsp_types.ObservationContext): Promise<_dbsp_types.ObservationContext>;
3121
+ observeOperation(client: {
3122
+ readonly opaqueClient: unknown;
3123
+ }, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, _phase: "before" | "after", issuer: _dbsp_types.ObservationIssuer): Promise<{
3124
+ observations: _dbsp_types.IssuedObservation[];
3125
+ fingerprint: _dbsp_types.FingerprintManifest;
3126
+ }>;
3127
+ checkGuard(client: {
3128
+ readonly opaqueClient: unknown;
3129
+ }, operation: _dbsp_types.PhysicalOperation, guard: _dbsp_types.ApplyGuard, context: _dbsp_types.ObservationContext): Promise<{
3130
+ passed: boolean;
3131
+ observations: _dbsp_types.AdvisoryObservation[];
3132
+ recovery: readonly _dbsp_types.RecoveryArtefact[];
3133
+ }>;
3134
+ executeOperation(client: {
3135
+ readonly opaqueClient: unknown;
3136
+ }, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, duringGuards?: readonly _dbsp_types.ApplyGuard[]): Promise<{
3137
+ kind: string;
3138
+ }>;
3139
+ writeCompletionJournal(client: {
3140
+ readonly opaqueClient: unknown;
3141
+ }, operation: _dbsp_types.PhysicalOperation, record: _dbsp_types.TransactionalCompletionRecord): Promise<void>;
3142
+ commit(client: {
3143
+ readonly opaqueClient: unknown;
3144
+ }): Promise<void>;
3145
+ rollback(client: {
3146
+ readonly opaqueClient: unknown;
3147
+ }): Promise<void>;
3148
+ writeObservedJournal(client: {
3149
+ readonly opaqueClient: unknown;
3150
+ }, journal: _dbsp_types.StepJournal): Promise<void>;
3151
+ isLockTimeout(error: unknown): boolean;
3152
+ } | {
3153
+ artifact: _dbsp_types.SemanticArtifactRef;
3154
+ operationKind: _dbsp_types.OperationKindRef;
3155
+ supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
3156
+ effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
3157
+ buildFingerprints: (operation: _dbsp_types.PhysicalOperation, evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
3158
+ expectedBefore: _dbsp_types.FingerprintManifest;
3159
+ expectedAfter: _dbsp_types.FingerprintManifest;
3160
+ };
3161
+ checkout(target: unknown): Promise<{
3162
+ readonly opaqueClient: unknown;
3163
+ }>;
3164
+ release(client: {
3165
+ readonly opaqueClient: unknown;
3166
+ }, error?: unknown): void;
3167
+ writeIntentJournal(client: {
3168
+ readonly opaqueClient: unknown;
3169
+ }, record: _dbsp_types.DurableIntentRecord): Promise<void>;
3170
+ begin(client: {
3171
+ readonly opaqueClient: unknown;
3172
+ }): Promise<void>;
3173
+ setLockTimeout(client: {
3174
+ readonly opaqueClient: unknown;
3175
+ }, maxWaitMs: number): Promise<void>;
3176
+ acquireLocks(client: {
3177
+ readonly opaqueClient: unknown;
3178
+ }, operation: _dbsp_types.PhysicalOperation): Promise<void>;
3179
+ observeContext(client: {
3180
+ readonly opaqueClient: unknown;
3181
+ }, operation: _dbsp_types.PhysicalOperation, _proofContext: _dbsp_types.ObservationContext): Promise<_dbsp_types.ObservationContext>;
3182
+ observeOperation(client: {
3183
+ readonly opaqueClient: unknown;
3184
+ }, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, _phase: "before" | "after", issuer: _dbsp_types.ObservationIssuer): Promise<{
3185
+ observations: _dbsp_types.IssuedObservation[];
3186
+ fingerprint: _dbsp_types.FingerprintManifest;
3187
+ }>;
3188
+ checkGuard(client: {
3189
+ readonly opaqueClient: unknown;
3190
+ }, operation: _dbsp_types.PhysicalOperation, guard: _dbsp_types.ApplyGuard, context: _dbsp_types.ObservationContext): Promise<{
3191
+ passed: boolean;
3192
+ observations: _dbsp_types.EvidenceObservation[];
3193
+ recovery: readonly _dbsp_types.RecoveryArtefact[];
3194
+ }>;
3195
+ executeOperation(client: {
3196
+ readonly opaqueClient: unknown;
3197
+ }, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, duringGuards?: readonly _dbsp_types.ApplyGuard[]): Promise<{
3198
+ kind: string;
3199
+ }>;
3200
+ writeCompletionJournal(client: {
3201
+ readonly opaqueClient: unknown;
3202
+ }, operation: _dbsp_types.PhysicalOperation, record: _dbsp_types.TransactionalCompletionRecord): Promise<void>;
3203
+ commit(client: {
3204
+ readonly opaqueClient: unknown;
3205
+ }): Promise<void>;
3206
+ rollback(client: {
3207
+ readonly opaqueClient: unknown;
3208
+ }): Promise<void>;
3209
+ writeObservedJournal(client: {
3210
+ readonly opaqueClient: unknown;
3211
+ }, journal: _dbsp_types.StepJournal): Promise<void>;
3212
+ isLockTimeout(error: unknown): boolean;
3213
+ } | {
3214
+ artifact: _dbsp_types.SemanticArtifactRef;
3215
+ operationKind: _dbsp_types.OperationKindRef;
3216
+ supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
3217
+ effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
3218
+ buildFingerprints: (operation: _dbsp_types.PhysicalOperation, evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
3219
+ expectedBefore: _dbsp_types.FingerprintManifest;
3220
+ expectedAfter: _dbsp_types.FingerprintManifest;
3221
+ };
3222
+ checkout(target: unknown): Promise<{
3223
+ readonly opaqueClient: unknown;
3224
+ }>;
3225
+ release(client: {
3226
+ readonly opaqueClient: unknown;
3227
+ }, error?: unknown): void;
3228
+ writeIntentJournal(client: {
3229
+ readonly opaqueClient: unknown;
3230
+ }, record: _dbsp_types.DurableIntentRecord): Promise<void>;
3231
+ begin(_client: {
3232
+ readonly opaqueClient: unknown;
3233
+ }): Promise<never>;
3234
+ setLockTimeout(_client: {
3235
+ readonly opaqueClient: unknown;
3236
+ }, _maxWaitMs: number): Promise<void>;
3237
+ acquireLocks(): Promise<void>;
3238
+ observeContext(client: {
3239
+ readonly opaqueClient: unknown;
3240
+ }, operation: _dbsp_types.PhysicalOperation, _proofContext: _dbsp_types.ObservationContext): Promise<_dbsp_types.ObservationContext>;
3241
+ observeOperation(client: {
3242
+ readonly opaqueClient: unknown;
3243
+ }, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, phase: "before" | "after", issuer: _dbsp_types.ObservationIssuer): Promise<{
3244
+ observations: _dbsp_types.IssuedObservation[];
3245
+ fingerprint: _dbsp_types.FingerprintManifest;
3246
+ }>;
3247
+ checkGuard(_client: {
3248
+ readonly opaqueClient: unknown;
3249
+ }, _operation: _dbsp_types.PhysicalOperation, guard: _dbsp_types.ApplyGuard): Promise<never>;
3250
+ executeOperation(client: {
3251
+ readonly opaqueClient: unknown;
3252
+ }, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, duringGuards?: readonly _dbsp_types.ApplyGuard[], executionTracker?: _dbsp_core.NonRollbackableExecutionTracker): Promise<{
3253
+ kind: "partially-applied";
3254
+ recovery: _dbsp_types.RecoveryArtefact[];
3255
+ detail: string;
3256
+ } | {
3257
+ kind: string;
3258
+ guard?: never;
3259
+ recovery?: never;
3260
+ nonRollbackableFootprint?: never;
3261
+ } | {
3262
+ kind: string;
3263
+ guard: _dbsp_types.ApplyGuard;
3264
+ recovery: never[];
3265
+ nonRollbackableFootprint: string;
3266
+ }>;
3267
+ writeCompletionJournal(client: {
3268
+ readonly opaqueClient: unknown;
3269
+ }, operation: _dbsp_types.PhysicalOperation, record: _dbsp_types.TransactionalCompletionRecord): Promise<void>;
3270
+ commit(_client: {
3271
+ readonly opaqueClient: unknown;
3272
+ }): Promise<never>;
3273
+ rollback(_client: {
3274
+ readonly opaqueClient: unknown;
3275
+ }): Promise<never>;
3276
+ writeObservedJournal(client: {
3277
+ readonly opaqueClient: unknown;
3278
+ }, journal: _dbsp_types.StepJournal): Promise<void>;
3279
+ isLockTimeout(error: unknown): boolean;
3280
+ })[];
3281
+ issuer: _dbsp_types.ObservationIssuer;
3282
+ executionCoordinator: ExecutionCoordinator;
3283
+ transactionDomain: string;
3284
+ equivalence: _dbsp_types.EquivalenceCapability;
3285
+ capabilityDescriptors: readonly CapabilityDescriptor[];
3286
+ comparatorNameNormalizer: {
3287
+ normalizeCurrentIdentifier: (identifier: string) => string;
3288
+ };
3289
+ compositionFactKinds: string[];
3290
+ satisfiesCompositionFact: typeof satisfiesPgEnumLabelVisibleCompositionFact;
3291
+ };
3292
+
2596
3293
  /**
2597
3294
  * Identifier Validation for adapter-pgsql
2598
3295
  *
@@ -2662,4 +3359,4 @@ declare function sanitizeForDisplay(value: string): string;
2662
3359
  */
2663
3360
  declare function validateSqlExpression(sql: string, context: string): void;
2664
3361
 
2665
- export { type AddedEnumValue, type BatchValuesJoinDecision, CamelCaseNamingPlugin, type CanonicalizeCheckConstraintsOptions, type ChangeKind, CheckConstraintCanonicalizationError, type CheckConstraintCanonicalizationWarning, CheckConstraintNewEnumValueError, type ComparePgsqlDatabaseSchemaOptions, type CompareSchemataOptions, type CompiledResult, type CompilerContext, type CompilerOptions, type CompilerState, type ConflictAction, type ConflictTarget, type CursorHoldOption, type CursorOptions, type CursorScrollOption, DEFAULT_PK_COLUMN, DEFAULT_REDACTION_PATTERNS, type Decision, type DeleteConfig, type DetectedHierarchy, type DiffSummary, type ExplainFormat, type ExplainOptions, type ExplainPlan, ExpressionCanonicalizationUnavailableError, type ExpressionHandler, type FetchDirection, type FetchOptions, type FkColumnDerivation, type GenerateDDLOptions, IdentityNamingPlugin, type IncludeHandler, type IncludeResult, type InsertConfig, type IntrospectedModelIR, type IntrospectionOptions, InvalidIdentifierError, type JoinDecision, type LeafCompileFn, type MigrationRecord, type MigrationSQLOptions, type NamingPlugin, NonConvergentSchemaDiffError, type ParamRefValidationResult, type ParsedMigrationFile, PgsqlAdapter, type PgsqlAdapterOptions, type PgsqlBorrowedClientAdapterOptions, type PgsqlPoolAdapterOptions, PgsqlRawSqlTransactionControlError, PgsqlTransactionAbortedCommitError, PgsqlTransactionAbortedError, PlanCompiler, type PlanDecision, type PrecompiledJoinDecision, type RedactionConfig, type RedactionPattern, type SchemaChange, type SchemaDiff, type SchemaScopeOptions, type SetOperationResult, type SimplifiedPlanReport, type StreamConfig, type UpdateConfig, type UpsertConfig, type WhereDispatcher, type WhereHandler, assertNoRepeatedExpressionSurfaceDrift, bm25Search, booleanSearch, boost, buildCloseCursor, buildDeclareCursor, buildExplain, buildExplainAnalyzeJson, buildExplainPlan, buildExplainVerbose, buildFetch, buildFetchAll, buildFetchFirst, buildFetchForward, buildFetchNext, buildOnConflictClause, buildStreamingStatements, camelCaseNaming, canGenerateCreateIndex, canonicalizeCheckConstraints, collectAndValidateParamRefs, comparePgsqlDatabaseSchema, compareSchemata, compileDelete, compileInsert, compileMutation, compilePlan, compileSetOperation, compileUpdate, compileUpsert, conditionalUpdate, cosineDistance, createAnyExpr, createEqualityExpr, createLeafCompileFn, createParamRef, createPgsqlAdapter, createPgsqlCompileOnlyAdapter, createTypeCastParamRef, defaultFkDerivation, ensureMigrationsTable, excludedRef, generateCreateIndex, generateCursorName, generateDDL, generateDownSQL, generateMigrationFile, generateMigrationSQL, generateSeries, getAppliedMigrations, getNamingPluginForDbCasing, getNextSchemaVersion, getRowEstimates, getTotalExecutionTime, identityNaming, innerProduct, introspect, isBatchValuesJoinDecision, isDestructiveDown, isJoinDecision, isMigrationApplied, isPrecompiledJoinDecision, isReservedKeyword, l2Distance, mapColumnType, mapOnDeleteAction, nextval, parse, parseExplainJson, parseMigrationFile, rawDistance, recordMigration, redactParams, removeMigrationRecord, resolveLogicalName, sanitizeForDisplay, score, validateIdentifier, validateIdentifiers, validateParamRef, validateQualifiedIdentifier, validateSqlExpression, vectorDims, withMigrationLock };
3362
+ export { ADD_CHECK_RULE_ID, ALTER_AUTHORITY_OBSERVATION, ALTER_COLUMN_SET_NOT_NULL_OPERATION_KIND, ALTER_TYPE_ADD_VALUE_OPERATION_KIND, ATTACH_LOGICAL_IDENTITY_OPERATION_KIND, type AddedEnumValue, type AlterColumnSetNotNullPayload, type AlterTypeAddValuePayload, type AttachLogicalIdentityPayload, type BatchValuesJoinDecision, COLUMN_EXISTS_OBSERVATION, CamelCaseNamingPlugin, type CanonicalizeCheckConstraintsOptions, type ChangeKind, CheckConstraintCanonicalizationError, type CheckConstraintCanonicalizationWarning, CheckConstraintNewEnumValueError, type ComparePgsqlDatabaseSchemaOptions, type CompareSchemataOptions, type CompiledResult, type CompilerContext, type CompilerOptions, type CompilerState, type ConflictAction, type ConflictTarget, type CursorHoldOption, type CursorOptions, type CursorScrollOption, DBSP_LOGICAL_IDENTITY_TABLE, DBSP_META_SCHEMA, DBSP_TRANSITION_JOURNAL_TABLE, DBSP_TRANSITION_RUN_TABLE, DEFAULT_PK_COLUMN, DEFAULT_REDACTION_PATTERNS, type Decision, type DeleteConfig, type DetectedHierarchy, type DiffSummary, ENGINE_VERSION_OBSERVATION, ENUM_ADD_VALUE_RULE_ID, ENUM_LABEL_VISIBLE_OBSERVATION, ENUM_TYPE_EXISTS_OBSERVATION, type EnumAddValueMatch, type EnumAddValueRuleOptions, type ExplainFormat, type ExplainOptions, type ExplainPlan, ExpressionCanonicalizationUnavailableError, type ExpressionHandler, type FetchDirection, type FetchOptions, type FkColumnDerivation, type GenerateDDLOptions, type IdentityAdoptionAsserter, IdentityNamingPlugin, type IncludeHandler, type IncludeResult, type IndexCapabilityContext, IndexFeatureUnsupportedError, type IndexRenderSpec, type InsertConfig, type IntrospectedModelIR, type IntrospectionOptions, InvalidIdentifierError, type JoinDecision, LOGICAL_IDENTITY_ADOPTION_RULE_ID, LOGICAL_IDENTITY_CARRIER_OBSERVATION, type LeafCompileFn, type LogicalIdentityAdoptionMatch, type LogicalIdentityAdoptionRuleOptions, MANUAL_SQL_OPERATION_KIND, type ManualSqlPayload, type MigrationRecord, type MigrationSQLOptions, NO_NULLS_GUARD, type NamingPlugin, NonConvergentSchemaDiffError, PG_INTROSPECTION_ARTIFACT, PG_OPERATION_PACK_ARTIFACT, PG_RULE_PACK_ARTIFACT, type ParamRefValidationResult, type ParsedMigrationFile, type PgAdvisoryLockKey, type PgAdvisoryLockResult, type PgTransitionPackOptions, PgsqlAdapter, type PgsqlAdapterOptions, PgsqlAdvisoryLockOptionsError, type PgsqlBorrowedClientAdapterOptions, PgsqlPinnedConnectionAbortSignalError, type PgsqlPoolAdapterOptions, PgsqlRawSqlTransactionControlError, PgsqlTransactionAbortSignalError, PgsqlTransactionAbortedCommitError, PgsqlTransactionAbortedError, PgsqlTransactionOptionsError, PgsqlTransactionTimeoutError, PlanCompiler, type PlanDecision, type PrecompiledJoinDecision, type RedactionConfig, type RedactionPattern, SET_NOT_NULL_RULE_ID, type SchemaChange, type SchemaDiff, type SchemaScopeOptions, type SetNotNullMatch, type SetNotNullRuleOptions, type SetOperationResult, type SimplifiedPlanReport, type StreamConfig, type UpdateConfig, type UpsertConfig, type WhereDispatcher, type WhereHandler, assertCreateIndexSupported, assertCreateIndexesSupported, assertNoRepeatedExpressionSurfaceDrift, bm25Search, booleanSearch, boost, buildCloseCursor, buildDeclareCursor, buildExplain, buildExplainAnalyzeJson, buildExplainPlan, buildExplainVerbose, buildFetch, buildFetchAll, buildFetchFirst, buildFetchForward, buildFetchNext, buildOnConflictClause, buildStreamingStatements, camelCaseNaming, canGenerateCreateIndex, canonicalizeCheckConstraints, collectAndValidateParamRefs, comparePgsqlDatabaseSchema, compareSchemata, compileDelete, compileInsert, compileMutation, compilePlan, compileSetOperation, compileUpdate, compileUpsert, conditionalUpdate, cosineDistance, createAlterColumnSetNotNullOperationRuntime, createAlterTypeAddValueOperationRuntime, createAnyExpr, createAttachLogicalIdentityOperationRuntime, createEnumAddValueRule, createEqualityExpr, createLeafCompileFn, createLogicalIdentityAdoptionRule, createManualSqlOperationRuntime, createParamRef, createPgObservationIssuer, createPgTransitionPack, createPgsqlAdapter, createPgsqlCompileOnlyAdapter, createSetNotNullRule, createTypeCastParamRef, defaultFkDerivation, derivePostgresqlCapabilitiesForVersion, ensureMigrationsTable, ensureTransitionJournal, excludedRef, generateCreateIndex, generateCursorName, generateDDL, generateDownSQL, generateMigrationFile, generateMigrationSQL, generateSeries, getAppliedMigrations, getNamingPluginForDbCasing, getNextSchemaVersion, getRowEstimates, getTotalExecutionTime, identityNaming, innerProduct, introspect, isBatchValuesJoinDecision, isDestructiveDown, isJoinDecision, isMigrationApplied, isPrecompiledJoinDecision, isReservedKeyword, l2Distance, mapColumnType, mapOnDeleteAction, nextval, normalizeManualSqlPayload, parse, parseExplainJson, parseMigrationFile, rawDistance, readPgObservationContext, readTransitionJournal, recordMigration, redactParams, removeMigrationRecord, renderAlterColumnSetNotNullSql, renderAlterTypeAddValueSql, renderAttachLogicalIdentityLockSql, renderCreateDbspMetaSchemaSql, renderCreateIndex, renderCreateLogicalIdentityIndexesSql, renderCreateLogicalIdentitySideTableSql, renderCreateTransitionJournalTableSql, renderCreateTransitionRunTableSql, renderInsertLogicalIdentitySql, renderNoNullsCheckSql, renderSetNotNullLockSql, resolveLogicalName, sanitizeForDisplay, score, validateIdentifier, validateIdentifiers, validateParamRef, validateQualifiedIdentifier, validateSqlExpression, vectorDims, withMigrationLock };