Use PGLite with Wrangler for local development

Hi everyone, For context, I develop an API with HonoJS and Drizzle. For my local development, I'd like to use PGLite. Database migration works perfectly, I can use Drizzle Studio to see this. However, when I make a query, I already have this error:
export const client = new PGlite('.database')

const users = await client.query('SELECT * FROM users')
console.log('users', users)
export const client = new PGlite('.database')

const users = await client.query('SELECT * FROM users')
console.log('users', users)
✘ [ERROR] Error: [unenv] fs.mkdirSync is not implemented yet!
✘ [ERROR] Error: [unenv] fs.mkdirSync is not implemented yet!
Is it possible to use PGLite with wrangler? If anyone can help me with this 🙂
1 Reply
Hello, I’m Allie!
It appears that PGLite requires access to a file system, which Workers do not have You might be able to mock it out with a stub, but no idea how performant that would be…
Want results from more Discord servers?
Add your server