@dbsp/adapter-pgsql 3.1.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
@@ -2,7 +2,7 @@ import * as _dbsp_core from '@dbsp/core';
2
2
  import { IndexInfo, TruncateOptions, VacuumOptions, AlterColumnOptions, CreateIndexOptions, DropIndexOptions, ExpressionRef, ModelIR as ModelIR$1, ExecutionCoordinator, CapabilityDescriptor } from '@dbsp/core';
3
3
  export { normalizeSQL } from '@dbsp/core';
4
4
  import * as _dbsp_types 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, 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
+ 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';
6
6
  import * as _pgsql_types from '@pgsql/types';
7
7
  import { Node, OnConflictClause, ParamRef } from '@pgsql/types';
8
8
  import { Pool, PoolClient } from 'pg';
@@ -877,6 +877,8 @@ interface IntrospectedModelIR extends ModelIR {
877
877
  */
878
878
  declare function introspect(pool: Pool, options?: IntrospectionOptions): Promise<IntrospectedModelIR>;
879
879
 
880
+ type PgsqlTransactionTimeoutParameter = 'lock_timeout' | 'statement_timeout';
881
+
880
882
  /**
881
883
  * PgsqlAdapter - Implements the Adapter interface for PostgreSQL using native pg driver.
882
884
  *
@@ -886,6 +888,16 @@ declare function introspect(pool: Pool, options?: IntrospectionOptions): Promise
886
888
  * @module pgsql-adapter
887
889
  */
888
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
+ };
889
901
  declare class PgsqlRawSqlTransactionControlError extends Error {
890
902
  readonly dbspRawSqlTransactionControl = true;
891
903
  constructor(cause: unknown);
@@ -898,6 +910,48 @@ declare class PgsqlTransactionAbortedError extends Error {
898
910
  readonly dbspTransactionAborted = true;
899
911
  constructor(cause: unknown);
900
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
+ }
901
955
  /**
902
956
  * Options for PgsqlAdapter.
903
957
  */
@@ -974,6 +1028,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
974
1028
  private readonly borrowedClient;
975
1029
  private readonly managedTransactions;
976
1030
  private readonly adapterManagedTransaction;
1031
+ private readonly adapterManagedPinnedConnection;
977
1032
  private readonly scopeToken;
978
1033
  private readonly scopeState;
979
1034
  private readonly schemaName;
@@ -1132,6 +1187,15 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1132
1187
  * Results are transformed to use model naming convention (e.g., snake_case → camelCase)
1133
1188
  */
1134
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
+ }>;
1135
1199
  /**
1136
1200
  * Transform result rows from database naming to model naming convention.
1137
1201
  * For CamelCaseNamingPlugin: price_cents → priceCents
@@ -1181,6 +1245,31 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1181
1245
  * ```
1182
1246
  */
1183
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;
1184
1273
  /**
1185
1274
  * Execute a callback within a database transaction.
1186
1275
  *
@@ -1210,7 +1299,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1210
1299
  * and hand dbsp a `borrowedClient` **without** `managedTransactions`. dbsp will then
1211
1300
  * contain its own statements inside *your* transaction instead of the other way round.
1212
1301
  */
1213
- transaction<T>(fn: (adapter: Adapter<DB>) => Promise<T>): Promise<T>;
1302
+ transaction<T>(fn: (adapter: Adapter<DB>) => Promise<T>, options?: TransactionOptions): Promise<T>;
1214
1303
  /**
1215
1304
  * Execute scratch PostgreSQL work in a scope that always rolls back on success.
1216
1305
  *
@@ -1222,12 +1311,16 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1222
1311
  */
1223
1312
  withScratchScope<T>(fn: (adapter: PgsqlAdapter<DB>) => Promise<T>): Promise<T>;
1224
1313
  private createManagedClientAdapter;
1314
+ private createPinnedConnectionAdapter;
1225
1315
  private createChildTransactionObserver;
1226
1316
  private observeChildTransaction;
1227
1317
  private markChildTransactionObserved;
1228
1318
  private refreshScopeChildrenFailure;
1229
1319
  private transactionWithManagedClient;
1230
1320
  private transactionWithManagedClientSavepointScope;
1321
+ private applyTransactionTimeouts;
1322
+ private captureAndApplySavepointTimeouts;
1323
+ private restoreSavepointTimeouts;
1231
1324
  private transactionWithClientTransaction;
1232
1325
  private releaseClient;
1233
1326
  private rollbackAndReleaseSavepoint;
@@ -1239,9 +1332,11 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1239
1332
  private classifySavepointReleaseFailure;
1240
1333
  private rollbackSavepointAfterReleaseFailure;
1241
1334
  private enterTransactionScope;
1335
+ private enterPinnedConnectionScope;
1242
1336
  private enterSavepointScope;
1243
1337
  private pushClientScope;
1244
1338
  private currentClientScope;
1339
+ private managedScopeEndedMessage;
1245
1340
  private assertCanUseClient;
1246
1341
  private assertUsableScopeAncestors;
1247
1342
  private findClientScope;
@@ -1306,6 +1401,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1306
1401
  */
1307
1402
  get inTransaction(): boolean;
1308
1403
  private adapterManagedScopeIsLive;
1404
+ private shouldProtectBorrowedClientTransaction;
1309
1405
  private executeQueryProtectingOpenTransaction;
1310
1406
  private executeConnectionStatement;
1311
1407
  private executeConnectionStatementUnlocked;
@@ -1355,27 +1451,27 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
1355
1451
  * Generate SQL for TRUNCATE TABLE.
1356
1452
  * Implements TableDDLGeneratorAdapter.generateTruncate.
1357
1453
  */
1358
- generateTruncate(table: string, schema?: string, options?: TruncateOptions): string;
1454
+ generateTruncate(table: string, schemaName: string, options?: TruncateOptions): string;
1359
1455
  /**
1360
1456
  * Generate SQL for VACUUM.
1361
1457
  * Implements TableDDLGeneratorAdapter.generateVacuum.
1362
1458
  */
1363
- generateVacuum(table: string, schema?: string, options?: VacuumOptions): string;
1459
+ generateVacuum(table: string, schemaName: string, options?: VacuumOptions): string;
1364
1460
  /**
1365
1461
  * Generate SQL for ALTER TABLE ... ALTER COLUMN.
1366
1462
  * Implements TableDDLGeneratorAdapter.generateAlterColumn.
1367
1463
  */
1368
- generateAlterColumn(table: string, column: string, options: AlterColumnOptions, schema?: string): string;
1464
+ generateAlterColumn(table: string, schemaName: string, column: string, options: AlterColumnOptions): string;
1369
1465
  /**
1370
1466
  * Generate SQL for CREATE INDEX.
1371
1467
  * Implements TableDDLGeneratorAdapter.generateCreateIndex.
1372
1468
  */
1373
- generateCreateIndex(table: string, options: CreateIndexOptions, schema?: string): string;
1469
+ generateCreateIndex(table: string, schemaName: string, options: CreateIndexOptions): string;
1374
1470
  /**
1375
1471
  * Generate SQL for DROP INDEX.
1376
1472
  * Implements TableDDLGeneratorAdapter.generateDropIndex.
1377
1473
  */
1378
- generateDropIndex(name: string, options?: DropIndexOptions): string;
1474
+ generateDropIndex(name: string, schemaName: string, options?: DropIndexOptions): string;
1379
1475
  /**
1380
1476
  * Validate an identifier (table name, column name, schema name).
1381
1477
  */
@@ -1694,9 +1790,12 @@ interface MigrationRecord {
1694
1790
  readonly destructive: boolean;
1695
1791
  }
1696
1792
  /**
1697
- * Execute a callback under an advisory lock using a dedicated client.
1793
+ * Execute a callback under the migration advisory lock using a pinned client.
1698
1794
  * The lock is held for the duration of the callback.
1699
- * 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.
1700
1799
  */
1701
1800
  declare function withMigrationLock<T>(pool: Pool, fn: (client: PoolClient) => Promise<T>): Promise<T>;
1702
1801
  /**
@@ -3260,4 +3359,4 @@ declare function sanitizeForDisplay(value: string): string;
3260
3359
  */
3261
3360
  declare function validateSqlExpression(sql: string, context: string): void;
3262
3361
 
3263
- 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 PgTransitionPackOptions, PgsqlAdapter, type PgsqlAdapterOptions, type PgsqlBorrowedClientAdapterOptions, type PgsqlPoolAdapterOptions, PgsqlRawSqlTransactionControlError, PgsqlTransactionAbortedCommitError, PgsqlTransactionAbortedError, 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 };
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 };