All Questions
26
questions
8
votes
0
answers
2k
views
Is there a way to generate the OpenAPI/Swagger definition from Postgres with object references?
I have a rest api using supabase/postgres(t) which generates it's own OpenAPI/Swagger definition. The problem is that this only contains the id fields but not actual references to the other tables.
...
7
votes
2
answers
2k
views
PostgREST - Add authenticated user id on insert
I need to automatically add an author of an inserted row in one of its columns. I am using postgREST (using Supabase cloud service) and I don't want users to add whoever they want as the author. Is ...
4
votes
1
answer
1k
views
How to use bigint safely with Supabase JS
Postgres' bigint type holds 64 bit integers. But the Supabase JS library returns those values as JS numbers, which cannot safely store 64 bit integers AFAIK. What would be the correct way to handle 64 ...
3
votes
1
answer
2k
views
How to add Supabase Order by in get request using Postman
I need to add order in supabase result while calling the supabase bash in postman.
I am doing same in flutter like below
Future getPropertiesFromBirmingham() async {
var response = await client
...
3
votes
0
answers
440
views
Auto-Incrementing IDs in Composite Primary Key
In my app, there are organizations that can create tasks. Instead of having a serial task ID, I would like to have an incrementing task ID for each organization ID. Just like in GitHub, where repo + ...
2
votes
1
answer
772
views
How to escape string characters in supabase js OR query?
I'm trying to write a query that matches rows where a user-provided string matches one of two text array columns.
For example, imagine a table messages with text columns greeting and goodbye:
// WORKS
...
2
votes
1
answer
47
views
How do you find table intersections in PostgREST clients?
Simple question from a rookie to PostgREST - is there an intersect function for the equivalent below PSQL query?
select a from table1
intersect
select a from table2;
I read through the documentation ...
1
vote
3
answers
6k
views
supabase flutter get multiple data (JSON object requested, multiple (or no) rows returned)
I am trying to print out multiple data from Supabase using flutter but it just isn't working
getResponse(String uid) async {
await client
.from("privChatRoom")
.select()
...
1
vote
1
answer
217
views
How to select and order rows based on number of matched elements in array from foreign table in postgREST
I'm creating simple supabase application and I want to construct postgREST query to select recipes and order them ascending by number of matched_ingredients
Right now I'm stuck on this:
https://URL....
1
vote
1
answer
939
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 ...
1
vote
1
answer
942
views
Querying sub-sub table in Supabase / Grandchild relationship in JOIN QUERY
Given the following schema:
CREATE TABLE organization (
org_name text NOT NULL,
PRIMARY KEY (org_name)
);
CREATE TABLE teams (
org_name text NOT NULL,
team_name text NOT NULL,
...
1
vote
1
answer
189
views
postgREST route using function does not update table
I am using Supabase which has a built in postgREST server.
In this server I have created a function that should update a value given a checksum:
CREATE OR REPLACE FUNCTION set_value(_id TEXT, _value ...
1
vote
1
answer
245
views
How do I chain multiple filters on Postgres database using Golang with supabase?
So I have a supabase postgres database setup and I'm trying to use gin to setup an API for that database. I'm using nedpals/supabase-go to connect to my supabase client. I'm trying to chain multiple ...
1
vote
0
answers
353
views
Return nested data from recursive query
We have a list of recipes (recipe_id) and ingredients (ingredient_id). Every recipe can become an ingredient of another recipe and that child recipe can then hold more second level child recipes and ...
1
vote
1
answer
3k
views
406 JSON object requested, multiple (or no) rows when RLS is enabled on Supabase
I have looked at various solutions on StackOverflow, github issues in supabase, supabase/postgrest-js, postgRESTPostgREST/postgrest, and searched the Discord as well. But none of the solutions have ...
1
vote
0
answers
2k
views
Nested query in postgrest (supabase) denies existence of relationship between two tables
I have the following structure
create table organisation (
id uuid primary key,
organisation_name varchar not null
);
create table organisation_member (
id uuid primary key,
email varchar not ...
0
votes
1
answer
346
views
possibility of having a Like operator inside of the IN operator
Hoping this is the right tag to ask this question. Posted it before on a couple of forums, havent got the answer yet.
Below is a query copied from the supabase website.
const { data, error } = await ...
0
votes
1
answer
78
views
Create view with join depending on table of another join
My tables:
create table Article (
ID int generated by default as identity primary key,
Name text);
create table Client (
ID int generated by default as identity primary key,
Name text);
...
0
votes
2
answers
70
views
Use Postgres functions on Supabase Client js
I have table 'MyTable' containing the column 'observations' of type jsonb. The Json structure is as following:
{
...
obsList: [
{
species: 'Goldfinch',
number: 2
},
{
...
0
votes
1
answer
2k
views
Supabase: get table count in rest mode
There is any way to get the table count in rest mode?
I'm using query params like:
https://urt.to.supabase/rest/v1/table?select=field,another_field
I was googling it out but without success.
0
votes
1
answer
719
views
Supabase / PostgREST: Deny select multiple
I am bulding a supabase app. Instead of a login every user gets a uuid (or multiple, if he wants to). Everyone that knows the uuid has full acces to the data behind this uuid.
So basically the ...
0
votes
1
answer
29
views
Postgrest function errors
I'm having some issues constructing some functions using postgrest for my senior capstone.
to my understanding the following should work to delete a category connected to a supabase database. (In this ...
0
votes
1
answer
88
views
Supabase PostgREST query returns null for all referenced rows
I'm making this API request, with the PostgREST query game?select=id,club(slug):
https://MY_DB.supabase.co/rest/v1/game?select=id,club(slug)&apikey=MY_API_KEY
I get this response:
[{"id"...
0
votes
1
answer
291
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 ...
0
votes
1
answer
331
views
Postgresql creating function that dynamically updates foreign key's value based on matching string value
I'm looking for help with my postgresql trigger function that dynamically updates foreign key field based on matching conditions. I believe it's an easy function, but I can't seem to execute it ...
0
votes
2
answers
2k
views
supabase python - i'm trying to update an entry in a supabase table but postgrest returns 'Failed to parse [("id","Filters.EQ.1")]'
as the title says, im using the supabase python library for a small project which requires me to update a table regularly.
i've set up this small test to construct an update function.
updatedtime = ...