The in-memory store is not a pretend SQL server. Its capability mask honestly omits
transactions, inspection, and notifications. Use a live helper when behavior depends
on a backend’s atomic gate or one of those capabilities.
Isolation contract
Every helper creates a boundary that no sibling test owns:- PostgreSQL creates a generated schema, runs production migrations against it, and supplies connection configuration for that schema.
- MySQL creates and migrates a generated database, then returns ready-to-use options or a DSN.
- Redis creates a generated key prefix. Cleanup uses
SCANand boundedDELbatches; it never runsKEYS,FLUSHDB, orFLUSHALL.
Rust live stores
MysqlTestDatabase::opts() returns mysql_async::Opts for a pool.
RedisTestNamespace::client() and prefix() connect directly to RedisStore::new.
Rust cleanup consumes the helper, making double cleanup impossible.
Go live stores
Require* forms register idempotent cleanup through testing.TB.Cleanup. Use
Create* when setup errors need custom handling. MySQLTestDatabase.Open returns a
database/sql handle. Redis namespaces plug into headgateredis.New through their
Client and Prefix values.
Run live helper tests
- Rust
- Go