Hacker Newsnew | past | comments | ask | show | jobs | submit | more burggraf's commentslogin

Yes, we can include postgis. I'm currently investigating how to include other PostgreSQL extensions as well. A fair number of standard extensions are already included, but there are more we need for a full Supabase implementation.


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/


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


So I've been using this for a couple weeks now on my mobile phone. There's really no reason to do this, other than I'm sitting in a car waiting for my wife to come out of the grocery store and I just feel like writing some some SQL code -- because I can. If you noticed, there's a little keyboard icon at the top of the demo that toggles on a mini keyboard with ^c, ^d and cursor keys. That's because the iPhone doesn't have those keys, and I'd start pinging a server and realize I can't break out of it and now I need to reset the whole emulator. Anyhow, that's why that little toggle is in there. :)


Wow, this is awesome! So as I understand it, this uses Postgres and JSON fields to emulate the features of MongoDB, sort of as an abstraction?


Thank you! It's exactly that: basically you don't need to keep an additional MongoDB instance if you already use and maintain a Postgres server somewhere.

I translate the JSON-based query interface into the corresponding SQL statements, leveraging the excellent JSON support that PostgreSQL offers.


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.


Could you tell me at a high level how you would implement in your mind/opinion passing USB devices through v86/WebUSB/libusb?


I love how you guys are already pushing us to think about performance issues on this project. Hacker news really pushes technology to the next level!


A good comparison might be something like Flatpak or gVisor.


Yes, you probably could do that. It's something I've considered. Early on before I got the networking working through the proxy I found a way to use arp to connect multiple browser tab versions of this in a pseudo-private-network configuration. It only works locally and only works inside chrome, and only a single instance of chrome at that. But it was cool idea and the only use case I could think of was setting up a local cluster of Postgres instances within the browser. And my kids think playing video games is fun! Meh.


This is cool! It's running debian and posgres 11. It's quite a bit larger (that's why we went with Buildroot, and frankly, we could do a lot better at trimming things down even more). But it's definitely a great implementation!


yes. this is just a test dummy for something bigger I have. we should chat. Feel free to DM me.


I originally went with buildroot too, but then I realized some things...


Would love to chat! Love to get your ideas on this.


what is the best way to contact you.


You can email me at mark @ supabase dot io. (Yeah, I know there are probably robots that can parse that as valid email address, but I'm old-school :))


got it.


Supabase developer here. Yes we'd love to collaborate on a native WASM version. I tried this first before starting on this project and I didn't get very far. I'll have to go back to my tests on that, but it seemed like WASM wasn't yet capable of compiling Postgres due do some libraries not being supported. Hopefully we can find workarounds or push WASM into a new era of compatibility :)


Supabase developer here. I've tried compiling directly to WASM, but it did not go well. As I recall, there were features used by PostgreSQL that WASM didn't support yet. This is definitely something we'll revisit though, especially as WASM matures!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: