KDbFunctionExpression
#include <KDbExpression.h>

Static Public Member Functions | |
static QStringList | builtInAggregates () |
static KDbEscapedString | greatestOrLeastFunctionUsingCaseToString (const QString &name, const KDbDriver *driver, const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) |
static bool | isBuiltInAggregate (const QString &function) |
static KDbEscapedString | toString (const QString &name, const KDbDriver *driver, const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) |
![]() | |
static KDb::ExpressionClass | classForToken (KDbToken token) |
Protected Member Functions | |
KDbFunctionExpression (const ExplicitlySharedExpressionDataPointer &ptr) | |
KDbFunctionExpression (KDbExpressionData *data) | |
![]() | |
KDbExpression (const ExplicitlySharedExpressionDataPointer &ptr) | |
KDbExpression (KDbExpressionData *data) | |
KDbExpression (KDbExpressionData *data, KDb::ExpressionClass aClass, KDbToken token) | |
void | appendChild (const ExplicitlySharedExpressionDataPointer &child) |
void | appendChild (const KDbExpression &child) |
bool | checkBeforeInsert (const ExplicitlySharedExpressionDataPointer &child) |
QList< ExplicitlySharedExpressionDataPointer > | children () const |
int | indexOfChild (const KDbExpression &child, int from=0) const |
void | insertChild (int i, const KDbExpression &child) |
void | insertEmptyChild (int i) |
int | lastIndexOfChild (const KDbExpression &child, int from=-1) const |
void | prependChild (const KDbExpression &child) |
bool | removeChild (const KDbExpression &child) |
void | removeChild (int i) |
void | setLeftOrRight (const KDbExpression &right, int index) |
KDbExpression | takeChild (int i) |
Additional Inherited Members | |
![]() | |
ExplicitlySharedExpressionDataPointer | d |
Detailed Description
The KDbFunctionExpression class represents expression that use functional notation F(x, ...)
The functions list include:
- aggregation functions like SUM, COUNT, MAX, ...
- builtin functions like CURRENT_TIME()
- user defined functions
Definition at line 502 of file KDbExpression.h.
Constructor & Destructor Documentation
◆ KDbFunctionExpression() [1/4]
KDbFunctionExpression::KDbFunctionExpression | ( | ) |
Constructs a null function expression.
- See also
- KDbExpression::isNull()
Definition at line 1307 of file KDbFunctionExpression.cpp.
◆ KDbFunctionExpression() [2/4]
|
explicit |
Constructs function expression with name name, without arguments.
Definition at line 1313 of file KDbFunctionExpression.cpp.
◆ KDbFunctionExpression() [3/4]
KDbFunctionExpression::KDbFunctionExpression | ( | const QString & | name, |
const KDbNArgExpression & | arguments | ||
) |
Constructs function expression with name name and arguments arguments.
Definition at line 1319 of file KDbFunctionExpression.cpp.
◆ KDbFunctionExpression() [4/4]
KDbFunctionExpression::KDbFunctionExpression | ( | const KDbFunctionExpression & | expr | ) |
Constructs a copy of other function expression expr. Resulting object is not a deep copy but rather a reference to the object expr.
Definition at line 1326 of file KDbFunctionExpression.cpp.
Member Function Documentation
◆ arguments()
KDbNArgExpression KDbFunctionExpression::arguments | ( | ) |
- Returns
- list of arguments of the function.
Definition at line 1380 of file KDbFunctionExpression.cpp.
◆ greatestOrLeastFunctionUsingCaseToString()
|
static |
- Returns
- a native (driver-specific) GREATEST() and LEAST() function calls generated to string using CASE WHEN... keywords. This is a workaround for cases when LEAST()/GREATEST() function ignores NULL values and only returns NULL if all the expressions evaluate to NULL. Instead of using F(v0,..,vN), this is used: (CASE WHEN (v0) IS NULL OR .. OR (vN) IS NULL THEN NULL ELSE F(v0,..,vN) END) where F == GREATEST or LEAST. Actually it is needed by MySQL < 5.0.13 and PostgreSQL.
Definition at line 1391 of file KDbFunctionExpression.cpp.
◆ name()
QString KDbFunctionExpression::name | ( | ) | const |
- Returns
- name of the function.
Definition at line 1370 of file KDbFunctionExpression.cpp.
◆ setArguments()
void KDbFunctionExpression::setArguments | ( | const KDbNArgExpression & | arguments | ) |
Sets the list of arguments to arguments.
Definition at line 1385 of file KDbFunctionExpression.cpp.
◆ setName()
void KDbFunctionExpression::setName | ( | const QString & | name | ) |
Sets name of the function to name.
Definition at line 1375 of file KDbFunctionExpression.cpp.
◆ toString() [1/2]
KDbEscapedString KDbExpression::toString |
- Returns
- string as a representation of this expression element by running recursive calls. param, if not 0, points to a list item containing value of a query parameter (used in QueryParameterExpr). The result may depend on the optional driver parameter. If driver is 0, representation for portable KDbSQL dialect is returned.
Definition at line 469 of file KDbExpression.cpp.
◆ toString() [2/2]
|
static |
Constructs function expression with name name and args args.
Definition at line 1359 of file KDbFunctionExpression.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:19:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.