LiteSQL
|
template class which holds SelectQuery for selecting objects of type T More...
#include <datasource.hpp>
Public Member Functions | |
DataSource (const Database &db_, const Expr &e=Expr()) | |
DataSource (const Database &db_, const SelectQuery &sel_) | |
const Database & | getDatabase () const |
returns database reference | |
SelectQuery | idQuery () const |
returns SelectQuery which selects ID-numbers of objects | |
size_t | count () const |
returns number of objects in result set | |
SelectQuery | objectQuery () const |
returns SelectQuery which selects objects | |
Cursor< T > | cursor () const |
returns cursor for query | |
T | one () const |
returns first object in result set. More... | |
std::vector< T > | all () const |
returns all objects in result set. | |
DataSource & | orderBy (FieldType f, bool asc=true) |
modifies SelectQuery to order result set More... | |
DataSource & | orderByRelation (FieldType id, FieldType f, bool asc=true) |
modifies SelectQuery to order result set by external table More... | |
template class which holds SelectQuery for selecting objects of type T
|
inline |
db_ | database reference |
e | selection filter |
References litesql::selectObjectQuery().
|
inline |
db_ | database reference |
sel_ | selection query |
|
inline |
returns first object in result set.
throw exception if none found
References litesql::DataSource< T >::cursor().
|
inline |
modifies SelectQuery to order result set
f | field to order by |
asc | ascending order |
|
inline |
modifies SelectQuery to order result set by external table
id | foreign key field used to join table with query |
f | field to order by |
asc | ascending order |