Please sign in to comment.
Allow NULLS FIRST/LAST when ordering using the :nulls=>:first/:last o…
…ption to asc and desc NULLS FIRST/LAST is an SQL:2003 extension supported by PostgreSQL 8.3+, Firebird 1.5+, Oracle, and probably some other databases as well. As you might expect, NULLS FIRST makes NULL values show up before other values, and NULLS LAST makes NULL values show up after other values. In Sequel, this feature is exposed via the new :nulls option to asc and desc: ds.filter(:release_date.desc(:nulls=>:first), :name.asc(:nulls=>:last)) Sequel can correctly invert orders even when the :nulls option is used, switching ASC NULLS FIRST to DESC NULLS LAST, for example.
- Loading branch information...
Showing with 53 additions and 10 deletions.