()
| 565 | let done = false; |
| 566 | const onLog = (log: string) => queue.push(log); |
| 567 | const runRestore = async () => { |
| 568 | if (input.backupType === "database") { |
| 569 | if (input.databaseType === "postgres") { |
| 570 | const postgres = await findPostgresById(input.databaseId); |
| 571 | await restorePostgresBackup(postgres, destination, input, onLog); |
| 572 | } else if (input.databaseType === "mysql") { |
| 573 | const mysql = await findMySqlById(input.databaseId); |
| 574 | await restoreMySqlBackup(mysql, destination, input, onLog); |
| 575 | } else if (input.databaseType === "mariadb") { |
| 576 | const mariadb = await findMariadbById(input.databaseId); |
| 577 | await restoreMariadbBackup(mariadb, destination, input, onLog); |
| 578 | } else if (input.databaseType === "mongo") { |
| 579 | const mongo = await findMongoById(input.databaseId); |
| 580 | await restoreMongoBackup(mongo, destination, input, onLog); |
| 581 | } else if (input.databaseType === "libsql") { |
| 582 | const libsql = await findLibsqlById(input.databaseId); |
| 583 | await restoreLibsqlBackup(libsql, destination, input, onLog); |
| 584 | } else if (input.databaseType === "web-server") { |
| 585 | await restoreWebServerBackup(destination, input.backupFile, onLog); |
| 586 | } |
| 587 | } else if (input.backupType === "compose") { |
| 588 | const compose = await findComposeById(input.databaseId); |
| 589 | await restoreComposeBackup(compose, destination, input, onLog); |
| 590 | } |
| 591 | }; |
| 592 | runRestore() |
| 593 | .catch((error) => { |
| 594 | onLog( |
no test coverage detected