ShaneTheKing
04/25/2022, 1:41 PMMartin INDIE MAKERS
04/25/2022, 4:18 PMcrasty
04/25/2022, 5:46 PMEmbm
04/25/2022, 7:45 PMsql
create or replace trigger on_user_update
before update on public.profiles for each row execute procedure handle_user_update;
in the cloud's sql editor returns syntax error at or near "trigger"
but works fine if I omit the replace attempt ? Am I not doing it properly, from my understanding supabase runs Pg14.1 which should support create or replace trigger ...
.Ben-jam-in
04/25/2022, 7:46 PMxephyr
04/26/2022, 12:48 AMsupabase db remote commit
and the output has this pattern for several tables:
REVOKE ALL ON TABLE public.user_settings FROM authenticated;
REVOKE ALL ON TABLE public.user_settings FROM postgres;
REVOKE ALL ON TABLE public.user_settings FROM service_role;
GRANT ALL ON TABLE public.user_settings TO authenticated;
GRANT ALL ON TABLE public.user_settings TO postgres;
GRANT ALL ON TABLE public.user_settings TO service_role;
Seems kinda redundant, is this some quirk of migrations that is necessary or something I can delete?Daniel_pttb
04/26/2022, 2:48 AMcjog
04/26/2022, 8:14 AMsupabase db remote commit
blows up for me with the error Error: unexpected end of JSON input
. I am on supbase cli version 0.25.0. Any suggestion to debug the issue. The password in the connection string for the remote does not have any special characters as mentioned here in this similar issue from some versions ago - https://github.com/supabase/cli/issues/95.Studywithdesign
04/26/2022, 8:26 AMNeedle
04/26/2022, 8:38 AM/title
command!
We have solved your problem?
Click the button below to archive it.max
04/26/2022, 8:38 AMcreate or replace function get_activities(radius int, point text)
returns setof activities as $$
var json_result = plv8.execute(
"SELECT activities.id, activities.name, activities.time, activities.participant_limit, row_to_json(activities_user.*) AS user FROM activities LEFT JOIN LATERAL ( SELECT users.full_name, users.avatar_url FROM users WHERE activities.added_by = users.id ) AS activities_user ON TRUE WHERE ST_DWithin(location, $1::geometry, $2) ORDER BY time asc", [point, radius]
);
return json_result;
$$ language plv8;
Running the query itself works fine, but when trying to run this function via supabase.rpc
I get a 500 with error code XX000 and message "field name / property name mismatch". I'm guessing that it is because my return type "activities" does not include the users table's field that I'm adding as part of the query. Any ideas how I can fix this?shubhj_45
04/26/2022, 12:26 PMsangle
04/26/2022, 3:56 PMstopa
04/26/2022, 5:57 PMbookshelf { user_id, id, title, ...}
book { id, title, ... }
bookshelf_book { book_id, bookshelf_id, ordering }
How would I go about getting all the bookshelves, with the book and ordering attached from the client?Needle
04/26/2022, 6:06 PM/title
command!
We have solved your problem?
Click the button below to archive it.Needle
04/26/2022, 7:13 PM/title
command!
We have solved your problem?
Click the button below to archive it.mangysaurus
04/26/2022, 7:24 PMNeedle
04/26/2022, 7:24 PM/title
command!
We have solved your problem?
Click the button below to archive it.Pacqui
04/26/2022, 8:10 PMawait supabase.auth.signIn({ email, password }, { redirectTo: "http://localhost:3000/auth/redirect?url=/abc" })
thats the code. user logs in but it doesnt redirect anywhereMihai Andrei
04/26/2022, 8:51 PMCornusAmmonis
04/27/2022, 2:18 AMKeooo
04/27/2022, 4:14 AM4a6d65
04/27/2022, 11:01 AMcma
04/27/2022, 11:32 AMLudvig
04/27/2022, 2:57 PMcustomer
table via the supabase-js client.
javascript
const { data: dataCustomerUpdate, error: errorCustomerUpdate } =
await supabase.from("customer").update(
{
first_name: checkoutForm.billingFirstName,
last_name: checkoutForm.billingLastName,
email_address: checkoutForm.billingEmail,
mobile_phone_number: checkoutForm.billingMobilePhoneNumber,
},
)
.eq("id", customerIdSelectedFromIncomingOrderTable) // Here is where I need help.
I need to find what customer
row to update. This is the problem.
I have another table called incoming_order
which contains a stripe_payment_id
and the foreign key customer_id
which I'm looking to select.
I have the stripe_payment_id
string which should be used to find (filter for) the correct row in incoming_order
, and from that row I need to get the customer_id
used instead of the customerIdSelectedFromIncomingOrderTable
which I wrote above.
I'm looking to do it all in this one query if that is possible.prabha
04/27/2022, 4:17 PMchek
04/27/2022, 6:56 PMstevharve
04/27/2022, 9:25 PMbjorgen
04/28/2022, 12:52 AMprabha
04/28/2022, 5:32 AM