Skip to content

fix(runtime): sort nulls last ascending on every engine - #468

Merged
dmealing merged 7 commits into
mainfrom
fm/mo-list-null-order
Oct 26, 2026
Merged

dmealing merged 7 commits into
mainfrom
fm/mo-list-null-order

Conversation

@dmealing

@dmealing dmealing commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What Changed

  • List and report ?sort= now puts nulls last on ASC and first on DESC in all five ports. Postgres output is unchanged. SQLite and MySQL sorted output changes for columns with nulls. Native NULLS LAST / NULLS FIRST is used on Postgres and SQLite (TypeScript Drizzle and Kysely drivers, Java PostgresDriver / SQLiteDriver, Python Dialect.order_term). MySQL uses a leading col IS NULL key. Generated C# routes and Kotlin controller sort helpers follow the same rule.
  • Runtime in-memory driver sorts nulls as larger than any value, matching the SQL drivers. SELECT DISTINCT in the Java OMDB driver skips the null key, since those engines reject ORDER BY items outside the select list.
  • Adds the api-contract report/ scenario sort-null-ordering and updates the sort-on-boolean and sort-on-defaulted scenarios. Adds Java OrderTermNullsTest and Python/TypeScript dialect and filter-parser tests. Docs and CHANGELOG describe the null-ordering rule (docs/features/api-contract.md#null-ordering).

Validation

  • Local CI (ci_mode: local) ran the full multi-port regression: TypeScript, C#, Java, Kotlin and Python conformance and integration lanes all passed.
  • The null ordering was driven live on TypeScript (SQLite, in-memory, MySQL 8 in Docker), Python and Java; the report-corpus scenario sort-null-ordering passes on SQLite, Postgres and MySQL.
  • The pipeline fixed three things: the Java SELECT DISTINCT guard (with a unit test), a CLI typecheck exclusion for concurrent scratch fixtures, and a regenerated showcase C# route file.
  • Not run: live MSSQL and Oracle engines.

…g, on every engine

Nulls sort as larger than any value (Postgres's default) in all five ports.
SQLite and MySQL sorted output changes for columns with nulls.
…e claim in fixtures/persistence-conformance/README.md: it said engines disagree on null sort order and pointed nowhere. It now says nulls sort the same in every port and links to docs/features/api-contract.md#null-ordering. CHANGELOG.md, docs/features/api-contract.md, docs/features/reporting.md and fixtures/api-contract-conformance/report/README.md were already updated by the change and checked. Remaining docs that mention NULLS LAST (migrations-and-drift.md, view DDL) describe projection view DDL, which this change did not alter. Edit left uncommitted.
@dmealing
dmealing merged commit 7549462 into main Oct 26, 2026
1 check passed
@dmealing
dmealing deleted the fm/mo-list-null-order branch October 26, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant