数据备份测试

This commit is contained in:
cc
2026-04-25 14:55:31 +08:00
parent c167be53b3
commit 5129574729
21 changed files with 1890 additions and 4 deletions

View File

@@ -366,6 +366,26 @@ export class WcdbService {
return this.callWorker('getMessageTableColumns', { dbPath, tableName })
}
async listTables(kind: string, dbPath: string = ''): Promise<{ success: boolean; tables?: string[]; error?: string }> {
return this.callWorker('listTables', { kind, dbPath })
}
async getTableSchema(kind: string, dbPath: string, tableName: string): Promise<{ success: boolean; schema?: string; error?: string }> {
return this.callWorker('getTableSchema', { kind, dbPath, tableName })
}
async exportTableSnapshot(kind: string, dbPath: string, tableName: string, outputPath: string): Promise<{ success: boolean; rows?: number; columns?: number; error?: string }> {
return this.callWorker('exportTableSnapshot', { kind, dbPath, tableName, outputPath })
}
async importTableSnapshot(kind: string, dbPath: string, tableName: string, inputPath: string): Promise<{ success: boolean; rows?: number; inserted?: number; ignored?: number; malformed?: number; columns?: number; error?: string }> {
return this.callWorker('importTableSnapshot', { kind, dbPath, tableName, inputPath })
}
async importTableSnapshotWithSchema(kind: string, dbPath: string, tableName: string, inputPath: string, createTableSql: string): Promise<{ success: boolean; rows?: number; inserted?: number; ignored?: number; malformed?: number; columns?: number; error?: string }> {
return this.callWorker('importTableSnapshotWithSchema', { kind, dbPath, tableName, inputPath, createTableSql })
}
async getMessageTableTimeRange(dbPath: string, tableName: string): Promise<{ success: boolean; data?: any; error?: string }> {
return this.callWorker('getMessageTableTimeRange', { dbPath, tableName })
}