Akonadi
querybuilder.h
56 };
118 void addJoin(JoinType joinType, const QString &table, const QString &col1, const QString &col2);
160 void addValueCondition(const QString &column, Query::CompareOperator op, const QVariant &value, ConditionType type = WhereCondition);
165 * This is an overload specially for passing a list of IDs, which is a fairly common case in Akonadi.
173 void addValueCondition(const QString &column, Query::CompareOperator op, const QList<qint64> &value, ConditionType type = WhereCondition);
178 * This is an overload specially for passing a set of IDs, which is a fairly common case in Akonadi.
186 void addValueCondition(const QString &column, Query::CompareOperator op, const QSet<qint64> &value, ConditionType type = WhereCondition);
196 void addColumnCondition(const QString &column, Query::CompareOperator op, const QString &column2, ConditionType type = WhereCondition);
Helper class to construct arbitrary SQL queries.
Definition querybuilder.h:33
void addValueCondition(const QString &column, Query::CompareOperator op, const QVariant &value, ConditionType type=WhereCondition)
Add a WHERE or HAVING condition which compares a column with a given value.
Definition querybuilder.cpp:258
void setDatabaseType(DbType::Type type)
Sets the database which should execute the query.
Definition querybuilder.cpp:231
void addSortColumn(const QString &column, Query::SortOrder order=Query::Ascending)
Add sort column.
Definition querybuilder.cpp:766
QString getTableWithColumn(const QString &column) const
Returns concatenated table name with column name.
Definition querybuilder.cpp:846
void addJoin(JoinType joinType, const QString &table, const Query::Condition &condition)
Join a table to the query.
Definition querybuilder.cpp:236
void addColumns(const QStringList &cols)
Adds the given columns to a select query.
Definition querybuilder.cpp:619
void addCondition(const Query::Condition &condition, ConditionType type=WhereCondition)
Add a WHERE condition.
Definition querybuilder.cpp:760
void setColumnValue(const QString &column, const QVariant &value)
Sets a column to the given value (only valid for INSERT and UPDATE queries).
Definition querybuilder.cpp:783
void setColumnValues(const QString &column, const QList< T > &values)
Set column to given values (only valid for INSERT query).
Definition querybuilder.h:258
void setDistinct(bool distinct)
Specify whether duplicates should be included in the result.
Definition querybuilder.cpp:797
void addColumnCondition(const QString &column, Query::CompareOperator op, const QString &column2, ConditionType type=WhereCondition)
Add a WHERE or HAVING condition which compares a column with another column.
Definition querybuilder.cpp:276
void addGroupColumns(const QStringList &columns)
Add list of columns to GROUP BY.
Definition querybuilder.cpp:777
void setForUpdate(bool forUpdate=true)
Indicate to the database to acquire an exclusive lock on the rows already during SELECT statement.
Definition querybuilder.cpp:836
ConditionType
Defines the place at which a condition should be evaluated.
Definition querybuilder.h:61
@ HavingCondition
add condition to HAVING part of the query NOTE: only supported for SELECT queries
Definition querybuilder.h:66
void setIdentificationColumn(const QString &column)
Sets the column used for identification in an INSERT statement.
Definition querybuilder.cpp:808
qint64 insertId()
Returns the ID of the newly created record (only valid for INSERT queries)
Definition querybuilder.cpp:813
void setSubQueryMode(Query::LogicOperator op, ConditionType type=WhereCondition)
Define how WHERE or HAVING conditions are combined.
Definition querybuilder.cpp:754
void addAggregation(const QString &col, const QString &aggregate)
Adds an aggregation statement.
Definition querybuilder.cpp:636
void addColumn(const QString &col)
Adds the given column to a select query.
Definition querybuilder.cpp:624
QueryBuilder(const QString &table, QueryType type=Select)
Creates a new query builder.
Definition querybuilder.cpp:111
JoinType
When the same table gets joined as both, Inner- and LeftJoin, it will be merged into a single InnerJo...
Definition querybuilder.h:49
QString getTable() const
Returns the name of the main table or subquery.
Definition querybuilder.cpp:841
void setLimit(int limit, int offset=-1)
Limits the amount of retrieved rows.
Definition querybuilder.cpp:802
Helper integration between Akonadi and Qt.
Server
QVariant fromValue(T &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 11:57:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 11:57:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.