Skip to content

Message storage by connection-string name for every RDBMS provider, plus named-connection docs and describe (GH-5127, GH-5156) - #5174

Merged
jeremydmiller merged 7 commits into
mainfrom
gh-5127-storage-named-connections
Oct 23, 2026
Merged

jeremydmiller merged 7 commits into
mainfrom
gh-5127-storage-named-connections

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Message storage registration by connection-string name for every RDBMS provider (GH-5127), plus the docs and describe work for named connections (GH-5156). Second half of the Aspire parity work after #5159 (transports).

What's here

  • PostgreSQL: PersistMessagesWithPostgresqlUsingNamedConnection(name, ...), NpgsqlDataSource resolved from the container, named static tenants.
  • SQL Server: by connection-string name, plus named static tenants. No data-source form: the provider only takes connection strings, and Aspire.Microsoft.Data.SqlClient registers SqlConnection, not a data source.
  • MySQL: by name, MySqlDataSource from the container (what Aspire.MySqlConnector's AddMySqlDataSource registers), named static tenants.
  • SQLite and Oracle: by name, plus named static tenants. SQLite still refuses in-memory databases, now checked when the named value is applied.
  • Core: NamedConfigurationDependency.Usage ("message store" vs the default "transport") for the failure text; an ApplyNamedConnectionString overload taking a full dependency; EnsureNamedConnectionStringsApplied(). Named values are applied once, thread-safely, on first access to the message stores and at the top of resource discovery. The missing-connection remedy names the Aspire database resource (AddX("server").AddDatabase("name")). Wolverine.RDBMS gets NamedConnectionStringTenants.
  • describe prints a Named Connection Strings table (resolved or missing, never the values) and reports a MissingNamedConnectionStringsException readably instead of failing.
  • Docs: aspire.md and every transport and durability page lead with the named-connection form. Pages that read the connection string by hand keep that section as "Reading the Connection String Yourself".

Naming follows the shipped ...UsingNamedConnection convention from #5159 rather than the issue's bare PersistMessagesWithX(string name), which would collide with the existing (string connectionString) overloads.

All additive; no existing overload changes behaviour. Marten / Polecat / Fisher IntegrateWithWolverine() paths are untouched.

Local gate (CI is off today; the version-bump PR runs full CI for the release)

  • dotnet build -c Release -f net9.0: PostgresqlTests, SqlServerTests, MySqlTests, OracleTests, SqliteTests, CoreTests, 0 warnings / 0 errors
  • --filter-class "*named_connection*": Postgres 5/5, SQL Server 4/4, MySQL 5/5, Oracle 4/4, SQLite 5/5, CoreTests 12/12

Closes #5127
Closes #5156

🤖 Generated with Claude Code

https://claude.ai/code/session_01DCggXgxnG3EBXoR9rrq37U

jeremydmiller and others added 7 commits October 23, 2026 13:36
…qlDataSource from the container, and named static tenants

Core: NamedConfigurationDependency.Usage ("message store" vs the default "transport") for the failure text,
an ApplyNamedConnectionString overload taking a full dependency, EnsureNamedConnectionStringsApplied(), and the
named values are applied (thread safe, once) on first access to the message stores too, and at the very top of
the resources discovery. Wolverine.RDBMS: NamedConnectionStringTenants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…med static tenants

No data-source form: the provider takes only connection strings, and Aspire.Microsoft.Data.SqlClient registers
SqlConnection, not a data source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Source from the container, and named static tenants

Aspire.MySqlConnector's AddMySqlDataSource registers MySqlDataSource, which the container overload resolves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…plus named static tenants

SQLite still refuses in-memory databases, now checked when the named value is applied.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…("name")) in the missing-connection remedy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… never values); aspire.md leads with named connections

describe now prints a Named Connection Strings table before anything that needs the values, and reports a
MissingNamedConnectionStringsException readably instead of failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ection form

Sections are built from the test-code snippet regions. Pages that already had an "Aspire Integration" section
reading the connection string by hand keep it, demoted to "Reading the Connection String Yourself".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller merged commit b3d590b into main Oct 23, 2026
@jeremydmiller jeremydmiller mentioned this pull request Oct 23, 2026
This was referenced Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant