KDb
KDbFunctionExpression.cpp
95 virtual KDbField::Type returnType(const KDbFunctionExpressionData* f, KDbParseInfo* parseInfo) const {
97 const KDbNArgExpressionData *argsData = f->args.constData()->convertConst<KDbNArgExpressionData>();
135 KDbField::Type returnType(const KDbFunctionExpressionData* f, KDbParseInfo* parseInfo) const override {
140 const KDbNArgExpressionData *argsData = f->args.constData()->convertConst<KDbNArgExpressionData>();
142 KDbQueryParameterExpressionData *queryParameterExpressionData = expr->convert<KDbQueryParameterExpressionData>();
150 KDbQueryParameterExpressionData *queryParameterExpressionData = expr->convert<KDbQueryParameterExpressionData>();
172 KDbField::Type returnType(const KDbFunctionExpressionData* f, KDbParseInfo* parseInfo) const override {
173 const KDbNArgExpressionData *argsData = f->args.constData()->convertConst<KDbNArgExpressionData>();
177 const KDbField::Type type0 = argsData->children.at(0)->type(); // cache: evaluating type of expressions can be expensive
231 KDbQueryParameterExpressionData *queryParameterExpressionData = expr->convert<KDbQueryParameterExpressionData>();
281 KDbField::Type returnType(const KDbFunctionExpressionData* f, KDbParseInfo* parseInfo) const override {
282 const KDbNArgExpressionData *argsData = f->args.constData()->convertConst<KDbNArgExpressionData>();
287 const KDbConstExpressionData *const0 = argsData->children.at(0)->convertConst<KDbConstExpressionData>();
288 const KDbConstExpressionData *const1 = argsData->children.at(1)->convertConst<KDbConstExpressionData>();
347 KDbField::Type returnType(const KDbFunctionExpressionData* f, KDbParseInfo* parseInfo) const override {
349 const KDbNArgExpressionData *argsData = f->args.constData()->convertConst<KDbNArgExpressionData>();
359 const KDbField::Type type = argsData->children.at(0)->type(); // cache: evaluating type of expressions can be expensive
446 // See also https://dev.mysql.com/doc/refman/5.1/en/mathematical-functions.html#function_ceiling
447 // See also https://www.postgresql.org/docs/9.5/static/functions-math.html#FUNCTIONS-MATH-FUNC-TABLE
449 // (CASE WHEN X = CAST(X AS INT) THEN CAST(X AS INT) WHEN X >= 0 THEN CAST(X AS INT) + 1 ELSE CAST(X AS INT) END)
477 // See also https://www.postgresql.org/docs/9.5/static/functions-math.html#FUNCTIONS-MATH-FUNC-TABLE
503 // See also https://www.postgresql.org/docs/9.5/static/functions-conditional.html#FUNCTIONS-GREATEST-LEAST
573 // See also https://www.postgresql.org/docs/9.5/static/functions-conditional.html#FUNCTIONS-GREATEST-LEAST
613 // See also https://www.postgresql.org/docs/9.5/static/functions-string.html#FUNCTIONS-STRING-SQL
627 // See also https://www.postgresql.org/docs/9.5/static/functions-string.html#FUNCTIONS-STRING-SQL
644 // See also https://www.postgresql.org/docs/9.5/static/functions-conditional.html#FUNCTIONS-NULLIF
663 // See also https://www.postgresql.org/docs/9.5/static/functions-math.html#FUNCTIONS-MATH-RANDOM-TABLE
679 // See also https://www.postgresql.org/docs/9.5/static/functions-math.html#FUNCTIONS-MATH-FUNC-TABLE
681 // example: SELECT ROUND(-1.13), ROUND(-5.51), ROUND(5.51), ROUND(1.298, 1), ROUND(1.298, 0), ROUND(7)
695 // See also https://www.postgresql.org/docs/9.5/static/functions-string.html#FUNCTIONS-STRING-SQL
740 // See also https://www.postgresql.org/docs/9.5/static/functions-string.html#FUNCTIONS-STRING-SQL
768 // See also https://www.postgresql.org/docs/9.5/static/functions-string.html#FUNCTIONS-STRING-SQL
776 //! @todo GLOB(X,Y) is SQLite-specific and is not present in MySQL so we don't expose it; use GLOB operator instead.
849void KDbFunctionExpressionData::debugInternal(QDebug dbg, KDb::ExpressionCallStack* callStack) const
896 QString::fromLatin1(greatestOrLeastName(name.toLatin1())), KDbNArgExpression(args), params, callStack);
907 return driver->ceilingOrFloorFunctionToString(name, KDbNArgExpression(args), params, callStack);
924KDbField::Type KDbFunctionExpressionData::typeInternal(KDb::ExpressionCallStack* callStack) const
945 firstSentence = KDbFunctionExpressionData::tr("Too many arguments.%1", "don't use space before %1")
949 firstSentence = KDbFunctionExpressionData::tr("Too few arguments.%1", "don't use space before %1")
993 KDbFunctionExpressionData::tr("%1%2() function requires %3 or %4 or %5 argument(s).", "", argCounts[2])
1239 const KDbField::Type exprType = expr->type(); // cache: evaluating type of expressions can be expensive
1255 const KDbField::Type exprType = expr->type(); // cache: evaluating type of expressions can be expensive
1368 const KDbNArgExpressionData *argsData = args.d.constData()->convertConst<KDbNArgExpressionData>();
Internal data class used to implement implicitly shared class KDbConstExpression.
Definition KDbExpressionData.h:218
virtual KDbEscapedString greatestOrLeastFunctionToString(const QString &name, const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
Generates native (driver-specific) GREATEST() and LEAST() function calls.
Definition KDbDriver.cpp:343
static QString defaultSqlTypeName(KDbField::Type type)
Definition KDbDriver.cpp:166
virtual KDbEscapedString ifnullFunctionToString(const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
Generates native (driver-specific) IFNULL() function call.
Definition KDbDriver.cpp:327
virtual KDbEscapedString randomFunctionToString(const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
Generates native (driver-specific) RANDOM() and RANDOM(X,Y) function calls.
Definition KDbDriver.cpp:352
virtual KDbEscapedString lengthFunctionToString(const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
Generates native (driver-specific) LENGTH() function call.
Definition KDbDriver.cpp:335
virtual KDbEscapedString hexFunctionToString(const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
Generates native (driver-specific) HEX() function call.
Definition KDbDriver.cpp:319
virtual KDbEscapedString ceilingOrFloorFunctionToString(const QString &name, const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
Generates native (driver-specific) CEILING() and FLOOR() function calls.
Definition KDbDriver.cpp:373
virtual KDbEscapedString unicodeFunctionToString(const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack) const
Generates native (driver-specific) UNICODE() function call.
Definition KDbDriver.cpp:382
Internal data class used to implement implicitly shared class KDbExpression.
Definition KDbExpressionData.h:68
The KDbExpression class represents a base class for all expressions.
Definition KDbExpression.h:52
Internal data class used to implement implicitly shared class KDbFunctionExpression.
Definition KDbExpressionData.h:320
bool validateInternal(KDbParseInfo *parseInfo, KDb::ExpressionCallStack *callStack) override
Definition KDbFunctionExpression.cpp:1133
KDbField::Type typeInternal(KDb::ExpressionCallStack *callStack) const override
Definition KDbFunctionExpression.cpp:924
void debugInternal(QDebug dbg, KDb::ExpressionCallStack *callStack) const override
Sends information about this expression to debug output dbg (internal).
Definition KDbFunctionExpression.cpp:849
The KDbFunctionExpression class represents expression that use functional notation F(x,...
Definition KDbExpression.h:503
static KDbEscapedString greatestOrLeastFunctionUsingCaseToString(const QString &name, const KDbDriver *driver, const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack)
Definition KDbFunctionExpression.cpp:1393
KDbFunctionExpression()
Definition KDbFunctionExpression.cpp:1309
static KDbEscapedString toString(const QString &name, const KDbDriver *driver, const KDbNArgExpression &args, KDbQuerySchemaParameterValueListIterator *params, KDb::ExpressionCallStack *callStack)
Definition KDbFunctionExpression.cpp:1361
void setArguments(const KDbNArgExpression &arguments)
Sets the list of arguments to arguments.
Definition KDbFunctionExpression.cpp:1387
KDbNArgExpression arguments()
Definition KDbFunctionExpression.cpp:1382
void setName(const QString &name)
Sets name of the function to name.
Definition KDbFunctionExpression.cpp:1377
Internal data class used to implement implicitly shared class KDbNArgExpression.
Definition KDbExpressionData.h:135
The KDbNArgExpression class represents a base class N-argument expression.
Definition KDbExpression.h:213
Internal data class used to implement implicitly shared class KDbQueryParameterExpression.
Definition KDbExpressionData.h:243
An iterator for a list of values of query schema parameters Allows to iterate over parameters and ret...
Definition KDbQuerySchemaParameter.shared.h:50
Type type(const QSqlDatabase &db)
KDB_EXPORT KDbField::Type maximumForIntegerFieldTypes(KDbField::Type t1, KDbField::Type t2)
QString name(StandardAction id)
QDebug & nospace()
iterator insert(const Key &key, const T &value)
QList< Key > keys() const const
T value(const Key &key) const const
pointer data()
QString arg(Args &&... args) const const
QString fromLatin1(QByteArrayView str)
bool isEmpty() const const
QString number(double n, char format, int precision)
QByteArray toLatin1() const const
QString toUpper() const const
qlonglong toLongLong(bool *ok) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.