Hacker News new | ask | show | jobs
by drej 1233 days ago
Note that this already exists on top of SQLite proper - authored by Ben Johnson (Litestream, Fly.io etc.) - https://github.com/benbjohnson/postlite
1 comments

I think they are quite different it seems. Postlite expects you to connect over the postgres wire protocal. Sqld is compiled into your application so your application behaves like it's talking to an embedded sqlite, the calls are then made over the network (using one of three available transports) before being returning to your application.
Dumb question, with all of this newfangled WASM stuff, why couldn't we also bake the Postgres server (and then client) into the code? I know the WASM runtime would need to expose the low-level ability to do filesystem operations, mmap()ing, network sockets, etc.
Then you'd need to run and maintain Postgres, which is much more complicated, not just a single database file.

Postgres also can't be embedded (according to some brief googling), so you'd need to run it as a separate process.

This would be handy for apps that use Postgres features, that would; nonetheless work in WASM.