Skip to content

Marten 9.48.0

Choose a tag to compare

@jeremydmiller jeremydmiller released this 11 Oct 02:07
a6832ce

Document diagnostics: filter and order by document properties (#869, #5631)

IDocumentStoreDiagnostics.QueryDocumentsAsync now applies DocumentQueryOptions.Where / OrderBy / Arguments instead of refusing them. The text goes onto Query<T>() through JasperFx 2.84.0's Dynamic LINQ helper, so member casing, enum storage, duplicated fields, conjoined tenancy, soft deletes and hierarchies are Marten's own; only the SELECT list is swapped for the diagnostics read's columns, so the JSON comes back byte-exact with its metadata, and the total counts the filtered rows. Operator text is never spliced into SQL, and the read issues no DDL.

Measured against a LINQ-to-objects oracle over 83 shapes and three storage configurations; every shape is either right or refused:

  • Refused: range comparisons on, and ordering by, an enum stored as its name (string serializer storage or a varchar duplicated field), and <> / a negated comparison on a nullable member unless the text says what null should do (JasperFx's SqlNullSemantics). Date-part members and inline in (…) lists are refused honestly by the provider.
  • Fixed rather than refused: criteria orderings put nulls first ascending, as .NET does (PostgreSQL defaults to last), and DateTime arguments compare correctly against timestamp without time zone locators.
  • String ordering follows the database's collation (note: Alpine images use musl and sort bytewise).
  • Under Native AOT, criteria are refused.

Fixes

  • Grouped projections translate Count / LongCount predicates through the Where parser, with null semantics and bound parameters (#5625).
  • A quick-mode StartStream that loses a race for the same stream id now throws ExistingStreamIdCollisionException instead of a raw 23505, so QuickWithServerTimestamps behaves like Rich and Quick (#5628).

Dependencies

JasperFx 2.84.0