Skip to content

fix(postgresql): drop global Dapper underscore name mapping - #42

Merged
giammin merged 2 commits into
mainfrom
fix/23-remove-global-dapper-typemap
Oct 22, 2026
Merged

giammin merged 2 commits into
mainfrom
fix/23-remove-global-dapper-typemap

Conversation

@giammin

@giammin giammin commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Alias the snake_case columns in the PostgreSQL SELECT (id AS "Id", ... via nameof(DataProtectionKeyEntity.X)) instead of enabling Dapper.DefaultTypeMap.MatchNamesWithUnderscores process-wide at registration time.

  • Removes the global setting from PersistKeysWithDapperInPostgreSQL and from the PostgreSQL test fixture.
  • Adds an integration test mapping Id, InsertDate, FriendlyName, Xml with the setting explicitly false, and a unit test asserting the extension leaves it false.
  • Removes the README note; updates AGENTS.md.

Closes #23

BREAKING CHANGE: the PostgreSQL provider no longer sets Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true. Applications that relied on it for their own Dapper queries must set it explicitly at startup.

Alias the snake_case columns in the PostgreSQL SELECT instead of enabling
Dapper.DefaultTypeMap.MatchNamesWithUnderscores process-wide.

Closes #23
BREAKING CHANGE: the PostgreSQL provider no longer sets
Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true. Applications that
relied on it for their own Dapper queries must set it explicitly at startup.
…dapper-typemap

# Conflicts:
#	AGENTS.md
#	tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlDataProtectionRepositoryTests.cs
@giammin
giammin merged commit 4ef7eb5 into main Oct 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the global Dapper.DefaultTypeMap.MatchNamesWithUnderscores side effect

1 participant