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

Method order_by_desc

src/query/helper.rs:645–652  ·  view source on GitHub ↗

Add an order_by expression (descending) ``` use sea_orm::{entity::*, query::*, tests_cfg::cake, DbBackend}; assert_eq!( cake::Entity::find() .order_by_desc(cake::Column::Id) .build(DbBackend::MySql) .to_string(), "SELECT `cake`.`id`, `cake`.`name` FROM `cake` ORDER BY `cake`.`id` DESC" ); ```

(mut self, col: C)

Source from the content-addressed store, hash-verified

643 /// );
644 /// ```
645 fn order_by_desc<C>(mut self, col: C) -> Self
646 where
647 C: IntoSimpleExpr,
648 {
649 self.query()
650 .order_by_expr(col.into_simple_expr(), Order::Desc);
651 self
652 }
653
654 /// Add an order_by expression with nulls ordering option
655 /// ```

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