QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgssqlstatement.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssqlstatement.h
3  ---------------------
4  begin : April 2016
5  copyright : (C) 2011 by Martin Dobias
6  copyright : (C) 2016 by Even Rouault
7  email : even.rouault at spatialys.com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSSQLSTATEMENT_H
18 #define QGSSQLSTATEMENT_H
19 
20 #include <QCoreApplication>
21 #include "qgis_sip.h"
22 #include <QMetaType>
23 #include <QStringList>
24 #include <QVariant>
25 #include <QList>
26 #include <QSet>
27 
28 #include "qgis_core.h"
29 
36 class CORE_EXPORT QgsSQLStatement
37 {
38  Q_DECLARE_TR_FUNCTIONS( QgsSQLStatement )
39  public:
40 
44  QgsSQLStatement( const QString &statement );
45 
49  QgsSQLStatement( const QgsSQLStatement &other );
50 
54  QgsSQLStatement &operator=( const QgsSQLStatement &other );
55  ~QgsSQLStatement();
56 
58  bool hasParserError() const;
60  QString parserErrorString() const;
61 
67  bool doBasicValidationChecks( QString &errorMsgOut SIP_OUT ) const;
68 
69  class Node;
70 
75  const QgsSQLStatement::Node *rootNode() const;
76 
82  QString statement() const;
83 
90  QString dump() const;
91 
96  static QString quotedIdentifier( QString name );
97 
103  static QString quotedIdentifierIfNeeded( const QString &name );
104 
109  static QString stripQuotedIdentifier( QString text );
110 
115  static QString quotedString( QString text );
116 
121  enum UnaryOperator
122  {
123  uoNot,
124  uoMinus,
125  };
126 
131  enum BinaryOperator
132  {
133  // logical
134  boOr,
135  boAnd,
136 
137  // comparison
138  boEQ, // =
139  boNE, // <>
140  boLE, // <=
141  boGE, // >=
142  boLT, // <
143  boGT, // >
144  boLike,
145  boNotLike,
146  boILike,
147  boNotILike,
148  boIs,
149  boIsNot,
150 
151  // math
152  boPlus,
153  boMinus,
154  boMul,
155  boDiv,
156  boIntDiv,
157  boMod,
158  boPow,
159 
160  // strings
161  boConcat,
162  };
163 
168  enum JoinType
169  {
170  jtDefault,
171  jtLeft,
172  jtLeftOuter,
173  jtRight,
174  jtRightOuter,
175  jtCross,
176  jtInner,
177  jtFull
178  };
179 
181  static const char *BINARY_OPERATOR_TEXT[] SIP_SKIP;
182 
184  static const char *UNARY_OPERATOR_TEXT[] SIP_SKIP;
185 
187  static const char *JOIN_TYPE_TEXT[] SIP_SKIP;
188 
190 
191  class Visitor; // visitor interface is defined below
192 
194  enum NodeType
195  {
196  ntUnaryOperator,
197  ntBinaryOperator,
198  ntInOperator,
199  ntBetweenOperator,
200  ntFunction,
201  ntLiteral,
202  ntColumnRef,
203  ntSelectedColumn,
204  ntSelect,
205  ntTableDef,
206  ntJoin,
207  ntColumnSorted,
208  ntCast
209  };
210 
215  class CORE_EXPORT Node
216  {
217 
218 #ifdef SIP_RUN
220  switch ( sipCpp->nodeType() )
221  {
222  case QgsSQLStatement::ntUnaryOperator: sipType = sipType_QgsSQLStatement_NodeUnaryOperator; break;
223  case QgsSQLStatement::ntBinaryOperator: sipType = sipType_QgsSQLStatement_NodeBinaryOperator; break;
224  case QgsSQLStatement::ntInOperator: sipType = sipType_QgsSQLStatement_NodeInOperator; break;
225  case QgsSQLStatement::ntBetweenOperator: sipType = sipType_QgsSQLStatement_NodeBetweenOperator; break;
226  case QgsSQLStatement::ntFunction: sipType = sipType_QgsSQLStatement_NodeFunction; break;
227  case QgsSQLStatement::ntLiteral: sipType = sipType_QgsSQLStatement_NodeLiteral; break;
228  case QgsSQLStatement::ntColumnRef: sipType = sipType_QgsSQLStatement_NodeColumnRef; break;
229  case QgsSQLStatement::ntSelectedColumn: sipType = sipType_QgsSQLStatement_NodeSelectedColumn; break;
230  case QgsSQLStatement::ntSelect: sipType = sipType_QgsSQLStatement_NodeSelect; break;
231  case QgsSQLStatement::ntTableDef: sipType = sipType_QgsSQLStatement_NodeTableDef; break;
232  case QgsSQLStatement::ntJoin: sipType = sipType_QgsSQLStatement_NodeJoin; break;
233  case QgsSQLStatement::ntColumnSorted: sipType = sipType_QgsSQLStatement_NodeColumnSorted; break;
234  case QgsSQLStatement::ntCast: sipType = sipType_QgsSQLStatement_NodeCast; break;
235  default: sipType = 0; break;
236  }
237  SIP_END
238 #endif
239 
240  public:
241  virtual ~Node() = default;
242 
248  virtual QgsSQLStatement::NodeType nodeType() const = 0;
249 
255  virtual QString dump() const = 0;
256 
265  virtual QgsSQLStatement::Node *clone() const = 0 SIP_FACTORY;
266 
282  virtual void accept( QgsSQLStatement::Visitor &v ) const = 0;
283  };
284 
289  class CORE_EXPORT NodeList
290  {
291  public:
293  NodeList() = default;
294  virtual ~NodeList() { qDeleteAll( mList ); }
295 
297  void append( QgsSQLStatement::Node *node SIP_TRANSFER ) { mList.append( node ); }
298 
300  QList<QgsSQLStatement::Node *> list() { return mList; }
301 
305  int count() const { return mList.count(); }
306 
308  void accept( QgsSQLStatement::Visitor &v ) const;
309 
312 
314  virtual QString dump() const;
315 
316  protected:
317  QList<Node *> mList;
318  };
319 
324  class CORE_EXPORT NodeUnaryOperator : public QgsSQLStatement::Node
325  {
326  public:
328  NodeUnaryOperator( QgsSQLStatement::UnaryOperator op, QgsSQLStatement::Node *operand SIP_TRANSFER ) : mOp( op ), mOperand( operand ) {}
329  ~NodeUnaryOperator() override { delete mOperand; }
330 
332  QgsSQLStatement::UnaryOperator op() const { return mOp; }
333 
335  QgsSQLStatement::Node *operand() const { return mOperand; }
336 
337  QgsSQLStatement::NodeType nodeType() const override { return ntUnaryOperator; }
338  QString dump() const override;
339 
340  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
341  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
342 
343  protected:
344  UnaryOperator mOp;
345  Node *mOperand = nullptr;
346  };
347 
352  class CORE_EXPORT NodeBinaryOperator : public QgsSQLStatement::Node
353  {
354  public:
357  : mOp( op )
358  , mOpLeft( opLeft )
359  , mOpRight( opRight )
360  {}
361  ~NodeBinaryOperator() override { delete mOpLeft; delete mOpRight; }
362 
364  QgsSQLStatement::BinaryOperator op() const { return mOp; }
365 
367  QgsSQLStatement::Node *opLeft() const { return mOpLeft; }
368 
370  QgsSQLStatement::Node *opRight() const { return mOpRight; }
371 
372  QgsSQLStatement::NodeType nodeType() const override { return ntBinaryOperator; }
373  QString dump() const override;
374 
375  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
376  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
377 
379  int precedence() const;
380 
382  bool leftAssociative() const;
383 
384  protected:
385 
387  Node *mOpLeft = nullptr;
388  Node *mOpRight = nullptr;
389  };
390 
395  class CORE_EXPORT NodeInOperator : public QgsSQLStatement::Node
396  {
397  public:
399  NodeInOperator( QgsSQLStatement::Node *node SIP_TRANSFER, QgsSQLStatement::NodeList *list SIP_TRANSFER, bool notin = false ) : mNode( node ), mList( list ), mNotIn( notin ) {}
400  ~NodeInOperator() override { delete mNode; delete mList; }
401 
403  QgsSQLStatement::Node *node() const { return mNode; }
404 
406  bool isNotIn() const { return mNotIn; }
407 
409  QgsSQLStatement::NodeList *list() const { return mList; }
410 
411  QgsSQLStatement::NodeType nodeType() const override { return ntInOperator; }
412  QString dump() const override;
413 
414  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
415  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
416 
417  protected:
418  Node *mNode = nullptr;
419  NodeList *mList = nullptr;
420  bool mNotIn;
421  };
422 
427  class CORE_EXPORT NodeBetweenOperator : public QgsSQLStatement::Node
428  {
429  public:
432  : mNode( node ), mMinVal( minVal ), mMaxVal( maxVal ), mNotBetween( notBetween ) {}
433  ~NodeBetweenOperator() override { delete mNode; delete mMinVal; delete mMaxVal; }
434 
436  QgsSQLStatement::Node *node() const { return mNode; }
437 
439  bool isNotBetween() const { return mNotBetween; }
440 
442  QgsSQLStatement::Node *minVal() const { return mMinVal; }
443 
445  QgsSQLStatement::Node *maxVal() const { return mMaxVal; }
446 
447  QgsSQLStatement::NodeType nodeType() const override { return ntBetweenOperator; }
448  QString dump() const override;
449 
450  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
451  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
452 
453  protected:
454  Node *mNode = nullptr;
455  Node *mMinVal = nullptr;
456  Node *mMaxVal = nullptr;
457  bool mNotBetween;
458  };
459 
464  class CORE_EXPORT NodeFunction : public QgsSQLStatement::Node
465  {
466  public:
468  NodeFunction( const QString &name, QgsSQLStatement::NodeList *args SIP_TRANSFER ) : mName( name ), mArgs( args ) {}
469  ~NodeFunction() override { delete mArgs; }
470 
472  QString name() const { return mName; }
473 
475  QgsSQLStatement::NodeList *args() const { return mArgs; }
476 
477  QgsSQLStatement::NodeType nodeType() const override { return ntFunction; }
478  QString dump() const override;
479 
480  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
481  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
482 
483  protected:
484  QString mName;
485  NodeList *mArgs = nullptr;
486 
487  };
488 
493  class CORE_EXPORT NodeLiteral : public QgsSQLStatement::Node
494  {
495  public:
497  NodeLiteral( const QVariant &value ) : mValue( value ) {}
498 
500  inline QVariant value() const { return mValue; }
501 
502  QgsSQLStatement::NodeType nodeType() const override { return ntLiteral; }
503  QString dump() const override;
504 
505  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
506  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
507 
508  protected:
509  QVariant mValue;
510  };
511 
516  class CORE_EXPORT NodeColumnRef : public QgsSQLStatement::Node
517  {
518  public:
520  NodeColumnRef( const QString &name, bool star ) : mName( name ), mDistinct( false ), mStar( star ) {}
522  NodeColumnRef( const QString &tableName, const QString &name, bool star ) : mTableName( tableName ), mName( name ), mDistinct( false ), mStar( star ) {}
523 
525  void setDistinct( bool distinct = true ) { mDistinct = distinct; }
526 
528  QString tableName() const { return mTableName; }
529 
531  QString name() const { return mName; }
532 
534  bool star() const { return mStar; }
535 
537  bool distinct() const { return mDistinct; }
538 
539  QgsSQLStatement::NodeType nodeType() const override { return ntColumnRef; }
540  QString dump() const override;
541 
542  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
543  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
546 
547  protected:
548  QString mTableName;
549  QString mName;
550  bool mDistinct;
551  bool mStar;
552  };
553 
558  class CORE_EXPORT NodeSelectedColumn : public QgsSQLStatement::Node
559  {
560  public:
562  NodeSelectedColumn( QgsSQLStatement::Node *node SIP_TRANSFER ) : mColumnNode( node ) {}
563  ~NodeSelectedColumn() override { delete mColumnNode; }
564 
566  void setAlias( const QString &alias ) { mAlias = alias; }
567 
569  QgsSQLStatement::Node *column() const { return mColumnNode; }
570 
572  QString alias() const { return mAlias; }
573 
574  QgsSQLStatement::NodeType nodeType() const override { return ntSelectedColumn; }
575  QString dump() const override;
576 
577  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
578  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
581 
582  protected:
583  Node *mColumnNode = nullptr;
584  QString mAlias;
585  };
586 
591  class CORE_EXPORT NodeCast : public QgsSQLStatement::Node
592  {
593  public:
595  NodeCast( QgsSQLStatement::Node *node SIP_TRANSFER, const QString &type ) : mNode( node ), mType( type ) {}
596  ~NodeCast() override { delete mNode; }
597 
599  QgsSQLStatement::Node *node() const { return mNode; }
600 
602  QString type() const { return mType; }
603 
604  QgsSQLStatement::NodeType nodeType() const override { return ntCast; }
605  QString dump() const override;
606 
607  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
608  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
609 
610  protected:
611  Node *mNode = nullptr;
612  QString mType;
613  };
614 
619  class CORE_EXPORT NodeTableDef : public QgsSQLStatement::Node
620  {
621  public:
623  NodeTableDef( const QString &name ) : mName( name ) {}
625  NodeTableDef( const QString &name, const QString &alias ) : mName( name ), mAlias( alias ) {}
626 
628  QString name() const { return mName; }
629 
631  QString alias() const { return mAlias; }
632 
633  QgsSQLStatement::NodeType nodeType() const override { return ntTableDef; }
634  QString dump() const override;
635 
636  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
637  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
640 
641  protected:
642  QString mName;
643  QString mAlias;
644  };
645 
650  class CORE_EXPORT NodeJoin : public QgsSQLStatement::Node
651  {
652  public:
654  NodeJoin( QgsSQLStatement::NodeTableDef *tabledef SIP_TRANSFER, QgsSQLStatement::Node *onExpr SIP_TRANSFER, QgsSQLStatement::JoinType type ) : mTableDef( tabledef ), mOnExpr( onExpr ), mType( type ) {}
656  NodeJoin( QgsSQLStatement::NodeTableDef *tabledef SIP_TRANSFER, const QList<QString> &usingColumns, QgsSQLStatement::JoinType type ) : mTableDef( tabledef ), mUsingColumns( usingColumns ), mType( type ) {}
657  ~NodeJoin() override { delete mTableDef; delete mOnExpr; }
658 
660  QgsSQLStatement::NodeTableDef *tableDef() const { return mTableDef; }
661 
663  QgsSQLStatement::Node *onExpr() const { return mOnExpr; }
664 
666  QList<QString> usingColumns() const { return mUsingColumns; }
667 
669  QgsSQLStatement::JoinType type() const { return mType; }
670 
671  QgsSQLStatement::NodeType nodeType() const override { return ntJoin; }
672  QString dump() const override;
673 
674  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
675  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
677  QgsSQLStatement::NodeJoin *cloneThis() const SIP_FACTORY;
678 
679  protected:
680  NodeTableDef *mTableDef = nullptr;
681  Node *mOnExpr = nullptr;
682  QList<QString> mUsingColumns;
683  JoinType mType;
684  };
685 
690  class CORE_EXPORT NodeColumnSorted : public QgsSQLStatement::Node
691  {
692  public:
694  NodeColumnSorted( QgsSQLStatement::NodeColumnRef *column SIP_TRANSFER, bool asc ) : mColumn( column ), mAsc( asc ) {}
695  ~NodeColumnSorted() override { delete mColumn; }
696 
698  QgsSQLStatement::NodeColumnRef *column() const { return mColumn; }
699 
701  bool ascending() const { return mAsc; }
702 
703  QgsSQLStatement::NodeType nodeType() const override { return ntColumnSorted; }
704  QString dump() const override;
705 
706  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
707  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
710 
711  protected:
712  NodeColumnRef *mColumn = nullptr;
713  bool mAsc;
714  };
715 
720  class CORE_EXPORT NodeSelect : public QgsSQLStatement::Node
721  {
722  public:
724  NodeSelect( const QList<QgsSQLStatement::NodeTableDef *> &tableList SIP_TRANSFER, const QList<QgsSQLStatement::NodeSelectedColumn *> &columns SIP_TRANSFER, bool distinct ) : mTableList( tableList ), mColumns( columns ), mDistinct( distinct ) {}
725  ~NodeSelect() override;
726 
728  void setJoins( const QList<QgsSQLStatement::NodeJoin *> &joins SIP_TRANSFER ) { qDeleteAll( mJoins ); mJoins = joins; }
730  void appendJoin( QgsSQLStatement::NodeJoin *join SIP_TRANSFER ) { mJoins.append( join ); }
732  void setWhere( QgsSQLStatement::Node *where SIP_TRANSFER ) { delete mWhere; mWhere = where; }
734  void setOrderBy( const QList<QgsSQLStatement::NodeColumnSorted *> &orderBy SIP_TRANSFER ) { qDeleteAll( mOrderBy ); mOrderBy = orderBy; }
735 
737  QList<QgsSQLStatement::NodeTableDef *> tables() const { return mTableList; }
739  QList<QgsSQLStatement::NodeSelectedColumn *> columns() const { return mColumns; }
741  bool distinct() const { return mDistinct; }
743  QList<QgsSQLStatement::NodeJoin *> joins() const { return mJoins; }
745  QgsSQLStatement::Node *where() const { return mWhere; }
747  QList<QgsSQLStatement::NodeColumnSorted *> orderBy() const { return mOrderBy; }
748 
749  QgsSQLStatement::NodeType nodeType() const override { return ntSelect; }
750  QString dump() const override;
751 
752  void accept( QgsSQLStatement::Visitor &v ) const override { v.visit( *this ); }
753  QgsSQLStatement::Node *clone() const override SIP_FACTORY;
754 
755  protected:
756  QList<NodeTableDef *> mTableList;
757  QList<NodeSelectedColumn *> mColumns;
758  bool mDistinct;
759  QList<NodeJoin *> mJoins;
760  Node *mWhere = nullptr;
761  QList<NodeColumnSorted *> mOrderBy;
762  };
763 
765 
771  class CORE_EXPORT Visitor
772  {
773  public:
774  virtual ~Visitor() = default;
776  virtual void visit( const QgsSQLStatement::NodeUnaryOperator &n ) = 0;
778  virtual void visit( const QgsSQLStatement::NodeBinaryOperator &n ) = 0;
780  virtual void visit( const QgsSQLStatement::NodeInOperator &n ) = 0;
782  virtual void visit( const QgsSQLStatement::NodeBetweenOperator &n ) = 0;
784  virtual void visit( const QgsSQLStatement::NodeFunction &n ) = 0;
786  virtual void visit( const QgsSQLStatement::NodeLiteral &n ) = 0;
788  virtual void visit( const QgsSQLStatement::NodeColumnRef &n ) = 0;
790  virtual void visit( const QgsSQLStatement::NodeSelectedColumn &n ) = 0;
792  virtual void visit( const QgsSQLStatement::NodeTableDef &n ) = 0;
794  virtual void visit( const QgsSQLStatement::NodeSelect &n ) = 0;
796  virtual void visit( const QgsSQLStatement::NodeJoin &n ) = 0;
798  virtual void visit( const QgsSQLStatement::NodeColumnSorted &n ) = 0;
800  virtual void visit( const QgsSQLStatement::NodeCast &n ) = 0;
801  };
802 
807  class CORE_EXPORT RecursiveVisitor: public QgsSQLStatement::Visitor
808  {
809  public:
811  RecursiveVisitor() = default;
812 
813  void visit( const QgsSQLStatement::NodeUnaryOperator &n ) override { n.operand()->accept( *this ); }
814  void visit( const QgsSQLStatement::NodeBinaryOperator &n ) override { n.opLeft()->accept( *this ); n.opRight()->accept( *this ); }
815  void visit( const QgsSQLStatement::NodeInOperator &n ) override { n.node()->accept( *this ); n.list()->accept( *this ); }
816  void visit( const QgsSQLStatement::NodeBetweenOperator &n ) override { n.node()->accept( *this ); n.minVal()->accept( *this ); n.maxVal()->accept( *this ); }
817  void visit( const QgsSQLStatement::NodeFunction &n ) override { n.args()->accept( *this ); }
818  void visit( const QgsSQLStatement::NodeLiteral & ) override {}
819  void visit( const QgsSQLStatement::NodeColumnRef & ) override { }
820  void visit( const QgsSQLStatement::NodeSelectedColumn &n ) override { n.column()->accept( *this ); }
821  void visit( const QgsSQLStatement::NodeTableDef & ) override {}
822  void visit( const QgsSQLStatement::NodeSelect &n ) override;
823  void visit( const QgsSQLStatement::NodeJoin &n ) override;
824  void visit( const QgsSQLStatement::NodeColumnSorted &n ) override { n.column()->accept( *this ); }
825  void visit( const QgsSQLStatement::NodeCast &n ) override { n.node()->accept( *this ); }
826  };
827 
830 
831  protected:
832  QgsSQLStatement::Node *mRootNode = nullptr;
833  QString mStatement;
835 };
836 
838 
839 #endif // QGSSQLSTATEMENT_H
QgsSQLStatement::Node
Definition: qgssqlstatement.h:229
QgsSQLStatement::NodeJoin
Definition: qgssqlstatement.h:664
QgsSQLStatement::NodeColumnSorted
Definition: qgssqlstatement.h:704
QgsSQLStatement::NodeUnaryOperator::operand
QgsSQLStatement::Node * operand() const
Operand.
Definition: qgssqlstatement.h:349
QgsSQLStatement::NodeBinaryOperator::opLeft
QgsSQLStatement::Node * opLeft() const
Left operand.
Definition: qgssqlstatement.h:381
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
QgsSQLStatement::Visitor::visit
virtual void visit(const QgsSQLStatement::NodeUnaryOperator &n)=0
Visit NodeUnaryOperator.
QgsSQLStatement::NodeTableDef
Definition: qgssqlstatement.h:633
QgsSQLStatement::NodeFunction
Definition: qgssqlstatement.h:478
QgsSQLStatement::acceptVisitor
void acceptVisitor(QgsSQLStatement::Visitor &v) const
Entry function for the visitor pattern.
Definition: qgssqlstatement.cpp:151
QgsSQLStatement::ntTableDef
@ ntTableDef
Definition: qgssqlstatement.h:219
QgsSQLStatement::NodeSelect
Definition: qgssqlstatement.h:734
QgsSQLStatement::NodeCast
Definition: qgssqlstatement.h:605
QgsSQLStatement::NodeUnaryOperator
Definition: qgssqlstatement.h:338
QgsSQLStatement::ntFunction
@ ntFunction
Definition: qgssqlstatement.h:214
QgsSQLStatement::ntInOperator
@ ntInOperator
Definition: qgssqlstatement.h:212
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
QgsSQLStatement::NodeColumnSorted::column
QgsSQLStatement::NodeColumnRef * column() const
The name of the column.
Definition: qgssqlstatement.h:712
QgsSQLStatement::NodeSelectedColumn::column
QgsSQLStatement::Node * column() const
Column that is referred to.
Definition: qgssqlstatement.h:583
QgsSQLStatement::ntCast
@ ntCast
Definition: qgssqlstatement.h:222
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
QgsSQLStatement::Visitor
Definition: qgssqlstatement.h:785
QgsSQLStatement::ntBinaryOperator
@ ntBinaryOperator
Definition: qgssqlstatement.h:211
QgsSQLStatement::ntSelectedColumn
@ ntSelectedColumn
Definition: qgssqlstatement.h:217
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsSQLStatement::NodeInOperator::node
QgsSQLStatement::Node * node() const
Variable at the left of IN.
Definition: qgssqlstatement.h:417
QgsSQLStatement::ntLiteral
@ ntLiteral
Definition: qgssqlstatement.h:215
QgsSQLStatement::mParserErrorString
QString mParserErrorString
Definition: qgssqlstatement.h:848
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsSQLStatement::ntColumnSorted
@ ntColumnSorted
Definition: qgssqlstatement.h:221
QgsSQLStatement
Definition: qgssqlstatement.h:36
QgsSQLStatement::ntSelect
@ ntSelect
Definition: qgssqlstatement.h:218
QgsSQLStatement::NodeBinaryOperator::opRight
QgsSQLStatement::Node * opRight() const
Right operand.
Definition: qgssqlstatement.h:384
QgsSQLStatement::NodeFunction::args
QgsSQLStatement::NodeList * args() const
Returns arguments.
Definition: qgssqlstatement.h:489
QgsSQLStatement::NodeBetweenOperator::node
QgsSQLStatement::Node * node() const
Variable at the left of BETWEEN.
Definition: qgssqlstatement.h:450
QgsSQLStatement::NodeType
NodeType
Node type.
Definition: qgssqlstatement.h:208
QgsSQLStatement::JoinType
JoinType
list of join types
Definition: qgssqlstatement.h:182
QgsSQLStatement::NodeInOperator
Definition: qgssqlstatement.h:409
QgsSQLStatement::NodeBinaryOperator
Definition: qgssqlstatement.h:366
QgsSQLStatement::NodeBetweenOperator::maxVal
QgsSQLStatement::Node * maxVal() const
Maximum bound.
Definition: qgssqlstatement.h:459
QgsSQLStatement::NodeColumnRef
Definition: qgssqlstatement.h:530
QgsSQLStatement::NodeList
A list of nodes.
Definition: qgssqlstatement.h:303
QgsSQLStatement::Node::accept
virtual void accept(QgsSQLStatement::Visitor &v) const =0
Support the visitor pattern.
QgsSQLStatement::UnaryOperator
UnaryOperator
list of unary operators
Definition: qgssqlstatement.h:135
QgsSQLStatement::NodeCast::node
QgsSQLStatement::Node * node() const
Node that is referred to.
Definition: qgssqlstatement.h:613
QgsSQLStatement::mStatement
QString mStatement
Definition: qgssqlstatement.h:847
QgsSQLStatement::ntJoin
@ ntJoin
Definition: qgssqlstatement.h:220
QgsSQLStatement::NodeColumnRef::accept
void accept(QgsSQLStatement::Visitor &v) const override
Support the visitor pattern.
Definition: qgssqlstatement.h:556
QgsSQLStatement::ntBetweenOperator
@ ntBetweenOperator
Definition: qgssqlstatement.h:213
QgsSQLStatement::ntColumnRef
@ ntColumnRef
Definition: qgssqlstatement.h:216
QgsSQLStatement::BinaryOperator
BinaryOperator
list of binary operators
Definition: qgssqlstatement.h:145
QgsSQLStatement::ntUnaryOperator
@ ntUnaryOperator
Definition: qgssqlstatement.h:210
QgsSQLStatement::RecursiveVisitor
Definition: qgssqlstatement.h:821
QgsSQLStatement::NodeList::accept
void accept(QgsSQLStatement::Visitor &v) const
Accept visitor.
Definition: qgssqlstatement.cpp:259
QgsSQLStatement::NodeInOperator::list
QgsSQLStatement::NodeList * list() const
Values list.
Definition: qgssqlstatement.h:423
QgsSQLStatement::NodeSelectedColumn
Definition: qgssqlstatement.h:572
QgsSQLStatement::NodeBetweenOperator::minVal
QgsSQLStatement::Node * minVal() const
Minimum bound.
Definition: qgssqlstatement.h:456
QgsSQLStatement::NodeBetweenOperator
Definition: qgssqlstatement.h:441
SIP_END
#define SIP_END
Definition: qgis_sip.h:189
QgsSQLStatement::NodeLiteral
Definition: qgssqlstatement.h:507