$ git log --oneline
Changelog
Every release across all Socigy.OpenSource packages. Newest first.
5 June 2026
Socigy.OpenSource.DBv0.3.1stable
Added
InsertMultipleAsyncon the database context.I{Table}Setnow exposesInsertMultipleAsync(entities, includeAutoFields, ct), batching a whole collection into multi-rowINSERTs within the unit-of-work scope.- Auto-field control on context inserts.
InsertAsyncandInsertMultipleAsynctakeincludeAutoFields(defaultfalse); passtrueto also write auto-increment columns (supply your own values) — the context equivalent ofWithAllFields(). Backed by a newGetInsertPlan(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.HashiCorppackage 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 asbytea. Any common value type plusstring/byte[]is supported. A built-in authenticatedAesFieldEncryptor(AES-256-CBC + HMAC-SHA256) ships in the package; the encryptor is pluggable viaIFieldEncryptor+SocigyFieldEncryption.Configure. Encrypted columns are non-queryable (a clearNotSupportedExceptionis thrown).[Encrypted(AutoDecrypt = false)]defers decryption — exposing a read-only{Field}RawEncryptedand a lazy, caching{Field}Decryptedaccessor. - Background diagnostics. The Vault encryptor/credentials provider, the connection factory's credential refresh, and
SocigyFieldEncryption.ConfigureemitILoggermessages and OpenTelemetry spans under theSocigy.OpenSource.DBsource, 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-rowINSERT ... 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
.sqlprocedure 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_regclassfirst. - 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.durationhistogram, and command/error counters — all under the source/meter nameSocigy.OpenSource.DB. - Structured SQL logging via
ILoggerwith 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}, andI{Table}Set— withExecuteAsync/ExecuteTransactionAsyncunit-of-work scopes, first-class transactions, streamingForEachAsync, and configurable connection lifetime. Callers never pass aDbConnection, and services are fully mockable. - Expression parser support for more operators and types: bool-column predicates,
Nullable<T>.HasValue/.Value, case-insensitiveILIKE(viaToLower()/ToUpper()),string.Equals,string.IsNullOrEmpty, arithmetic operators, and null-coalescing (??toCOALESCE).
Changed
- Unsupported LINQ expressions now throw
NotSupportedExceptionwith 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. LIKEpatterns are now escaped.Contains/StartsWith/EndsWithescape%,_and\and appendESCAPE '\', 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.WriteLinediagnostics 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
DEFAULTexpression in generated DDL (DEFAULT 0instead ofDEFAULT Draft, which PostgreSQL rejected as a column reference). - C# enum property initialisers on
[DatabaseEnum]-annotated enums now emit a quoted stringDEFAULTexpression 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 noDEFAULTclause is emitted. - Enum
DEFAULTemission now usesConvert.ToInt64instead ofConvert.ToInt32, preventing silent failures for enums withlongas 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(), andDelete()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(), andFullJoin()with expression-based ON conditions. - Set operations:
Union(),UnionAll(),Intersect(), andExcept()across two compatible queries via theICompiledQueryinterface. - Value convertors:
IDbValueConvertor<T>interface and[ValueConvertor]attribute for custom read/write transformation per column. - Procedure mapping:
.sqlfiles declared as<AdditionalFiles>are parsed by the generator and produce strongly-typed async method wrappers in{Assembly}.Socigy.Generated.Procedures. DateOnlyandTimeOnlysupport, mapping to PostgreSQLDATEandTIME WITHOUT TIME ZONErespectively.[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 andCREATE SEQUENCEgeneration 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
PackageReferenceinstalls 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
PackageVersionchanges.
Initial development — pre-release
← all packages4 releases