Questions tagged [supabase-database]

Supabase is a database solution powered by PostgreSQL. Under the hood, Supabase uses PostgREST, an open source tool to make automatically create REST API for PostgreSQL databases. Supabase utilizes row level security feature on top of PostgREST to provide authorization. Use this tag when you are having problems, and not to ask for new features.

Supabase Database is a component of Supabase that automatically creates RESTful APIs for your Supabase database backed by PostgreSQL. Under the hood, Supabase uses PostgREST, an open source tool to create REST APIs for your PostgreSQL database. Supabase utilizes row level security feature on top of PostgREST to provide authorization. Use this tag when you are having problems, and not to ask for new features.

Supabase Database comes with:

  • intuitive table editor
  • clients in various languages to communicate with the database
  • SQL editor to easily run SQL on your database
330 questions
1
vote
1 answer

Supabase Redirect URL not working for Deeplinking

I am using Supabase for Auth with React Native and using React Navigation. When the user requests for password reset I set a redirect URL myApp://updatepassword. This link comes back with the link in the email but only always opens the…
1
vote
1 answer

How can I check if a row with a specific column value exists

My goal is to see if a row exists with the user's email. If it exists, do nothing. If it does not exist, create it. I've tried a few variations of the function below, but it fails every time when I use OAuth, printing an error that a row with that…
Globe
  • 169
  • 11
1
vote
1 answer

Supabase to React data fetch error - supabaseUrl is required

I'm trying to set up my React app with Supabase for fetching data but everytime getting the error Uncaught Error: supabaseUrl is required. Error Image I've checked all the previous answers but still getting the error: My .env.local…
shry
  • 11
  • 3
1
vote
2 answers

How to query joins from multiple table using Flutter SupaseClient

This is my schema I am trying to fetch a list of events from the table along with the host info and the list of attendees by matching events.host_id with user.user_id and events.event_id with 'attendees.user_id` Schema user(user_id, name,…
Mahesh Jamdade
  • 17,235
  • 8
  • 110
  • 131
1
vote
1 answer

Session always returns as undefined in Expo app using Supabase auth

I am following this example - https://supabase.com/docs/guides/with-expo The login and account creation works as expected. The issue is on the accounts page the Session is returning at undefined even when a user is logged in. Here is the…
herbie
  • 335
  • 2
  • 14
1
vote
1 answer

Supabase : PGSQL Function will not Validate

I am trying to create a PGSQL function that uses HTTP to get some json, format it, and insert it into a table using the donation_id key as a row constraint to prevent duplicates. I have tried this function: BEGIN INSERT INTO donations( …
Scyne
  • 33
  • 6
1
vote
2 answers

Supabase custom claims

I was looking for a way to implement RBAC in supabase, then I have stumbled upon this.However when I try to run the set_claim in a trigger function which runs on insert of new user, I get error that function doesn't exist. There is an open issue…
ProllyGeek
  • 15,517
  • 9
  • 53
  • 72
1
vote
1 answer

How to insert and query clients favorite restaurants in supabase

I have created clients, restaurants and favorites tables in supabase and linked them using foreign keys, I want to list a client's favorite restaurant if any and also insert favorite restaurants when the client clicks on the favorite icon. The…
1
vote
1 answer

Unable to add foreign key in Supabase

I am following Build a SaaS product with Next.js, Supabase and Stripe course by Jon Meyers. I am facing issue in Add Relationships Between Tables in Supabase Using Foreign Keys part. I have created a table called profile where id and created_at were…
coderX
  • 183
  • 1
  • 14
1
vote
3 answers

I can’t get Supabase real-time listen to Postgres changes to work

Inspired by the Supabase docs, I have this code in a React Native app: useEffect(() => { if (session?.user?.id === null) return const channel = supabase .channel('value-db-changes', { selfBroadcast: true }) .on( …
Tom Söderlund
  • 4,743
  • 4
  • 45
  • 67
1
vote
1 answer

Authenticated requests to web server from client logged in with Supabase

In my case, I have a web client, a web server and a desktop app. First the user creates a profile in the web client with email and password. At this point, once it's in the homepage, the user connects 3rd party services using OAuth2.0. The server…
1
vote
1 answer

Supabase join and nested select

Let's say I have 3 tables: Table1 (id, col1, col2) Table2 (id, col3, col4) Table3 (table1_id, table2_id) What I want to do is to join Table1 and Table2 and then select the rows with a specific column value (for example col4 == "123") What I…
Fabio
  • 376
  • 6
  • 19
1
vote
1 answer

How to reset the auto incremented id column to 1 whenever I seed the database in postgreSQL?

I am using Supabase as a backend which provides postgres as its database and prisma for my next-js app. I wanted to seed some dummy data into the database. The first time I run the seed script, everything's fine but when I ran the script multiple…
1
vote
2 answers

Make DOM live update with SvelteKit and Supabase

I am using SvelteKit with Supabase. Whenever the form is submitted I would like to see the DOM live update. However, it takes a refresh to see the changes. How would I live update the DOM whenever a new row is inserted into the table?