2
Add setup and teardown code for `supabase db test`
Source: supabase/supabase#13053 · opened by @isaacharrisholt
The problem
When running tests with supabase db test, it's useful to be able to run SQL as an auth user as described in [the docs for RLS](
We don't want those functions to be in the database permanently for security reasons, so it would be good if they could be created at the start of the test then town down at the end.
Proposed solution
supabase db test could look for setup.sql and teardown.sql files in the supabase/tests/database directory and run them before and after the tests respectively.
Currently, we have a procedure that creates these functions, and another to delete them, but it's a pain to have to call those at the start and end of each test.
When running tests with supabase db test, it's useful to be able to run SQL as an auth user as described in [the docs for RLS](
We don't want those functions to be in the database permanently for security reasons, so it would be good if they could be created at the start of the test then town down at the end.
Proposed solution
supabase db test could look for setup.sql and teardown.sql files in the supabase/tests/database directory and run them before and after the tests respectively.
Currently, we have a procedure that creates these functions, and another to delete them, but it's a pain to have to call those at the start and end of each test.
No pledges yet. Be the first to back this.
Comments
Similar requests
DBT Cloud Console
3 votes · 0 comments
It would be nice to have a jdbc fdw. As the already existing are dead.
1 vote · 0 comments
Using other DBs like Surrealdb or Neo4j for socializing
2 votes · 0 comments
Configure External PostgreSQL for Supabase Instead of supabase-db
3 votes · 0 comments
Supabase developer experience improvements - realtimes, types & transactions - Supabase hosted backed/server functions as solution?
3 votes · 0 comments
No comments yet.