Methods
Creates a new empty SqlQuery This equals a sql query like SELECT * FROM *;
Example
let query = exo::SqlQuery::new();
assert!(query is exo::SqlQuery);
Return the SqlQuery as sql string.
Example
let query = exo::SqlQuery::new();
assert_eq!(query.to_string(), "SELECT * FROM *;");
This function tries to parse the SqlQuery from a string.
Example
let query = exo::SqlQuery::parse_str("SELECT * FROM *;")?;
assert_eq!(query,exo::SqlQuery::new());
Clones the SqlQuery and returns a new independet one.
Set one or multiple models to the SqlQuery. This functions consumes the SqlQuery and returns it updated.
Example
let query = exo::SqlQuery::new().model("user").model("right");
assert_eq!(query.to_string(), "SELECT * FROM user, right;");
Set the limit of the SqlQuery. This functions consumes the SqlQuery and returns it updated.
Example
let query = exo::SqlQuery::new().limit(10);
assert_eq!(query.to_string(), "SELECT * FROM * LIMIT 10;");
Set the offset of the SqlQuery. This functions consumes the SqlQuery and returns it updated.
Example
let query = exo::SqlQuery::new().offset(10);
assert_eq!(query.to_string(), "SELECT * FROM * OFFSET 10;");
Set an additonal check/where condition This functions consumes the SqlQuery and returns it updated.
Example
let query = exo::SqlQuery::new().check("ident", "==", "test");
assert_eq!(query.to_string(), "SELECT * FROM * WHERE ident = 'test';");
Set a full text search query for the given language This functions consumes the SqlQuery and returns it updated.
Example
let query = exo::SqlQuery::new().search("Right");
Set a specific column for the SqlQuery This functions consumes the SqlQuery and returns it updated.
Example
let query = exo::SqlQuery::new().column("uuid");
assert_eq!(query.to_string(), "SELECT uuid FROM *;");
Set a specific aggregate column for the SqlQuery This functions consumes the SqlQuery and returns it updated. Aggregates can not be combined with normal columns.
Example
let query = exo::SqlQuery::new().aggregate("uuid", "count");
assert_eq!(query.to_string(), "SELECT COUNT(uuid) FROM *;");
Protocols
let output = value.models
Allows a get operation to work.
value.models = input
Allows a set operation to work.
let output = value.limit
Allows a get operation to work.
value.limit = input
Allows a set operation to work.
let output = value.offset
Allows a get operation to work.
value.offset = input
Allows a set operation to work.
let output = value.columns
Allows a get operation to work.
value.columns = input
Allows a set operation to work.
let output = value.sort_by
Allows a get operation to work.
value.sort_by = input
Allows a set operation to work.
let output = value.sort_order
Allows a get operation to work.
value.sort_order = input
Allows a set operation to work.
if value == b { }
Allows for partial equality operations to work.
println("{:?}", value)
Allows the value to be debug printed.
println("{}", value)
Allows the value to be display printed.