MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / order_by_with_nulls

Method order_by_with_nulls

src/query/helper.rs:667–674  ·  view source on GitHub ↗

Add an order_by expression with nulls ordering option ``` use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend}; use sea_query::NullOrdering; assert_eq!( cake::Entity::find() .order_by_with_nulls(cake::Column::Id, Order::Asc, NullOrdering::First) .build(DbBackend::Postgres) .to_string(), r#"SELECT "cake"."id", "cake"."name" FROM "cake" ORDER BY "cake"."id" ASC NULLS FIRST"# ); ```

(mut self, col: C, ord: Order, nulls: NullOrdering)

Source from the content-addressed store, hash-verified

665 /// );
666 /// ```
667 fn order_by_with_nulls<C>(mut self, col: C, ord: Order, nulls: NullOrdering) -> Self
668 where
669 C: IntoSimpleExpr,
670 {
671 self.query()
672 .order_by_expr_with_nulls(col.into_simple_expr(), ord, nulls);
673 self
674 }
675}
676
677// LINT: when the column does not appear in tables selected from

Callers

nothing calls this directly

Implementers 1

cursor.rssrc/executor/cursor.rs

Calls 2

into_simple_exprMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected