© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•6mo ago•
4 replies
chrisb2244

Best way to (quickly) reset between tests/after all tests?

Are there alternatives to
npx supabase db reset
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
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?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Reset password expires too quickly
SupabaseSSupabase / help-and-questions
13mo ago
What is the best way to manage password reset in Remix?
SupabaseSSupabase / help-and-questions
4y ago
Best way to track all changes (and who made the change)
SupabaseSSupabase / help-and-questions
4y ago
Best way to perform complex queries?
SupabaseSSupabase / help-and-questions
3y ago