Methods
Creates a new empty SqlQuery This equals a sql query like SELECT * FROM *;
Example
let query = new;
assert!;
This function tries to parse the SqlQuery from a string.
Example
let query = parse_str?;
assert_eq!;
Set one or multiple models to the SqlQuery. This functions consumes the SqlQuery and returns it updated.
Example
let query = new.model.model;
assert_eq!;
Set the limit of the SqlQuery. This functions consumes the SqlQuery and returns it updated.
Example
let query = new.limit;
assert_eq!;
Set the offset of the SqlQuery. This functions consumes the SqlQuery and returns it updated.
Example
let query = new.offset;
assert_eq!;
Set an additonal check/where condition This functions consumes the SqlQuery and returns it updated.
Example
let query = new.check;
assert_eq!;
Set a full text search query for the given language This functions consumes the SqlQuery and returns it updated. Also sets sort_by to none and sort_oder to desc.
Example
let query = new.search;
Set a specific column for the SqlQuery This functions consumes the SqlQuery and returns it updated.
Example
let query = new.column;
assert_eq!;
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 = new.aggregate;
assert_eq!;
Set a specific aggregate column with parameter for the SqlQuery This functions consumes the SqlQuery and returns it updated.
Example
let query = new.aggregate_with_param;
assert_eq!;
Add an AND condition to the query This functions consumes the SqlQuery and returns it updated.
Example
let query = new.and.and;
assert_eq!;
Add an OR condition to the query This functions consumes the SqlQuery and returns it updated.
Example
let query = new.and.or;
assert_eq!;
Add a grouped set of conditions with AND chaining to the query This functions consumes the SqlQuery and returns it updated.
Example
let query = new
.and_group
.or;
// Produces: WHERE (a = "1" AND b = "2") OR c = "3"
Add a grouped set of conditions with OR chaining to the query This functions consumes the SqlQuery and returns it updated.
Example
let query = new
.and
.or_group;
// Produces: WHERE status = "active" OR (priority = "high" OR urgent = "true")
Define the sort oder (desc / asc)