import type { NodePgDatabase } from "drizzle-orm/node-postgres"; /** * Anything that can run SQL for us. * * Narrower than `NodePgDatabase` so the provisioning handle — which is what the * boot path actually has in hand — satisfies it without a cast at every call * site. */ export interface SchemaMetaQueryable { execute(query: unknown): Promise<{ rows: Record[]; }>; } /** * Read the stamped version, or `null` when this database has never been stamped. * * `to_regclass` rather than a plain `SELECT` so a missing schema or table is a * `null` instead of a thrown 42P01 — the overwhelmingly common case on a fresh * database is that neither exists yet, and that is not news. */ export declare function readCollectionsSchemaVersion(db: SchemaMetaQueryable | NodePgDatabase, metaSchema: string): Promise; /** * Record the version this runtime just applied. * * Creates the meta table if the auth stamp has not already — the two are * independent halves of one boot and either may run first, so neither can assume * the table is there. `CREATE TABLE IF NOT EXISTS` is not atomic against a * concurrent identical statement, which is exactly the race a split deployment * arranges; it is tolerated here for the same reason it is elsewhere in the boot * path, and the caller treats any failure as a warning rather than a fatal. */ export declare function stampCollectionsSchemaVersion(db: SchemaMetaQueryable | NodePgDatabase, metaSchema: string, version: string): Promise;