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
3
votes
1 answer

Update multiple rows in a single query in a Supabase Database (postgres)

I looking to update multiple rows via a single query in Supabase. I'm struggling to find an example of how to do it online. For this example here is how the data exists the database's 'food'…
Jake Anderson
  • 309
  • 1
  • 4
  • 18
3
votes
2 answers

How to set run time variable to postgresql in typeorm and nest js

Iam using the row level security in supabase with nest.js, So how can I set runtime variables safely to the DB so that I can be sure that the variables sync with each app user (due to the http request triggered the execution)? I saw that it is…
3
votes
1 answer

Supabase database size issue

I am quite new to Supabase. Please clarify this: I have a table in the database and its only 32KB in size.(2 columns and 2 rows of data only) So why it is showing a Database Space Usage (under Settings > Database Usage) as 30 MB out of 512 MB Does…
3
votes
2 answers

Cannot access env variables next.js

I'm creating an app with Next.js and Supabase. When I create the client in /utils/supabase-client.js, it throws the error that Error: supabaseUrl is required.. Here is my file: import { createClient } from '@supabase/supabase-js' const supabaseUrl…
3
votes
1 answer

Supabase: How to automatically update a timestamp field after updating a row?

What DB I am using? Supabase hosted version What do I need? After I update a row with .update({ name: 'Middle Earth' }) method I need to automatically update also a timestamp in my table. How can I update automatically a timestamp?
Jakub Szlaur
  • 1,852
  • 10
  • 39
3
votes
1 answer

supabase: how to reference files within tables

I want my users to be able to upload reports (PDFs). For this purpose, I have created a table of "reports" and thought that I can reference the object stored there. Therefore I created a column "file" with the foreign key reference to the object…
K. D.
  • 4,041
  • 9
  • 48
  • 72
3
votes
1 answer

Supabase Self hosting issue

I am trying to host Supabase with a separate PostgreSQL DB. According to their docs, they say that Supabase uses pgjwt for auth. However, AWS RDS or Azure PosrgreSQL doesnt not support pgjwt. Is there an alternate for pgjwt for PostgreSQL?? Thanks…
3
votes
1 answer

Role based authentication in Supabase

I am trying to make policy in supabase where a user with admin role can only get list of employees whose role are "agent" There is a "users" table and I am trying to add following policy "(auth.email() in (select users.email from users where…
Yash
  • 223
  • 2
  • 11
2
votes
1 answer

Where to place prisma seed.ts in Next.js 13 with appDir to apply seed data into supabase?

I am trying to apply seed data into supabase database from the Next.js 13 app that using appDir. In some tutorials and articles, you can place seed file in pages/api and once it runs next api server, seed data would be applied. I want to try that,…
Vicky
  • 21
  • 2
2
votes
1 answer

How to pull data from my production supabase database into my local supabase database

I have been trying to fix this problem, I could not search any documentation for this specific problem. I have everyhing setup, the project is linked, the docker is running, I just can not figure out the way to pull data from my production database…
2
votes
0 answers

How to sort by a calculated column in Supabase?

is it possible to sort a db query using the supabase api on a computed value? something like: await supabase .from('drives') .select('distance / time AS speed') .order('speed', { ascending: false }) (yes i know i could call a custom postgres…
stuart
  • 1,785
  • 2
  • 26
  • 38
2
votes
1 answer

Failed to run sql query: must be member of role "supabase_admin" showing in SQL editor

How to get supabase admin role? I am new to Sql editor So I don't know anything
2
votes
1 answer

Access supabase database from edge function as admin

I'm coming from Firebase Function... Where I can use the Admin Library to access database from the Function bypassing all security rules? On supabase I didn't yet find a way to do that, the documentation is very scarce. Now I'm using this code to…
2
votes
2 answers

Supabase realtime connection failing when custom JWT is used

I'm using supabase self-hosted and auth0 for my authentication instead of the default authentication provided by supabase. So I'm signing my auth0's payload with supabase secret and sending it in headers. const payload = { userId: user.email, …
2
votes
1 answer

How to use the signUp() method in Supabase to add additional user info when signing up

I am attempting to build a Vue.js application that includes authentication with Supabase. I wish to use the built-in Supabase signUp() method to handle additional user data when signing up. To do this, I added a property to the signUp object that…
1 2
3
21 22