FeatureFuel
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.

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests