import { type ConditionalBatchCondition } from './interface.ts'; import { type BatchNetEffect } from './neon-value-mapping.ts'; import type { PostgresKeyValueQueries } from './postgres-key-value-queries.ts'; import type { PostgresPoolClient } from './postgres-key-value-storage.ts'; /** * The collapsed transaction-phase helpers for the Postgres storage adapters' * `batch()` and `conditionalBatch()`. Each phase runs as ONE statement regardless * of operation count, so a checkpoint commit no longer pays one round trip per * key. Split out of the storage class to keep that module under the size ceiling; * all run on a caller-supplied pinned-transaction `client`. * * @module storage/neon-batch */ /** * Evaluate every precondition with ONE `key = ANY($1)` read instead of one * `SELECT` per condition. Builds a key→value map from the single result, then * compares each condition's `expectedValue` against the current value (absent * key → `null`, which matches an expect-absent condition). Returns `true` only * when every condition holds. With no conditions, holds vacuously and issues no * query. */ export declare function conditionsHold(client: PostgresPoolClient, queries: PostgresKeyValueQueries, conditions: ConditionalBatchCondition[]): Promise; /** * Write a resolved batch net effect with at most one upsert and one delete * statement — the put-set as a single `unnest`-driven multi-row upsert, the * delete-set as a single `key = ANY($1)` delete. The two key sets are disjoint * (see {@link resolveBatchNetEffect}), so the statements commute; each is * skipped when its set is empty. */ export declare function writeBatchNetEffect(client: PostgresPoolClient, queries: PostgresKeyValueQueries, netEffect: BatchNetEffect): Promise;