Live data from Hacker News

Postgres WASM

supabase.com

131–140 of 190 posts

Re: Postgres WASM

#131
Stephen Grider made a cool website[0] that allows people to make and use databases using PostgreSQL statements for his udemy course[1] about SQL. It's great for learning and testing and has been around a while so I feel like he should get some attention/credit too

[0] pg-sql.com/

[1] https://www.udemy.com/course/sql-and-postgresql/

Re: Postgres WASM

#132

Earlier quoted context omitted.

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.

But now instead of the annoyance of installing pg, you have the annoyance of installing docker. and then writing a dockerfile. And then bootstrapping docker. etc. etc. =)

Installing pg is hardly annoying. `brew install postgres`. Done.

Re: Postgres WASM

#133
Designed for browsers but... presumably can be run in Node? I'm thinking this would be perfect for tests, to avoid spinning up a standalone postgres server every time.

Re: Postgres WASM

#134

Earlier quoted context omitted.

But now instead of the annoyance of installing pg, you have the annoyance of installing docker. and then writing a dockerfile. And then bootstrapping docker. etc. etc. =)

Installing pg is hardly annoying. `brew install postgres`. Done.

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-size-fits-all, and Docker may be the answer... or it may not)

Re: Postgres WASM

#135

Earlier quoted context omitted.

Could I hypothetically pass USB through to v86? Like libusb on the host into v86 on the guest? Or do USB over IP or something?

Chrome supports a USB api that could potentially work for that, https://developer.chrome.com/docs/extensions/reference/usb/ sadly though it's chrome only, not a standard of any kind (no other browsers support it that I know of). ESPHome can use it to program microcontrollers (along with the serial port support).

Isn't that because it was explicitly rejected on grounds of security & privacy concerns, rather than 'oh if only others would be up with Google on implementing new features'?

Re: Postgres WASM

#136

Stephen Grider made a cool website[0] that allows people to make and use databases using PostgreSQL statements for his udemy course[1] about SQL. It's great for learning and testing and has been around a while so I feel like he should get some attention/credit too [0] pg-sql.com/ [1] https://www.udemy.com/course/sql-and-postgresql/

I’d love to see udemy courses on postgresql administration beyond the basics… I’d love something to get you to, say, a junior-level dba. Focused on postgresql of course.

Re: Postgres WASM

#137

One interesting use case that wasn't mentioned is edge computing. If you buy into Chrome-as-a-container that can run on an "edge" more easily than a data center, this is a step in that direction

And those are very likely to have tcp sockets at some point in the future (or at least that is the hope!)

Funny thing is that Chrome used to have sockets. As an extension but they solidly worked. I wrote a socks proxy that ran in the browser. It worked really well.

Re: Postgres WASM

#138
post #130
post #129

This seems a step closer to the embeddable postgres I've wanted for ages.

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 exciting to run under WASM in the browser. What's that going to be?

2. We love Postgres. It's our favorite database and this tool gives us a quick and simple sandbox to try out new things that might mess up our production (or even dev) database. Got a crazy idea that might not work? Try it in the browser and if it doesn't work, refresh the page and start over.

3. My goal is to eventually have an entire version of Supabase running in the browser as a basic dev / experiment tool. This would make a great quick and easy way to try out Supabase, or even to do full scale development, after which you can migrate your data up to your staging or production databases.

[0] https://sql.js.org/

Re: Postgres WASM

#139

Earlier quoted context omitted.

Installing pg is hardly annoying. `brew install postgres`. Done.

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.

Re: Postgres WASM

#140

Earlier quoted context omitted.

Could I hypothetically pass USB through to v86? Like libusb on the host into v86 on the guest? Or do USB over IP or something?

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)
Post reply on HN