Quince defines C++ functions that wrap certain SQL functions; i.e. they
build and return exprn_mappers
that represent SQL function calls.
E.g., if str
is some abstract_mapper<std::string>
, then length(str)
builds an exprn_mapper<int32_t>
which, when executed, evaluates the
SQL subexpression represented by str
,
and passes the result to the SQL length
function.
Here is a list of all the quince functions that wrap SQL functions in this way:
Quince function name |
Argument is |
Returns |
SQL function name |
---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
any type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
any single-column type |
|
|
|
any single-column type |
|
|
Quince defines two function constants:
count_all
is an
exprn_mapper<int64_t>
that wraps SQL's COUNT(*)
empty
is a predicate
(i.e. an exprn_mapper<bool>
).
It is defined as count_all==int64_t(0)
.
E.g.:
const query<int64_t> n_points = points.select(count_all); const query<bool> no_points = points.select(empty);
As we shall see, quince provides special
means of creating and executing queries that end in .select(count_all)
or .select(empty)
.