Live data from Hacker News

PGlite – Embeddable Postgres

pglite.dev

51–60 of 118 posts

Re: PGlite – Embeddable Postgres

#51

Hey everyone, I work on PGlite. Excited to see this on HN again. If you have any questions I'll be sure to answer them. We recently crossed a massive usage milestone with over 3M weekly downloads (we're nearly at 4M!) - see https://www.npmjs.com/package/@electric-sql/pglite While we originally built this for embedding into web apps, we have seen enormous growth in devtools and developer environments - both Google Fir…

This looks really interesting...but why WASM-only? Naively it seems like WASM-ification would be a 2nd step, after lib-ification. Obviously missing something...

WASM means you only need to develop for one target run time. That's my guess as to why.

Re: PGlite – Embeddable Postgres

#53

Hey everyone, I work on PGlite. Excited to see this on HN again. If you have any questions I'll be sure to answer them. We recently crossed a massive usage milestone with over 3M weekly downloads (we're nearly at 4M!) - see https://www.npmjs.com/package/@electric-sql/pglite While we originally built this for embedding into web apps, we have seen enormous growth in devtools and developer environments - both Google Fir…

This looks really interesting...but why WASM-only? Naively it seems like WASM-ification would be a 2nd step, after lib-ification. Obviously missing something...

If I understand correctly, what this project does is take the actual postgresql sources, which are written in C, compile them to wasm and provide typescript wrappers. So you need the wasm to be able to use the C code from js/ts.

Re: PGlite – Embeddable Postgres

#54

Earlier quoted context omitted.

This looks really interesting...but why WASM-only? Naively it seems like WASM-ification would be a 2nd step, after lib-ification. Obviously missing something...

If I understand correctly, what this project does is take the actual postgresql sources, which are written in C, compile them to wasm and provide typescript wrappers. So you need the wasm to be able to use the C code from js/ts.

Yes. I would like to use the code as a library from something other than js/ts.

Re: PGlite – Embeddable Postgres

#56

Hey everyone, I work on PGlite. Excited to see this on HN again. If you have any questions I'll be sure to answer them. We recently crossed a massive usage milestone with over 3M weekly downloads (we're nearly at 4M!) - see https://www.npmjs.com/package/@electric-sql/pglite While we originally built this for embedding into web apps, we have seen enormous growth in devtools and developer environments - both Google Fir…

Amazing work! It makes setting up CI so much easier.

huh. could you tell how you use it in ci?

Re: PGlite – Embeddable Postgres

#57
At work we started building a new internal service and decided to try this out for the test setup. We built a small wrapper which seamlessly uses PGLite when running tests and actual Postgres instance otherwise. Great success!

The ability to .clone() the database to create "checkpoints" is also great for tests, as we can run all of the migrations and return to that clean state between each test. Running 50 test suites in parallel is also so easy with this setup.

Re: PGlite – Embeddable Postgres

#58

Hey everyone, I work on PGlite. Excited to see this on HN again. If you have any questions I'll be sure to answer them. We recently crossed a massive usage milestone with over 3M weekly downloads (we're nearly at 4M!) - see https://www.npmjs.com/package/@electric-sql/pglite While we originally built this for embedding into web apps, we have seen enormous growth in devtools and developer environments - both Google Fir…

Thanks for your work!

Is the project interested in supporting http-vfs readonly usecases? I'm thinking of tools like DuckDB or sql.js-httpvfs that support reading blocks from a remote url via range requests.

Curious because we build stuff like this https://news.ycombinator.com/item?id=45774571 at my lab, and the current ecosystem for http-vfs is very slim — a lot of proofs of concept, not many widely used and optimized libraries.

I have no idea if this makes sense for postgres — are the disk access patterns better or worse for http-vfs in postgres than they are in sqlite?

Re: PGlite – Embeddable Postgres

#59

What is the advantage of using something like this instead of the IndexedDB Browser Feature

I was shocked to discover how incredibly poorly IndexedDB works. I always thought it would be fast and snappy if a bit alien. But nope, it's incredibly bad!

Despite being a native feature to the browser it's incredibly slow, and the way it works in terms of fetching records based on non-primary keys forces you to either load your entire dataset into RAM at once or iterate though it record-by-record in a slow callback. Something as trivial as 10k records can bring your webapp to a crawl.

Re: PGlite – Embeddable Postgres

#60

Hey everyone, I work on PGlite. Excited to see this on HN again. If you have any questions I'll be sure to answer them. We recently crossed a massive usage milestone with over 3M weekly downloads (we're nearly at 4M!) - see https://www.npmjs.com/package/@electric-sql/pglite While we originally built this for embedding into web apps, we have seen enormous growth in devtools and developer environments - both Google Fir…

Does pglite in memory outperform “normal” postgres?

If so then supporting the network protocol so it could be run in CI for non-JS languages could be really cool

Post reply on HN