finds.dev← search

// the find

jbogard/Respawn

★ 3,009 · C# · Apache-2.0 · updated Jan 2026

Intelligent database cleaner for integration tests

Respawn resets integration test databases to a clean state by deleting data in foreign-key-safe order rather than truncating or rolling back transactions. It supports SQL Server, PostgreSQL, MySQL, Oracle, SQLite, Informix, DB2, and Snowflake. If you write integration tests against a real database, this is the missing piece between your test setup and a known-good starting state.

The FK-aware deletion order is the core insight — it actually works without disabling constraints, which truncation-based tools can't claim. The Respawner object caches the table graph after the first CreateAsync call, so you pay the metadata cost once per test suite run, not per test. Broad database adapter coverage is genuine, not nominal — the test suite has a real fixture file for each adapter. The API surface is minimal: one options object, one async factory, one reset method.

The SQLite adapter is limited — SQLite has no FK metadata introspection equivalent, so the deletion order is essentially a best-effort guess rather than the FK-graph traversal the other adapters get. No support for resetting sequences or identity columns alongside the data wipe, so auto-increment IDs don't reset between tests, which can cause unexpected ID collisions in assertion-heavy tests. The last meaningful release activity has slowed; some adapter quirks (Snowflake support is community-contributed and lightly tested) are sitting open without resolution. There is no async cancellation token threading through the ResetAsync path, which matters if you're running many parallel test workers.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →