Fainaru
01/21/2023, 12:32 AMAmara
01/21/2023, 1:51 AMcamiaei
01/21/2023, 2:04 AMjopfre
01/21/2023, 3:19 AMVallery
01/21/2023, 6:38 AMdrop function if exists get_member_log;
create function get_member_log(membertag text)
returns table (
playername text,
team text[],
opponent text[],
t int,
map text,
ticket int,
trophychange int
)
language plpgsql
as $$
begin
return query
select (
club_members.playername,
club_league.team,
club_league.opponent,
club_league.time,
club_league.map,
club_league.ticket,
club_league.trophychange
)
from club_league
inner join club_members on club_league.playertag = club_members.playertag
where club_league.playertag = membertag;
end;
$$
I have an rpc like the above but when I try to call it using supabase py wrapper it says 'Returned type record does not match expected type text in column 1.' Why does it return a record type? and how can I fix this?silentworks
01/21/2023, 11:15 AMKjell
01/21/2023, 8:29 AMEidur
01/21/2023, 9:40 AMLukas V
01/21/2023, 9:41 AMelliott
01/21/2023, 9:53 AMjacin
01/21/2023, 11:35 AMthasmo
01/21/2023, 1:00 PMunique
option, but the option is missing from the dropdown. Is this a known/recent issue?DaLink
01/21/2023, 1:03 PMerror=server_error&error_description=Unable%20to%20exchange%20external%20code:.....
I have already checked the Google Creds, they have not changed...
Can it be that there is a problem in the backend, because I am briefly logged in and redirected, then the session is immediately destroyed and I am redirected back to the login page.Dbugger
01/21/2023, 1:25 PMcraftables
01/21/2023, 5:54 PMFailed to run sql query: relation "community2_id_seq" does not exist
I set id as the primarykey and identity. I am sure it is properly sequenced but it won't let me import it directly. So i just remove the identity key setting on creation, and then I just set it to identity after the table is created from the gui..
However, once I do that, the autoincrement key is set at 1, I want to reset it to the length of the import, but when I go to do that in the SQL editork, the SQL is failing to allow me to alter the sequence and says the relationship does not exist
*
select pg_get_serial_sequence('Community', 'id')
*
I try runnning this command in sql editor but then i get
Failed to run sql query: relation "community" does not exist
Could anyone please help!athomas
01/21/2023, 6:01 PMShelby
01/21/2023, 6:16 PMshantanubharadwaj
01/21/2023, 6:43 PMGregory
01/21/2023, 8:13 PMaw_jelly
01/21/2023, 8:13 PMauth-helpers-nextjs
I get the following error [TypeError: context.res.getHeader is not a function]
It's coming from the setCookie method and causes my app to throw an unhandled error. I'm currently using Next 13 and auth-helpers-nextjs 0.5.2Cardoso
01/21/2023, 9:43 PMsupabase.from<B>(Table B).select("*, b(*) ") i get all the information.
but when i get do
const date = new Date().toISOString();
supabase.from<B>(Table B).select("*, b(*) ").gte("A.start_date", date);
i only get table B information even though i have the b_id present on the table.
I also tried filter but i did not manage to get any results.
I will go on the view approach.
question is if i'm doing anything wrong or it is a limitation.jar
01/21/2023, 11:09 PMCody
01/21/2023, 11:26 PMsupabase db push
or supabase db dump
, it takes around 4 to 5 minutes to ask for my database password. Once I enter it, the command finishes executing quickly. Essentially, anything that connects to my hosted Supabase instance via CLI is extremely slow. I tried restarting my hosted instance, but that did not fix the issue.cayblood
01/22/2023, 1:02 AMselect * from net.http_collect_response(
(SELECT net.http_get('http://httpbin.org/headers', '{}'::jsonb, '{"Content-Type": "application/json"}'::jsonb)),
async := false
);
I'm struggling to figure out how to test the pg_net
if I can't even run this.mqp
01/22/2023, 1:15 AMpg_vector
and pg_repack
extensions which were just merged into the build in https://github.com/supabase/postgres. Right now it looks like the AMI build is broken due to some internal problems, but once it's fixed, how will I actually get my existing instance running that AMI?th_m
01/22/2023, 1:39 AMbob_the_robot
01/22/2023, 2:30 AMsql
select id,username from profiles where id = (select profile_two from friends where profile_one = 'user-uuid-string')
Tried this, but does not work.
js
await supabaseClient
.from("profiles")
.select("username, id")
.eq("friends.profile_one", "user-uuid-string");
> Cannot apply filter because 'friends' is not an embedded resource in this request
Have tried this with no success
js
await supabaseClient
.from("profiles")
.select(`username, id, friends(profile_two)`)
.eq("friends.profile_one", user.id);
> Could not embed because more than one relationship was found for 'profiles' and 'friends'
the friends
table is just uuid (pk), profile_one (fk), profile_two (fk)
the profiles
table is uuid (pk), username
Trying to capture where the current user is in profile_one
column and return profile username and the id
and profile_two
would be the same, so that part doesn't matter. Just trying to gather the other profile's username.
Thanks for any helpsimrell
01/22/2023, 2:44 AMccssmnn
01/22/2023, 8:28 AMsql
create table "Tasks" (
"organizationId" int references "Organizations"(id),
id int check (id > 0),
description text not null,
primary key ("organizationId", id)
);
But Users should not "know" the ID before creating it, so I add a trigger:
sql
create function increment_task_id() returns trigger language
plpgsql security definer as $$
declare
next_id integer := 1;
begin
select coalesce(max("id") + 1, 1)
from "Tasks"
where "organizationId" = new."organizationId"
into next_id;
new.id = next_id;
return new;
end;$$;
create trigger task_insert
before insert on "Tasks"
for each row execute function increment_task_id();
This works fine until I run multiple insertions in parallel. The triggers seem to be executed in parallel, leading to several tasks having the same ID. Inserts might fail when two or more people happen to create a task at the same time. How can I avoid this? Is there a better way?unknown1337
01/22/2023, 8:37 AM