evelodb
Version:
A high-performance native B-tree database for Node.js. Made by Evelocore.
42 lines (41 loc) • 990 B
TypeScript
export interface BackupResult {
success: boolean;
err?: string;
backupPath?: string;
}
export interface BackupFileInfo {
success: boolean;
err?: string;
title?: string;
protected?: boolean;
schema?: any;
length?: number;
data: any[];
created?: Date;
}
/**
* Handles all backup and restoration logic for EveloDB
*/
export declare class BackupManager {
private db;
constructor(db: any);
createBackup(collection: string, config: {
type?: 'json' | 'binary';
path: string;
password?: string;
title?: string;
}): BackupResult;
restoreBackup(collection: string, config: {
type?: 'json' | 'binary';
file: string;
password?: string;
}): {
success: boolean;
err?: string;
};
readBackupFile(filePath: string, password?: string): BackupFileInfo;
private serializeSchema;
private applyRestoredSchema;
private encrypt;
private decrypt;
}