Lurker News
Hey, Sam and the team from ElectricSQL here.

PGlite is a WASM Postgres build packaged into a TypeScript/JavaScript client library, that enables you to run Postgres in the browser, Node.js and Bun, with no need to install any other dependencies. It's 3mb Gzipped, now has support for many Postgres extensions, including pgvector, and it has a reactive "live query" API. It's also fast, with CRUD style queries executing in under 0.3 ms, and larger, multi-row select queries occurring within a fraction of a single frame.
PGlite started as an experimental project we shared on X, and the response to it was incredible, encouraging us to see how far we could take it. Since then we have been working to get it to a point where people can use it to build real things. We are incredibly excited as today, with the release of v0.2, the Supabase team has released the amazing http://postgres.new site built on top of it. Working with them to deliver both PGlite and postgres.new has been a joy.
- https://pglite.dev - PGlite website
- https://github.com/electric-sql/pglite - GitHub repo
- https://pglite.dev/docs - Docs on how to use PGlite
- https://pglite.dev/extensions - Extensions catalog
- https://pglite.dev/benchmarks - Early micro-benchmarks
- https://pglite.dev/repl - An online REPL so that you can try it in the browser
We would love you to try it out, and we will be around to answer any questions.

Comments (108) 37 threads

Earlier comments
cheema331 reply#
The filesystems page at https://pglite.dev/docs/filesystems says the following:

> "We would recommend using the IndexedDB VFS in the browser at the current time as the OPFS VFS is not supported by Safari."
Is it possible to configure PGLite to use IndexedDB on Safari and OPFS on Chrome & Firefox?

netghost#
Looks like you configure it with the connection string, so assuming you can just detect whether OPFS is available or swap based on the browser you should be fine.
drzaiusx11#
Anyone know if something similar is available for MySQL/Maria? This is very cool, especially given the tiny size of it
srameshc2 replies#
If I understand correctly, this is like SQLite, but Postgres. I love SQLite, but sometimes I need a little more. So, no more saving Date as text and we have arrays, jsonb etc and all the good stuff from Postgres. Am I right ?
samwillis#
Exactly, all your favourite PG types, plus any that come with extensions such as vectors with pgvector.

We are working on PostGIS to, which will bring the geo types to PGlite.

aitchnyu1 reply#
IIRC Sqlite can exist as flat file and can be backed up. Will this work the same? And will it allow multiple writers?
srameshc#
Every use case and expectations are different IMO. And yes if it's a file system , you can always grab a way to keep a snapshot. Too early for this project to deliver everything at one go.

Load more comments