Mx
12/27/2022, 2:51 AMsinrabo
12/27/2022, 4:34 AMf
12/27/2022, 5:08 AMRizzaxc
12/27/2022, 5:17 AMdirector
from films
, I can't seem to get correct TS typing from the generated types. The typing for data.director
says
director: {id, name} | director: {id, name}[] | null
while I'd prefer it to only contain the singular variant, since my database schema enforces NOT NULL
and the relationship is many to one (no plurals).
How can I correct this? Typescript wouldn't let me use either form after the optional check and casting per here
https://supabase.com/docs/reference/javascript/typescript-support doesn't seem to workDarthJarJar
12/27/2022, 5:18 AMf
12/27/2022, 6:58 AMellie_dd
12/27/2022, 7:56 AMRama2l11
12/27/2022, 8:38 AMak4zh
12/27/2022, 9:16 AMbigint
as primary key.
I deleted the table and recreated new table with same name but uuid
as primary key..
Now when I try to call await supabase.from('mytable').delete().eq('id', rowUUID)
I get the following error:
{"code":"22P02","details":null,"hint":null,"message":"invalid input syntax for type bigint: \"fb056279-c67c-4bd4-9b76-0e0c2c85822b\""}
Crownie
12/27/2022, 9:32 AMResponses are automatically parsed as json, blob and form-data depending on the Content-Type header sent by your function. Responses are parsed as text by default.
Responses are parsed as text by default.
but how do i access the incoming form datalake_mattiato
12/27/2022, 10:34 AMactivenode
12/27/2022, 11:28 AMAissam
12/27/2022, 11:49 AMjdgamble555
12/27/2022, 12:56 PMjs
function reseedDb() {
execSync(
"PGPASSWORD=postgres psql -U postgres -h 127.0.0.1 -p 64322 -f supabase/clear-db-data.sql",
{ stdio: "ignore" }
);
}
The script just truncates the users table:
sql
truncate table auth.users cascade;
So how can I run this command in Windows for my local testing environment? Do I need a password (I don't see where a local Supabase DB has a password? Would my PGPASSWORD just be stored in my Windows ENV?
This is from the Fireship Supabase course.
Thanks,
Jquick_piper15
12/27/2022, 2:22 PMTobias Grether
12/27/2022, 3:00 PMgaryaustin
12/27/2022, 3:30 PMdebabrata
12/27/2022, 4:53 PMpg_trgm
extension from the dashboard but I'm getting the following error
Failed to toggle PG_TRGM: failed to create pg.extensions: Connection terminated unexpectedly
I tried installing other extensions as well, but I'm getting the same error.Guy Rozen
12/27/2022, 5:07 PMDrip
12/27/2022, 6:58 PMwill-estuary
12/27/2022, 7:51 PMDrip
12/27/2022, 8:26 PM49Ryann
12/27/2022, 10:29 PMFailed to run sql query: target column number not match
The blog example shows I can add a foreign table with certain keys & I then add metadata to it and it creates ok it's just when I query it I get the above error, should this not give me access to all available keys on the Stripe products type? Or is it just too early in development to support this?
create foreign table products (
id text,
name text,
description text,
default_price text,
metadata json <----- Added this
)
server stripe_server
options ( object 'products' );
pkdiscgolf
12/27/2022, 10:34 PMfridon
12/27/2022, 11:29 PMrocko
12/28/2022, 12:53 AMFailed to finalize migration: An error has occurred: Failed to fetch
DYELbrah
12/28/2022, 2:46 AMjar
12/28/2022, 3:45 AMroyboy789
12/28/2022, 4:16 AMmedia_gallery_rel
with the media_id. Goal would be to have a list of all media, with their associated galleries(by id). I can worry about grabbing data form the galleries table later, unless I can bring that in too?
.eq('media_gallery_rel.media_id', some_id);
this works if I pass in the some_id
but is it possible to do this dynamically without 2 SELECT's? or do I have to select all media, then loop through and call the relationship?
this returns empty array:
eq('media_gallery_rel.media_id', 'photos.media_id');
^ photos is media, old scope namef
12/28/2022, 7:46 AM