✨ feat(bdd): parallel-safe schema-per-package isolation (T12 stage 2/2) — 2.85x speedup (#35)
Per-package isolated Postgres schema with migrations. Local benchmark: 12.87s sequential → 4.51s parallel = 2.85x. ADR-0025 status to Implemented. CI uses BDD_SCHEMA_ISOLATION=true. Co-authored-by: Gabriel Radureau <arcodange@gmail.com> Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #35.
This commit is contained in:
@@ -184,7 +184,15 @@ func BuildSchemaIsolatedDSN(cfg *config.Config, schemaName string) string {
|
||||
)
|
||||
}
|
||||
|
||||
// (Close already exists below; we reuse it.)
|
||||
// Exec runs a raw SQL statement against the repository's connection.
|
||||
// Used by BDD test infra for schema lifecycle (CREATE SCHEMA / DROP SCHEMA).
|
||||
// Avoid in production code paths -- prefer the typed Repository methods.
|
||||
func (r *PostgresRepository) Exec(sql string) error {
|
||||
if r.db == nil {
|
||||
return fmt.Errorf("Exec called on PostgresRepository with nil db")
|
||||
}
|
||||
return r.db.Exec(sql).Error
|
||||
}
|
||||
|
||||
// initializeDatabase sets up the PostgreSQL database connection and runs migrations
|
||||
func (r *PostgresRepository) initializeDatabase() error {
|
||||
|
||||
Reference in New Issue
Block a user