Using the Supabase dashboard, I created a function...
# off-topic
e
Using the Supabase dashboard, I created a function using the following configuration:
return type: record Arguments email - text password - text acctkey - text updatedat int8 Definition
Copy code
begin
insert into public.Users(email, password, acctKey, updatedAt)
values (email, crypt(password, gen_salt('bf')), acctkey, updatedat) returning id, password;
end;
Advanced Settings Language: * plpgsql* Type of security: Security Definer
Calling the function:
Copy code
let {data, error } = await supabaseClient.rpc('function_one', {
'email': 'john@example.com',
'password': 'mypass',
'acctkey':'key1',
'updatedat': Date.now()
});
I enabled
PLPGSQL
,
AUTOINC
, and
PGCRYPTO
on Extensions page.
Moving thread to help