Files
myeasycms-v2/apps/web/supabase/tests/database/00000-makerkit-helpers.sql
giancarlo 48f1ee90c4 Update Supabase clients and refactor codebase
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.
2024-04-11 12:31:08 +08:00

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;