I have a data directory that I initialized with initdb. When I try to run the example connecting to that data directory, the Promise returned by db.query(...) never resolves. Here's the code:
import { PGlite } from "@electric-sql/pglite";
const db = new PGlite("./pgdata");
await db.waitReady;
const result = await db.query("select 'Hello world' as message;");
console.log(result);
await db.close();
EDIT: I just realized that this is most likely because there is a difference in the version of postgres that created the dbs:
// created by installed initdb command on my machine
PostgreSQL 16.0 on aarch64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.102), 64-bit
// created by pglite
PostgreSQL 15devel on aarch64-apple-darwin22.6.0, compiled by emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.25 (febd44b21ecaca86e2cb2a25ef3ed4a0a2076365), 32-bit
It would be nice to include an error for this type of thing. Are there plans for this to be resolved?
Hey, yep, PGlite is using v15 and there is no compatibility between major pg versions data stores. We need to improve error handling in this situation.
I have a data directory that I initialized with
initdb
. When I try to run the example connecting to that data directory, the Promise returned bydb.query(...)
never resolves. Here's the code:EDIT: I just realized that this is most likely because there is a difference in the version of postgres that created the dbs:
It would be nice to include an error for this type of thing. Are there plans for this to be resolved?