Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql
3.0.0
dotnet add package Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql --version 3.0.0
NuGet\Install-Package Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql -Version 3.0.0
<PackageReference Include="Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql" Version="3.0.0" />
<PackageVersion Include="Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql" Version="3.0.0" />
<PackageReference Include="Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql" />
paket add Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql --version 3.0.0
#r "nuget: Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql, 3.0.0"
#:package Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql@3.0.0
#addin nuget:?package=Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql&version=3.0.0
#tool nuget:?package=Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql&version=3.0.0
Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql
Part of Anarchy I/O Toolkit, a .NET developer platform · Pillar: Infrastructure · Layer: Infrastructure · Package catalog
MySQL adapter for the toolkit's relational persistence layer, using MySqlConnector.
dotnet add package Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql
MysqlDbDialect, connection pools, unit of work, retry policy and repository bases adapt the shared relational layer to MySQL.- Register
AppTelemetryin DI and configureModuleMysqlwith connection and resilience options factories;AddMysqlHealthReports()adds reader and writer checks. - The unkeyed storage policy uses the writer; use the
readerkey for read-only operations. Port 3306 is the default. - Named session time zones require populated MySQL time-zone tables. Retry the whole unit of work rather than individual commands inside a transaction.
When to use it
Use this adapter for a MySQL-backed application that needs the toolkit's relational policies, unit of work and repository bases. The consuming application supplies its schema, migrations and MySQL-specific queries.
How to use it
- Register
AppTelemetryand useModuleMysqlwith factories forMysqlConnectionOptionsandMysqlResilienceOptions. Obtain hosts and credentials from the environment or a secret provider rather than committing them. - Configure reader/writer hosts, database name, command timeout and optional session time zone. The port defaults to 3306 and
MaximumPoolSizedefaults to 100; tune pool size for the database and number of application instances. - Implement repositories with the MySQL bases and select the keyed
readerpolicy for read-only work. The unkeyed policy uses the writer. AddAddMysqlHealthReports()if the host should check both endpoints. - Validate the integration against a dedicated MySQL test database using
Testing.Db.Mysql. If a transaction fails, retry the whole unit of work rather than individual statements inside it.
See the MySQL usage notes and Testing.Db.Mysql.
Third-party dependencies
This package brings these libraries, which its name does not announce:
| Library | Why | In the public API? |
|---|---|---|
Dapper (through Infrastructure.Persistence.Db) |
Runs the repositories' SQL and maps results | Yes: through Infrastructure.Persistence.Db's type handlers |
Polly (Polly.Core, through Infrastructure.Persistence.Db) |
Retries transient database failures | Yes: through the resilience policy builder |
Releases
See the release notes for the complete release history.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Anarchy.Toolkit.Core (>= 3.0.0)
- Anarchy.Toolkit.Core.Telemetry (>= 2.0.0)
- Anarchy.Toolkit.Infrastructure.Persistence.Db (>= 4.0.0)
- Dapper (= 2.1.79)
- Humanizer (>= 3.0.10)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- MySqlConnector (>= 3.0.0)
- Newtonsoft.Json (>= 13.0.4)
- Polly.Core (>= 8.9.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Anarchy.Toolkit.Infrastructure.Persistence.Db.Mysql:
| Package | Downloads |
|---|---|
|
Anarchy.Toolkit.Testing.Db.Mysql
MySQL integration-test fixtures, settings mapping, enum handlers and table reset helpers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
## Releases
### 3.0.0
- **Breaking:** extension classes take the `Extensions` suffix under `Extensions/<extended namespace>/`, helpers live in `Helpers/<Subject>/`, and their namespaces follow those folders: update `using` directives.
- **Breaking:** depends on the new major versions of `Infrastructure.Persistence.Db`.
### 2.0.0
- Update dependencies for the relational event-persistence split and event contract changes.
### 1.0.1
- chore(build): Format package release notes property
### 1.0.0
- New package identity, renamed from `Anarchy.Toolkit.Infrastructure.Persistence.Mysql`; versions below are historical releases under that package ID.
- Preserve unit-of-work failures and use provider-neutral application telemetry.
### Historical releases under `Anarchy.Toolkit.Infrastructure.Persistence.Mysql`
### 1.2.1
- docs(packages): identify each package's pillar and layer
- build(packages): attribute the copyright to Leandro Melão Medeiros
- build: relicense under Apache-2.0 and update the package metadata
### 1.2.0
- build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1
### 1.1.5
- docs: expand XML docblocks across all projects for the DocFX API reference
### 1.1.4
- refactor(src): clean up code style across library packages
- chore(deps): update AWS SDK, Lambda ASP.NET Core server and MySqlConnector packages
### 1.1.2
- build: migrate local automation to build tooling
### 1.1.1
- docs: expand package guides and release histories
- chore(deps): update AWS, Polly, and xUnit packages
### 1.1.0
- Applied the configurable maximum pool size to MySQL connection strings.
### 1.0.1
- Added a package-specific NuGet README.
### 1.0.0
- Introduced the MySQL relational persistence provider, connection handling and provider-specific health reports.