27 lines
1.0 KiB
Markdown
27 lines
1.0 KiB
Markdown
## New Features
|
|
|
|
### 🎉 PGlite driver Support
|
|
|
|
PGlite is a WASM Postgres build packaged into a TypeScript client library that enables you to run Postgres in the browser, Node.js and Bun, with no need to install any other dependencies. It is only 2.6mb gzipped.
|
|
|
|
It can be used as an ephemeral in-memory database, or with persistence either to the file system (Node/Bun) or indexedDB (Browser).
|
|
|
|
Unlike previous "Postgres in the browser" projects, PGlite does not use a Linux virtual machine - it is simply Postgres in WASM.
|
|
|
|
Usage Example
|
|
```ts
|
|
import { PGlite } from '@electric-sql/pglite';
|
|
import { drizzle } from 'drizzle-orm/pglite';
|
|
|
|
// In-memory Postgres
|
|
const client = new PGlite();
|
|
const db = drizzle(client);
|
|
|
|
await db.select().from(users);
|
|
```
|
|
---
|
|
There are currently 2 limitations, that should be fixed on Pglite side:
|
|
|
|
- [Attempting to refresh a materialised view throws error](https://github.com/electric-sql/pglite/issues/63)
|
|
|
|
- [Attempting to SET TIME ZONE throws error](https://github.com/electric-sql/pglite/issues/62) |