skip empty tables

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-09-23 20:42:55 +02:00
parent bffb802ba2
commit 105d5c6ad9
No known key found for this signature in database

View file

@ -41,6 +41,7 @@ export class ExportAllCommand extends BaseCommand {
const totalRowsCount = await connection
.query(`SELECT COUNT(*) AS count FROM ${tableName}`)
.then((rows: Array<{ count: number }>) => rows[0].count);
if (totalRowsCount === 0) continue;
const stream = fs.createWriteStream(join(backupPath, `${tableName}.jsonl`));