Live data from Hacker News

Supabase-JS v2

supabase.com

41–50 of 82 posts

Re: Supabase-JS v2

#41

I'm going to have to very kindly ask the Supabase devs to stop making such an appealing development platform as I don't have the time/energy to rewrite my existing web/apps. But for real, congrats on this and it looks very nice. At this point I'm just waiting on a new project that would be a good fit so I can play with all of this. Keep up the great work!

I think the best part is that if you're willing to go all in on RLS for your authorization, you can do away with needing a backend for your typical crud operations and use their functions for things like webhooks, or the occasional endpoint for more complicated operations.

I can't quite get onboard with RLS directly from the client. It seems like a risky and finicky thing to design database access patterns around, but they might be a stroke of genius that I'm too blind to see right now.

Re: Supabase-JS v2

#43
post #12

Much prefer the DX of the types inferring from the `from` and `select`. Also really love that `insert` now understands if a field is required (or has a server-side default etc.) Unless I am missing something we seem to have lost all typing for Views? And it is less clear how to use PostREST style embedding?

> we seem to have lost all typing for Views

I've sent this to the team. We generate the types directly from database, so it's definitely possible.

> PostREST style embedding

For now, you'll need to do something like this:

https://supabase.com/docs/reference/javascript/next/typescri...

In future releases I think we'll have an approach which doesn't require any manual intervention, but for this release we wanted to keep the upgrade path relatively simple (it will probably require us to change from strings - `select('id, name')` - to objects)

Re: Supabase-JS v2

#44

Anyone running projects with just Next.js + Supabase and no traditional backend?

I tried to make this work for me, but I finally gave up this week and wrote a traditional backend component for part of my backend because supabase doesn't support transactions and I am NOT going to write my whole backend in postgres functions.

Re: Supabase-JS v2

#45
post #44

Anyone running projects with just Next.js + Supabase and no traditional backend?

I tried to make this work for me, but I finally gave up this week and wrote a traditional backend component for part of my backend because supabase doesn't support transactions and I am NOT going to write my whole backend in postgres functions.

supabase does support transactions through RPC calls - I think you already understood that based on your comment but want to make the distinction clear for other readers

I can completely understand if you don't to write everything in pgpsql though. Did you also try the Deno Functions?

We've been brainstorming ways to support transactions directly from the client libs in a way that won't lock up the database if there is a network failure between database operations. It seems doable, but not something we want to rush.

Re: Supabase-JS v2

#46

Maybe it's been discussed before but since it's a VC backed company, what's their business model? They raised a ton of money. How do they plan on getting that back?

supabase ceo here. we have a hosted platform - you can sign up and spin up a postgres database, and we charge you $25/month (+ additional usage over a certain quota). This model is proving to be fine for us. It's very common for developers to pay for a database, especially a full Postgres database (more-so than say, a frontend hosting solution). We have a free tier too, where we pause the database if it is unused for…

Where does the actual hosting happen? AWS?

Re: Supabase-JS v2

#47
post #44

Earlier quoted context omitted.

I tried to make this work for me, but I finally gave up this week and wrote a traditional backend component for part of my backend because supabase doesn't support transactions and I am NOT going to write my whole backend in postgres functions.

supabase does support transactions through RPC calls - I think you already understood that based on your comment but want to make the distinction clear for other readers I can completely understand if you don't to write everything in pgpsql though. Did you also try the Deno Functions? We've been brainstorming ways to support transactions directly from the client libs in a way that won't lock up the database if there…

I will give deno functions a look -- I haven't really looked into them.

And for the record I am still loving supabase overall. PostgREST works for 90% of what I want to do and I can spin up a simple stateless backend to support the other 10%.

Re: Supabase-JS v2

#48
How do you limit the queries allowed in the UI aka prevent someone from making a really slow / large query? Do you general not use supabase directly in the UI and write an API that your front end can call instead?

Re: Supabase-JS v2

#49
I'm having a bit of difficulty understanding what supabase is.

I thought it was a Postgres database that gave you a PostgREST HTTP API interface.

If that's the case... what does the javascript library do?

Re: Supabase-JS v2

#50

I'm having a bit of difficulty understanding what supabase is. I thought it was a Postgres database that gave you a PostgREST HTTP API interface. If that's the case... what does the javascript library do?

The JS library is an interface to the HTTP API which handles functionality such as authentication, querying (and the likes) and more complex functionality such as real-time updates. I notice V2 also included auto-generated type defs for various table columns
Post reply on HN