Struct sea_orm_migration::prelude::Search
pub struct Search { /* private fields */ }
Expand description
For recursive WithQuery WithClauses the traversing order can be specified in some databases that support this functionality.
The clause contains the type of traversal: SearchOrder and the expression that is used to construct the current path.
A query can have both SEARCH and CYCLE clauses.
Setting Self::order and Self::expr is mandatory. The SelectExpr used must specify an alias which will be the name that you can use to order the result of the CommonTableExpression.
Implementations§
§impl Search
impl Search
pub fn new_from_order_and_expr<EXPR>(order: SearchOrder, expr: EXPR) -> Searchwhere
EXPR: Into<SelectExpr>,
pub fn new_from_order_and_expr<EXPR>(order: SearchOrder, expr: EXPR) -> Searchwhere EXPR: Into<SelectExpr>,
Create a complete Search specification from the SearchOrder and a SelectExpr. The given SelectExpr must have an alias specified.
pub fn order(&mut self, order: SearchOrder) -> &mut Search
pub fn order(&mut self, order: SearchOrder) -> &mut Search
The traversal order to be used.
pub fn expr<EXPR>(&mut self, expr: EXPR) -> &mut Searchwhere
EXPR: Into<SelectExpr>,
pub fn expr<EXPR>(&mut self, expr: EXPR) -> &mut Searchwhere EXPR: Into<SelectExpr>,
The given SelectExpr must have an alias specified.
The actual expression will be the one used to track the path in the graph.
The alias of the given SelectExpr will be the name of the order column generated by this clause.