472 questions
0
votes
1
answer
75
views
Access interface types inside database interface types file
New to Typescript.
I am struggling to figure out how to access and use the interface values in my database types export as interfaces in my code.
I don't want to create new seperate interfaces if my ...
1
vote
0
answers
612
views
Can we fetch data from storage schema while fetching data from the public schema in Supabase?
I have a table product which has a foreign key relation with storage.objects.id.
(https://i.sstatic.net/DqJTR.png)
From the client, I wanted to produce data along with the data of the storage.objects....
0
votes
1
answer
2k
views
TypeError: Cannot read properties of undefined (reading 'user') when using Supabase authentication in a React app
I'm developing a React application with Next.js and using Supabase for authentication. I have a custom hook called useAuthentication that checks if the user is logged in and redirects them to the ...
0
votes
1
answer
2k
views
Creating supabase client with Basic Auth
I need to interact with my supabase database from a Nextjs webhook route handler that is invoked by an external system. This is not from the browser so there is no user session or cookies available. ...
0
votes
1
answer
635
views
how to get userid from supabase default table react native
in my mobile app I have a userinfo table witch has a primary key that references the default user table in supabase now when trying to sign up i can insert into user_info because I cant get the id ...
1
vote
1
answer
679
views
How can i include a package that is in a node built in modules (Crypto) in a supabase edge function that use Deno
I am having problems when I deploy the function to supabase, locally the package works correctly using the node specifiers
import * as crypton from "node:crypto"
when i deploy Im getting ...
1
vote
0
answers
278
views
Not Displaying Stripe Customer Info in my Supabase Table
I am using NextJs to create a stripe customer subscription and I have set up a webhook to interract with my stripe account, but I am not seeing the users data in my supabase table.
First here is the ...
0
votes
0
answers
38
views
Prevent insecure function
I have an application that, upon registration, creates a friend code for the user. In order for the codes to be unique, in the table in the supabase I made a column with the isUnique parameter and ...
7
votes
6
answers
9k
views
Supabase "TypeError: fetch failed"
I am making a to-do list application with Supabase and NextJS-13 and while fetching the lists from Supabase, the server gave me this error
Error Image
My List table on Supabase has three columns:
id
...
1
vote
2
answers
4k
views
How to access a Supabase Vault Secret from my app?
I am trying to query a secret from supabase vault into my app but I am not sure how to do that.
Do I need to create a rpc function or is it possible to use the postgREST API?
For the latter, what is ...
0
votes
2
answers
536
views
supabase row level security for append only table
What I'm trying to do is to have a table that assigns a subscription to a user. All the samples I found so far do this via:
(auth.uid() = user_id)
However I would like to keep track of reassignments. ...
0
votes
1
answer
541
views
How to trigger insertion of row into child table from parent table with RLS enabled?
In Supabase, I get the following error when I try to add a row to a parent table which should also trigger the addition of a corresponding row in the child table: new row violates row-level security ...
0
votes
1
answer
965
views
Supabase function doesn't do any calculations
I have a function:
begin
if pg_trigger_depth() <> 1 then
return new;
end if;
new.rating = ROUND((new.total_score / new.total_reviews), 1);
return new;
end;
This function ...
2
votes
0
answers
441
views
How to check if a user is a member within an organisation within a members RLS policy with Supabase
I'm trying to write a SELECT RLS policy for a members table within Supabase. The policy should only reveal members that are in the same organisations as you.
Each row in the members table represents a ...
2
votes
1
answer
1k
views
Supabase and Cloudflare Workers
How do i protect a Cloudflare Worker route to authorize only if the user is authenticated on Supabase?
I'm using Cloudflare Pages Function to create a worker inside the Cloudflare Pages: https://...
1
vote
1
answer
3k
views
Supabase won't take UPDATE query
I'm currently using supabase to make quick MVP for college work. I create feedback feature, so I have to update some columns in row. There is my JS query:
const { error: updateError } = await supabase....
0
votes
0
answers
181
views
Store encrypted text potentially containing \u0000 in Supabase Postgresql database
Trying to store encrypted text using crypto-js AES in Supabase Postgres database, I want the encoded string to be as short as possible, so I convert the base64 result from the encryption function ...
2
votes
1
answer
967
views
How exactly are Supabase realtime DB listeners billed?
I'm trying to gauge potential costs for running my app on Supabase, I've read through the pricing documentation but I'm not clear on how exactly realtime database reads are billed.
For e.g, the docs ...
0
votes
0
answers
244
views
Supabase - empty table and bulk insert data from MS Access db
I'm using supabase for a project. I have an odbc access database that will take data from an AS400 DB2 database, and into the electron app where I'm using the data, I need to update the supabase ...
0
votes
1
answer
384
views
How can i use hCaptcha verification to protect a table in supabase?
In supabase:
I have a table named "ratings", this table have three columns named; "rating", "review" and "name", the "ratings" table is basically ...
0
votes
1
answer
721
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(...
5
votes
2
answers
6k
views
Why is supabase update not working for me?
I am trying to update a user's name in the profiles table. This command works when i disable rls on the table but not when it is on. When the function is called the error is null, data is just an ...
1
vote
1
answer
7k
views
AuthApiError: Database error saving new user with react-native/supabase
I created a react-native app using supabase as a backend. Everything was working fine, I created my first user, signed it, etc., but now I'm trying to create a new user and I'm getting this error:
[...
0
votes
1
answer
641
views
Supabase: Resource Embedding on Computed relationship
I am using supabase (postgREST under the hood).
I have 2 tables:
challenge(name: string, date_begin: date, date_end: date)
timelog(created_at: timestamp, time_reached: bigint).
Those are not linked ...
1
vote
1
answer
1k
views
When trying to use multischema with Prisma and Supabase, can't migrate
I'm learning to use Supabase w/ Postgres in Supabase with the following schema:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator ...
4
votes
2
answers
4k
views
How to modify a Supabase table from the dashboard UI or the Supabase SQL editor?
Whenever I try to modify an existing table in the Supabase dashboard, I get this error "Failed to pg.columns: must be owner of table <table_name>". This seems to be like a permission ...
1
vote
1
answer
1k
views
Supabase many-to-many join issue with dart
I'm trying to get the mentioned many-to-many join feature to work as described here: https://supabase.com/docs/guides/api/joins-and-nesting#many-to-many-joins
I have three simple tables:
create table ...
3
votes
1
answer
1k
views
Supabase SELECT with function call
From Javascript, I want to call a function in my supabase select statement (funcition name is id_encode in this example):
const { data, error } = await supabase
.from('table')
.select(&...
2
votes
0
answers
855
views
Supabase array contains
In Firestore, a query for "array contains" is simple.
Firestore.firestore().collection("Posts").whereField("members", arrayContains: userid)
How can the same query be ...
1
vote
1
answer
3k
views
Supabase - Mobile - Offline first - Sync remote Postgres DB to a local SQLite DB
What is the best way to Sync remote-Postgres DB into local-SQLite DB on mobile apps ?
I am currently working on a Flutter mobile project that supports offline-first.
On every opening of the app (or ...
0
votes
1
answer
520
views
Supabase - create view from web UI SQL editor fails with 'Invalid SQL'
From the Supabase admin web UI I'm trying to create a new view and this fails but all I get is am "invalid SQL" message
The DDL is...
CREATE VIEW gd_goal_task
AS
SELECT
a."goalId"...
3
votes
1
answer
2k
views
Can't update an image from the bucket
I've been trying to update a single file within a folder in the bucket that i created but when i go to update with a new image from the front does not update the image and gives the following error.
...
2
votes
1
answer
3k
views
Supabase JavaScript data fetching with nested select
I am new to supabase and data fetching via supabase-js client.
When I have the tables below and I have to fetch votes and additionally data from the result and club table, how does this work? ...
2
votes
2
answers
2k
views
Error when importing supabase from createServerClient in generateStaticParams - Next js 13
I'm migrating my app from nextjs 12 to nextjs 13 and I'm having some trouble migrating my [...slug].tsx file.
I started with a simple code snippet but I'm getting this error:
Error: Invariant: Method ...
1
vote
2
answers
5k
views
Copy only public schema from Supabase to local db?
How copy data from only public schema from Supabase database and paste it to a new local PostgreSQL database?
I tried with Snaplet but save only transformed data.
1
vote
2
answers
4k
views
SUPABASE local development seed users table
I'm working on a SQL function to fill the auth.users table with a given number of rows for local development.
I manage to complete the creation function but I didn't find a way to handle password hash ...
1
vote
1
answer
787
views
What's the best way to implement supabase auth and database in Next js?
I'm starting an app in next js and I'm using supabase for authentication and database.
I have the authenticated users (the actual users Supabase creates) and a table called 'User', where I will store ...
0
votes
1
answer
401
views
How to monthly update every users free credits? (change one column of every row of a users table)
My app gives new users a free amount of monthly credits to use.
Every month I want to modify many rows of my users table if they are on the free plan.
So my API call might be something like:
supabase....
3
votes
1
answer
9k
views
Could not find the function in the schema cache ( RPC supabase )
Hi I have created a postgres function using the supabase ui with 4 parameters.
see this screenshot
function definition is
begin
insert into public.rooms (created_by_id, room_manager_id, room_name, ...
0
votes
1
answer
376
views
Query is slow with SECURITY INVOKER
We have a big table (events) which contains events for a lot of devices. Each row is protected by an RLS check that verifies that the authenticated user is in an organization that owns the specific ...
0
votes
2
answers
366
views
deno postgres.js embeddings query in deno under supabase functions
Trying to run an embeddings query on data stored from openAI. Currently using Supabase functions, using the following library. Any ideas on how to fix this?
OpenAI Embeddings response is successful -
...
2
votes
1
answer
638
views
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, ...
0
votes
2
answers
212
views
How to increase the loading speed of database in django?
I've build this website https://hanjaba.com/ using django and supabase as the database. However the loading speed website seems to be very slow when it have to retrieve data from the database and ...
1
vote
1
answer
510
views
In supabase's flutter sdk, how do I filter a stream using something like .contains("group_members", [my_uid])?
In supabase's flutter sdk, how do I filter a stream using something like
.contains("group_members", [my_uid])
how do I achieve something like this?
I tried adding
.contains("...
0
votes
3
answers
906
views
Add user metadata in Flutter
I am trying to add raw_user_metadata on the auth.users table when a new user creates an account. However, I'm unable to find the documentation for how to do so in Flutter. The documentation exists for ...
0
votes
0
answers
332
views
Supabase JOIN by column jsonb[]
There is a table of products and categories.
In the products table, the category column contains a JSONB array of the format [1,4], where 1 and 4 are category IDs. How to do a JOIN correctly?
This is ...
0
votes
2
answers
2k
views
Supabase security with JWT token
I am still new with supabase. I am little concern of the security.
Now I have a react app and with the anon public API keys I can query the database CRUD.
When I navigate to the db table editor, it ...
6
votes
6
answers
11k
views
How to fix Postgres error "operator does not exist" using pgvector
I have a Postgres function to find the top 10 most relevant vectors. I called this function from a supabase serverless function, but logs returned 500.
The error I get is related to the <#> ...
0
votes
1
answer
663
views
Supabase realtime console log is not synced with presence event sync
I am broadcasting my players positions.
// Subscribe registers client with the server
this.channel.subscribe(async (status: any) => {
if (status === 'SUBSCRIBED') {
const status = await this....
0
votes
1
answer
896
views
My delete query is not working in supabase
async function deleteImage(imageName) {
const { data, error } = await supabase
.storage
.from('img')
.remove([ CDNURL + "/" + imageName ])
console.log(...