electric-sql / electric-sql/pglite
Add lock to indexeddb vfs so that the database can only be opened once.
- Dominant language
- TypeScript
- Stars
- 16k
- Forks
- 442
- Avg merge
- 20h 19m
- Merged PRs (30d)
- 7
Description
Each time I try to use the `IndexedDb` I get this error.
```bash
this.program: could not access the server configuration file "/pgdata/postgresql.conf": No such file or directory
```

This is the code that trigger it:
```tsx
"use client";
import { PGlite } from "@electric-sql/pglite";
import { useEffect, useState } from "react";
export default function PgLiteComponent() {
const [data, setData] = useState("PENDING");
useEffect(() => {
(async () => {
const client = new PGlite("idb://local", { debug: 1 });
const result = await client.exec("SELECT NOW()");
setData(result);
})();
}, []);
return (
PGLite
{JSON.stringify(data ?? "", null, 2)}
);
}
```
The app halts, the error cannot be caught, so is not possible to do anything.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.