Best way to (quickly) reset between tests/after all tests?
Are there alternatives to
I'd imagine transactions could perhaps solve this, but I can't use those with the supabase-js client.
If I run
I can manually track the changes I think I'm making, and then try and invert those changes and use the service_role key to delete/un-update etc, but this doubles the amount of code to write, and potentially requires specific code in tests that I'd rather avoid...
What's the best practice here?
npx supabase db reset if I want to reset my database to the seeded state for local testing?I'd imagine transactions could perhaps solve this, but I can't use those with the supabase-js client.
If I run
supabase db reset, then I get the functionality I want, but the entire Docker stack is reset, which takes quite a long time (comparitively, for simple testing).I can manually track the changes I think I'm making, and then try and invert those changes and use the service_role key to delete/un-update etc, but this doubles the amount of code to write, and potentially requires specific code in tests that I'd rather avoid...
What's the best practice here?