Qx v0.7
Qt Extensions Library
|
The SqlDmlQuery class represents SQL queries that fit into the data manipulation language sub-language. More...
#include <qx/sql/qx-sqlquery.h>
Public Member Functions | |
SqlDmlQuery () | |
SqlDmlQuery (SqlDatabase &db) | |
auto & | DELETE () |
SqlError | execute (int &affected) |
template<QxSql::sql_struct Struct> | |
auto & | INSERT_INTO () |
template<sql_stringable First, sql_stringable ... Rest> | |
auto & | INSERT_INTO (const SqlString &table, First &&first, Rest &&... rest) |
auto & | MATCHED () |
template<sql_stringable First> | |
auto & | MERGE_INTO (First &&fs) |
template<QxSql::sql_struct Struct> | |
auto & | SET (const Struct &s) |
template<sql_stringable First, sql_stringable ... Rest> | |
auto & | SET (First &&fs, Rest &&... s) |
template<QxSql::sql_struct Struct> | |
auto & | UPDATE () |
template<sql_stringable First> | |
auto & | UPDATE (First &&fs) |
template<QxSql::sql_struct Struct> | |
auto & | VALUES (const Struct &s) |
template<sql_stringable First, sql_stringable ... Rest> | |
auto & | VALUES (First &&fs, Rest &&... s) |
![]() | |
auto & | AS (First &&fs) |
auto & | BETWEEN (First &&fs) |
auto & | CASE () |
auto & | DISTINCT () |
auto & | ELSE (First &&fs) |
auto & | END () |
SqlDmlQuery & | FROM () |
auto & | FROM (First &&fs, Rest &&... s) |
SqlDmlQuery & | IN (const R &range) |
auto & | IN (const SqlQuery &q) |
auto & | IN (First &&fs, Rest &&... s) |
auto & | IS () |
auto & | IS (First &&fs) |
auto & | ON (First &&fs) |
SqlDmlQuery & | SELECT () |
SqlDmlQuery & | SELECT (First &&fsel, Rest &&... sel) |
SqlDmlQuery & | SELECT_DISTINCT () |
SqlDmlQuery & | SELECT_DISTINCT (First &&fsel, Rest &&... sel) |
auto & | THEN (First &&fs) |
SqlDmlQuery & | verbatim (const QString &sql, bool space=true) |
auto & | WHEN () |
auto & | WHEN (First &&fs) |
auto & | WHERE () |
auto & | WHERE (First &&fs) |
![]() | |
void | bindValue (const QString &placeholder, const QVariant &val) |
SqlDatabase * | database () |
const SqlDatabase * | database () const |
bool | hasDatabase () const |
QString | string () const |
A query can be created separately, but is most often created directly using one of the methods of SqlDatabase.
Qx::SqlDmlQuery::SqlDmlQuery | ( | ) |
Creates a DML query without an associated database.
A query without an associated database cannot be execute, but can be used as a sub-query.
Qx::SqlDmlQuery::SqlDmlQuery | ( | SqlDatabase & | db | ) |
Creates a DML query associated with database db.
auto & Qx::SqlDmlQuery::DELETE | ( | ) |
Adds a DELETE
clause to the query and returns a reference to the query.
SqlError Qx::SqlDmlQuery::execute | ( | int & | affected | ) |
Executes the query and sets affected to the number of rows affected.
A valid error is returned if there was an issue executing the query.
|
inline |
Adds an INSERT INTO
clause to the query using table table and all of the fields from first through rest and returns a reference to the query.
|
inline |
Adds an INSERT INTO
clause to the query using table table and first through rest and returns a reference to the query.
auto & Qx::SqlDmlQuery::MATCHED | ( | ) |
Adds a MATCHED
clause to the query and returns a reference to the query.
auto & Qx::SqlDmlQuery::MERGE_INTO | ( | First && | fs | ) |
Adds a MERGE INTO
clause to the query using fs and returns a reference to the query.
|
inline |
Adds a SET
clause to the query using all of the fields from s and returns a reference to the query.
auto & Qx::SqlDmlQuery::SET | ( | First && | fs, |
Rest &&... | s ) |
Adds a SET
clause to the query using fs through s and returns a reference to the query.
|
inline |
Adds an UPDATE
clause to the query using Struct as the identifier and returns a reference to the query.
auto & Qx::SqlDmlQuery::UPDATE | ( | First && | fs | ) |
Adds a UPDATE
clause to the query using fs and returns a reference to the query.
|
inline |
Adds a VALUES
clause to the query using all of the fields from s and returns a reference to the query.
auto & Qx::SqlDmlQuery::VALUES | ( | First && | fs, |
Rest &&... | s ) |
Adds a VALUES
clause to the query using fs through s and returns a reference to the query.