pub struct Cycle { /* private fields */ }
Expand description
For recursive WithQuery WithClauses the CYCLE sql clause can be specified to avoid creating an infinite traversals that loops on graph cycles indefinitely. You specify an expression that identifies a node in the graph and that will be used to determine during the iteration of the execution of the query when appending of new values whether the new values are distinct new nodes or are already visited and therefore they should be added again into the result.
A query can have both SEARCH and CYCLE clauses.
Setting Self::set, Self::expr and Self::using is mandatory.
Implementations§
source§impl Cycle
impl Cycle
sourcepub fn new_from_expr_set_using<EXPR, ID1, ID2>(
expr: EXPR,
set: ID1,
using: ID2,
) -> Self
pub fn new_from_expr_set_using<EXPR, ID1, ID2>( expr: EXPR, set: ID1, using: ID2, ) -> Self
Create a complete Search specification from the SearchOrder and a SelectExpr. The given SelectExpr must have an alias specified.
sourcepub fn expr<EXPR>(&mut self, expr: EXPR) -> &mut Selfwhere
EXPR: Into<SimpleExpr>,
pub fn expr<EXPR>(&mut self, expr: EXPR) -> &mut Selfwhere
EXPR: Into<SimpleExpr>,
The expression identifying nodes.
sourcepub fn set<ID>(&mut self, set: ID) -> &mut Selfwhere
ID: IntoIden,
pub fn set<ID>(&mut self, set: ID) -> &mut Selfwhere
ID: IntoIden,
The name of the boolean column containing whether we have completed a cycle or not yet generated by this clause.
sourcepub fn using<ID>(&mut self, using: ID) -> &mut Selfwhere
ID: IntoIden,
pub fn using<ID>(&mut self, using: ID) -> &mut Selfwhere
ID: IntoIden,
The name of the array typed column that contains the node ids (generated using the Self::expr) that specify the current nodes path that will be generated by this clause.
Trait Implementations§
impl StructuralPartialEq for Cycle
Auto Trait Implementations§
impl Freeze for Cycle
impl !RefUnwindSafe for Cycle
impl Send for Cycle
impl Sync for Cycle
impl Unpin for Cycle
impl !UnwindSafe for Cycle
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)