/DB

Changelog

What changed in Socigy.OpenSource.DB. Modular-monolith and multi-project fixes — `required` members, flowing Npgsql/Bcl dependencies, a `contextName` for lowercase databases, and `excludeDbDefaults` on every insert path — in 0.3.4; Binary COPY bulk insert, scalar/affected/DTO procedure returns, database-first scaffolding, and Transit data-key envelope encryption with per-column profiles and OpenBao support in 0.3.3; runtime-named typed tables ([TableType] and DynamicTable) in 0.3.2; the database-context bulk insert plus scalar and aggregate API in 0.3.1; and 0.3.0's field encryption, rotating credentials, and HashiCorp Vault package.

updated 26 Jun 20267 min readv0.3.4View as Markdown
26 June 2026
Socigy.OpenSource.DBv0.3.4stable
Added
  • `contextName` config. A new optional socigy.json field that decouples the generated C# identifiers from the physical database name: a lowercase databaseName like identity can produce IIdentityDb / AddIdentityDb() while the connection-string key and physical database stay identity.
  • `excludeDbDefaults` on every insert path. The context InsertAsync / InsertMultipleAsync, the static Table.InsertMultipleAsync, and BulkCopy.InsertMultipleCopyAsync take excludeDbDefaults: true to omit [Default] columns so the server default applies — previously only the fluent Insert().ExcludeAutoFields() could.
Changed
  • `required` members supported. Generated constructors emit [SetsRequiredMembers], so a required member no longer breaks the builders new() constraint (CS9040).
  • Dependencies flow to consumers. The package multi-targets netstandard2.0;net8.0; on net8.0+ it declares Npgsql and Microsoft.Bcl.AsyncInterfaces as normal dependencies, so generated code compiles and migrations run without adding either package by hand.
Fixed
  • Generator no longer crashes without `socigy.json`. Consumer projects that reference a model project transitively now emit nothing instead of throwing CS8785.
  • Lowercase `databaseName` produces valid C# type names. A Postgres-conventional name like identity no longer generates an all-lowercase type that trips CS8981.
  • Multi-table migration names. A migration creating users and outbox is now named AddUsersAndOutbox instead of after a single table.