@dbsp/adapter-pgsql 3.3.0 → 3.4.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/README.md +3 -1
- package/dist/index.d.ts +313 -85
- package/dist/index.js +2985 -1407
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
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
|
+
import { IndexInfo, TruncateOptions, VacuumOptions, AlterColumnOptions, CreateIndexOptions, DropIndexOptions, ExpressionRef, ModelIR as ModelIR$1, TransitionRunPersister, 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, PinnedConnectionOptions, TransactionOptions,
|
|
5
|
+
import { DialectCapabilities, ModelIR, ColumnListInput, ParamIntent, JsonAggOrderByEntry, IndexIR, HierarchyIR, Adapter, DbCasing, AdapterLogger, AdapterCapabilities, ConnectionAvailability, PlanReport, CompiledNqlQuery, CompileOptions, CompiledQuery, CompileResultWithIncludes, SubqueryIncludeInfo, ExpressionIntent, InsertIntent, InsertFromIntent, UpdateIntent, BatchUpdateIntent, DeleteIntent, UpsertIntent, UpsertFromIntent, RecursivePlanReport, CteQueryIntent, SetOperationIntent, DumpMeta, Dump, AdapterStreamOptions, PinnedConnectionOptions, TransactionOptions, ColumnIR, MutationReturningItem, WhereIntent, OutputDescriptor, QueryIntent, OperationKindRef, SemanticArtifactRef, ProvenPlanShape, PostgreSqlObservationTargetIdentity, ExecutionContract, TransitionSessionClient, TransitionRunJournal, TransitionLessor, ObservationIssuer, ObservationRequest, ObservationContext, EvidenceObservation, TypeRef, ExpressionValue, CollationRef, LogicalIdentity, PhysicalOperation, OperationEffectAssessment, 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';
|
|
@@ -888,6 +888,11 @@ type PgsqlTransactionTimeoutParameter = 'lock_timeout' | 'statement_timeout';
|
|
|
888
888
|
* @module pgsql-adapter
|
|
889
889
|
*/
|
|
890
890
|
|
|
891
|
+
declare const rollbackOnlyPgsqlScopeBrand: unique symbol;
|
|
892
|
+
/** A scope minted by withScratchScope and guaranteed to roll back on success. */
|
|
893
|
+
type RollbackOnlyPgsqlScope<DB = unknown> = PgsqlAdapter<DB> & {
|
|
894
|
+
readonly [rollbackOnlyPgsqlScopeBrand]: typeof rollbackOnlyPgsqlScopeBrand;
|
|
895
|
+
};
|
|
891
896
|
type PgAdvisoryLockKey = bigint | {
|
|
892
897
|
readonly classId: number;
|
|
893
898
|
readonly objId: number;
|
|
@@ -1029,6 +1034,7 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
|
|
|
1029
1034
|
private readonly managedTransactions;
|
|
1030
1035
|
private readonly adapterManagedTransaction;
|
|
1031
1036
|
private readonly adapterManagedPinnedConnection;
|
|
1037
|
+
private readonly rollbackOnlyScope;
|
|
1032
1038
|
private readonly scopeToken;
|
|
1033
1039
|
private readonly scopeState;
|
|
1034
1040
|
private readonly schemaName;
|
|
@@ -1072,11 +1078,13 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
|
|
|
1072
1078
|
private compileNqlBundleLeafEnvelope;
|
|
1073
1079
|
private compileNqlBundle;
|
|
1074
1080
|
/**
|
|
1075
|
-
* Returns the pool/client executor, or
|
|
1081
|
+
* Returns the pool/client executor, or refuses a connectionless adapter.
|
|
1076
1082
|
*/
|
|
1077
1083
|
private requireConnection;
|
|
1078
1084
|
/** Adapter capabilities for feature detection */
|
|
1079
1085
|
get capabilities(): AdapterCapabilities;
|
|
1086
|
+
/** Per-instance connection state, distinct from PostgreSQL capabilities. */
|
|
1087
|
+
get connectionAvailability(): ConnectionAvailability;
|
|
1080
1088
|
/** PostgreSQL dialect capabilities for planner strategy selection */
|
|
1081
1089
|
get dialectCapabilities(): DialectCapabilities;
|
|
1082
1090
|
/**
|
|
@@ -1304,12 +1312,16 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
|
|
|
1304
1312
|
* Execute scratch PostgreSQL work in a scope that always rolls back on success.
|
|
1305
1313
|
*
|
|
1306
1314
|
* This is intentionally PostgreSQL-adapter-specific. It is used for catalog
|
|
1307
|
-
* shaped scratch DDL such as
|
|
1308
|
-
*
|
|
1315
|
+
* shaped scratch DDL such as expression canonicalisation, where the caller
|
|
1316
|
+
* needs PostgreSQL's rendering but must not keep the scratch objects. This
|
|
1317
|
+
* scope has exactly one successful exit: rollback. In a caller transaction,
|
|
1318
|
+
* only this outer savepoint is retained after rollback; nested work releases
|
|
1319
|
+
* normally, so a large canonicalisation run cannot retain one subtransaction
|
|
1320
|
+
* per expression.
|
|
1309
1321
|
* Rollback here is cleanup of dbsp-created work, not a sandbox for arbitrary
|
|
1310
1322
|
* session effects.
|
|
1311
1323
|
*/
|
|
1312
|
-
withScratchScope<T>(fn: (adapter:
|
|
1324
|
+
withScratchScope<T>(fn: (adapter: RollbackOnlyPgsqlScope<DB>) => Promise<T>): Promise<T>;
|
|
1313
1325
|
private createManagedClientAdapter;
|
|
1314
1326
|
private createPinnedConnectionAdapter;
|
|
1315
1327
|
private createChildTransactionObserver;
|
|
@@ -1499,10 +1511,11 @@ declare class PgsqlAdapter<DB = unknown> implements Adapter<DB> {
|
|
|
1499
1511
|
declare function createPgsqlAdapter<DB = unknown>(pool: Pool, options?: PgsqlPoolAdapterOptions): PgsqlAdapter<DB>;
|
|
1500
1512
|
declare function createPgsqlAdapter<DB = unknown>(client: PoolClient, options: PgsqlBorrowedClientAdapterOptions): PgsqlAdapter<DB>;
|
|
1501
1513
|
/**
|
|
1502
|
-
* Creates a
|
|
1514
|
+
* Creates a connectionless PgsqlAdapter for SQL generation without a database connection.
|
|
1503
1515
|
*
|
|
1504
1516
|
* All compilation methods (compile, compileInsert, etc.), createDump(), and generateDDL()
|
|
1505
|
-
* work normally.
|
|
1517
|
+
* work normally. The adapter has the full PgsqlAdapter surface; database operations refuse
|
|
1518
|
+
* at runtime until it is constructed with a connection via createPgsqlAdapter(pool).
|
|
1506
1519
|
*
|
|
1507
1520
|
* @example
|
|
1508
1521
|
* ```typescript
|
|
@@ -1515,7 +1528,57 @@ declare function createPgsqlAdapter<DB = unknown>(client: PoolClient, options: P
|
|
|
1515
1528
|
* console.log(dump.sql);
|
|
1516
1529
|
* ```
|
|
1517
1530
|
*/
|
|
1518
|
-
declare function createPgsqlCompileOnlyAdapter<DB = unknown>(options?: PgsqlAdapterOptions):
|
|
1531
|
+
declare function createPgsqlCompileOnlyAdapter<DB = unknown>(options?: PgsqlAdapterOptions): PgsqlAdapter<DB>;
|
|
1532
|
+
|
|
1533
|
+
interface CheckConstraintCanonicalizationWarning {
|
|
1534
|
+
readonly table: string;
|
|
1535
|
+
readonly kind: 'check_constraint';
|
|
1536
|
+
readonly name: string;
|
|
1537
|
+
readonly constraint: string;
|
|
1538
|
+
readonly message: string;
|
|
1539
|
+
readonly cause: unknown;
|
|
1540
|
+
}
|
|
1541
|
+
interface ColumnDefaultCanonicalizationWarning {
|
|
1542
|
+
readonly table: string;
|
|
1543
|
+
readonly kind: 'column_default';
|
|
1544
|
+
readonly name: string;
|
|
1545
|
+
readonly message: string;
|
|
1546
|
+
readonly cause: unknown;
|
|
1547
|
+
readonly outcome?: 'unavailable' | 'rejected' | 'refused';
|
|
1548
|
+
/** Whether this warning represents a raw fallback or absent counterpart. */
|
|
1549
|
+
readonly comparison: 'raw' | 'unpaired';
|
|
1550
|
+
/** Present when the default could not be paired with the opposite model side. */
|
|
1551
|
+
readonly side?: 'desired' | 'database';
|
|
1552
|
+
}
|
|
1553
|
+
type ExpressionCanonicalizationWarning = CheckConstraintCanonicalizationWarning | ColumnDefaultCanonicalizationWarning;
|
|
1554
|
+
interface CanonicalizeCheckConstraintsOptions {
|
|
1555
|
+
/** Database schema that owns the target tables and target-scoped enum types. */
|
|
1556
|
+
readonly schemaName?: string;
|
|
1557
|
+
/** Naming convention used when matching desired table names to DB table names. */
|
|
1558
|
+
readonly dbCasing?: DbCasing;
|
|
1559
|
+
/** Called when PostgreSQL CHECK canonicalisation fails and raw comparison is used. */
|
|
1560
|
+
readonly onWarning?: (warning: CheckConstraintCanonicalizationWarning) => void;
|
|
1561
|
+
/** Throw instead of falling back to raw comparison when canonicalisation fails. */
|
|
1562
|
+
readonly requireCanonicalization?: boolean;
|
|
1563
|
+
/** Skip CHECK scratch work when the caller's dialect does not support CHECK DDL. */
|
|
1564
|
+
readonly canonicalizeCheckConstraints?: boolean;
|
|
1565
|
+
}
|
|
1566
|
+
declare class CheckConstraintCanonicalizationError extends Error {
|
|
1567
|
+
readonly table: string;
|
|
1568
|
+
readonly constraints: readonly string[];
|
|
1569
|
+
readonly cause: unknown;
|
|
1570
|
+
constructor(table: string, constraints: readonly string[], cause: unknown);
|
|
1571
|
+
}
|
|
1572
|
+
declare class ColumnDefaultCanonicalizationError extends Error {
|
|
1573
|
+
readonly table: string;
|
|
1574
|
+
readonly column: string;
|
|
1575
|
+
readonly cause: unknown;
|
|
1576
|
+
constructor(table: string, column: string, cause: unknown);
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Canonicalise PostgreSQL CHECK constraint expressions in a desired model.
|
|
1580
|
+
*/
|
|
1581
|
+
declare function canonicalizeCheckConstraints(adapter: RollbackOnlyPgsqlScope, desired: ModelIR, dbModel: ModelIR, options?: CanonicalizeCheckConstraintsOptions): Promise<ModelIR>;
|
|
1519
1582
|
|
|
1520
1583
|
/**
|
|
1521
1584
|
* Schema Comparison Engine (DDL-PROV Block 1)
|
|
@@ -1586,13 +1649,16 @@ interface CompareSchemataOptions {
|
|
|
1586
1649
|
*
|
|
1587
1650
|
* `compareSchemata()` is intentionally pure and cannot ask PostgreSQL to
|
|
1588
1651
|
* canonicalise raw-SQL expression surfaces. By default it keeps the historic
|
|
1589
|
-
* best-effort
|
|
1590
|
-
* predicates, and index expressions. Set this flag to throw when either model
|
|
1652
|
+
* best-effort verbatim comparison for column defaults, CHECK expressions,
|
|
1653
|
+
* partial-index predicates, and index expressions. Set this flag to throw when either model
|
|
1591
1654
|
* contains one of those surfaces so a caller cannot accidentally rely on a
|
|
1592
1655
|
* compile-only diff for a convergence-sensitive check.
|
|
1593
1656
|
*
|
|
1594
1657
|
* Live PostgreSQL callers should use `comparePgsqlDatabaseSchema()`, which
|
|
1595
|
-
* canonicalises CHECK constraint expressions before calling this function.
|
|
1658
|
+
* canonicalises CHECK constraint expressions and column defaults before calling this function.
|
|
1659
|
+
* Under that live mode, every default surface considered under this option is
|
|
1660
|
+
* either canonicalised as a pair or explicitly refused. This does not prove
|
|
1661
|
+
* that the resulting migration is executable.
|
|
1596
1662
|
* Partial-index predicates and index expressions are not canonicalised by the
|
|
1597
1663
|
* live helper and are rejected there when this strict flag is set.
|
|
1598
1664
|
*/
|
|
@@ -1614,36 +1680,44 @@ declare function compareSchemata(schema: ModelIR, db: ModelIR, options?: Compare
|
|
|
1614
1680
|
|
|
1615
1681
|
interface ComparePgsqlDatabaseSchemaOptions extends CompareSchemataOptions, SchemaScopeOptions {
|
|
1616
1682
|
/**
|
|
1617
|
-
* Whether to canonicalise PostgreSQL CHECK constraint expressions before
|
|
1683
|
+
* Whether to canonicalise PostgreSQL CHECK constraint expressions and column defaults before
|
|
1618
1684
|
* comparing. Defaults to `true`. Set to `false` only for compatibility with
|
|
1619
1685
|
* legacy raw-string live diffs.
|
|
1620
1686
|
*
|
|
1621
|
-
* Live canonicalisation creates temporary scratch tables
|
|
1622
|
-
*
|
|
1623
|
-
*
|
|
1624
|
-
*
|
|
1625
|
-
*
|
|
1626
|
-
* falls back to best-effort raw string comparison for the affected CHECK
|
|
1627
|
-
* constraints.
|
|
1687
|
+
* Live canonicalisation creates temporary scratch tables inside an adapter
|
|
1688
|
+
* scratch scope whose successful cleanup is rollback. The database role needs
|
|
1689
|
+
* permission to create temporary tables and use the scratch column types. If
|
|
1690
|
+
* PostgreSQL refuses that scratch DDL, non-strict mode warns and falls back to
|
|
1691
|
+
* best-effort raw string comparison for the affected expression surfaces.
|
|
1628
1692
|
*/
|
|
1629
1693
|
readonly canonicalizeExpressions?: boolean;
|
|
1630
1694
|
/**
|
|
1631
|
-
* Receives live
|
|
1695
|
+
* Receives live expression canonicalisation warnings. Defaults to console.warn.
|
|
1632
1696
|
*/
|
|
1633
1697
|
readonly onWarning?: (message: string) => void;
|
|
1698
|
+
/** Receives the identity-bearing canonicalisation warning before its string form. */
|
|
1699
|
+
readonly onExpressionCanonicalizationWarning?: (warning: ExpressionCanonicalizationWarning) => void;
|
|
1634
1700
|
/**
|
|
1635
1701
|
* Diff that the caller just applied before this live re-diff. Used only when
|
|
1636
|
-
* CHECK expressions are compared by raw text to fail loudly if the exact same
|
|
1702
|
+
* CHECK expressions or column defaults are compared by raw text to fail loudly if the exact same
|
|
1637
1703
|
* expression-surface drift appears again after re-introspection.
|
|
1638
1704
|
*/
|
|
1639
1705
|
readonly previouslyAppliedDiff?: SchemaDiff;
|
|
1640
1706
|
}
|
|
1641
|
-
|
|
1707
|
+
type NonConvergentSchemaDiffSurface = {
|
|
1708
|
+
readonly kind: 'check_constraint';
|
|
1642
1709
|
readonly table: string;
|
|
1643
1710
|
readonly constraint: string;
|
|
1644
|
-
|
|
1645
|
-
readonly
|
|
1646
|
-
|
|
1711
|
+
} | {
|
|
1712
|
+
readonly kind: 'column_default';
|
|
1713
|
+
readonly table: string;
|
|
1714
|
+
readonly column: string;
|
|
1715
|
+
};
|
|
1716
|
+
declare class NonConvergentSchemaDiffError extends Error {
|
|
1717
|
+
readonly surface: NonConvergentSchemaDiffSurface;
|
|
1718
|
+
readonly desiredExpressionHash: string;
|
|
1719
|
+
readonly databaseExpressionHash: string;
|
|
1720
|
+
constructor(surface: NonConvergentSchemaDiffSurface, desiredExpressionHash: string, databaseExpressionHash: string);
|
|
1647
1721
|
}
|
|
1648
1722
|
/** An enum value this diff adds, reported as a candidate cause — never asserted. */
|
|
1649
1723
|
interface AddedEnumValue {
|
|
@@ -1654,11 +1728,12 @@ declare class CheckConstraintNewEnumValueError extends Error {
|
|
|
1654
1728
|
readonly table: string;
|
|
1655
1729
|
readonly constraint: string;
|
|
1656
1730
|
readonly addedEnumValues: readonly AddedEnumValue[];
|
|
1657
|
-
|
|
1731
|
+
readonly surfaceKind: 'CHECK constraint' | 'column default';
|
|
1732
|
+
constructor(table: string, constraint: string, addedEnumValues: readonly AddedEnumValue[], surfaceKind?: 'CHECK constraint' | 'column default');
|
|
1658
1733
|
}
|
|
1659
1734
|
/**
|
|
1660
1735
|
* Live PostgreSQL schema diff: introspect, canonicalise desired CHECK
|
|
1661
|
-
* constraint expressions through PostgreSQL, then call the pure synchronous
|
|
1736
|
+
* constraint expressions and column defaults through PostgreSQL, then call the pure synchronous
|
|
1662
1737
|
* schema comparator.
|
|
1663
1738
|
*
|
|
1664
1739
|
* If CHECK canonicalisation falls back while the same diff adds a plausibly
|
|
@@ -1673,7 +1748,7 @@ declare class CheckConstraintNewEnumValueError extends Error {
|
|
|
1673
1748
|
* diffs reject them.
|
|
1674
1749
|
*/
|
|
1675
1750
|
declare function comparePgsqlDatabaseSchema(adapter: PgsqlAdapter, desired: ModelIR, options?: ComparePgsqlDatabaseSchemaOptions): Promise<SchemaDiff>;
|
|
1676
|
-
declare function assertNoRepeatedExpressionSurfaceDrift(previouslyAppliedDiff: SchemaDiff, currentDiff: SchemaDiff,
|
|
1751
|
+
declare function assertNoRepeatedExpressionSurfaceDrift(previouslyAppliedDiff: SchemaDiff, currentDiff: SchemaDiff, rawExpressionSurfaces?: ReadonlySet<string>): void;
|
|
1677
1752
|
|
|
1678
1753
|
/**
|
|
1679
1754
|
* Migration SQL Generator (DDL-PROV Block 1)
|
|
@@ -1965,59 +2040,6 @@ declare function getRowEstimates(plans: ExplainPlan[]): {
|
|
|
1965
2040
|
actual: number;
|
|
1966
2041
|
};
|
|
1967
2042
|
|
|
1968
|
-
interface CheckConstraintCanonicalizationWarning {
|
|
1969
|
-
readonly table: string;
|
|
1970
|
-
readonly constraint: string;
|
|
1971
|
-
readonly message: string;
|
|
1972
|
-
readonly cause: unknown;
|
|
1973
|
-
}
|
|
1974
|
-
interface CanonicalizeCheckConstraintsOptions {
|
|
1975
|
-
/** Database schema that owns the target tables and target-scoped enum types. */
|
|
1976
|
-
readonly schemaName?: string;
|
|
1977
|
-
/** Naming convention used when matching desired table names to DB table names. */
|
|
1978
|
-
readonly dbCasing?: DbCasing;
|
|
1979
|
-
/** Called when PostgreSQL CHECK canonicalisation fails and raw comparison is used. */
|
|
1980
|
-
readonly onWarning?: (warning: CheckConstraintCanonicalizationWarning) => void;
|
|
1981
|
-
/** Throw instead of falling back to raw comparison when canonicalisation fails. */
|
|
1982
|
-
readonly requireCanonicalization?: boolean;
|
|
1983
|
-
}
|
|
1984
|
-
type PgsqlCanonicalizationScope = Pick<Adapter, 'executeRaw' | 'transaction'>;
|
|
1985
|
-
declare class CheckConstraintCanonicalizationError extends Error {
|
|
1986
|
-
readonly table: string;
|
|
1987
|
-
readonly constraints: readonly string[];
|
|
1988
|
-
readonly cause: unknown;
|
|
1989
|
-
constructor(table: string, constraints: readonly string[], cause: unknown);
|
|
1990
|
-
}
|
|
1991
|
-
/**
|
|
1992
|
-
* Canonicalise PostgreSQL CHECK constraint expressions in a desired model.
|
|
1993
|
-
*
|
|
1994
|
-
* CHECK constraints are canonicalised by creating a transaction-local temp table
|
|
1995
|
-
* with the desired table's column definitions (borrowing live database type
|
|
1996
|
-
* detail for existing columns when the desired model omits it), adding the
|
|
1997
|
-
* authored CHECK constraints to that temp table, and reading PostgreSQL's
|
|
1998
|
-
* `pg_get_constraintdef()` rendering. The caller must provide a rollback-only
|
|
1999
|
-
* scratch scope; that rollback is cleanup for dbsp-created scratch objects, not
|
|
2000
|
-
* a sandbox for arbitrary session effects.
|
|
2001
|
-
* Missing desired enum types are also created inside that scratch scope before
|
|
2002
|
-
* scratch tables.
|
|
2003
|
-
* Scratch columns include only names and types; defaults, identity, uniqueness,
|
|
2004
|
-
* nullability, and other table-shape clauses are deliberately omitted.
|
|
2005
|
-
*
|
|
2006
|
-
* The returned expression is the full `CHECK (...)` clause. Bare authored
|
|
2007
|
-
* predicates are accepted and become full CHECK clauses.
|
|
2008
|
-
*
|
|
2009
|
-
* PostgreSQL does not allow an enum value added by `ALTER TYPE ... ADD VALUE`
|
|
2010
|
-
* to be used in the same transaction that added it. Because dbsp currently
|
|
2011
|
-
* emits and applies each migration in one transaction, the live diff layer
|
|
2012
|
-
* deliberately refuses CHECK constraints that fall back while the same diff adds
|
|
2013
|
-
* a plausibly referenced enum value. Splitting that into multiple transaction
|
|
2014
|
-
* phases is a separate migration-runner feature.
|
|
2015
|
-
*
|
|
2016
|
-
* This does not canonicalise partial-index predicates or index expressions, so
|
|
2017
|
-
* those surfaces may still compare by raw text in non-strict diffs.
|
|
2018
|
-
*/
|
|
2019
|
-
declare function canonicalizeCheckConstraints(adapter: PgsqlCanonicalizationScope, desired: ModelIR, dbModel: ModelIR, options?: CanonicalizeCheckConstraintsOptions): Promise<ModelIR>;
|
|
2020
|
-
|
|
2021
2043
|
/**
|
|
2022
2044
|
* ParadeDB Extension Wrappers
|
|
2023
2045
|
*
|
|
@@ -2759,6 +2781,7 @@ declare const ENUM_ADD_VALUE_RULE_ID = "postgresql.enum.add-value";
|
|
|
2759
2781
|
declare const LOGICAL_IDENTITY_ADOPTION_RULE_ID = "postgresql.logical-identity.adopt";
|
|
2760
2782
|
declare const DBSP_META_SCHEMA = "dbsp_meta";
|
|
2761
2783
|
declare const DBSP_TRANSITION_RUN_TABLE = "dbsp_transition_run";
|
|
2784
|
+
declare const DBSP_TRANSITION_RUN_PLAN_TABLE = "dbsp_transition_run_plan";
|
|
2762
2785
|
declare const DBSP_TRANSITION_JOURNAL_TABLE = "dbsp_transition_journal";
|
|
2763
2786
|
declare const DBSP_LOGICAL_IDENTITY_TABLE = "dbsp_logical_identity";
|
|
2764
2787
|
declare const COLUMN_EXISTS_OBSERVATION = "postgresql.column.exists";
|
|
@@ -2769,6 +2792,40 @@ declare const ENGINE_VERSION_OBSERVATION = "postgresql.engine.version-supported"
|
|
|
2769
2792
|
declare const LOGICAL_IDENTITY_CARRIER_OBSERVATION = "postgresql.logical-identity.carrier-state";
|
|
2770
2793
|
declare const NO_NULLS_GUARD = "NO_NULLS";
|
|
2771
2794
|
|
|
2795
|
+
/**
|
|
2796
|
+
* A proven operation may still be ineligible for a durable execution contract
|
|
2797
|
+
* when its reviewed requirements cannot be derived. The CLI renders this as a
|
|
2798
|
+
* blocked assessment rather than treating it as an operational failure.
|
|
2799
|
+
*/
|
|
2800
|
+
declare class PgExecutionContractDerivationError extends Error {
|
|
2801
|
+
readonly operationRef: string;
|
|
2802
|
+
readonly operationName: string;
|
|
2803
|
+
constructor(operationRef: string, operationName: string, detail: string);
|
|
2804
|
+
}
|
|
2805
|
+
/**
|
|
2806
|
+
* Compare namespace identities by name, rather than the incidental order in
|
|
2807
|
+
* which PostgreSQL or a persisted JSON document happened to return them.
|
|
2808
|
+
*/
|
|
2809
|
+
declare function pgTargetIdentityMismatch(expected: PostgreSqlObservationTargetIdentity, observed: PostgreSqlObservationTargetIdentity): string | undefined;
|
|
2810
|
+
/**
|
|
2811
|
+
* Name resolution is only used to locate the namespace OID. The resulting
|
|
2812
|
+
* contract never treats the name itself as identity.
|
|
2813
|
+
*/
|
|
2814
|
+
declare function readPgExecutionTargetFromClient(target: TransitionSessionClient, namespaceNames: readonly string[]): Promise<{
|
|
2815
|
+
readonly identity: PostgreSqlObservationTargetIdentity;
|
|
2816
|
+
readonly sessionProvenance: Readonly<Record<'search_path' | 'client_encoding' | 'TimeZone', string>>;
|
|
2817
|
+
}>;
|
|
2818
|
+
/** Build the versioned canonical document once, while the plan is minted. */
|
|
2819
|
+
declare function createPgExecutionContract(plan: ProvenPlanShape, identity: PostgreSqlObservationTargetIdentity, _sessionProvenance: Readonly<Record<'search_path' | 'client_encoding' | 'TimeZone', string>>): ExecutionContract;
|
|
2820
|
+
/** Evaluate the stored document on the leased executor, before it renders SQL. */
|
|
2821
|
+
declare function evaluatePgExecutionContract(target: TransitionSessionClient, contract: ExecutionContract): Promise<{
|
|
2822
|
+
readonly ok: true;
|
|
2823
|
+
} | {
|
|
2824
|
+
readonly ok: false;
|
|
2825
|
+
readonly clause: string;
|
|
2826
|
+
readonly detail: string;
|
|
2827
|
+
}>;
|
|
2828
|
+
|
|
2772
2829
|
type QueryResultLike = {
|
|
2773
2830
|
readonly rows: readonly Record<string, unknown>[];
|
|
2774
2831
|
};
|
|
@@ -2778,9 +2835,20 @@ type TransitionJournalQueryable = {
|
|
|
2778
2835
|
declare function renderCreateDbspMetaSchemaSql(): string;
|
|
2779
2836
|
declare function renderCreateTransitionRunTableSql(): string;
|
|
2780
2837
|
declare function renderCreateTransitionJournalTableSql(): string;
|
|
2838
|
+
declare function renderCreateTransitionRunPlanTableSql(): string;
|
|
2781
2839
|
declare function ensureTransitionJournal(executor: TransitionJournalQueryable): Promise<void>;
|
|
2782
|
-
declare function
|
|
2840
|
+
declare function createPgTransitionRunPersister(executor: TransitionJournalQueryable): TransitionRunPersister;
|
|
2841
|
+
declare function readTransitionJournal(executor: TransitionJournalQueryable, runId: string): Promise<TransitionRunJournal & {
|
|
2842
|
+
readonly plan: ProvenPlanShape;
|
|
2843
|
+
}>;
|
|
2783
2844
|
|
|
2845
|
+
type PgTransitionClientLease = {
|
|
2846
|
+
readonly client: PoolClient;
|
|
2847
|
+
query(sql: string, params?: unknown): Promise<{
|
|
2848
|
+
readonly rows: readonly Record<string, unknown>[];
|
|
2849
|
+
}>;
|
|
2850
|
+
release(error?: unknown): void;
|
|
2851
|
+
};
|
|
2784
2852
|
/**
|
|
2785
2853
|
* Declare a pg Pool as a source of transition leases.
|
|
2786
2854
|
*
|
|
@@ -2801,6 +2869,8 @@ declare function readTransitionJournal(executor: TransitionJournalQueryable, run
|
|
|
2801
2869
|
* worth spending that.
|
|
2802
2870
|
*/
|
|
2803
2871
|
declare function createPgTransitionLessor(pool: Pool): TransitionLessor;
|
|
2872
|
+
/** Acquire a UTF-8-configured PostgreSQL client for direct planning paths. */
|
|
2873
|
+
declare function acquirePgTransitionClient(pool: Pool): Promise<PgTransitionClientLease>;
|
|
2804
2874
|
|
|
2805
2875
|
type ObservationTarget = {
|
|
2806
2876
|
readonly table: string;
|
|
@@ -2817,7 +2887,7 @@ type EnumObservationTarget = {
|
|
|
2817
2887
|
/** Acquire one lease, issue the observation, then release that lease. */
|
|
2818
2888
|
declare function executePgObservationFromLessor(lessor: TransitionLessor, request: ObservationRequest, context: ObservationContext): Promise<EvidenceObservation>;
|
|
2819
2889
|
/** Acquire one lease, read context, then release that lease. */
|
|
2820
|
-
declare function readPgObservationContextFromLessor(lessor: TransitionLessor, schema?: string, observationTarget?: ObservationTarget | EnumObservationTarget): Promise<ObservationContext>;
|
|
2890
|
+
declare function readPgObservationContextFromLessor(lessor: TransitionLessor, schema?: string, observationTarget?: ObservationTarget | EnumObservationTarget, expectedTargetIdentity?: ObservationContext['postgresqlTargetIdentity']): Promise<ObservationContext>;
|
|
2821
2891
|
declare function createPgObservationIssuer(): ObservationIssuer;
|
|
2822
2892
|
|
|
2823
2893
|
interface SetNotNullColumnShapeExpectation {
|
|
@@ -2864,7 +2934,12 @@ declare function beforeAfterFingerprints$3(operation: PhysicalOperation, evidenc
|
|
|
2864
2934
|
};
|
|
2865
2935
|
declare function createAlterColumnSetNotNullOperationRuntime(): {
|
|
2866
2936
|
artifact: _dbsp_types.SemanticArtifactRef;
|
|
2937
|
+
operationKind: _dbsp_types.OperationKindRef;
|
|
2938
|
+
executionContractEligibility: {
|
|
2939
|
+
readonly eligible: true;
|
|
2940
|
+
};
|
|
2867
2941
|
supportsOperation(operation: PhysicalOperation): boolean;
|
|
2942
|
+
renderPlanSql(operation: PhysicalOperation, context: ObservationContext): string;
|
|
2868
2943
|
effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
|
|
2869
2944
|
buildFingerprints: typeof beforeAfterFingerprints$3;
|
|
2870
2945
|
writeIntentJournal(client: TransitionExecutionClient$3, record: DurableIntentRecord): Promise<void>;
|
|
@@ -2910,7 +2985,15 @@ declare function beforeAfterFingerprints$2(operation: PhysicalOperation, evidenc
|
|
|
2910
2985
|
declare function createAlterTypeAddValueOperationRuntime(): {
|
|
2911
2986
|
artifact: _dbsp_types.SemanticArtifactRef;
|
|
2912
2987
|
operationKind: _dbsp_types.OperationKindRef;
|
|
2988
|
+
executionContractEligibility: {
|
|
2989
|
+
readonly eligible: true;
|
|
2990
|
+
};
|
|
2991
|
+
rendererSessionRequirements: readonly [{
|
|
2992
|
+
readonly setting: "standard_conforming_strings";
|
|
2993
|
+
readonly value: "on";
|
|
2994
|
+
}];
|
|
2913
2995
|
supportsOperation(operation: PhysicalOperation): boolean;
|
|
2996
|
+
renderPlanSql(operation: PhysicalOperation, context: ObservationContext): string;
|
|
2914
2997
|
effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
|
|
2915
2998
|
buildFingerprints: typeof beforeAfterFingerprints$2;
|
|
2916
2999
|
writeIntentJournal(client: TransitionExecutionClient$2, record: DurableIntentRecord): Promise<void>;
|
|
@@ -2958,7 +3041,12 @@ declare function beforeAfterFingerprints$1(operation: PhysicalOperation, evidenc
|
|
|
2958
3041
|
};
|
|
2959
3042
|
declare function createAttachLogicalIdentityOperationRuntime(): {
|
|
2960
3043
|
artifact: _dbsp_types.SemanticArtifactRef;
|
|
3044
|
+
executionContractEligibility: {
|
|
3045
|
+
readonly eligible: false;
|
|
3046
|
+
readonly detail: "PostgreSQL AttachLogicalIdentity has no derivable execution requirements yet";
|
|
3047
|
+
};
|
|
2961
3048
|
supportsOperation(operation: PhysicalOperation): boolean;
|
|
3049
|
+
renderPlanSql(operation: PhysicalOperation): string;
|
|
2962
3050
|
effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
|
|
2963
3051
|
buildFingerprints: typeof beforeAfterFingerprints$1;
|
|
2964
3052
|
writeIntentJournal(client: TransitionExecutionClient$1, record: DurableIntentRecord): Promise<void>;
|
|
@@ -3002,7 +3090,12 @@ declare function beforeAfterFingerprints(operation: PhysicalOperation, _evidence
|
|
|
3002
3090
|
declare function createManualSqlOperationRuntime(): {
|
|
3003
3091
|
artifact: _dbsp_types.SemanticArtifactRef;
|
|
3004
3092
|
operationKind: _dbsp_types.OperationKindRef;
|
|
3093
|
+
executionContractEligibility: {
|
|
3094
|
+
readonly eligible: false;
|
|
3095
|
+
readonly detail: "PostgreSQL ManualSql has no derivable execution requirements because its statement has no declared schema target";
|
|
3096
|
+
};
|
|
3005
3097
|
supportsOperation(operation: PhysicalOperation): boolean;
|
|
3098
|
+
renderPlanSql(operation: PhysicalOperation, context: ObservationContext): string;
|
|
3006
3099
|
effectsOf(operation: PhysicalOperation, context: ObservationContext): OperationEffectAssessment;
|
|
3007
3100
|
buildFingerprints: typeof beforeAfterFingerprints;
|
|
3008
3101
|
writeIntentJournal(client: TransitionExecutionClient, record: DurableIntentRecord): Promise<void>;
|
|
@@ -3107,7 +3200,12 @@ declare function createPgTransitionPack(options?: PgTransitionPackOptions): {
|
|
|
3107
3200
|
rules: (_dbsp_types.TransitionRule<AddCheckMatch> | _dbsp_types.TransitionRule<LogicalIdentityAdoptionMatch> | _dbsp_types.TransitionRule<CreateUniqueIndexConcurrentlyMatch> | _dbsp_types.TransitionRule<EnumAddValueMatch> | _dbsp_types.TransitionRule<SetNotNullMatch>)[];
|
|
3108
3201
|
operationSemantics: ({
|
|
3109
3202
|
artifact: _dbsp_types.SemanticArtifactRef;
|
|
3203
|
+
operationKind: _dbsp_types.OperationKindRef;
|
|
3204
|
+
executionContractEligibility: {
|
|
3205
|
+
readonly eligible: true;
|
|
3206
|
+
};
|
|
3110
3207
|
supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
|
|
3208
|
+
renderPlanSql(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): string;
|
|
3111
3209
|
effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
|
|
3112
3210
|
buildFingerprints: (operation: _dbsp_types.PhysicalOperation, evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
|
|
3113
3211
|
expectedBefore: _dbsp_types.FingerprintManifest;
|
|
@@ -3162,7 +3260,15 @@ declare function createPgTransitionPack(options?: PgTransitionPackOptions): {
|
|
|
3162
3260
|
} | {
|
|
3163
3261
|
artifact: _dbsp_types.SemanticArtifactRef;
|
|
3164
3262
|
operationKind: _dbsp_types.OperationKindRef;
|
|
3263
|
+
executionContractEligibility: {
|
|
3264
|
+
readonly eligible: true;
|
|
3265
|
+
};
|
|
3266
|
+
rendererSessionRequirements: readonly [{
|
|
3267
|
+
readonly setting: "standard_conforming_strings";
|
|
3268
|
+
readonly value: "on";
|
|
3269
|
+
}];
|
|
3165
3270
|
supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
|
|
3271
|
+
renderPlanSql(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): string;
|
|
3166
3272
|
effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
|
|
3167
3273
|
buildFingerprints: (operation: _dbsp_types.PhysicalOperation, evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
|
|
3168
3274
|
expectedBefore: _dbsp_types.FingerprintManifest;
|
|
@@ -3214,10 +3320,71 @@ declare function createPgTransitionPack(options?: PgTransitionPackOptions): {
|
|
|
3214
3320
|
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3215
3321
|
}, journal: _dbsp_types.StepJournal): Promise<void>;
|
|
3216
3322
|
isLockTimeout(error: unknown): boolean;
|
|
3323
|
+
} | {
|
|
3324
|
+
artifact: _dbsp_types.SemanticArtifactRef;
|
|
3325
|
+
executionContractEligibility: {
|
|
3326
|
+
readonly eligible: false;
|
|
3327
|
+
readonly detail: "PostgreSQL AttachLogicalIdentity has no derivable execution requirements yet";
|
|
3328
|
+
};
|
|
3329
|
+
supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
|
|
3330
|
+
renderPlanSql(operation: _dbsp_types.PhysicalOperation): string;
|
|
3331
|
+
effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
|
|
3332
|
+
buildFingerprints: (operation: _dbsp_types.PhysicalOperation, evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
|
|
3333
|
+
expectedBefore: _dbsp_types.FingerprintManifest;
|
|
3334
|
+
expectedAfter: _dbsp_types.FingerprintManifest;
|
|
3335
|
+
};
|
|
3336
|
+
writeIntentJournal(client: {
|
|
3337
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3338
|
+
}, record: _dbsp_types.DurableIntentRecord): Promise<void>;
|
|
3339
|
+
begin(client: {
|
|
3340
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3341
|
+
}): Promise<void>;
|
|
3342
|
+
setLockTimeout(client: {
|
|
3343
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3344
|
+
}, maxWaitMs: number): Promise<void>;
|
|
3345
|
+
acquireLocks(client: {
|
|
3346
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3347
|
+
}, operation: _dbsp_types.PhysicalOperation): Promise<void>;
|
|
3348
|
+
observeContext(client: {
|
|
3349
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3350
|
+
}, operation: _dbsp_types.PhysicalOperation, _proofContext: _dbsp_types.ObservationContext): Promise<_dbsp_types.ObservationContext>;
|
|
3351
|
+
observeOperation(client: {
|
|
3352
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3353
|
+
}, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, phase: "before" | "after", issuer: _dbsp_types.ObservationIssuer): Promise<{
|
|
3354
|
+
observations: _dbsp_types.IssuedObservation[];
|
|
3355
|
+
fingerprint: _dbsp_types.FingerprintManifest;
|
|
3356
|
+
}>;
|
|
3357
|
+
checkGuard(): Promise<{
|
|
3358
|
+
passed: boolean;
|
|
3359
|
+
observations: never[];
|
|
3360
|
+
recovery: never[];
|
|
3361
|
+
}>;
|
|
3362
|
+
executeOperation(client: {
|
|
3363
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3364
|
+
}, operation: _dbsp_types.PhysicalOperation): Promise<{
|
|
3365
|
+
kind: "completed";
|
|
3366
|
+
}>;
|
|
3367
|
+
writeCompletionJournal(client: {
|
|
3368
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3369
|
+
}, operation: _dbsp_types.PhysicalOperation, record: _dbsp_types.TransactionalCompletionRecord): Promise<void>;
|
|
3370
|
+
commit(client: {
|
|
3371
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3372
|
+
}): Promise<void>;
|
|
3373
|
+
rollback(client: {
|
|
3374
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3375
|
+
}): Promise<void>;
|
|
3376
|
+
writeObservedJournal(client: {
|
|
3377
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3378
|
+
}, journal: _dbsp_types.StepJournal): Promise<void>;
|
|
3379
|
+
isLockTimeout(error: unknown): boolean;
|
|
3217
3380
|
} | {
|
|
3218
3381
|
artifact: _dbsp_types.SemanticArtifactRef;
|
|
3219
3382
|
operationKind: _dbsp_types.OperationKindRef;
|
|
3383
|
+
executionContractEligibility: {
|
|
3384
|
+
readonly eligible: true;
|
|
3385
|
+
};
|
|
3220
3386
|
supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
|
|
3387
|
+
renderPlanSql(operation: _dbsp_types.PhysicalOperation): string;
|
|
3221
3388
|
effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
|
|
3222
3389
|
buildFingerprints: (operation: _dbsp_types.PhysicalOperation, evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
|
|
3223
3390
|
expectedBefore: _dbsp_types.FingerprintManifest;
|
|
@@ -3275,6 +3442,62 @@ declare function createPgTransitionPack(options?: PgTransitionPackOptions): {
|
|
|
3275
3442
|
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3276
3443
|
}, journal: _dbsp_types.StepJournal): Promise<void>;
|
|
3277
3444
|
isLockTimeout(error: unknown): boolean;
|
|
3445
|
+
} | {
|
|
3446
|
+
artifact: _dbsp_types.SemanticArtifactRef;
|
|
3447
|
+
operationKind: _dbsp_types.OperationKindRef;
|
|
3448
|
+
executionContractEligibility: {
|
|
3449
|
+
readonly eligible: false;
|
|
3450
|
+
readonly detail: "PostgreSQL ManualSql has no derivable execution requirements because its statement has no declared schema target";
|
|
3451
|
+
};
|
|
3452
|
+
supportsOperation(operation: _dbsp_types.PhysicalOperation): boolean;
|
|
3453
|
+
renderPlanSql(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): string;
|
|
3454
|
+
effectsOf(operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): _dbsp_types.OperationEffectAssessment;
|
|
3455
|
+
buildFingerprints: (operation: _dbsp_types.PhysicalOperation, _evidence: readonly _dbsp_types.EvidenceObservation[], context: _dbsp_types.ObservationContext) => {
|
|
3456
|
+
expectedBefore: _dbsp_types.FingerprintManifest;
|
|
3457
|
+
expectedAfter: _dbsp_types.FingerprintManifest;
|
|
3458
|
+
};
|
|
3459
|
+
writeIntentJournal(client: {
|
|
3460
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3461
|
+
}, record: _dbsp_types.DurableIntentRecord): Promise<void>;
|
|
3462
|
+
begin(client: {
|
|
3463
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3464
|
+
}): Promise<void>;
|
|
3465
|
+
setLockTimeout(_client: {
|
|
3466
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3467
|
+
}, _maxWaitMs: number): Promise<void>;
|
|
3468
|
+
acquireLocks(): Promise<void>;
|
|
3469
|
+
observeContext(client: {
|
|
3470
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3471
|
+
}, _operation: _dbsp_types.PhysicalOperation, proofContext: _dbsp_types.ObservationContext): Promise<_dbsp_types.ObservationContext>;
|
|
3472
|
+
observeOperation(_client: {
|
|
3473
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3474
|
+
}, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext, phase: "before" | "after"): Promise<{
|
|
3475
|
+
observations: never[];
|
|
3476
|
+
fingerprint: _dbsp_types.FingerprintManifest;
|
|
3477
|
+
}>;
|
|
3478
|
+
checkGuard(): Promise<{
|
|
3479
|
+
passed: boolean;
|
|
3480
|
+
observations: never[];
|
|
3481
|
+
recovery: never[];
|
|
3482
|
+
}>;
|
|
3483
|
+
executeOperation(client: {
|
|
3484
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3485
|
+
}, operation: _dbsp_types.PhysicalOperation, context: _dbsp_types.ObservationContext): Promise<{
|
|
3486
|
+
kind: "completed";
|
|
3487
|
+
}>;
|
|
3488
|
+
writeCompletionJournal(client: {
|
|
3489
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3490
|
+
}, operation: _dbsp_types.PhysicalOperation, record: _dbsp_types.TransactionalCompletionRecord): Promise<void>;
|
|
3491
|
+
commit(client: {
|
|
3492
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3493
|
+
}): Promise<void>;
|
|
3494
|
+
rollback(client: {
|
|
3495
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3496
|
+
}): Promise<void>;
|
|
3497
|
+
writeObservedJournal(client: {
|
|
3498
|
+
readonly opaqueClient: _dbsp_types.TransitionSessionClient;
|
|
3499
|
+
}, journal: _dbsp_types.StepJournal): Promise<void>;
|
|
3500
|
+
isLockTimeout(error: unknown): boolean;
|
|
3278
3501
|
})[];
|
|
3279
3502
|
issuer: _dbsp_types.ObservationIssuer;
|
|
3280
3503
|
executionCoordinator: ExecutionCoordinator;
|
|
@@ -3346,6 +3569,11 @@ declare function validateIdentifiers(identifiers: Record<string, 'table' | 'colu
|
|
|
3346
3569
|
* NOT for use in SQL - use validateIdentifier + AST helpers for that.
|
|
3347
3570
|
*/
|
|
3348
3571
|
declare function sanitizeForDisplay(value: string): string;
|
|
3572
|
+
/**
|
|
3573
|
+
* Preserve hostile diagnostic text as one printable line without losing which
|
|
3574
|
+
* control character was supplied. This is for diagnostics only, never SQL.
|
|
3575
|
+
*/
|
|
3576
|
+
declare function escapeDiagnosticText(value: string): string;
|
|
3349
3577
|
/**
|
|
3350
3578
|
* Validate a raw SQL expression used in DDL contexts (defaults, policy USING/CHECK).
|
|
3351
3579
|
* Rejects injection vectors: semicolons, line-comment markers, block-comment markers.
|
|
@@ -3357,4 +3585,4 @@ declare function sanitizeForDisplay(value: string): string;
|
|
|
3357
3585
|
*/
|
|
3358
3586
|
declare function validateSqlExpression(sql: string, context: string): void;
|
|
3359
3587
|
|
|
3360
|
-
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, createPgTransitionLessor, createPgTransitionPack, createPgsqlAdapter, createPgsqlCompileOnlyAdapter, createSetNotNullRule, createTypeCastParamRef, defaultFkDerivation, derivePostgresqlCapabilitiesForVersion, ensureMigrationsTable, ensureTransitionJournal, excludedRef, executePgObservationFromLessor, 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, readPgObservationContextFromLessor, 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 };
|
|
3588
|
+
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, ColumnDefaultCanonicalizationError, type ColumnDefaultCanonicalizationWarning, 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_PLAN_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 ExpressionCanonicalizationWarning, 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, type NonConvergentSchemaDiffSurface, PG_INTROSPECTION_ARTIFACT, PG_OPERATION_PACK_ARTIFACT, PG_RULE_PACK_ARTIFACT, type ParamRefValidationResult, type ParsedMigrationFile, type PgAdvisoryLockKey, type PgAdvisoryLockResult, PgExecutionContractDerivationError, type PgTransitionClientLease, 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, type RollbackOnlyPgsqlScope, 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, acquirePgTransitionClient, 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, createPgExecutionContract, createPgObservationIssuer, createPgTransitionLessor, createPgTransitionPack, createPgTransitionRunPersister, createPgsqlAdapter, createPgsqlCompileOnlyAdapter, createSetNotNullRule, createTypeCastParamRef, defaultFkDerivation, derivePostgresqlCapabilitiesForVersion, ensureMigrationsTable, ensureTransitionJournal, escapeDiagnosticText, evaluatePgExecutionContract, excludedRef, executePgObservationFromLessor, 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, pgTargetIdentityMismatch, rawDistance, readPgExecutionTargetFromClient, readPgObservationContextFromLessor, readTransitionJournal, recordMigration, redactParams, removeMigrationRecord, renderAlterColumnSetNotNullSql, renderAlterTypeAddValueSql, renderAttachLogicalIdentityLockSql, renderCreateDbspMetaSchemaSql, renderCreateIndex, renderCreateLogicalIdentityIndexesSql, renderCreateLogicalIdentitySideTableSql, renderCreateTransitionJournalTableSql, renderCreateTransitionRunPlanTableSql, renderCreateTransitionRunTableSql, renderInsertLogicalIdentitySql, renderNoNullsCheckSql, renderSetNotNullLockSql, resolveLogicalName, sanitizeForDisplay, score, validateIdentifier, validateIdentifiers, validateParamRef, validateQualifiedIdentifier, validateSqlExpression, vectorDims, withMigrationLock };
|