import type { Knex } from 'knex'; /** * Auto-migrate all dashboard SQLite tables. * * Uses raw SQL (not Lucid migrations) so we never pollute the host * application's migration history. Each `CREATE TABLE` / `CREATE INDEX` * uses `IF NOT EXISTS` so the function is idempotent. * * Yields to the event loop between each table so the server can * continue processing HTTP requests during migration. */ export declare function autoMigrate(db: Knex): Promise; /** * Delete records older than `retentionDays` from all tables, then enforce * the database size cap. * * Foreign-key cascades on `server_stats_requests` handle the child * tables (queries, events, traces). Standalone tables (logs, emails, * metrics, saved_filters) are pruned individually. * * `maxDbSizeMb` bounds the *live* data size: when exceeded, the globally * oldest rows are deleted — regardless of age — until usage drops below * ~90% of the cap. `0` disables the cap. * * Yields between each DELETE so the event loop stays responsive. */ export declare function runRetentionCleanup(db: Knex, retentionDays: number, maxDbSizeMb?: number): Promise;