feat(backend): add transactional outbox and embedded goose migrations
This commit is contained in:
1 parent
653f3775f8
commit
15e2e50561
40 files changed
+2471
-67
No files matched your search
@@ -0,0 +1,20 @@
|
||||
//go:build integration
|
||||
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
|
||||
"lincodex/backend/internal/port/outbound"
|
||||
)
|
||||
|
||||
// TransactionForIntegrationTest exposes the transaction behind a unit of work
|
||||
// to integration tests that write test-only tables. It is compiled only with
|
||||
// the integration build tag and is not part of the adapter API.
|
||||
func TransactionForIntegrationTest(unit outbound.UnitOfWork) (pgx.Tx, bool) {
|
||||
postgresUnit, ok := unit.(*UnitOfWork)
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
return postgresUnit.tx, true
|
||||
}
|
||||
Reference in new issue
Block a user