25QgsSQLiteExpressionCompiler::QgsSQLiteExpressionCompiler( 
const QgsFields &fields, 
bool ignoreStaticNodes )
 
   33  if ( staticRes != Fail )
 
   52          if ( compileNode( op->
opLeft(), opL ) != Complete ||
 
   53               compileNode( op->
opRight(), opR ) != Complete )
 
   56          result = QStringLiteral( 
"lower(%1) %2 lower(%3) ESCAPE '\\'" )
 
   75      if ( fd->
name() == QLatin1String( 
"make_datetime" ) || fd->
name() == QLatin1String( 
"make_date" ) || fd->
name() == QLatin1String( 
"make_time" ) )
 
   77        const auto constList = n->
args()->
list();
 
   95QString QgsSQLiteExpressionCompiler::quotedIdentifier( 
const QString &identifier )
 
  100QString QgsSQLiteExpressionCompiler::quotedValue( 
const QVariant &value, 
bool &ok )
 
  106QString QgsSQLiteExpressionCompiler::sqlFunctionFromFunctionName( 
const QString &fnName )
 const 
  108  static const QMap<QString, QString> FN_NAMES
 
  112    { 
"coalesce", 
"coalesce" },
 
  113    { 
"lower", 
"lower" },
 
  114    { 
"round", 
"round" },
 
  116    { 
"upper", 
"upper" },
 
  117    { 
"make_datetime", 
"" },
 
  122  return FN_NAMES.value( fnName, QString() );
 
  125QStringList QgsSQLiteExpressionCompiler::sqlArgumentsFromFunctionName( 
const QString &fnName, 
const QStringList &fnArgs )
 const 
  127  QStringList args( fnArgs );
 
  128  if ( fnName == QLatin1String( 
"make_datetime" ) )
 
  130    args = QStringList( QStringLiteral( 
"'%1-%2-%3T%4:%5:%6Z'" ).arg( args[0].rightJustified( 4, 
'0' ) )
 
  131                        .arg( args[1].rightJustified( 2, 
'0' ) )
 
  132                        .arg( args[2].rightJustified( 2, 
'0' ) )
 
  133                        .arg( args[3].rightJustified( 2, 
'0' ) )
 
  134                        .arg( args[4].rightJustified( 2, 
'0' ) )
 
  135                        .arg( args[5].rightJustified( 2, 
'0' ) ) );
 
  137  else if ( fnName == QLatin1String( 
"make_date" ) )
 
  139    args = QStringList( QStringLiteral( 
"'%1-%2-%3'" ).arg( args[0].rightJustified( 4, 
'0' ) )
 
  140                        .arg( args[1].rightJustified( 2, 
'0' ) )
 
  141                        .arg( args[2].rightJustified( 2, 
'0' ) ) );
 
  143  else if ( fnName == QLatin1String( 
"make_time" ) )
 
  145    args = QStringList( QStringLiteral( 
"'%1:%2:%3'" ).arg( args[0].rightJustified( 2, 
'0' ) )
 
  146                        .arg( args[1].rightJustified( 2, 
'0' ) )
 
  147                        .arg( args[2].rightJustified( 2, 
'0' ) ) );
 
  152QString QgsSQLiteExpressionCompiler::castToReal( 
const QString &value )
 const 
  154  return QStringLiteral( 
"CAST((%1) AS REAL)" ).arg( value );
 
  157QString QgsSQLiteExpressionCompiler::castToInt( 
const QString &value )
 const 
  159  return QStringLiteral( 
"CAST((%1) AS INTEGER)" ).arg( value );
 
  162QString QgsSQLiteExpressionCompiler::castToText( 
const QString &value )
 const 
  164  return QStringLiteral( 
"CAST((%1) AS TEXT)" ).arg( value );
 
A abstract base class for defining QgsExpression functions.
 
QString name() const
The name of the function.
 
A binary expression operator, which operates on two values.
 
QgsExpressionNode * opLeft() const
Returns the node to the left of the operator.
 
QgsExpressionNode * opRight() const
Returns the node to the right of the operator.
 
QgsExpressionNodeBinaryOperator::BinaryOperator op() const
Returns the binary operator.
 
An expression node for expression functions.
 
int fnIndex() const
Returns the index of the node's function.
 
QgsExpressionNode::NodeList * args() const
Returns a list of arguments specified for the function.
 
QList< QgsExpressionNode * > list()
Gets a list of all the nodes.
 
Abstract base class for all nodes that can appear in an expression.
 
virtual QgsExpressionNode::NodeType nodeType() const =0
Gets the type of this node.
 
static const QList< QgsExpressionFunction * > & Functions()
 
Container of fields for a vector layer.
 
Generic expression compiler for translation to provider specific SQL WHERE clauses.
 
virtual Result compileNode(const QgsExpressionNode *node, QString &str)
Compiles an expression node and returns the result of the compilation.
 
Result
Possible results from expression compilation.
 
static QString quotedIdentifier(const QString &identifier)
Returns a properly quoted version of identifier.
 
static QString quotedValue(const QVariant &value)
Returns a properly quoted and escaped version of value for use in SQL strings.