Refactored several Supabase client functions and updated them to use generics. Also, the '@kit/supabase-config' package was removed from the project and all references were replaced accordingly. The project's dependencies were updated as well, including the Supabase package which was upgraded to the latest version.
38 lines
825 B
PL/PgSQL
38 lines
825 B
PL/PgSQL
create schema if not exists makerkit;
|
|
|
|
-- anon, authenticated, and service_role should have access to tests schema
|
|
grant USAGE on schema makerkit to anon, authenticated, service_role;
|
|
|
|
-- Don't allow public to execute any functions in the tests schema
|
|
alter default PRIVILEGES in schema makerkit revoke execute on FUNCTIONS from public;
|
|
|
|
-- Grant execute to anon, authenticated, and service_role for testing purposes
|
|
alter default PRIVILEGES in schema makerkit grant execute on FUNCTIONS to anon,
|
|
authenticated, service_role;
|
|
|
|
create or replace function makerkit.get_account_by_slug(
|
|
account_slug text
|
|
)
|
|
returns setof accounts
|
|
as $$
|
|
begin
|
|
|
|
return query
|
|
select
|
|
*
|
|
from
|
|
accounts
|
|
where
|
|
slug = account_slug;
|
|
|
|
end;
|
|
|
|
$$ language PLPGSQL;
|
|
|
|
select
|
|
*
|
|
from
|
|
finish();
|
|
|
|
rollback;
|