vexkiddy
09/19/2022, 7:36 PMconst { data, error } = await supabase
.from('attendance')
.delete()
.match([{address: $userAccount.address, id: id}])
The actual table has another column, which is a UUID. Do I also need that to be present in the .match
method for it to delete ? currently i get an error when trying the above 😦JuicyBenjamin
09/19/2022, 7:39 PMAnimeDev
09/19/2022, 7:57 PMAdam Ambrosius
09/19/2022, 8:20 PMjs
const supabaseClient = createClient(
// Supabase API URL - env var exported by default when deployed.
Deno.env.get("SUPABASE_URL") ?? "",
// Supabase API ANON KEY - env var exported by default when deployed.
Deno.env.get("SUPABASE_ANON_KEY") ?? ""
);
const { data, error } = await supabaseClient
.from("table_name")
.select("*");
console.log({ data, error });
I am getting an error
json
{
data: null,
error: {
code: "42P01",
details: null,
hint: null,
message: 'relation "public.table_name" does not exist'
}
}
Do I need to do something else to link up my tables to my edge functions? Thanks in advance for the helpjustifi
09/19/2022, 9:56 PMpostgres
.
Having been told one too many times that I could not alter a table because it had been created by supabase_admin
, I decided to assign supabase_admin
a password and login as it w/ PGAdmin.
After doing so, Studio web app stopped cooperating. It no longer can do its thing as supabase_admin
because that user now has a password.
Is it possible to unset
this change, or, ideally, inform the webapp about the change to its user? Or should I just pg_dump
the instance, delete it, and start fresh?
note: I know that this is not the proper solution - I'd just like to undo it.Tony_n
09/19/2022, 10:27 PMnoahflk
09/19/2022, 10:37 PM@supabase#0835/auth-helpers-nextjs
with Google Auth. This is the flow that's happening after a user logs in with Google:
- I get a callback request from Google that contains the access token
- gSSP in Next sees that we’re not yet authenticated (because I have a check for protected pages)
- This check redirects to login page
- Client side Supabase sees access token and authenticates us
- Manual reload required to get away from login page to dashboard
The problem I see is that the Supabase client side JS deals with the callback coming from Google. That way the getUser
in my gSSP still thinks I'm unauthenticated. What's the most elegant way to immediately be let through to my protected page on the Google callback?
For example, is there a onAuthenticated
callback in the Supabase JS client I can use to redirect on client after Supabase has parsed the token?stevharve
09/20/2022, 12:44 AMsql
DECLARE teamId public.teams.id%TYPE;
BEGIN
SELECT id
INTO teamId
FROM public.teams
WHERE code IS NOT DISTINCT FROM team_code;
IF teamId ISNULL THEN
RAISE EXCEPTION 'Invalid code.';
END IF;
IF EXISTS
(SELECT
FROM public.members
WHERE user_id = auth.uid()
AND team_id = teamId)
THEN
RAISE EXCEPTION 'You are already a member.';
END IF;
END;
((()))
09/20/2022, 1:23 AMleviwhalen
09/20/2022, 2:21 AMSimonP
09/20/2022, 5:16 AMRano
09/20/2022, 8:12 AMKarunesh K
09/20/2022, 8:54 AMlewisd
09/20/2022, 9:31 AMcamalCase
I need to select a few fields, in total I want:
- createdAt
(when the conversation was created)
- id
(of the conversation)
- membersData
(username, avatar and id from all users involved in this conversation)
- latestMessage
(The latest message... struggling with this part)
My query so far:
select
conversations."createdAt",
conversations.id,
array_agg(json_build_object('id', "conversationMembers"."userId", 'avatar', "userData".avatar, 'username', "userData".username)) as "membersData"
from
conversations
join
"conversationMembers" on "conversationMembers"."conversationId" = conversations.id
join
"userData" on "conversationMembers"."userId" = "userData".id
group by
conversations.id
order by
conversations."createdAt" desc
Solomon Lijo
09/20/2022, 9:47 AMsupabase link uuyujtlklufbbccytnis
but it still says that my project reference ID isn't there
So, how exactly do I link my supabase project?rishav
09/20/2022, 10:23 AMAmr
09/20/2022, 11:50 AMCraonnne
09/20/2022, 12:38 PMKasperLund
09/20/2022, 3:02 PMrealvarx
09/20/2022, 3:14 PMrlee128
09/20/2022, 3:19 PMSimonP
09/20/2022, 4:03 PMVWL Tobias Hassebrock
09/20/2022, 11:36 PMJulien
09/21/2022, 2:08 AMdaksh
09/21/2022, 4:09 AMredirectTo
prop, but it's getting redirected to the homepage of that domain for some reason. That domain is added separately in the allowed domains but the same code works fine for the primary domainjbergius
09/21/2022, 6:57 AMsupabase
.from('subscriptions')
.select('*, prices(*, products(*))')
.in('status', ['trialing', 'active']);
But what I would like to do is to make an inner join filter on the products table.
I would like to get all subscriptions that dosen't match a specific product. Something like:
supabase
.from('subscriptions')
.select('*, prices(*, products!inner(*))')
.neq('products.id', 'prod_MSjuJNMlVA1zBF')
.in('status', ['trialing', 'active']);
Is that possible?Solomon Lijo
09/21/2022, 9:06 AMCREATE TYPE expires AS ENUM (
'never',
'1h',
'2h',
'10h',
'1d',
'2d',
'1w',
'1m',
'1y'
);
CREATE TABLE snips (
id varchar(255) PRIMARY KEY,
code TEXT NOT NULL,
password TEXT,
language TEXT,
expires_in expires,
created_at TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id UUID,
CONSTRAINT user FOREIGN KEY(user_id) REFERENCES user(id)
)
By running it, it's showing up an error as Failed to validate sql query: syntax error at or near "user"
Can someone help me resolve this issue?Amr
09/21/2022, 10:41 AM#hash
from URL and sends it to a different endpoint to verify the JWT before setting a cookie.
But I don't know how to verify the incoming JWT with the secret key from supabase, using jose
!
Overall I may be making hard work to re-invent the wheel , but the main issue that I'm wondering if I could just use supabase on client side to handle authentication and such ... while allowing visitors to make reservation without authenticating ? please note it's just a form that the company wants to collect those data and contact those possible clients... so they don't want their clients to signup for the website.
Please help me with thisChensokheng
02/09/2023, 5:15 PM2023/02/10 00:14:01 Connect Error: tcp [::1]:54322 dial tcp [::1]:54322: connect: connection refused
Error: failed to connect to `host=localhost user=postgres database=postgres`: dial error (dial tcp [::1]:54322: connect: connection refused)
drewbie
09/21/2022, 1:53 PM