All Questions

Tagged with
Filter by
Sorted by
Tagged with
19 votes
2 answers
9k views

How can I create an enum column in Supabase?

I want to create an enum column in a Supabase table. Supabase uses Postgres under the hood, so I understand that technically it is possible if I do it manually using SQL. But is there any way I can do ...
Sumit Ghosh's user avatar
  • 1,133
12 votes
3 answers
5k views

Supabase: Solutions for column-level security

Currently, I'm using a Supabase database. One of the big roadblocks that I'm facing is column-level security, which seems a lot more complicated than RLS. Say that I have a column called is_banned, ...
Dragonsnap's user avatar
6 votes
5 answers
17k views

Error: supabaseUrl is required (supabase) postgresql

i'm using supabase postgresql online, in which important create a .env file where is my online DMBS's URL and anon key is saved and a "supabase client" file also create to access DBMS and ...
Muhammad tanzeel's user avatar
6 votes
2 answers
3k views

Use Supabase with deno

I'm trying to use Supabase with deno. I used import { createClient } from "https://esm.sh/@supabase/supabase-js" but it only gives me errors like Module '"deno:///missing_dependency.d....
Programmer Developement's user avatar
4 votes
2 answers
4k views

Supabase not allowing upload of files into storage bucket

I have a simple script for uploading a .txt file into a Supabase bucket named 'training-data'. The bucket was made public, and I made sure to include the necessary storage/object policies in order to ...
Chubbyman's user avatar
2 votes
1 answer
4k views

Count the occurrences of DISTINCT values using supabase

I want alternative supabase code for this SQL command SELECT order_date,COUNT(*) as count FROM orders GROUP BY order_date ORDER BY order_date Desc; What I am trying to do is, I want the number of ...
Hadi azeez's user avatar
2 votes
1 answer
4k views

Supabase: How to filter data from foreign tables?

hello I wish you a nice day I need help, I want to filter a relational column, I am using Supabase. In the documentation it says that you can find all the rows in the column that satisfy the filter. ....
Florentino Moore's user avatar
2 votes
2 answers
11k views

How to create an sql dump file of a Postgres database using psql

I currently have created a database via Supabase, which uses the Postgres database. After doing so, I then downloaded Postgres on my computer, which gave me the psql command line script for use to ...
Yan Xu's user avatar
  • 47
1 vote
2 answers
1k views

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 '...
Mahesh Jamdade's user avatar
1 vote
1 answer
1k views

Supabase query all posts from followed users that are not liked

I am trying to get all posts from followed users such that the posts have not been liked by the following user (aka me). how can i create a schema and query such a thing in supabase? My current tables ...
Farhan Haider's user avatar
1 vote
0 answers
14 views

Ratelimit or prevent exessive rpc calls on database functions on Supabase

I'm still very new to working with databases so I'm not quite sure how to proceed. I am working on a webapp game where votes can be cast on player submissions. I created a vote function that takes a ...
misterthedork's user avatar
1 vote
0 answers
48 views

Encountering Foreign Key Constraint Error When Deleting Rows in PostgreSQL

I have a PostgreSQL database with two tables, types and order_items where order_items has a foreign key constraint referencing the types table. When I attempt to delete a row from the types table, I ...
JS3's user avatar
  • 1,729
1 vote
0 answers
249 views

Supabase: Type of expression is ambiguous without more context

I have spent more time than I would like to admit on this bug and any help would be appreciated. The bug occurs in this line of code in the fetchUserData() function guard let userId = supabase.auth....
Your Friend's user avatar
1 vote
0 answers
2k views

supabase: error: duplicate key value violates unique constraint "cartItems_pkey1"

I save data on my database with an RLS feature for authenticated users who can only insert, update, and delete their data; this works well. When I save data on the database, I check if any data with ...
Iheanacho Amarachi Sharon's user avatar
1 vote
1 answer
66 views

How do I make a policy to stop inserting a row if two values from the table are the same as the values I plan to insert

I need to check if a booking with the same timestamp and product id has been made before inserting a new row. I am struggling with making this policy and would be great if anybody could help. Here is ...
Felix's user avatar
  • 23
0 votes
3 answers
439 views

Postgresql: remove ability to query every row in a table

I have the following table called "profile": id, name, created_at Every user ( with SupaBase ) has his own row in the "profile" table with his user_id as the key ( id ) I added RLS ...
Redy's user avatar
  • 56
0 votes
3 answers
401 views

Where do we store user data after login in React Native

I am new to React Native and app development. So I am making a basic app that once opened, a modal opens up for use to login. User authenticates with Supabase, and then modal goes away to user can ...
Danny's user avatar
  • 139
0 votes
1 answer
543 views

Trigger Function Permissions Issue in Supabase: Access Denied for Function Called by Trigger

I'm encountering an issue while working with Supabase triggers and function execution permissions. I have set up a trigger to fire after an insert into the auth.users table. The trigger calls a ...
Joerie's user avatar
  • 85
0 votes
1 answer
86 views

Supabase raw_user_meta_data values stored with quotation marks (" ")

I have a function in Supabase like this: declare username text; name text; begin insert into public.users (id, email, username, name, role) values (new.id, new.email, new.raw_user_meta_data -&...
Raka M.A's user avatar
  • 149
0 votes
1 answer
130 views

Can I get a property instead of array of records using supabase select() in join table?

Take a look at the schema visualizer: This is my request: const { data } = await supabase.from('teams').select(` *, members:profiles ( *, roles ( name ), members( ...
MoDrazzz's user avatar
0 votes
2 answers
2k views

supabase realtime subscribe for react

I am trying to display the last value of a supabase table whenever new data is posted to to it. I am using react, currently just trying to log the data to the console, but I am not getting anything. ...
hasin's user avatar
  • 59
0 votes
1 answer
1k views

Supabase on flutter did not return correctly the response

I have several problems with supabase on flutter. I'm trying to get the username of the one who is connected via his id. Here is what I did: getUsername() async { final user = supabase.auth....
Gaetan Taconnet's user avatar
0 votes
2 answers
43 views

How to populate a table from a json array column in another table?

In my Postgres database I naively created a column in table Foos as a json[] that looks like this: TABLE Foos id | ... | baas -------------------------------- 1 | ... | [ | ... | { | ... | ...
JakesMD's user avatar
  • 1,924
0 votes
1 answer
102 views

Supabase payload datatype in TypeScript

I am attempting to use supabase on my ReactJS Typescript project but not sure what is the data type of channel payload response and i wish to get the eventType and new data. const handleInserts = () =...
Sarotobi's user avatar
  • 753
0 votes
2 answers
67 views

PostgreSQL Trigger Function Call Error: "function <function> doesn't exist"

I have a PostgreSQL trigger that fires after an INSERT on the auth.users table, calling a function handle_new_user() which, in turn, calls insert_into_profiles() to add user data to another table. The ...
Joerie's user avatar
  • 85
0 votes
2 answers
158 views

How Can I Query User Via JSONB Data In Supabase?

This is a function that I wrote down to communicate with database and query admin users by a property that I call usertag which is unique for each user. Idk why the function returns null, I mentioned ...
7Wdev's user avatar
  • 47
0 votes
1 answer
726 views

Writing Database Function in PostgreSql - Supabase

I need help with querying data from a PostgreSQL database. Currently on the client side this is the query that is being sent to the server: await Supabase.instance.client .from('books') ...
lostDeveloper's user avatar
0 votes
1 answer
3k views

Supabase-Py: TypeError: __init__() got an unexpected keyword argument 'headers' when making client

I have been using supabase in python without problem but today I got an error when I went to create my client. Code is below, all help would be great. Code from supabase import create_client, Client ...
Garberchov's user avatar
0 votes
0 answers
12 views

Use supabase to back a public API with api key auth

How can I use supabase as a database for a REST API, with some "api key" (something like what Stripe or Twilio does) solution? I am trying to use supabase as the database backend for a ...
Angelica's user avatar
0 votes
0 answers
12 views

PrismaClientValidationError: Invalid `prisma.roomMember.create()` invocation

If I attempt to create a room without including a RoomMember, everything works as expected. However, when I try to create a member using the createRoomAction, I encounter the following error message: ...
saeed Alh's user avatar
0 votes
1 answer
32 views

Why "npx prisma db pull" is blocked on Introspecting?

hello I want to add a table in my database (supabase). So I add this in supabase. And when I try to pull my table (from database supabase) with npx prisma db pull for uptdate prisma schema the command ...
toto's user avatar
  • 1
0 votes
0 answers
24 views

Can I Insert Entire Typed Object Into Table With SQL, Without Specifying Each Column?

This is piggy backing off of this Question. Is there an easier method to implement the SQL statement "INSERT INTO" to an entire table without manually specifying table columns? When using ...
Katerlad's user avatar
0 votes
1 answer
59 views

Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? [2024]

I'm encountering a KnexTimeoutError when attempting to deploy my Node.js application's database changes using a series of npm scripts that utilize Knex migrations. My goal is to rollback all ...
RukshanJS's user avatar
  • 870
0 votes
1 answer
49 views

trouble with functions in postgresql

in SUPABASE functions which is based on Postgresql I want to write a function that gives the customer's name as input then in the body of the function I want to implement this logic that if the ...
Eddy Hezarian's user avatar
0 votes
1 answer
76 views

How do I identify active users on my Nextjs app using Supabase auth?

I want to identify who is on my app so I can place green badges as indicators. I logged into my app (which I have not deployed) through Google OAuth, so the session is stored. However, I left days ago ...
Judeson's user avatar
0 votes
1 answer
179 views

supabase / PostgreSQL RLS Rule leads to "infinite recursion detected in policy for relation \"profiles\""

I am currently familiarizing myself with Supabase and Postgres and RLS-Rules. But these rules lead to an error: response 400 "infinite recursion detected in policy for relation "profiles&...
Henner's user avatar
  • 1
0 votes
0 answers
45 views

Supabase RLS shenanigans (I'm trying to implement an RLS policy to one of my Supabase tables & the policy is automatically changing to something else)

I'm trying to implement an RLS policy to one of my Supabase tables and the policy is automatically changing to something else. I have a table called "Employees" which stores user data ...
SyedHaiderShah's user avatar
0 votes
1 answer
245 views

How do I get the data from the supabase to the flutter?

child: StreamBuilder<List<Map<String, dynamic>>>( stream: Supabase.instance.client.from("todo").stream( primaryKey: [ {"idx": 1}, ], ), ...
ddongyun's user avatar
  • 115
0 votes
1 answer
375 views

Database of Supabase UPDATE doesn't work on Flutter

I had a problem with Database of Supabase on Flutter. I couldn't update the database. I implemented the sign in feature with Google. And I referenced this video: Flutter Database & User ...
atom's user avatar
  • 1
0 votes
0 answers
48 views

Handling 'Not Found' Responses in Supabase when Querying Vector Databases

Recently, I've been experimenting with a vector database. I've successfully inserted some data into it. However, what I want to achieve is implementing a 'not found' handling when there are no ...
Khoerul Umam's user avatar
0 votes
2 answers
84 views

Write a trigger that accepts a user_id

When creating a new user in Postgres, I have a trigger that automatically creates a chat for him (like saved messages in telegram). I also have a chat_members table in the database that stores chat ...
Igor's user avatar
  • 41
0 votes
0 answers
330 views

Migrating a Supabase database to another project

I am attempting to migrate database within Supabase to another project, for example i want to migrate to another project while keeping the data intact in the current project so my site can run ...
MadeSabbah's user avatar
0 votes
0 answers
44 views

Querying the route in the browser using Supabase

I have created a data table on Supabase. I'm querying the route in my browser by appending the anon key as a query parameter: https://<PROJECT_REF>.supabase.co/rest/v1/users?apikey=<ANON_KEY&...
Alex Cuba's user avatar
  • 103
0 votes
1 answer
50 views

I need to convert this code to supabase, but there is an error in the join

I need to convert the following SQL code to the subbase using docs API integration (I found almost nothing in the documentation) SELECT * FROM public.usuario JOIN public.usuario_empresa ON public....
EDUARDO AMARO's user avatar
0 votes
0 answers
42 views

How to get name through foreign key in Reactjs

function CourseCard() { const { isLoading, data: courses, // eslint-disable-next-line no-unused-vars error, } = useQuery({ queryKey: ['course'], queryFn: getCourses, }); ...
Pavel Moroșan's user avatar
0 votes
1 answer
587 views

Cannot create Database entry onClick using Prisma and Next.js

I have a Next.js local project I am working on that uses a Supabase PostgreSQL database and Prisma. I have a button on my page that I would like to click and then create a new database entry. This is ...
BennyLearnsCode's user avatar
0 votes
0 answers
318 views

Updating a status of a record based on datetime in supabase

I am trying to set up a cron job on supabase, which looks at a table called 'matches' and gets all the rows with a status of 'waiting_for_players' where we've gone past the current time. For those ...
a7dc's user avatar
  • 3,377
0 votes
1 answer
289 views

match function is giving an error in Supabase flutter

I'm trying to fetch some data from the database using the code Supabase.instance.client .from('delivery') .select('location') .match({'order': 'test'}) .then((value){print(...
mohammadmnyer's user avatar
0 votes
2 answers
954 views

Supabase uploaded audio blobs not playing

I'm using Supabase storage to store audio blobs. The blob is returned from an API call and once returned it is uploaded. I can see the file in my storage bucket with the file type of audio/mpeg and a ...
the_islander's user avatar
0 votes
0 answers
111 views

Initializer for conditional binding must have Optional type, not 'UUID'

I am attempting to log into my app using Supabase. I cannot solve this error and any attempt leads to even more bugs. Help would be greatly appreciated. The line with the bug is if let loggedInUserId =...
Your Friend's user avatar