Skip to content

Add StrEnum.Npgsql package#1

Merged
dmytro-khmara merged 1 commit intomasterfrom
add-strenum-npgsql-package
Apr 25, 2026
Merged

Add StrEnum.Npgsql package#1
dmytro-khmara merged 1 commit intomasterfrom
add-strenum-npgsql-package

Conversation

@dmytro-khmara
Copy link
Copy Markdown
Member

Summary

  • Introduces StrEnum.Npgsql, an EF Core + Npgsql integration that lets StrEnum string enums be stored either as text or as native Postgres enum types (analogous to MapEnum for regular C# enums).
  • Public API: UseStringEnums() on the options builder; HasPostgresStringEnum<T>() / MapStringEnumAsPostgresEnum<T>() on the model builder; HasPostgresStringEnum<T>() on the property builder.
  • Self-contained: depends only on StrEnum and Npgsql.EntityFrameworkCore.PostgreSQL. The value converter selector logic is inlined rather than pulled from StrEnum.EntityFrameworkCore.
  • Targets net6.0–net10.0 with the matching EFCore.PG version range per TFM. Mirrors the sibling repos: Dockerfile, build/publish workflows, .gitignore, .dockerignore, LICENSE.txt, README, sln.

Test plan

  • dotnet build succeeds for all five target frameworks
  • dotnet test — 18/18 pass on net10.0 (xUnit + FluentAssertions)
  • Smoke-test against a real Postgres instance (text and PG-enum modes, including a dotnet ef migrations add to verify the generated migration shape)
  • Verify docker build --target test succeeds in CI

@dmytro-khmara dmytro-khmara merged commit 459ace7 into master Apr 25, 2026
1 check passed
@dmytro-khmara dmytro-khmara deleted the add-strenum-npgsql-package branch April 25, 2026 16:36
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.

1 participant