File: qgssqlstatement.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (1057 lines) | stat: -rw-r--r-- 24,687 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgssqlstatement.h                                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/




class QgsSQLStatement
{
%Docstring(signature="appended")
Class for parsing SQL statements.
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
  public:

    QgsSQLStatement( const QString &statement );
%Docstring
Creates a new statement based on the provided string.
%End

    QgsSQLStatement( const QgsSQLStatement &other );

    virtual ~QgsSQLStatement();

    bool hasParserError() const;
%Docstring
Returns ``True`` if an error occurred when parsing the input statement
%End
    QString parserErrorString() const;
%Docstring
Returns parser error
%End

    bool doBasicValidationChecks( QString &errorMsgOut /Out/ ) const;
%Docstring
Performs basic validity checks. Basically checking that columns
referencing a table, references a specified table. Returns ``True`` if
the validation is successful
%End


    const QgsSQLStatement::Node *rootNode() const;
%Docstring
Returns the root node of the statement. The root node is ``None`` if
parsing has failed.
%End

    QString statement() const;
%Docstring
Returns the original, unmodified statement string. If there was none
supplied because it was constructed by sole API calls,
:py:func:`~QgsSQLStatement.dump` will be used to create one instead.
%End

    QString dump() const;
%Docstring
Returns the statement string, constructed from the internal abstract
syntax tree. This does not contain any nice whitespace formatting or
comments. In general it is preferable to use
:py:func:`~QgsSQLStatement.statement` instead.
%End

    static QString quotedIdentifier( QString name );
%Docstring
Returns a quoted column reference (in double quotes)

.. seealso:: :py:func:`quotedString`

.. seealso:: :py:func:`quotedIdentifierIfNeeded`
%End

    static QString quotedIdentifierIfNeeded( const QString &name );
%Docstring
Returns a quoted column reference (in double quotes) if needed, or
otherwise the original string.

.. seealso:: :py:func:`quotedString`

.. seealso:: :py:func:`quotedIdentifier`
%End

    static QString stripQuotedIdentifier( QString text );
%Docstring
Remove double quotes from an identifier.

.. seealso:: :py:func:`quotedIdentifier`
%End

    static QString stripMsQuotedIdentifier( QString text );
%Docstring
Remove double quotes from an Microsoft style identifier.

.. seealso:: :py:func:`quotedIdentifier`
%End

    static QString quotedString( QString text );
%Docstring
Returns a quoted version of a string (in single quotes)

.. seealso:: :py:func:`quotedIdentifier`

.. seealso:: :py:func:`quotedIdentifierIfNeeded`
%End

    enum UnaryOperator /BaseType=IntEnum/
    {
      uoNot,
      uoMinus,
    };

    enum BinaryOperator /BaseType=IntEnum/
    {
      // logical
      boOr,
      boAnd,

      // comparison
      boEQ,
      boNE,
      boLE,
      boGE,
      boLT,
      boGT,
      boLike,
      boNotLike,
      boILike,
      boNotILike,
      boIs,
      boIsNot,

      // math
      boPlus,
      boMinus,
      boMul,
      boDiv,
      boIntDiv,
      boMod,
      boPow,

      // strings
      boConcat,
    };

    enum JoinType /BaseType=IntEnum/
    {
      jtDefault,
      jtLeft,
      jtLeftOuter,
      jtRight,
      jtRightOuter,
      jtCross,
      jtInner,
      jtFull
    };






    enum NodeType /BaseType=IntEnum/
    {
      ntUnaryOperator,
      ntBinaryOperator,
      ntInOperator,
      ntBetweenOperator,
      ntFunction,
      ntLiteral,
      ntColumnRef,
      ntSelectedColumn,
      ntSelect,
      ntTableDef,
      ntJoin,
      ntColumnSorted,
      ntCast
    };

    class Node
{
%Docstring(signature="appended")
Abstract node class
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
%ConvertToSubClassCode
        switch ( sipCpp->nodeType() )
        {
          case QgsSQLStatement::ntUnaryOperator:   sipType = sipType_QgsSQLStatement_NodeUnaryOperator; break;
          case QgsSQLStatement::ntBinaryOperator:  sipType = sipType_QgsSQLStatement_NodeBinaryOperator; break;
          case QgsSQLStatement::ntInOperator:      sipType = sipType_QgsSQLStatement_NodeInOperator; break;
          case QgsSQLStatement::ntBetweenOperator: sipType = sipType_QgsSQLStatement_NodeBetweenOperator; break;
          case QgsSQLStatement::ntFunction:        sipType = sipType_QgsSQLStatement_NodeFunction; break;
          case QgsSQLStatement::ntLiteral:         sipType = sipType_QgsSQLStatement_NodeLiteral; break;
          case QgsSQLStatement::ntColumnRef:       sipType = sipType_QgsSQLStatement_NodeColumnRef; break;
          case QgsSQLStatement::ntSelectedColumn:  sipType = sipType_QgsSQLStatement_NodeSelectedColumn; break;
          case QgsSQLStatement::ntSelect:          sipType = sipType_QgsSQLStatement_NodeSelect; break;
          case QgsSQLStatement::ntTableDef:        sipType = sipType_QgsSQLStatement_NodeTableDef; break;
          case QgsSQLStatement::ntJoin:            sipType = sipType_QgsSQLStatement_NodeJoin; break;
          case QgsSQLStatement::ntColumnSorted:    sipType = sipType_QgsSQLStatement_NodeColumnSorted; break;
          case QgsSQLStatement::ntCast:            sipType = sipType_QgsSQLStatement_NodeCast; break;
          default:                               sipType = 0; break;
        }
%End
      public:
        virtual ~Node();

        virtual QgsSQLStatement::NodeType nodeType() const = 0;
%Docstring
Abstract virtual that returns the type of this node.

:return: The type of this node
%End

        virtual QString dump() const = 0;
%Docstring
Abstract virtual dump method

:return: A statement which represents this node as string
%End

        virtual QgsSQLStatement::Node *clone() const = 0 /Factory/;
%Docstring
Generate a clone of this node. Make sure that the clone does not contain
any information which is generated in prepare and context related.
Ownership is transferred to the caller.

:return: a deep copy of this node.
%End

        virtual void accept( QgsSQLStatement::Visitor &v ) const = 0;
%Docstring
Support the visitor pattern.

For any implementation this should look like

.. code-block:: python

       v.visit(self)

:param v: A visitor that visits this node.
%End
    };

    class NodeList
{
%Docstring(signature="appended")
A list of nodes.
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:

        NodeList();
        virtual ~NodeList();

        void append( QgsSQLStatement::Node *node /Transfer/ );
%Docstring
Takes ownership of the provided node
%End

        QList<QgsSQLStatement::Node *> list();
%Docstring
Returns list
%End

        int count() const;
%Docstring
Returns the number of nodes in the list.
%End

        void accept( QgsSQLStatement::Visitor &v ) const;
%Docstring
Accept visitor
%End

        QgsSQLStatement::NodeList *clone() const /Factory/;
%Docstring
Creates a deep copy of this list. Ownership is transferred to the caller
%End

        virtual QString dump() const;
%Docstring
Dump list
%End

      protected:
    };

    class NodeUnaryOperator : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Unary logicial/arithmetical operator ( NOT, - )
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeUnaryOperator( QgsSQLStatement::UnaryOperator op, QgsSQLStatement::Node *operand /Transfer/ );
%Docstring
Constructor
%End
        ~NodeUnaryOperator();

        QgsSQLStatement::UnaryOperator op() const;
%Docstring
Operator
%End

        QgsSQLStatement::Node *operand() const;
%Docstring
Operand
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


      protected:
    };

    class NodeBinaryOperator : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Binary logical/arithmetical operator (AND, OR, =, +, ...)
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeBinaryOperator( QgsSQLStatement::BinaryOperator op, QgsSQLStatement::Node *opLeft /Transfer/, QgsSQLStatement::Node *opRight /Transfer/ );
%Docstring
Constructor
%End
        ~NodeBinaryOperator();

        QgsSQLStatement::BinaryOperator op() const;
%Docstring
Operator
%End

        QgsSQLStatement::Node *opLeft() const;
%Docstring
Left operand
%End

        QgsSQLStatement::Node *opRight() const;
%Docstring
Right operand
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


        int precedence() const;
%Docstring
Precedence
%End

        bool leftAssociative() const;
%Docstring
Is left associative ?
%End

      protected:

    };

    class NodeInOperator : QgsSQLStatement::Node
{
%Docstring(signature="appended")
'x IN (y, z)' operator
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeInOperator( QgsSQLStatement::Node *node /Transfer/, QgsSQLStatement::NodeList *list /Transfer/, bool notin = false );
%Docstring
Constructor
%End
        ~NodeInOperator();

        QgsSQLStatement::Node *node() const;
%Docstring
Variable at the left of IN
%End

        bool isNotIn() const;
%Docstring
Whether this is a NOT IN operator
%End

        QgsSQLStatement::NodeList *list() const;
%Docstring
Values list
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


      protected:
    };

    class NodeBetweenOperator : QgsSQLStatement::Node
{
%Docstring(signature="appended")
'X BETWEEN y and z' operator
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeBetweenOperator( QgsSQLStatement::Node *node /Transfer/, QgsSQLStatement::Node *minVal /Transfer/, QgsSQLStatement::Node *maxVal /Transfer/, bool notBetween = false );
%Docstring
Constructor
%End

        QgsSQLStatement::Node *node() const;
%Docstring
Variable at the left of BETWEEN
%End

        bool isNotBetween() const;
%Docstring
Whether this is a NOT BETWEEN operator
%End

        QgsSQLStatement::Node *minVal() const;
%Docstring
Minimum bound
%End

        QgsSQLStatement::Node *maxVal() const;
%Docstring
Maximum bound
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


      protected:
    };

    class NodeFunction : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Function with a name and arguments node
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeFunction( const QString &name, QgsSQLStatement::NodeList *args  /Transfer/ );
%Docstring
Constructor
%End
        ~NodeFunction();

        QString name() const;
%Docstring
Returns function name
%End

        QgsSQLStatement::NodeList *args() const;
%Docstring
Returns arguments
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


      protected:

    };

    class NodeLiteral : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Literal value (integer, integer64, double, string)
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeLiteral( const QVariant &value );
%Docstring
Constructor
%End

        QVariant value() const;
%Docstring
The value of the literal.
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


      protected:
    };

    class NodeColumnRef : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Reference to a column
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeColumnRef( const QString &name, bool star );
%Docstring
Constructor with column name only
%End
        NodeColumnRef( const QString &tableName, const QString &name, bool star );
%Docstring
Constructor with table and column name
%End

        void setDistinct( bool distinct = true );
%Docstring
Sets whether this is prefixed by DISTINCT
%End

        QString tableName() const;
%Docstring
The name of the table. May be empty.
%End

        QString name() const;
%Docstring
The name of the column.
%End

        bool star() const;
%Docstring
Whether this is the * column
%End

        bool distinct() const;
%Docstring
Whether this is prefixed by DISTINCT
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;

        QgsSQLStatement::NodeColumnRef *cloneThis() const /Factory/;
%Docstring
Clone with same type return
%End

      protected:
    };

    class NodeSelectedColumn : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Selected column
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeSelectedColumn( QgsSQLStatement::Node *node /Transfer/ );
%Docstring
Constructor
%End
        ~NodeSelectedColumn();

        void setAlias( const QString &alias );
%Docstring
Sets alias name
%End

        QgsSQLStatement::Node *column() const;
%Docstring
Column that is referred to
%End

        QString alias() const;
%Docstring
Alias name
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;

        QgsSQLStatement::NodeSelectedColumn *cloneThis() const /Factory/;
%Docstring
Clone with same type return
%End

      protected:
    };

    class NodeCast : QgsSQLStatement::Node
{
%Docstring(signature="appended")
CAST operator
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeCast( QgsSQLStatement::Node *node /Transfer/, const QString &type );
%Docstring
Constructor
%End
        ~NodeCast();

        QgsSQLStatement::Node *node() const;
%Docstring
Node that is referred to
%End

        QString type() const;
%Docstring
Type
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


      protected:
    };

    class NodeTableDef : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Table definition
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeTableDef( const QString &name );
%Docstring
Constructor with table name
%End
        NodeTableDef( const QString &name, const QString &alias );
%Docstring
Constructor with table name and alias
%End

        NodeTableDef( const QString &schema, const QString &name, const QString &alias );
%Docstring
Constructor with schema, table name and alias

.. versionadded:: 3.28
%End

        QString name() const;
%Docstring
Table name
%End

        QString schema() const;
%Docstring
Returns the schema name.

.. versionadded:: 3.28
%End

        QString alias() const;
%Docstring
Table alias
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;

        QgsSQLStatement::NodeTableDef *cloneThis() const /Factory/;
%Docstring
Clone with same type return
%End

      protected:
    };

    class NodeJoin : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Join definition
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeJoin( QgsSQLStatement::NodeTableDef *tabledef /Transfer/, QgsSQLStatement::Node *onExpr /Transfer/, QgsSQLStatement::JoinType type );
%Docstring
Constructor with table definition, ON expression
%End
        NodeJoin( QgsSQLStatement::NodeTableDef *tabledef /Transfer/, const QList<QString> &usingColumns, QgsSQLStatement::JoinType type );
%Docstring
Constructor with table definition and USING columns
%End
        ~NodeJoin();

        QgsSQLStatement::NodeTableDef *tableDef() const;
%Docstring
Table definition
%End

        QgsSQLStatement::Node *onExpr() const;
%Docstring
On expression. Will be ``None`` if :py:func:`~NodeJoin.usingColumns` is
not empty
%End

        QList<QString> usingColumns() const;
%Docstring
Columns referenced by USING
%End

        QgsSQLStatement::JoinType type() const;
%Docstring
Join type
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;

        QgsSQLStatement::NodeJoin *cloneThis() const /Factory/;
%Docstring
Clone with same type return
%End

      protected:
    };

    class NodeColumnSorted : QgsSQLStatement::Node
{
%Docstring(signature="appended")
Column in a ORDER BY
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeColumnSorted( QgsSQLStatement::NodeColumnRef *column /Transfer/, bool asc );
%Docstring
Constructor
%End
        ~NodeColumnSorted();

        QgsSQLStatement::NodeColumnRef *column() const;
%Docstring
The name of the column.
%End

        bool ascending() const;
%Docstring
Whether the column is sorted in ascending order
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;

        QgsSQLStatement::NodeColumnSorted *cloneThis() const /Factory/;
%Docstring
Clone with same type return
%End

      protected:
    };

    class NodeSelect : QgsSQLStatement::Node
{
%Docstring(signature="appended")
SELECT node
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        NodeSelect( const QList<QgsSQLStatement::NodeTableDef *> &tableList /Transfer/, const QList<QgsSQLStatement::NodeSelectedColumn *> &columns /Transfer/, bool distinct );
%Docstring
Constructor
%End
        ~NodeSelect();

        void setJoins( const QList<QgsSQLStatement::NodeJoin *> &joins /Transfer/ );
%Docstring
Sets joins
%End
        void appendJoin( QgsSQLStatement::NodeJoin *join /Transfer/ );
%Docstring
Append a join
%End
        void setWhere( QgsSQLStatement::Node *where /Transfer/ );
%Docstring
Sets where clause
%End
        void setOrderBy( const QList<QgsSQLStatement::NodeColumnSorted *> &orderBy /Transfer/ );
%Docstring
Sets order by columns
%End

        QList<QgsSQLStatement::NodeTableDef *> tables() const;
%Docstring
Returns the list of tables
%End
        QList<QgsSQLStatement::NodeSelectedColumn *> columns() const;
%Docstring
Returns the list of columns
%End
        bool distinct() const;
%Docstring
Returns if the SELECT is DISTINCT
%End
        QList<QgsSQLStatement::NodeJoin *> joins() const;
%Docstring
Returns the list of joins
%End
        QgsSQLStatement::Node *where() const;
%Docstring
Returns the where clause
%End
        QList<QgsSQLStatement::NodeColumnSorted *> orderBy() const;
%Docstring
Returns the list of order by columns
%End

        virtual QgsSQLStatement::NodeType nodeType() const;
        virtual QString dump() const;


        virtual void accept( QgsSQLStatement::Visitor &v ) const;
        virtual QgsSQLStatement::Node *clone() const /Factory/;


      protected:
    };


    class Visitor
{
%Docstring(signature="appended")
Support for visitor pattern - algorithms dealing with the statement may
be implemented without modifying the Node classes
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:
        virtual ~Visitor();
        virtual void visit( const QgsSQLStatement::NodeUnaryOperator &n ) = 0;
%Docstring
Visit NodeUnaryOperator
%End
        virtual void visit( const QgsSQLStatement::NodeBinaryOperator &n ) = 0;
%Docstring
Visit NodeBinaryOperator
%End
        virtual void visit( const QgsSQLStatement::NodeInOperator &n ) = 0;
%Docstring
Visit NodeInOperator
%End
        virtual void visit( const QgsSQLStatement::NodeBetweenOperator &n ) = 0;
%Docstring
Visit NodeBetweenOperator
%End
        virtual void visit( const QgsSQLStatement::NodeFunction &n ) = 0;
%Docstring
Visit NodeFunction
%End
        virtual void visit( const QgsSQLStatement::NodeLiteral &n ) = 0;
%Docstring
Visit NodeLiteral
%End
        virtual void visit( const QgsSQLStatement::NodeColumnRef &n ) = 0;
%Docstring
Visit NodeColumnRef
%End
        virtual void visit( const QgsSQLStatement::NodeSelectedColumn &n ) = 0;
%Docstring
Visit NodeSelectedColumn
%End
        virtual void visit( const QgsSQLStatement::NodeTableDef &n ) = 0;
%Docstring
Visit NodeTableDef
%End
        virtual void visit( const QgsSQLStatement::NodeSelect &n ) = 0;
%Docstring
Visit NodeSelect
%End
        virtual void visit( const QgsSQLStatement::NodeJoin &n ) = 0;
%Docstring
Visit NodeJoin
%End
        virtual void visit( const QgsSQLStatement::NodeColumnSorted &n ) = 0;
%Docstring
Visit NodeColumnSorted
%End
        virtual void visit( const QgsSQLStatement::NodeCast &n ) = 0;
%Docstring
Visit NodeCast
%End
    };

    class RecursiveVisitor: QgsSQLStatement::Visitor
{
%Docstring(signature="appended")
A visitor that recursively explores all children
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
      public:

        RecursiveVisitor();

        virtual void visit( const QgsSQLStatement::NodeUnaryOperator &n );
        virtual void visit( const QgsSQLStatement::NodeBinaryOperator &n );
        virtual void visit( const QgsSQLStatement::NodeInOperator &n );
        virtual void visit( const QgsSQLStatement::NodeBetweenOperator &n );
        virtual void visit( const QgsSQLStatement::NodeFunction &n );
        virtual void visit( const QgsSQLStatement::NodeLiteral & );
        virtual void visit( const QgsSQLStatement::NodeColumnRef & );
        virtual void visit( const QgsSQLStatement::NodeSelectedColumn &n );
        virtual void visit( const QgsSQLStatement::NodeTableDef & );
        virtual void visit( const QgsSQLStatement::NodeSelect &n );

        virtual void visit( const QgsSQLStatement::NodeJoin &n );

        virtual void visit( const QgsSQLStatement::NodeColumnSorted &n );
        virtual void visit( const QgsSQLStatement::NodeCast &n );
    };

    void acceptVisitor( QgsSQLStatement::Visitor &v ) const;
%Docstring
Entry function for the visitor pattern
%End

  protected:

    QgsSQLStatement( const QString &statement, bool allowFragments );
%Docstring
Constructor for QgsSQLStatement, with the specified ``statement``.

If ``allowFragments`` is ``True`` then the parser will allow SQL
fragments, such as a expression or filter where clause alone.

.. versionadded:: 3.16
%End
};


class QgsSQLStatementFragment : QgsSQLStatement
{
%Docstring(signature="appended")
Class for parsing fragments of SQL statements, such as an expression or
where clause.

.. versionadded:: 3.16
%End

%TypeHeaderCode
#include "qgssqlstatement.h"
%End
  public:

    QgsSQLStatementFragment( const QString &fragment );
%Docstring
Constructor for QgsSQLStatementFragment of the specified ``fragment``.
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgssqlstatement.h                                           *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/