/**
 * Database status utility for CLI and dev workflows.
 *
 * Queries migration state and table info without a running server.
 * Returns structured data that consumer scripts can print however they like.
 *
 * @module
 */
import type { Db } from './db.js';
import type { MigrationNamespace } from './migrate.js';
/**
 * Migration status for a single namespace.
 */
export interface MigrationStatus {
    namespace: string;
    /** Names of migrations recorded in the tracker, sequence-ascending. */
    applied_names: Array<string>;
    /** Names of code migrations not yet applied (suffix of the code array). */
    pending_names: Array<string>;
    /** Whether `applied_names` is the full code array (no pending work). */
    up_to_date: boolean;
}
/**
 * Table info with row count.
 */
export interface TableStatus {
    name: string;
    row_count: number;
}
/**
 * Full database status snapshot.
 */
export interface DbStatus {
    /** Whether the database is reachable. */
    connected: boolean;
    /** Error message if connection failed. */
    error?: string;
    /** Number of public tables. */
    table_count: number;
    /** Per-table row counts. */
    tables: Array<TableStatus>;
    /** Per-namespace migration status. */
    migrations: Array<MigrationStatus>;
    /**
     * True if the pre-0.42 `schema_version` shape (with a `version` column)
     * was detected. The runner refuses to start in this state — operators
     * see this flag as their cue to drop the table or call `baseline()`.
     */
    old_tracker_shape?: boolean;
}
/**
 * Query database status including connectivity, tables, and migration state.
 *
 * Designed for CLI `db:status` commands. Does not modify the database.
 *
 * @param db - the database instance
 * @param namespaces - migration namespaces to check status for
 * @returns a snapshot of database status; `connected: false` with `error`
 *   set when the initial connectivity probe fails
 * @throws Error propagated from the driver if a query fails after the
 *   connectivity probe (e.g. a table is dropped mid-scan)
 */
export declare const query_db_status: (db: Db, namespaces?: Array<MigrationNamespace>) => Promise<DbStatus>;
/**
 * Format a `DbStatus` as a human-readable string for CLI output.
 *
 * @param status - the status to format
 * @returns multi-line string suitable for console output
 */
export declare const format_db_status: (status: DbStatus) => string;
//# sourceMappingURL=status.d.ts.map