Live data from Hacker News

PGlite – Embeddable Postgres

pglite.dev

101–110 of 118 posts

Re: PGlite – Embeddable Postgres

#103

I was evaluating local storage solutions a while back and I tried setting up PGlite, but unfortunately I couldn't get it to work in Next.js with Turbopack in a web worker. I've been using SQLite locally instead with wa-sqlite and it's been working great for my use case so far. It's also more lightweight.

How are you measuring "lightweight" here, what do you mean by it? (Not doubting your claim this just seems one of those words that means many different things depending on the context.)

Primarily bundle size. Pglite is a 3 MB binary, SQLite is <1 MB.

Re: PGlite – Embeddable Postgres

#105

Earlier quoted context omitted.

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

Sounds you only need to create the APIs for calling into WASM if so, so as long as your language of choice can do that, you're good to go.

That adds extra unnecessary complexity. The code is written in C. There are C compilers for all CPUs. So just call the C code from .

Re: PGlite – Embeddable Postgres

#106

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…

Hi there, would you like to share the progress of converting PGlite into a native system library? I can see there is a repo for that, but it hasn't been updated for 5 months

Re: PGlite – Embeddable Postgres

#107

Earlier quoted context omitted.

Sounds you only need to create the APIs for calling into WASM if so, so as long as your language of choice can do that, you're good to go.

That adds extra unnecessary complexity. The code is written in C. There are C compilers for all CPUs. So just call the C code from .

Well, a project has scope.

Looking at the repo, it started as postgres-in-the-browser. An abstract interface with C and wasm as targets is just more scope.

But it looks like the hard part of patching postgres to librar-ify it is already done agnostically in C.

So you just need to ctrl-f for "#if defined(__EMSCRIPTEN__)" to impl those else branches and port the emmake file to make.

Re: PGlite – Embeddable Postgres

#109
post #41

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 is awesome, thanks for your work! Could this work with the file system api in the bowser to write to user disk instead of indexeddb? I'm interested in easy ways for syncing fot local-first single user stuff <3 thanks again

That's a very nice idea, we will look into it!

Re: PGlite – Embeddable Postgres

#110

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…

Hi there, would you like to share the progress of converting PGlite into a native system library? I can see there is a repo for that, but it hasn't been updated for 5 months

We are actively looking into it. But as you can see from the comments here, there are quite a lot of other features that users want and we have limited bandwidth. We will do it!
Post reply on HN