Skip to content

DataLinq v0.9.3 - Join Queries and Model Generation Fixes

Latest

Choose a tag to compare

@bazer bazer released this 05 Oct 15:12
· 1 commit to master since this release

0.9.3 fixes explicit inner-join composition, generated model defaults, cache attributes on partial declarations, and schema regeneration. It resolves all nine issues in the 0.9.3 milestone.

Upgrade all DataLinq packages together to 0.9.3 and rebuild generated models. Regenerate imported model files to pick up corrected defaults and foreign-key handling. Review the compatibility notes below when regenerating existing schemas.

Join queries

  • Nullable checks after an explicit inner-join projection now resolve directly forwarded members to their source columns. This includes HasValue, its negation, and supported predicates combining Value with local Contains. Predicates execute in the database. #233
  • Explicit inner joins now accept supported Where filters on either input, including repeated filters, self joins, and captured parameters whose values change between executions. Ordering, paging, grouping, outer joins, and additional chained joins remain outside this extension. #234

Defaults and generated metadata

  • Fixed DateTime, DateTimeOffset, and TimeSpan defaults generate legal C# attributes through DefaultDateTime, DefaultDateTimeOffset, and DefaultTimeSpan. Generated initialization preserves ticks, date-time kind, and explicit offsets. SQLite default literals preserve timestamp fractions and duration signs, days, and fractions; MySQL/MariaDB DateTime literals retain microseconds and reject finer fractions. #235
  • Symbolic enum defaults and constant expressions resolve to their integral values in generated metadata. MySQL/MariaDB integer columns receive numeric defaults, while native ENUM columns retain their mapped labels. Changing enum constants refreshes incremental generator output. #236
  • Unsigned MySQL/MariaDB columns place UNSIGNED before DEFAULT, producing valid DDL for unsigned columns with defaults. #241
  • TypeAttribute constructor arguments accept named constants, constant expressions, named arguments, and constants from referenced assemblies. Changes to their resolved values invalidate affected generated metadata. #242
  • Database and table UseCache attributes are honored across partial declarations. Generated metadata preserves database defaults and table overrides, including incremental changes between an absent attribute and explicit UseCache(false). #247

Schema generation and regeneration

  • Cyclic dependencies no longer cause recursive schema ordering to overflow the stack. SQLite supports cyclic table references. MySQL/MariaDB support self-references and report cycles between distinct tables with an actionable diagnostic. Cyclic view dependencies produce a diagnostic on all SQL providers. #246
  • Model regeneration handles differently named foreign-key constraints with the same source and target columns without throwing a duplicate dictionary-key exception. Constraint identity is preserved; ambiguous matches after constraint renames produce a diagnostic. #249

Upgrade and compatibility notes

  • The new temporal default attributes require matching 0.9.3 runtime, generator, and tooling packages. Fixed DateOnly and TimeOnly defaults still have no supported attribute carriers: metadata-to-model generation rejects those defaults explicitly. The property types themselves remain supported.
  • MySQL/MariaDB cyclic constraints between different tables still require creating tables before adding the constraints. This release does not generate deferred ALTER TABLE statements for them.
  • Partial-declaration attribute support added here is scoped to UseCache; it does not imply that every model attribute can be moved to a separate partial declaration.
  • DataLinq.Memory remains an experimental read-only backend with its existing bounded query surface.

Full changelog

Changes since 0.9.2 · 0.9.3 milestone