uneatenauthor
09/29/2022, 9:22 PMArgument of type '"CAA"' is not assignable to parameter of type 'RecordType'
Googling this issue doesn't turn up much other than pointing to possible a version mismatch somewhere amongst the dependencies. I noticed that the error is looking at deno standard library 0.153.0 while the latest is 0.158.0. Since my local runtime is up-to-date, I can only assume that this is either coming from my function (which does not specify a std lib version) or from supabase docker stack or cli.
How do I figure out what std library version is being used by supabase when I deploy a function locally? Where exactly is this function being run? How to I keep the supabase deno runtime and my local machine deno version in sync so that I can get correct analysis in vscode while I write these functions?
How do I manage dependencies with deno? It seems like it wants me to do that by putting version numbers in the import urls but this would require me to upgrade them by searching for each one and updating the version by hand. This sounds awful. Why isn't there a package.lock or similar?
I'm just so frustrated with supabase edge functions generally and it's such an unusual stack that it's hard to find help. For context, I've used azure and gcp functions for years now.Nin
09/29/2022, 9:53 PMczypnt
09/29/2022, 9:58 PMwave_pt_CoL
09/29/2022, 10:42 PMrgfx
09/29/2022, 11:51 PMCannot read properties of undefined (reading 'user')
TypeError: Cannot read properties of undefined (reading 'user')
at +layout.svelte:39:27
at Object.$$render (/node_modules/.pnpm/svelte@3.50.1/node_modules/svelte/internal/index.mjs:1771:22)
at Object.default (root.svelte:43:39)
at eval (/src/routes/+layout.svelte:22:41)
at Object.$$render (/node_modules/.pnpm/svelte@3.50.1/node_modules/svelte/internal/index.mjs:1771:22)
at root.svelte:41:37
at $$render (/node_modules/.pnpm/svelte@3.50.1/node_modules/svelte/internal/index.mjs:1771:22)
at Object.render (/node_modules/.pnpm/svelte@3.50.1/node_modules/svelte/internal/index.mjs:1779:26)
at render_response (file:///C:/rgfx/auth/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.505_svelte@3.50.1+vite@3.1.4/node_modules/@sveltejs/kit/src/runtime/server/page/render.js:122:27)
at async render_page (file:///C:/rgfx/auth/node_modules/.pnpm/@svelt
/src/routes/+layout.svelte is pertty simple.
<script>
// we need to make sure the supabase instance is initialized on the client
import '$lib/db';
import { startSupabaseSessionSync } from '@supabase/auth-helpers-sveltekit';
import { invalidateAll } from '$app/navigation';
import { page } from '$app/stores';
// this sets up automatic token refreshing
startSupabaseSessionSync({
page,
handleRefresh: () => invalidateAll()
});
</script>
<slot />
Anyone got any leads for me to look into.NanoBit
09/30/2022, 3:12 AMVik
09/30/2022, 2:02 AMrlee128
09/30/2022, 2:37 AMquery has no destination for result data, code: 42601, details: Bad Request, hint: If you want to discard the results of a SELECT, use PERFORM instead.
Each time a try to do an insert in flutter. This started after adding a trigger.AlanK
09/30/2022, 4:07 AManurag
09/30/2022, 6:50 AMthomas_mol
09/30/2022, 7:57 AMtimmy
09/30/2022, 8:24 AMsql
begin
insert into public.profiles (id, email)
values (new.id, new.raw_user_meta_data->>'email');
return new;
end;
that was just a shot in the dark, but is there some way to populate the "email" field in in "profiles" with the email address from "users" when a new profile is created via a trigger on auth? using magic link authenticationgoldaeon
09/30/2022, 8:54 AMid,
title,
body,
ST_X(location),
ST_Y(location)
)**
but it seems like it does not work. Is there a special way to do that or should I use RPC ?
Thanks in advance for your help((()))
09/30/2022, 9:12 AMsql
select
munies.name as municipality,
concat(muni_admins.first_name, muni_admins.last_name) as "admin",
muni_offices.name as office,
muni_users.user_id,
muni_users.first_name,
muni_users.middle_name,
muni_users.last_name,
muni_users.role,
muni_users.email,
muni_users.phone,
muni_users."isActive" as status
from munies
join muni_admins on munies.muni_id = muni_admins.muni_id
join muni_offices on munies.muni_id = muni_offices.muni_id
join muni_users on muni_offices.office_id = muni_users.office_id
where muni_users.user_id = '0dea707d-2248-4a2e-b8fd-b65578852ca9'
which gives me very nice clean table for data named exactly how I want and in proper order.
Try to make supabase-js equalent
js
userDetails(userId) {
return supabase
.from('munies')
.select(`
name,
muni_offices(name, muni_users(first_name, middle_name, last_name, role, email, phone, isActive)),
muni_admins(first_name, last_name)
`)
.eq('muni_users.user_id', userId)
.single();
}
Heath
09/30/2022, 10:47 AMdb_pre_request
function according to the documentation https://postgrest.org/en/stable/configuration.html#db-pre-request and also following this github issue https://github.com/supabase/supabase/issues/3233
It works fine when I spin up my environment locally using supabase start
and supabase db reset
. The parameter gets set and my function runs correctly.
Unfortunately I get an error when I try to run the migrations for a linked supabase project. Here is the SQL in the migration that is failing
postgres
-- inside of migration 20220914185059...
ALTER ROLE postgres SET pgrst.db_pre_request to db_pre_request;
NOTIFY pgrst, 'reload config';
Here is the command and error I'm seeing
Run supabase link --project-ref $NEXT_PUBLIC_SUPABASE_ID --password SUPABASE_DB_PASSWORD
Finished supabase link.
Applying unapplied migrations...
Error: ERROR: permission denied to set parameter "pgrst.db_pre_request" (SQLSTATE 42501); while executing migration 20220914185059
Error: Process completed with exit code 1.
Can anyone help? My first thought is that whatever role is being used to run the migrations doesn't have the right GRANTs, but I don't know how to check that. Any other ideas, or solutions?Kcrik
09/30/2022, 10:54 AMrlee128
09/30/2022, 1:20 PMbegin
insert into public.reactioncount(parent_id, reaction_value)
values(new.id, 'share');
values(new.id, 'comment');
values(new.id, 'like');
return new;
end;
ŁukaszW.
09/30/2022, 4:04 PMsupabaseServerClient({ req: opts.req })
After log out still having user on it, event if the cookies and all sesions are clearedmr madcat
09/30/2022, 6:27 PMjdgamble555
09/30/2022, 9:25 PMrgfx
09/30/2022, 7:00 PMoski啦
09/30/2022, 8:09 PMcorasan
09/30/2022, 8:35 PMdave johnson
09/30/2022, 9:36 PMmartypdx
09/30/2022, 10:27 PMgerry
09/30/2022, 10:47 PMVik
10/01/2022, 12:16 AMuneatenauthor
10/01/2022, 12:33 AMzander
10/01/2022, 12:55 AMrlee128
10/01/2022, 4:08 AMdeclare
new_count bigint;
begin
select reaction_count into new_count from public.reactioncount
where parent_id = new.parent_id and
reaction_value = new.reaction_type;
new_count = new_count + 1;
update public.reactioncount
set reaction_count = new_count
where parent_id = new.parent_id and
reaction_value = new.reaction_type;
return new, new_count;
end;