Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
samwillis committed Jul 29, 2024
1 parent 3853cdd commit 2f0af8f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/pglite/src/worker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ export class PGliteWorker implements PGliteInterface {
* @returns The direct message data response produced by Postgres
*/
async execProtocolRaw(message: Uint8Array): Promise<Uint8Array> {
return this.#worker.execProtocolRaw(message);
await this.waitReady;
return (await this.#rpc("execProtocolRaw", message)) as Uint8Array;
}

/**
Expand Down Expand Up @@ -370,8 +371,8 @@ export class PGliteWorker implements PGliteInterface {
}
}

async dumpDataDir() {
return this.#worker.dumpDataDir();
async dumpDataDir(): Promise<File | Blob> {
return (await this.#rpc("dumpDataDir")) as File | Blob;
}
}

Expand Down Expand Up @@ -544,7 +545,7 @@ function makeWorkerApi(db: PGliteInterface) {
},
async dumpDataDir() {
return await db.dumpDataDir();
}
},
};
}

Expand Down

0 comments on commit 2f0af8f

Please sign in to comment.