Live data from Hacker News

Postgres WASM

supabase.com

141–150 of 190 posts

Re: Postgres WASM

#141

Earlier quoted context omitted.

I'm curious -- what's the intended use case for this? This is something we could try to add if gives some cool new functionality.

passing devices through to do libusb stuff with them (like OBD diagnostics on cars)

Oh, so it's not related to PostgreSQL. I'm super interested in new and different uses for WASM. This could open some new doors.

Re: Postgres WASM

#142
Got excited thinking this was the wasmer runtime for postgres that I'd looked at and hasn't seemed to make any progress for a couple years not.

Re: Postgres WASM

#143
post #130

Earlier quoted context omitted.

why most it be postgres and not sqlite? just curious on what you were looking for out of it

Why Postgres? (There's already a WASM version of SQLite [0], btw, and it's very cool.) We did this with Postgres for a number of reasons: 1. It's a slightly difficult task, and in doing this we hope to spur others to think about using WASM to run things they didn't think were possible before. Before Crunchy did this, nobody really knew this was possible. This project is a framework for you to port something new and e…

oh i mean i can see why you as a supabase employee would want it, just wanted to get more opinions from third parties :)

Re: Postgres WASM

#144

Earlier quoted context omitted.

Supabase developer here. I've used this to move data from a live Supabase database down to the browser for testing and playing around with things in a "sandbox" environment. Then I save snapshots along the way in case I mess things up. To move a table over from my Supabase-hosted postgres instance to the browser, I just exit out of psql and run something like this: pg_dump --clean --if-exists --quote-all-identifiers…

Correct me if I'm wrong, but given your profile (I assume someone in the tech world), nothing stopping you from doing all of the above with a local pg. If installing is annoying you could run it in docker.

Generally use docker myself for this... pg + pgadmin + volume.. spin up when needed, down when not. Works pretty well.. I can see this being useful too though.

Re: Postgres WASM

#146
> postgres-wasm is currently about 30mb. So at this stage, running Postgres in the browser isn't great for general use-cases.

Don't see why thats a hindrance... Presumably you'd be storing GBs of data with this client-side. Whats 30mb in that context?

Amazing job... very excited to see this develop along with more wasm.

Re: Postgres WASM

#147

Very impressive technically, but what are the practical use cases for this? We have IndexedDB and WebSQL, so apart from the other comments mentioning using it in tutorials, I'm not sure what the value add is. edit: as always, I should read the whole article first. The idea of using it as a dev environment is very cool.

There are some things that are uniquely beneficial for Postgres beyond the data storage - the main one I'm excited about is using PostGIS inside the browswer. OSM + PostGIS in the browser has the potential to do for Maps, what Figma's WASM approach did for design.

> OSM + PostGIS in the browser has the potential to do for Maps, what Figma's WASM approach did for design.

Can you elaborate on this analogy?

Re: Postgres WASM

#148
would this make it possible to install Postgres from NPM for local development? could make it much easier to build/run an app vs. installing Postgres on the machine directly, or running in a Docker container.

Re: Postgres WASM

#149

Earlier quoted context omitted.

Replied to the wrong person, but I'll take that bait anyway: "Ahahahaha, no". That only works if you live a blissful "all my hosted pg instances use the exact same version" world, which I've never seen be the case for even moderately sized projects. You're going to need multiple Postgres installs if you're going to need pg_dump/pg_restore, which you probably are. (How you solve that problem, of course, is not a one-s…

Doesn’t pg_dump/pg_restore work across versions? (So long as the CLI tools are the latest version). I guess version compatibility could be an issue in theory, but I’m yet to hit into a backwards compatibility issue with Postgres.

I wish. You'd think it'd just be able to check the db to see if there's any schema or procedure incompatibility, but it doesn't. Instead, it goes "Remote uses version X and you're using version Y, sort that out" and then it exits.

Re: Postgres WASM

#150
The most important piece of jigsaw left is writable local file access api. Yet, no energy put to do it! Security shouldn't be a stopper but a thing to be solved, probably only allow installed pwa app write with little cute settings widget like on mobile to see which apps have accessed to local machine's storage, showing path, usage size, etc. It's like conspiracy to leave Chrome do it alone. Strange!
Post reply on HN