import { Pool } from 'pg'; export interface ScratchDb { name: string; /** A pool of the test's own, on the scratch database */ db: Pool; /** Core's pool; checked to point at the scratch database */ corePool: Pool; close(): Promise; } /** * Create the database, point core's pool at it and run the core migrations. * Returns `null`, after a warning, when no Postgres 13+ server is reachable. */ export declare function openScratchDb(name: string): Promise; /** An order, every required column filled from the real schema */ export declare function createOrder(db: Pool, values?: Record): Promise>; /** The `order_placed` events written for an order */ export declare function placedEvents(db: Pool, orderId: number): Promise>>; /** * Every `order_placed` event, for any order or none: one written with an * empty payload belongs to no order, so `placedEvents` would not see it */ export declare function countPlacedEvents(db: Pool): Promise; /** Make every `order_placed` insert fail until `off()` is called */ export declare function failOrderPlacedWrites(db: Pool): Promise<{ off: () => Promise>; }>;