Skip to main content

QueryBuilder

Struct QueryBuilder 

Source
pub struct QueryBuilder<'a> { /* private fields */ }
Expand description

Fluent API for building node queries

Implementations§

Source§

impl<'a> QueryBuilder<'a>

Source

pub fn new(engine: &'a QueryEngine<'a>, node_type: impl Into<String>) -> Self

Source

pub fn where_cond( self, field: impl Into<String>, op: &str, value: impl Into<String>, ) -> Self

Add a WHERE condition

Source

pub fn where_num(self, field: impl Into<String>, op: &str, value: i64) -> Self

Add numeric WHERE condition

Source

pub fn order_by(self, field: impl Into<String>, direction: &str) -> Self

Set ORDER BY clause

Source

pub fn limit(self, n: usize) -> Self

Set LIMIT

Source

pub fn offset(self, n: usize) -> Self

Set OFFSET

Source

pub fn return_fields(self, fields: Vec<&str>) -> Self

Set fields to return

Source

pub fn execute(self) -> Result<QueryResult>

Execute the built query

Source

pub fn count(self) -> Result<usize>

Execute count query

Auto Trait Implementations§

§

impl<'a> Freeze for QueryBuilder<'a>

§

impl<'a> RefUnwindSafe for QueryBuilder<'a>

§

impl<'a> Send for QueryBuilder<'a>

§

impl<'a> Sync for QueryBuilder<'a>

§

impl<'a> Unpin for QueryBuilder<'a>

§

impl<'a> UnsafeUnpin for QueryBuilder<'a>

§

impl<'a> UnwindSafe for QueryBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.