/** * Database backup and maintenance utilities * * Provides backup, vacuum, and rotation functionality for SQLite database. */ import type Database from "better-sqlite3-multiple-ciphers"; /** * Get the backup directory path */ export declare function getBackupDir(workspaceRoot?: string): string; /** * Generate timestamped backup filename (format: memory-YYYYMMDD.sqlite) */ export declare function generateBackupFilename(date?: Date): string; /** * Rotate backups, keeping only the N most recent */ export declare function rotateBackups(backupDir: string, maxBackups?: number): void; /** * Backup database to timestamped file with optional rotation * * @param dbPath - Path to the source database file * @param rotate - Number of backups to keep (default: 7, 0 = no rotation) * @param workspaceRoot - Optional workspace root override * @returns Path to the created backup file */ export declare function backupDatabase(dbPath: string, rotate?: number, workspaceRoot?: string): string; /** * Vacuum (optimize) the database * * This command rebuilds the database file, repacking it into a minimal amount * of disk space and improving query performance. * * @param db - Database instance */ export declare function vacuumDatabase(db: Database.Database): void; /** * Get backup retention count from environment variable */ export declare function getBackupRetention(): number;