Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finalizer ¶
type Finalizer[DB any, TX any] struct { Ctx context.Context DB *DB Log *internal.Log BeginTx func(context.Context, *DB) (*TX, error) BodyTx func(context.Context, *TX) error // executes inside tx or runs outside work using pooled conn; returns error for body SaveStatus func(context.Context, *TX, error) error // persist final outcome (err==nil success) CommitTx func(*TX) error RollbackTx func(*TX) SetDone func() SetError func(error) }
Finalizer orchestrates a migration attempt and status persistence. It exists to allow unit testing of the logic and to make the logic shared between database drivers.
Assumptions / rules:
- TX must be a pointer type (e.g. *sql.Tx); we rely on direct nil comparisons.
- No optional callbacks: every function field must be set (supply no-op when unused).
- Any opened transaction that isn't committed gets rolled back by a dedicated defer.
Click to show internal directories.
Click to hide internal directories.