$ git log --oneline

Changelog

Every release across all Socigy.OpenSource packages. Newest first.

5 June 2026
Socigy.OpenSource.DBv0.3.1stable
Added
  • InsertMultipleAsync on the database context. I{Table}Set now exposes InsertMultipleAsync(entities, includeAutoFields, ct), batching a whole collection into multi-row INSERTs within the unit-of-work scope.
  • Auto-field control on context inserts. InsertAsync and InsertMultipleAsync take includeAutoFields (default false); pass true to also write auto-increment columns (supply your own values) — the context equivalent of WithAllFields(). Backed by a new GetInsertPlan(bool includeAutoIncrement).
  • ForEachAsync<TResult> projection. Streams matching rows, projects each through the callback, and returns the results (materialized inside the scope), so you can transform rows without a lazy enumerable escaping the connection.
Fixed
  • CI now builds, packs, and publishes the optional Socigy.OpenSource.DB.HashiCorp package independently of the main package (each is version-checked separately, so a re-run still ships one when the other is already published).
Socigy.OpenSource.DBv0.3.0stable
Added
  • Field-level encryption. Mark a property [Encrypted] to encrypt it on write and decrypt it on read, stored as bytea. Any common value type plus string/byte[] is supported. A built-in authenticated AesFieldEncryptor (AES-256-CBC + HMAC-SHA256) ships in the package; the encryptor is pluggable via IFieldEncryptor + SocigyFieldEncryption.Configure. Encrypted columns are non-queryable (a clear NotSupportedException is thrown). [Encrypted(AutoDecrypt = false)] defers decryption — exposing a read-only {Field}RawEncrypted and a lazy, caching {Field}Decrypted accessor.
  • Background diagnostics. The Vault encryptor/credentials provider, the connection factory's credential refresh, and SocigyFieldEncryption.Configure emit ILogger messages and OpenTelemetry spans under the Socigy.OpenSource.DB source, so admins can track key loads, credential leases, and renewals.
  • Rotating DB credentials. The generated connection factory can source its connection string from an optional IDbCredentialsProvider (sync cached value + async refresh), enabling externally-managed/rotating credentials.
  • Batched bulk insert. Table.InsertMultipleAsync(rows, conn[, tx]) inserts a whole collection as chunked multi-row INSERT ... VALUES (…),(…) commands (auto-chunked under PostgreSQL's 65,535-parameter limit) instead of a command per row.
  • New optional package Socigy.OpenSource.DB.HashiCorp — HashiCorp Vault implementations: field encryption keyed from Vault (KV-v2) and rotating credentials from Vault's Database secrets engine, each wired with one DI call.
  • Schema placeholders in procedure files. Reference a table or column from a .sql procedure with optional {{Type}} (→ table name) and {{Type.Property}} (→ column name) placeholders; the generator expands them at build time to the real, quoted names, keeping raw SQL in sync with C# renames and [Table]/[Column] overrides. Files that use no placeholder are flagged (SCGDB003) and can opt out per-file with -- @ignore warning.
  • Build-time generator diagnostics. The source generator now validates tables and procedure files and reports issues as SCGDB### diagnostics — unsupported attribute combinations, missing primary keys, malformed or unresolvable procedure headers and placeholders, unused/undeclared parameters, and more. Each is configurable from .editorconfig.
Fixed
  • The OpenTelemetry instrumentation-scope version now reports the package version instead of 1.0.0.0.
  • Migration-version lookup no longer throws (and breaks in the debugger) on first run when the migrations table doesn't exist yet — it probes with to_regclass first.
  • A still-active query/stream when a unit-of-work delegate completes (a forgotten await) now throws a clear, actionable error instead of an opaque "command already in progress".
4 June 2026
Socigy.OpenSource.DBv0.2.0stable
Added
  • Diagnostics & OpenTelemetry. Every executed SQL statement now emits an OpenTelemetry activity (with database semantic-convention tags), a db.client.operation.duration histogram, and command/error counters — all under the source/meter name Socigy.OpenSource.DB.
  • Structured SQL logging via ILogger with the SQL text, parameters and duration. Parameter value capture is opt-in (CaptureParameterValues) with a redaction hook and truncation.
  • Testable database context. A generated, fully interface-based facade — ISocigyDatabaseFactory<I{Db}>, I{Db}, and I{Table}Set — with ExecuteAsync/ExecuteTransactionAsync unit-of-work scopes, first-class transactions, streaming ForEachAsync, and configurable connection lifetime. Callers never pass a DbConnection, and services are fully mockable.
  • Expression parser support for more operators and types: bool-column predicates, Nullable<T>.HasValue/.Value, case-insensitive ILIKE (via ToLower()/ToUpper()), string.Equals, string.IsNullOrEmpty, arithmetic operators, and null-coalescing (?? to COALESCE).
Changed
  • Unsupported LINQ expressions now throw NotSupportedException with a clear message instead of silently emitting invalid SQL. If you relied on an unsupported operator slipping through, it now fails fast at translation time.
  • LIKE patterns are now escaped. Contains/StartsWith/EndsWith escape %, _ and \ and append ESCAPE '\', so values containing wildcards match literally. Queries that accidentally depended on unescaped wildcards may return different rows.
  • License changed to MPL-2.0 (from the previous MIT-with-non-commercial terms).
Fixed
  • Removed stray Console.WriteLine diagnostics from the query parser and the generated query builder.
  • The generated query builder no longer times only preparation; actual execution duration is measured and reported through the diagnostics pipeline.
3 May 2026
Socigy.OpenSource.DBv0.1.83stable
Fixed
  • The generated IDbConnectionFactory.Create() now correctly appends ;Database={name} to the connection string regardless of whether the string already ends with a semicolon. Previously a connection string without a trailing ; produced an invalid string (e.g. ...PasswordDatabase=MyDb), causing Npgsql to fail to parse it.
Socigy.OpenSource.DBv0.1.82stable
Fixed
  • C# enum property initialisers now emit the correct integer DEFAULT expression in generated DDL (DEFAULT 0 instead of DEFAULT Draft, which PostgreSQL rejected as a column reference).
  • C# enum property initialisers on [DatabaseEnum]-annotated enums now emit a quoted string DEFAULT expression matching the PostgreSQL enum type (e.g. DEFAULT 'Draft').
  • Combined flag initialisers (Test.First | Test.Fourth) are now silently skipped — the combined value is not a valid single-row reference in an enum table, so no DEFAULT clause is emitted.
  • Enum DEFAULT emission now uses Convert.ToInt64 instead of Convert.ToInt32, preventing silent failures for enums with long as their underlying type.
1 May 2026
Socigy.OpenSource.DBv0.1.81stable
Added
  • Initial public release of Socigy.OpenSource.DB.
  • Roslyn incremental source generator that produces typed Insert(), Query(), Update(), and Delete() extension methods from annotated C# classes at build time.
  • Attribute-based schema definition: [Table], [PrimaryKey], [Column], [Default], [Nullable], [Ignore], [ForeignKey], [Unique], [Check], [StringLength], [Min], [Max], and [Renamed].
  • Fluent query builder with LINQ expression support for parameterised WHERE clauses.
  • JOIN support via InnerJoin(), LeftJoin(), RightJoin(), and FullJoin() with expression-based ON conditions.
  • Set operations: Union(), UnionAll(), Intersect(), and Except() across two compatible queries via the ICompiledQuery interface.
  • Value convertors: IDbValueConvertor<T> interface and [ValueConvertor] attribute for custom read/write transformation per column.
  • Procedure mapping: .sql files declared as <AdditionalFiles> are parsed by the generator and produce strongly-typed async method wrappers in {Assembly}.Socigy.Generated.Procedures.
  • DateOnly and TimeOnly support, mapping to PostgreSQL DATE and TIME WITHOUT TIME ZONE respectively.
  • [FlaggedEnum] attribute for flags enums — generates a junction table and syncs rows on INSERT/SELECT.
  • [JsonColumn(typeof(TContext))] and [RawJsonColumn] attributes for JSONB columns with optional AOT-safe typed serialisation.
  • [AutoIncrement] attribute and CREATE SEQUENCE generation for integer sequence columns.
  • CLI migration tool (Socigy.OpenSource.DB.Tool) that analyses compiled assemblies and generates PostgreSQL DDL, bundled inside the NuGet meta-package.
  • NuGet meta-package pattern: a single PackageReference installs the Core runtime, the Roslyn source generator, and the CLI tool.
  • GitHub Actions CI workflow: runs tests against a real PostgreSQL 14 service container and publishes to NuGet.org when the PackageVersion changes.
Initial development — pre-release