Skip to content

Commit

Permalink
Tidyup
Browse files Browse the repository at this point in the history
  • Loading branch information
samwillis committed Jul 31, 2024
1 parent 4d3ceca commit 6d2048f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 2 additions & 4 deletions packages/pglite/examples/basic.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { PGlite } from "../dist/index.js";

console.log("Starting...");
const start = performance.now();
// In-memory database:
// const pg = new PGlite();
const pg = new PGlite();
// Or, on-disk database:
// const pg = new PGlite('pgdata');
const pg = new PGlite('idb://pgdata');

console.log("Waiting for ready...");
await pg.waitReady;

console.log("Ready! Took", performance.now() - start, "ms");
console.log("Ready!");

console.log("Creating table...");
await pg.exec(`
Expand Down
2 changes: 0 additions & 2 deletions packages/pglite/src/fs/opfs-ahp/opfsAhp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,13 @@ export class OpfsAhp {
const change = size - this.state.pool.length;
const promises: Promise<void>[] = [];
for (let i = 0; i < change; i++) {
console.log("push", i);
promises.push(
new Promise<void>(async (resolve) => {
++this.poolCounter;
const filename = `${(Date.now() - 1704063600).toString(16).padStart(8, "0")}-${this.poolCounter.toString(16).padStart(8, "0")}`;
const fh = await this.#dataDirAh.getFileHandle(filename, {
create: true,
});
console.log("do", i);
const sh: FileSystemSyncAccessHandle = await (
fh as any
).createSyncAccessHandle();
Expand Down

0 comments on commit 6d2048f

Please sign in to comment.