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

Supabase realtime "error occurred when joining realtime:public:"

I upgraded from Supabase-Js v1 to v2. After doing so, my previously working realtime subscription all fail and create the following error: Question What does this error message mean? Why does the error occur and how could I fix it? I think the table…
0
votes
1 answer

Trouble saving text to the Supabase Database on onChange in a form

I'm working on something that uses onChange saving (like auto saving on Gmail or docs on Google Docs) and I would like to save text from on onChange. I can do it with just displaying text from the input on onChange and then printing it in the…
0
votes
0 answers

How to handle redirect for update.UserAttributes in Supabase

Currently when I try to update email using: await Supabase.instance.client.auth .update(UserAttributes(email: newEmail)); It sends a link to the new email for confirmation but when I click on it, it doesn't redirect to the app…
0
votes
1 answer

Issues with React hooks/async behavior

There is some kind of a problem with this code, so I've been "debugging" it with console.log(). The result here doesn't make any sense. What's wrong with this code? I was curious why my console.logs in "useEffect" were null, so I"ve checked it along…
0
votes
1 answer

Error 42501: "Permission denied for schema public", in NextJs

I'm new to Supabase and experimenting with building a new Next.js app using it. Below are the steps that I've taken thus far that led to the error: I initialized a fresh Next.js app using npx create-next-app I installed Supabase using npm i…
sulaim
  • 1
  • 1
0
votes
1 answer

Supabase select data with relation

I have two tables: users (id, name) and tasks (id, user_id, status, ...). I would like to get list of all users with information (count) how many unfinished tasks they have (based on tasks.status value). I expect result like that: [ { id: 1, name:…
0
votes
1 answer

Supabase rc 2 typescript types from remote db

For supabase 1 there was open-api to generate types for typescript which is pretty clear: https://supabase.com/docs/guides/api/generating-types npx openapi-typescript https://your-project.supabase.co/rest/v1/?apikey=your-anon-key --output…
Dawe
  • 562
  • 1
  • 9
  • 19
0
votes
1 answer

Can we listen to changes in csv file in a supabase table?

Having a CSV file, after importing it to the Supabase Database, how can we listen to the changes in the same CSV file? Is uploading the CSV file in the Storage and then writing a Hook Function to check if the CSV file is updated a solution?
Taha Aslam
  • 21
  • 3
0
votes
1 answer

Supabase & @nuxtjs/supabase not getting the correct data from join table

I use the @nuxtjs/supabase module (essentially supabase-js). I have a table "challenges" and two join tables "profile_challenge" (to assign the challenge to a profile) and "challenge_category" (to assign categories to the challenge). Both of these…
0
votes
1 answer

Self Hosting with Supabase - what are the next steps

I followed this guide in the supabase docs to get started with self-hosting. The issue is that the information is very limited. After telling you how to run Docker, open localhost, and create API keys, there’s no more instructions. I’m extremely new…
Globe
  • 514
  • 3
  • 17
0
votes
1 answer

Supabase triggers : Getting syntax error at or near "select" (SQL)

Iam trying to insert a new row in profiles table when a new user is created in auth table using a trigger in the supabase dashboard But when creating the function for the trigger I get Failed to create function: failed to update pg.functions with…
0
votes
1 answer

How to structure chat messages in supabase database?

There are many questions available for the firebase chat structure. But I cant figure out how to structured in supabase. As I think, case 1: In one table store every message of all chat room. In this case billions of row will inserted of…
tailor
  • 373
  • 4
  • 19
0
votes
2 answers

SELECT if array column is NULL or DOESN'T contain input value in Supabase

I want to write an SELECT statement using Supabase-JS library, where it would return all rows whose associated_campaigns (array of UUIDs) column is either null or doesn't contain input string. I'm trying with something like this, where campaign_id…
kecman
  • 813
  • 3
  • 14
  • 34
0
votes
1 answer

Can I do this query in plpgsql?

I have a table USER with 3 columns ID, Flag (boolean), and partnerID. What I want to achieve is that each ID is randomly inserted into the partnerID column. The following rules should be followed: If Flag has the value false, NULL should be set…
D.Doe
  • 89
  • 2
  • 10
0
votes
1 answer

Filter query by current user

Schema: DB Schema How do I filter a query based on the current user in a joined table? The closest I've come is with using: query = supabase.from('shows').select('*, user__shows!left (*)') if ($user) { query = query.not('user__shows.watched',…
user19896971