PGlite - Embeddable Postgres
46 points by linkdd
46 points by linkdd
This would be a great test setup to get temporary in-memory PG, without having to run a real server. Interesting.
The pglite.wasm served on this page is 2.71MB gzipped, 8.86MB uncompressed. They're certainly getting their money's worth out of gzip compression! Impressively small binary for what's inside.
My main issue with SQLite has been the lack of descriptive error messages when the query is written wrong. might have to give this one a try :)
I'm looking for a way to run PostgreSQL within the JVM environment for better integration with my infrastructure. Does anyone have experience of running PGlite on GraalVM?
I have no experience with Java, but since PGlite is using WASM, I found this: https://www.graalvm.org/webassembly/docs/
Could this work?
To use existing drivers, you're going to need to send and receive the postgres protocol over TCP.
They provide a proxy for this https://pglite.dev/docs/pglite-socket
Although, in theory, drivers could be adapted to talk directly to a pglite instance.
I wonder how a cosomopolitan/APE version of PG would compare. So far it doesn't look like any work has been done getting PG to build/run from cosmocc.
I'm starting to build some small tiny programs under cosmo and so far it's really nice. I haven't tried anything large yet.
Seems like it's not quite the same use-case as WASM, since cosmo doesn't run in a browser, but otherwise the idea seems similar at least in large generalized terms, run code all over the place. Except WASM works great in the browser and is just now starting to work on other platforms, where cosmo runs everywhere but the browser.
For local development, there are a few projects that provide Postgres binaries, for example:
Although WASM is a very intriguing option. I'm just waiting for a WASM Debian port :)