@restoreverify/sqlite
v0.2.4
Published
Verify every backup. Recover with confidence. Enterprise-grade database point-in-time recovery (PITR) and verification.
Maintainers
Readme
@restoreverify/sqlite
Database adapter for SQLite in the RestoreVerify ecosystem.
RestoreVerify is an enterprise-grade, open source database point-in-time recovery (PITR) and verification tool.
This package provides the core adapter for SQLite to execute backups, restores, and verification drills programmatically.
Installation
npm install @restoreverify/sqlite @restoreverify/core(Alternatively, you can install the unified restoreverify package which includes all adapters).
Functions
This adapter implements the standard RestoreVerify adapter interface:
backup(config): Initiates an online backup of the.sqlitedatabase file using thesqlite3CLI.restore(config): Restores the backup by copying the backed-up database file to the target destination. (Note: SQLite does not natively support true PITR).verify(config): Connects to SQLite and runs queries to ensure data integrity.validateBackup(config): Validates the sqlite database backup on disk.
Code Snippet Usage
import { sqliteAdapter } from '@restoreverify/sqlite';
import { LocalBinaryStrategy, DockerExecStrategy } from '@restoreverify/core';
// Example: Backup an SQLite database locally
async function performBackup() {
const result = await sqliteAdapter.backup({
connectionString: 'file:production.sqlite',
backupDir: '/mnt/backups/sqlite',
// Choose your execution strategy (Local, Docker, Kubernetes, SSH)
strategy: new LocalBinaryStrategy()
});
if (result.success) {
console.log(`Backup completed successfully! ID: ${result.backupId}`);
} else {
console.error(`Backup failed: ${result.error}`);
}
}
performBackup();Author
Avisekh Kumar Tewari
GitHub: https://github.com/Avisekh02
