# Changelog

What changed in Socigy.OpenSource.DB v0.2.0 — diagnostics/OpenTelemetry, a testable database context, and a hardened expression parser.

## v0.2.0 — 4 June 2026

### 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`. See [Diagnostics & OpenTelemetry](/database/0.2.0/observability/diagnostics).
- **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. See [Logging](/database/0.2.0/observability/logging).
- **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. See [Database context & unit of work](/database/0.2.0/core-concepts/database-context) and [Unit testing](/database/0.2.0/testing/unit-testing).
- **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 (`??` → `COALESCE`).

### Changed / Breaking

- **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.

---

> For the full release history across all versions see the [Changelog](/changelog).
