Qx v0.7
Qt Extensions Library
Loading...
Searching...
No Matches
Qx::AbstractSqlQuery< Derived > Class Template Reference

AbstractSqlQuery is a common base class from which all query types are derived, and provides common SQL keywords.

#include <qx/sql/qx-sqlquery.h>

Inheritance diagram for Qx::AbstractSqlQuery< Derived >:
[legend]

Public Member Functions

template<sql_stringable First>
auto & AS (First &&fs)
 
template<sql_stringable First>
auto & BETWEEN (First &&fs)
 
auto & CASE ()
 
auto & DISTINCT ()
 
template<sql_stringable First>
auto & ELSE (First &&fs)
 
auto & END ()
 
template<QxSql::sql_struct First, QxSql::sql_struct... Rest>
Derived & FROM ()
 
template<sql_stringable First, sql_stringable ... Rest>
auto & FROM (First &&fs, Rest &&... s)
 
template<std::ranges::input_range R>
requires sql_stringable<unwrap_t<R>>
Derived & IN (const R &range)
 
auto & IN (const SqlQuery &q)
 
template<sql_stringable First, sql_stringable ... Rest>
auto & IN (First &&fs, Rest &&... s)
 
auto & IS ()
 
template<sql_stringable First>
auto & IS (First &&fs)
 
template<sql_stringable First>
auto & ON (First &&fs)
 
template<QxSql::sql_struct First, QxSql::sql_struct... Rest>
Derived & SELECT ()
 
template<sql_stringable First, sql_stringable ... Rest>
Derived & SELECT (First &&fsel, Rest &&... sel)
 
template<QxSql::sql_struct First, QxSql::sql_struct... Rest>
Derived & SELECT_DISTINCT ()
 
template<sql_stringable First, sql_stringable ... Rest>
Derived & SELECT_DISTINCT (First &&fsel, Rest &&... sel)
 
template<sql_stringable First>
auto & THEN (First &&fs)
 
Derived & verbatim (const QString &sql, bool space=true)
 
auto & WHEN ()
 
template<sql_stringable First>
auto & WHEN (First &&fs)
 
auto & WHERE ()
 
template<sql_stringable First>
auto & WHERE (First &&fs)
 
- Public Member Functions inherited from Qx::SqlQuery
void bindValue (const QString &placeholder, const QVariant &val)
 
SqlDatabasedatabase ()
 
const SqlDatabasedatabase () const
 
bool hasDatabase () const
 
QString string () const
 

Member Function Documentation

◆ AS()

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::AS ( First && fs)

Adds a AS clause to the query using fs and returns a reference to the query.

◆ BETWEEN()

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::BETWEEN ( First && fs)

Adds a BETWEEN clause to the query using fs and returns a reference to the query.

◆ CASE()

template<typename Derived>
auto & Qx::AbstractSqlQuery< Derived >::CASE ( )

Adds a CASE clause to the query and returns a reference to the query.

◆ DISTINCT()

template<typename Derived>
auto & Qx::AbstractSqlQuery< Derived >::DISTINCT ( )

Adds a DISTINCT clause to the query and returns a reference to the query.

◆ ELSE()

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::ELSE ( First && fs)

Adds a ELSE clause to the query using fs and returns a reference to the query.

◆ END()

template<typename Derived>
auto & Qx::AbstractSqlQuery< Derived >::END ( )

Adds a END clause to the query and returns a reference to the query.

◆ FROM() [1/2]

template<typename Derived>
template<QxSql::sql_struct First, QxSql::sql_struct... Rest>
Derived & Qx::AbstractSqlQuery< Derived >::FROM ( )
inline

Adds a FROM clause to the query using all of the fields from First through Rest and returns a reference to the query.

◆ FROM() [2/2]

template<typename Derived>
template<sql_stringable First, sql_stringable ... Rest>
auto & Qx::AbstractSqlQuery< Derived >::FROM ( First && fs,
Rest &&... s )

Adds a FROM clause to the query using fs through s and returns a reference to the query.

◆ IN() [1/3]

template<typename Derived>
template<std::ranges::input_range R>
requires sql_stringable<unwrap_t<R>>
Derived & Qx::AbstractSqlQuery< Derived >::IN ( const R & range)
inline

Adds an IN clause to the query using all of the elments from range.

If range is empty, the SQL statement will be ill-formed.

◆ IN() [2/3]

template<typename Derived>
auto & Qx::AbstractSqlQuery< Derived >::IN ( const SqlQuery & q)

Adds a IN clause to the query using q as a sub-query and returns a reference to the query.

◆ IN() [3/3]

template<typename Derived>
template<sql_stringable First, sql_stringable ... Rest>
auto & Qx::AbstractSqlQuery< Derived >::IN ( First && fs,
Rest &&... s )

Adds a IN clause to the query using fs through s and returns a reference to the query.

◆ IS() [1/2]

template<typename Derived>
auto & Qx::AbstractSqlQuery< Derived >::IS ( )

Adds a IS clause to the query and returns a reference to the query.

◆ IS() [2/2]

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::IS ( First && fs)

Adds a IS clause to the query using fs and returns a reference to the query.

◆ ON()

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::ON ( First && fs)

Adds a ON clause to the query using fs and returns a reference to the query.

◆ SELECT() [1/2]

template<typename Derived>
template<QxSql::sql_struct First, QxSql::sql_struct... Rest>
Derived & Qx::AbstractSqlQuery< Derived >::SELECT ( )
inline

Adds a SELECT clause to the query using all of the fields from First through Rest and returns a reference to the query.

◆ SELECT() [2/2]

template<typename Derived>
template<sql_stringable First, sql_stringable ... Rest>
Derived & Qx::AbstractSqlQuery< Derived >::SELECT ( First && fs,
Rest &&... s )
inline

Adds a SELECT clause to the query using fs through s, and returns a reference to the query.

◆ SELECT_DISTINCT() [1/2]

template<typename Derived>
template<QxSql::sql_struct First, QxSql::sql_struct... Rest>
Derived & Qx::AbstractSqlQuery< Derived >::SELECT_DISTINCT ( )
inline

Adds a SELECT clause to the query using all of the fields from First through Rest, followed by the keyword DISTINCT and returns a reference to the query.

◆ SELECT_DISTINCT() [2/2]

template<typename Derived>
template<sql_stringable First, sql_stringable ... Rest>
Derived & Qx::AbstractSqlQuery< Derived >::SELECT_DISTINCT ( First && fs,
Rest &&... s )
inline

Adds a SELECT clause to the query using fs through s, followed by the keyword DISTINCT and returns a reference to the query.

◆ THEN()

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::THEN ( First && fs)

Adds a THEN clause to the query using fs and returns a reference to the query.

◆ verbatim()

template<typename Derived>
Derived & Qx::AbstractSqlQuery< Derived >::verbatim ( const QString & sql,
bool space = true )
inline

Adds the text sql directly to the query and returns a reference to the query.

If space is true, a space is automatically added before sql if the query already contains some text.

◆ WHEN() [1/2]

template<typename Derived>
auto & Qx::AbstractSqlQuery< Derived >::WHEN ( )

Adds a WHEN clause to the query and returns a reference to the query.

◆ WHEN() [2/2]

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::WHEN ( First && fs)

Adds a WHEN clause to the query using fs and returns a reference to the query.

◆ WHERE() [1/2]

template<typename Derived>
auto & Qx::AbstractSqlQuery< Derived >::WHERE ( )

Adds a WHERE clause to the query and returns a reference to the query.

◆ WHERE() [2/2]

template<typename Derived>
template<sql_stringable First>
auto & Qx::AbstractSqlQuery< Derived >::WHERE ( First && fs)

Adds a WHERE clause to the query using fs and returns a reference to the query.


The documentation for this class was generated from the following files: