stevenbdf1
01/10/2023, 7:24 PMjsonb[]
(important, the column is not jsonb
) and I store objects of the following shape.
[{"status":"pending","response":null,"created_at":"2023-01-10T17:45:11.824Z"}]
I have built this PostgreSQL Query that looks for the records which their first element in the status array is status = ''pending".
SELECT status FROM queue_events WHERE status[1]->>'status' = 'pending'
I want to run this query using supabase-js
. I have tried
const { data } = await supabase.from('queue_events').select('status').eq("status[1]->>'status'", 'pending');
But it returns null
. Does the javascript client supports queries like these? If not, is there a way to run a plain SQL query?stillmotion
01/10/2023, 7:35 PMconst { error: pagesError } = await Supabase.from("pages").delete().eq("story_id", id).select()
Error:
invalid input syntax for type uuid: \"story-xjYRGelSlIQsIuxCNtLIF\"
story_id is a text column and the PK of the story id
column is text also. I am not using UUIDs in the current version of this table (I was previously, but dropped the table and created a new one with the same name). RLS is disabled.Xki
01/10/2023, 7:45 PMshashankdaima
01/10/2023, 7:52 PMsupabase functions delete hello-world
is not working. giving Error: Cannot find project ref. Have you run supabase link?
. What to do in such case.
2. redeploying command is updating the version of cloud function on web-ui but running the curl command is not showing updated results.
thanks.kjames
01/10/2023, 8:38 PMconfig.toml
But I'm not sure if there are config.toml
variables for setting custom email templates, and if so what they are called?Vik
01/10/2023, 10:22 PMurth
01/10/2023, 11:50 PMlet user = await supabase.from('users').select(`
id,
username,
email,
created_at,
steam_id,
stats (
*
),
flags(
*
),
friends!friends_user_id_fkey (
friend_id,
user_id,
status,
user:users!friends_user_id_fkey (
username
),
friend:users!friends_friend_id_fkey (
username
),
),
`).eq('username', username).single();
Hi, were there any updates to the supabase? I can swear that this code used to work as is up to a week agoGregory
01/11/2023, 12:38 AMlyu
01/11/2023, 1:00 AMselect
*
from
profiles
where
to_tsvector(title) @@ to_tsquery('Smith');
and there's definitely a row with title column containing Smith
But when I run it in supabase SQL Editor it returns empty result.
Does anyone know the reason? ThanksVimHax
01/11/2023, 2:21 AMsupabase.from(...).download(...)
actually fully downloads the video and you won't be able to see it until it does so. And for supabase.from(...).createSignedUrl(...)
my issue is that this will allow anonymous users to view the video temporarily and that the video will only be watchable for the time allocated. (which may be too much or too little)
I want an experience like private YouTube video where only you can see it and you can watch it for as long as you wish anytime without downloading it.jinsley8
01/11/2023, 2:23 AMsalzar
01/11/2023, 2:49 AMCabtn
01/11/2023, 4:47 AMauth.uid = id
.
Any ideas of what I'm doing wrong here?salzar
01/11/2023, 5:13 AManggoran
01/11/2023, 6:31 AMpwsh
# Append /rest/v1/ to your URL, and then use the table name as the route
curl '<SUPABASE_URL>/rest/v1/todos' \
-H "apikey: <SUPABASE_ANON_KEY>" \
-H "Authorization: Bearer <SUPABASE_ANON_KEY>"
And in the supabase github action example, we have this example.
yaml
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.STAGING_DB_PASSWORD }}
PROJECT_ID: cimpzzikygouamvsjwxa
steps:
- uses: actions/checkout@v3
- uses: supabase/setup-cli@v1
with:
version: 1.0.0
- run: supabase link --project-ref $PROJECT_ID
My questions are:
1. Should I use Service Role
or Access Token
in Github Actions?
2. Where can I find the endpoints for database and storage?VimHax
01/11/2023, 7:27 AMjs
db.on(
'postgres_changes',
{
event: 'UPDATE',
schema: 'public',
table: 'projects'
},
(payload) => { ... }
).subscribe();
vs
js
db.on(
'postgres_changes',
{
event: 'UPDATE',
schema: 'public',
table: 'projects',
filter: `id=eq.1`
},
(payload) => { ... }
).on(
'postgres_changes',
{ filter: `id=eq.3` },
(payload) => { ... }
).on(
'postgres_changes',
{ filter: `id=eq.3` },
(payload) => { ... }
).subscribe();
4. Is it possible to listen to updates to objects in storage with Realtime? (no file name changes, upserts)
My goal is to have virtually all user content be updated in realtime for all users on changes.legousk
01/11/2023, 7:50 AMboeledi
01/11/2023, 9:23 AMbrguy
01/11/2023, 9:53 AMAbdallahZ
01/11/2023, 10:02 AMShaneJones
01/11/2023, 11:04 AMEsore
01/11/2023, 1:18 PMcryptoneur
01/11/2023, 3:24 PMEvanJ
01/11/2023, 4:00 PMsalzar
01/11/2023, 4:16 PMHuntedman
01/11/2023, 4:19 PMTheOriginalDude
01/11/2023, 5:22 PMuser
from supabase, in the serverless API routes.
I've noticed people use the supabase.auth.api
API to set the cookie and get user by cookie, but it doesn't seem to work anymore. What's the workaround/fix to achieve so?petoma
01/11/2023, 5:51 PMexport const registerUserWithEmailPassword = async ({ email, password }) => {
try {
let { data, error } = await supabase.auth.signUp({ email, password })
console.log( data )
return {
ok: true, data, error
}
} catch (error) {
console.log(error);
return { ok: false, errorMessage: error }
}
}
This is what I have in thunks in my store:
export const startLoginWithEmailPassword = ({ email, password }) => {
return async( dispatch ) => {
dispatch( checkingCredentials() );
const { ok, data, error } = await loginWithEmailPassword({ email, password })
if ( !ok ) return dispatch( logout( error.message ) );
console.log(data)
dispatch ( login( data ));
}
}
And this is a hook that I have to listen for auth changes:
Any guide will be appreciated. Thanks!coker
01/11/2023, 6:59 PMuser_metadata
. Specifically, I have a client
string value stored in the app_metadata
, but when I use the following logic:
pgsql
begin
insert into public.profiles (id, email, client)
values (new.id, new.email, new.raw_app_meta_data->>'client');
return new;
end;
the profiles.client
column null for all rows. How can I retrieve this client value in my triggered function?
Its worth noting that I tested this out, and instead stashed the client
value in the raw_user_meta_data
property, and was able to retrieve it just fine. I just don't want to store this value in the user's metadata.LarryPotato
01/11/2023, 7:00 PM