pub enum Query {
Select(SelectQuery),
Delete(DeleteQuery),
CreateKeyspace(CreateKeyspaceQuery),
}
Expand description
Represents a query
use scyllax_parser::*;
let query = Query::try_from("select id, name from person where id = ?");
assert_eq!(
query,
Ok(Query::Select(SelectQuery {
table: "person".to_string(),
columns: vec![
Column::Identifier("id".to_string()),
Column::Identifier("name".to_string()),
],
condition: vec![
WhereClause {
column: Column::Identifier("id".to_string()),
operator: ComparisonOperator::Equal,
value: Value::Variable(Variable::Placeholder),
},
],
limit: None,
}))
);
Variants§
Select(SelectQuery)
A select query
Delete(DeleteQuery)
A delete query
CreateKeyspace(CreateKeyspaceQuery)
A create keyspace query
Trait Implementations§
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
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
Mutably borrows from an owned value. Read more