Closed GeorgiosP closed 2 days ago
postgres.js node build is in interim archive and does support FS ( i use it with bun and pglite-server/pg-gateway everyday), if it says NodeFS is missing then the postgres.js picked up is probably the web version.
Got it! is it also included in the PGLite since I'm using that here?
I'm running on my server not in client but the only way I've managed to get it to play nice is using memory://
during PGLite setup
const client = await PGlite.create({ dataDir: "memory://" });
const db = drizzle(client);
if you want to use Node raw fs you can unpack "/tmp/pglite" on the drive first so it can create "base" in it ( as it will mount it on /tmp/pglite in node vfs ) nb: base must not exist prior to initdb / first pglite setup ! eg
const db = new PGlite("/tmp/pglite/base", {
"username" : "postgres",
"debug" : true,
extensions: {
"vector" : new URL("./node_modules/@electric-sql/pglite/dist/vector.tar.gz", import.meta.url),
}
});
Sweet! I'll give that a shot 🙏🏼
Closing this out for now appreciate the support 🫡 unpack works well but its not super sustainable
Looking at the docs for node / bun its listing NodeFS for retaining content in the file system for some persistence any assistance would be greatly appreciated!
https://pglite.dev/docs/filesystems#node-fs
using version 0.2.12
cannot use NodeFS since its saying it does not exist 😢