|
QEloquent 1.1.0
Qt most flexible ORM.
|
Fluent SQL query builder. More...
Public Member Functions | |
| Query () | |
| Constructs an empty query. | |
| Query (const Query &) | |
| Copy constructor. | |
| Query (Query &&) | |
| Move constructor. | |
| Query & | operator= (const Query &) |
| Copy assignment operator. | |
| Query & | operator= (Query &&) |
| Move assignment operator. | |
| ~Query () | |
| Destructor. | |
| QString | tableName () const |
| Returns the table name configured for this query. | |
| Query & | table (const QString &tableName) |
| Configures the table name for the query. | |
| Query & | andWhere (const QString &field, const QString &op, const QVariant &value) |
| Adds an AND WHERE clause with a custom operator. | |
| Query & | andWhere (const QString &expression) |
| Adds a raw AND WHERE expression. | |
| Query & | orWhere (const QString &field, const QString &op, const QVariant &value) |
| Adds an OR WHERE clause with a custom operator. | |
| Query & | orWhere (const QString &expression) |
| Adds a raw OR WHERE expression. | |
| Query & | join (const QString &table, const QString &first, const QString &op, const QString &second, const QString &type="INNER") |
| Adds a JOIN clause. | |
| Query & | groupBy (const QString &field) |
| Adds a GROUP BY clause. | |
| Query & | orderBy (const QString &field, Qt::SortOrder order=Qt::DescendingOrder) |
| Adds an ORDER BY clause. | |
| Query & | page (int page, int countPerPage=20) |
| Configures pagination (LIMIT/OFFSET). | |
| Query & | limit (int limit) |
| Adds a LIMIT clause. | |
| Query & | offset (int offset) |
| Adds an OFFSET clause. | |
| Query & | with (const QString &relation) |
| Adds a relationship for eager loading. | |
| Query & | with (const QStringList &relations) |
| Adds multiple relationships for eager loading. | |
| Connection | connection () const |
| Returns the connection used by this query. | |
| QString | connectionName () const |
| Returns the name of the connection. | |
| Query & | connection (const QString &connectionName) |
| Configures the connection name for the query. | |
| bool | hasWhere () const |
| Returns true if the query has WHERE clauses. | |
| QString | whereClause () const |
| Returns the generated WHERE clause string. | |
| QString | whereClause (const Driver *driver) const |
| Returns the generated WHERE clause string for a specific driver. | |
| bool | hasGroupBy () const |
| Returns true if the query has GROUP BY clauses. | |
| QString | groupByClause () const |
| Returns the generated GROUP BY clause string. | |
| QString | groupByClause (const Driver *driver) const |
| Returns the generated GROUP BY clause string for a specific driver. | |
| bool | hasOrderBy () const |
| Returns true if the query has ORDER BY clauses. | |
| QString | orderByClause () const |
| Returns the generated ORDER BY clause string. | |
| QString | orderByClause (const Driver *driver) const |
| Returns the generated ORDER BY clause string for a specific driver. | |
| QString | limitClause () const |
| Returns the generated LIMIT clause string. | |
| QString | offsetClause () const |
| Returns the generated OFFSET clause string. | |
| QString | toString () const |
| Returns the full SQL statement (SELECT). | |
| QString | toString (const Driver *driver) const |
| Returns the full SQL statement for a specific driver. | |
| QStringList | relations () const |
| Returns the list of relations to be eager loaded. | |
Fluent SQL query builder.
Query provides a chainable API to build SELECT, INSERT, UPDATE, and DELETE statements without writing raw SQL.