feat(mysql)!: promote to v1.0.0 — BeginTx with isolation levels, Stats, bump all deps to v1.0.0

Add BeginTx(ctx, *sql.TxOptions) to Client interface for explicit transaction isolation
level control; Begin refactored as a convenience wrapper calling BeginTx(ctx, nil).
Add Stats() sql.DBStats to Component interface for connection pool observability.
Bump all micro-lib dependencies (logz, health, launcher, xerrors) from v0.9.0 to v1.0.0.
API committed as stable.
This commit is contained in:
2026-05-11 19:16:51 -06:00
parent 9d8762458c
commit f43fc8056c
5 changed files with 73 additions and 18 deletions

View File

@@ -5,6 +5,25 @@ All notable changes to this module will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.0] — 2026-05-12
### Added
- `Client.BeginTx(ctx context.Context, opts *sql.TxOptions) (Tx, error)` — starts a transaction with explicit isolation level and read-only options; accepts any `*sql.TxOptions` supported by `database/sql`.
- `Component.Stats() sql.DBStats` — returns connection pool metrics (`OpenConnections`, `WaitCount`, `WaitDuration`, etc.) for observability and alerting; returns zero value when called before `OnInit`.
### Changed
- `Client.Begin(ctx context.Context) (Tx, error)` — refactored as a convenience wrapper calling `BeginTx(ctx, nil)`; behavior is identical, no breaking change.
- All micro-lib dependencies bumped from v0.9.1 to v1.0.0: `logz`, `health`, `launcher`, `xerrors`.
### Unchanged
All other API (`Executor`, `Tx`, `Client`, `Component`, `UnitOfWork`, `Config`, `New`,
`NewUnitOfWork`, `HandleError`) is API-compatible with v0.9.1.
[1.0.0]: https://code.nochebuena.dev/go/mysql/releases/tag/v1.0.0
## [0.9.1] - 2026-03-20
### Added
@@ -23,6 +42,8 @@ and this module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.
- **Backward compatible.** Existing `Config` literals that do not set `Charset`, `Loc`, or `ParseTime` produce the same DSN as v0.9.0 (`charset=utf8mb4&loc=UTC&parseTime=true`).
- **Collation via DSN is not supported.** `go-sql-driver` v1.8.x negotiates the collation using a 1-byte handshake ID (max 255). MariaDB 11.4+ collations such as `utf8mb4_uca1400_as_cs` carry IDs > 255 and will cause a connection error if set in the DSN. Set the desired collation in schema migrations at the database/table level.
[0.9.1]: https://code.nochebuena.dev/go/mysql/releases/tag/v0.9.1
## [0.9.0] - 2026-03-18
### Added
@@ -49,5 +70,4 @@ and this module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.
- The module is structurally parallel to `postgres` but uses `database/sql` types throughout; the two modules are intentionally type-incompatible.
- MySQL error codes are matched by numeric constant via `MySQLError.Number`, not by string parsing, for stability across MySQL and MariaDB versions.
[0.9.1]: https://code.nochebuena.dev/go/mysql/releases/tag/v0.9.1
[0.9.0]: https://code.nochebuena.dev/go/mysql/releases/tag/v0.9.0