Fix "delete and restart" after database error

This commit is contained in:
Fedor Indutny 2021-07-09 17:43:36 -07:00 committed by GitHub
parent 9c48a95eb5
commit 455820a9cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View file

@ -22,6 +22,9 @@ export type WorkerRequest =
| {
readonly type: 'close';
}
| {
readonly type: 'removeDB';
}
| {
readonly type: 'sqlCall';
readonly method: string;
@ -117,6 +120,10 @@ export class MainSQL {
await this.onExit;
}
public async removeDB(): Promise<void> {
await this.send({ type: 'removeDB' });
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public async sqlCall(method: string, args: ReadonlyArray<any>): Promise<any> {
if (this.onReady) {