QGIS/python/core/qgssqlstatement.sip

1045 lines
24 KiB
Plaintext
Raw Normal View History

2017-05-22 09:01:45 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgssqlstatement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsSQLStatement
{
2017-05-22 09:01:45 +02:00
%Docstring
Class for parsing SQL statements.
.. versionadded:: 2.16
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
2017-05-22 09:01:45 +02:00
QgsSQLStatement( const QString &statement );
2017-05-22 09:01:45 +02:00
%Docstring
Creates a new statement based on the provided string.
%End
QgsSQLStatement( const QgsSQLStatement &other );
%Docstring
Create a copy of this statement.
%End
~QgsSQLStatement();
2017-05-22 09:01:45 +02:00
%Docstring
Create a copy of this statement.
%End
bool hasParserError() const;
2017-05-22 09:01:45 +02:00
%Docstring
Returns true if an error occurred when parsing the input statement
:rtype: bool
%End
QString parserErrorString() const;
2017-05-22 09:01:45 +02:00
%Docstring
Returns parser error
:rtype: str
%End
bool doBasicValidationChecks( QString &errorMsgOut /Out/ ) const;
2017-05-22 09:01:45 +02:00
%Docstring
Performs basic validity checks. Basically checking that columns referencing
a table, references a specified table. Returns true if the validation is
successful *
:rtype: bool
%End
const QgsSQLStatement::Node *rootNode() const;
2017-05-22 09:01:45 +02:00
%Docstring
Returns root node of the statement. Root node is null is parsing has failed
:rtype: QgsSQLStatement.Node
%End
QString statement() const;
2017-05-22 09:01:45 +02:00
%Docstring
Return the original, unmodified statement string.
If there was none supplied because it was constructed by sole
API calls, dump() will be used to create one instead.
2017-05-22 09:01:45 +02:00
:rtype: str
%End
QString dump() const;
2017-05-22 09:01:45 +02:00
%Docstring
Return 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
statement() instead.
2017-05-22 09:01:45 +02:00
:rtype: str
%End
static QString quotedIdentifier( QString name );
%Docstring
Returns a quoted column reference (in double quotes)
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`quotedString()`
2017-05-22 09:01:45 +02:00
:rtype: str
%End
static QString quotedIdentifierIfNeeded( const QString &name );
%Docstring
Returns a quoted column reference (in double quotes) if needed, or
otherwise the original string.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`quotedString()`
2017-05-22 09:01:45 +02:00
:rtype: str
%End
static QString stripQuotedIdentifier( QString text );
%Docstring
Remove double quotes from an identifier.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`quotedIdentifier()`
2017-05-22 09:01:45 +02:00
:rtype: str
%End
static QString quotedString( QString text );
%Docstring
Returns a quoted version of a string (in single quotes)
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`quotedIdentifier()`
2017-05-22 09:01:45 +02:00
:rtype: str
%End
enum UnaryOperator
{
uoNot,
uoMinus,
};
enum BinaryOperator
{
// logical
boOr,
boAnd,
// comparison
2017-05-22 09:01:45 +02:00
boEQ,
boNE,
boLE,
boGE,
boLT,
boGT,
boLike,
boNotLike,
boILike,
boNotILike,
boIs,
boIsNot,
// math
boPlus,
boMinus,
boMul,
boDiv,
boIntDiv,
boMod,
boPow,
// strings
boConcat,
};
enum JoinType
{
jtDefault,
jtLeft,
jtLeftOuter,
jtRight,
jtRightOuter,
jtCross,
jtInner,
jtFull
};
enum NodeType
{
ntUnaryOperator,
ntBinaryOperator,
ntInOperator,
ntBetweenOperator,
ntFunction,
ntLiteral,
ntColumnRef,
ntSelectedColumn,
ntSelect,
ntTableDef,
ntJoin,
ntColumnSorted,
ntCast
};
class Node
2017-05-22 09:01:45 +02:00
{
%Docstring
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;
}
2017-05-22 09:01:45 +02:00
%End
public:
virtual ~Node();
virtual QgsSQLStatement::NodeType nodeType() const = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Abstract virtual that returns the type of this node.
:return: The type of this node
:rtype: QgsSQLStatement.NodeType
%End
virtual QString dump() const = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Abstract virtual dump method
:return: A statement which represents this node as string
:rtype: str
%End
virtual QgsSQLStatement::Node *clone() const = 0 /Factory/;
2017-05-22 09:01:45 +02:00
%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.
:rtype: QgsSQLStatement.Node
%End
virtual void accept( QgsSQLStatement::Visitor &v ) const = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Support the visitor pattern.
For any implementation this should look like
C++:
v.visit( *this );
Python:
v.visit( self)
\param v A visitor that visits this node.
%End
};
class NodeList
2017-05-22 09:01:45 +02:00
{
%Docstring
List of nodes *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeList();
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
virtual ~NodeList();
void append( QgsSQLStatement::Node *node /Transfer/ );
2017-05-22 09:01:45 +02:00
%Docstring
Takes ownership of the provided node
%End
QList<QgsSQLStatement::Node *> list();
%Docstring
Return list
:rtype: list of QgsSQLStatement.Node
%End
int count() const;
2017-05-22 09:01:45 +02:00
%Docstring
Returns the number of nodes in the list.
:rtype: int
%End
void accept( QgsSQLStatement::Visitor &v ) const;
2017-05-22 09:01:45 +02:00
%Docstring
Accept visitor
%End
QgsSQLStatement::NodeList *clone() const /Factory/;
2017-05-22 09:01:45 +02:00
%Docstring
Creates a deep copy of this list. Ownership is transferred to the caller
:rtype: QgsSQLStatement.NodeList
%End
virtual QString dump() const;
2017-05-22 09:01:45 +02:00
%Docstring
Dump list
:rtype: str
%End
protected:
};
class NodeUnaryOperator : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Unary logicial/arithmetical operator ( NOT, - ) *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeUnaryOperator( QgsSQLStatement::UnaryOperator op, QgsSQLStatement::Node *operand /Transfer/ );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
~NodeUnaryOperator();
QgsSQLStatement::UnaryOperator op() const;
2017-05-22 09:01:45 +02:00
%Docstring
Operator
:rtype: QgsSQLStatement.UnaryOperator
%End
QgsSQLStatement::Node *operand() const;
2017-05-22 09:01:45 +02:00
%Docstring
Operand
:rtype: QgsSQLStatement.Node
%End
virtual QgsSQLStatement::NodeType nodeType() const;
virtual QString dump() const;
virtual void accept( QgsSQLStatement::Visitor &v ) const;
virtual QgsSQLStatement::Node *clone() const /Factory/;
2017-05-22 09:01:45 +02:00
protected:
};
class NodeBinaryOperator : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
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/ );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
~NodeBinaryOperator();
QgsSQLStatement::BinaryOperator op() const;
2017-05-22 09:01:45 +02:00
%Docstring
Operator
:rtype: QgsSQLStatement.BinaryOperator
%End
QgsSQLStatement::Node *opLeft() const;
2017-05-22 09:01:45 +02:00
%Docstring
Left operand
:rtype: QgsSQLStatement.Node
%End
QgsSQLStatement::Node *opRight() const;
2017-05-22 09:01:45 +02:00
%Docstring
Right operand
:rtype: QgsSQLStatement.Node
%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;
2017-05-22 09:01:45 +02:00
%Docstring
Precedence
:rtype: int
%End
bool leftAssociative() const;
2017-05-22 09:01:45 +02:00
%Docstring
Is left associative ?
:rtype: bool
%End
protected:
};
class NodeInOperator : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
'x IN (y, z)' operator *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeInOperator( QgsSQLStatement::Node *node /Transfer/, QgsSQLStatement::NodeList *list /Transfer/, bool notin = false );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
virtual ~NodeInOperator();
QgsSQLStatement::Node *node() const;
2017-05-22 09:01:45 +02:00
%Docstring
Variable at the left of IN
:rtype: QgsSQLStatement.Node
%End
bool isNotIn() const;
2017-05-22 09:01:45 +02:00
%Docstring
Whether this is a NOT IN operator
:rtype: bool
%End
QgsSQLStatement::NodeList *list() const;
2017-05-22 09:01:45 +02:00
%Docstring
Values list
:rtype: QgsSQLStatement.NodeList
%End
virtual QgsSQLStatement::NodeType nodeType() const;
virtual QString dump() const;
virtual void accept( QgsSQLStatement::Visitor &v ) const;
virtual QgsSQLStatement::Node *clone() const /Factory/;
2017-05-22 09:01:45 +02:00
protected:
};
class NodeBetweenOperator : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
'X BETWEEN y and z' operator *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
2017-05-22 09:01:45 +02:00
NodeBetweenOperator( QgsSQLStatement::Node *node /Transfer/, QgsSQLStatement::Node *minVal /Transfer/, QgsSQLStatement::Node *maxVal /Transfer/, bool notBetween = false );
%Docstring
Constructor
%End
QgsSQLStatement::Node *node() const;
2017-05-22 09:01:45 +02:00
%Docstring
Variable at the left of BETWEEN
:rtype: QgsSQLStatement.Node
%End
bool isNotBetween() const;
2017-05-22 09:01:45 +02:00
%Docstring
Whether this is a NOT BETWEEN operator
:rtype: bool
%End
QgsSQLStatement::Node *minVal() const;
2017-05-22 09:01:45 +02:00
%Docstring
Minimum bound
:rtype: QgsSQLStatement.Node
%End
QgsSQLStatement::Node *maxVal() const;
2017-05-22 09:01:45 +02:00
%Docstring
Maximum bound
:rtype: QgsSQLStatement.Node
%End
virtual QgsSQLStatement::NodeType nodeType() const;
virtual QString dump() const;
virtual void accept( QgsSQLStatement::Visitor &v ) const;
virtual QgsSQLStatement::Node *clone() const /Factory/;
2017-05-22 09:01:45 +02:00
protected:
};
class NodeFunction : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Function with a name and arguments node *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
2017-05-22 09:01:45 +02:00
NodeFunction( const QString &name, QgsSQLStatement::NodeList *args /Transfer/ );
%Docstring
Constructor
%End
virtual ~NodeFunction();
QString name() const;
2017-05-22 09:01:45 +02:00
%Docstring
Return function name
:rtype: str
%End
QgsSQLStatement::NodeList *args() const;
2017-05-22 09:01:45 +02:00
%Docstring
Return arguments
:rtype: QgsSQLStatement.NodeList
%End
virtual QgsSQLStatement::NodeType nodeType() const;
virtual QString dump() const;
virtual void accept( QgsSQLStatement::Visitor &v ) const;
virtual QgsSQLStatement::Node *clone() const /Factory/;
2017-05-22 09:01:45 +02:00
protected:
};
class NodeLiteral : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Literal value (integer, integer64, double, string) *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeLiteral( const QVariant &value );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
2017-05-22 09:01:45 +02:00
QVariant value() const;
%Docstring
The value of the literal.
:rtype: QVariant
%End
virtual QgsSQLStatement::NodeType nodeType() const;
virtual QString dump() const;
virtual void accept( QgsSQLStatement::Visitor &v ) const;
2017-05-22 09:01:45 +02:00
virtual QgsSQLStatement::Node *clone() const /Factory/;
protected:
};
class NodeColumnRef : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Reference to a column *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeColumnRef( const QString &name, bool star );
2017-05-22 09:01:45 +02:00
%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 );
2017-05-22 09:01:45 +02:00
%Docstring
Set whether this is prefixed by DISTINCT
%End
QString tableName() const;
2017-05-22 09:01:45 +02:00
%Docstring
The name of the table. May be empty.
:rtype: str
%End
QString name() const;
2017-05-22 09:01:45 +02:00
%Docstring
The name of the column.
:rtype: str
%End
bool star() const;
2017-05-22 09:01:45 +02:00
%Docstring
Whether this is the * column
:rtype: bool
%End
bool distinct() const;
%Docstring
Whether this is prefixed by DISTINCT
:rtype: bool
%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/;
2017-05-22 09:01:45 +02:00
%Docstring
Clone with same type return
:rtype: QgsSQLStatement.NodeColumnRef
%End
protected:
};
class NodeSelectedColumn : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Selected column *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
2017-05-22 09:01:45 +02:00
NodeSelectedColumn( QgsSQLStatement::Node *node /Transfer/ );
%Docstring
Constructor
%End
virtual ~NodeSelectedColumn();
void setAlias( const QString &alias );
2017-05-22 09:01:45 +02:00
%Docstring
Set alias name
%End
QgsSQLStatement::Node *column() const;
2017-05-22 09:01:45 +02:00
%Docstring
Column that is referred to
:rtype: QgsSQLStatement.Node
%End
QString alias() const;
2017-05-22 09:01:45 +02:00
%Docstring
Alias name
:rtype: str
%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/;
2017-05-22 09:01:45 +02:00
%Docstring
Clone with same type return
:rtype: QgsSQLStatement.NodeSelectedColumn
%End
protected:
};
class NodeCast : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
CAST operator *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeCast( QgsSQLStatement::Node *node /Transfer/, const QString &type );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
virtual ~NodeCast();
QgsSQLStatement::Node *node() const;
2017-05-22 09:01:45 +02:00
%Docstring
Node that is referred to
:rtype: QgsSQLStatement.Node
%End
QString type() const;
2017-05-22 09:01:45 +02:00
%Docstring
Type
:rtype: str
%End
virtual QgsSQLStatement::NodeType nodeType() const;
virtual QString dump() const;
virtual void accept( QgsSQLStatement::Visitor &v ) const;
virtual QgsSQLStatement::Node *clone() const /Factory/;
2017-05-22 09:01:45 +02:00
protected:
};
class NodeTableDef : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Table definition *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeTableDef( const QString &name );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor with table name
%End
NodeTableDef( const QString &name, const QString &alias );
%Docstring
Constructor with table name and alias
%End
QString name() const;
2017-05-22 09:01:45 +02:00
%Docstring
Table name
:rtype: str
%End
QString alias() const;
2017-05-22 09:01:45 +02:00
%Docstring
Table alias
:rtype: str
%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/;
2017-05-22 09:01:45 +02:00
%Docstring
Clone with same type return
:rtype: QgsSQLStatement.NodeTableDef
%End
protected:
};
class NodeJoin : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Join definition *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeJoin( QgsSQLStatement::NodeTableDef *tabledef /Transfer/, QgsSQLStatement::Node *onExpr /Transfer/, QgsSQLStatement::JoinType type );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor with table definition, ON expression
%End
NodeJoin( QgsSQLStatement::NodeTableDef *tabledef /Transfer/, const QList<QString> &usingColumns, QgsSQLStatement::JoinType type );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor with table definition and USING columns
%End
virtual ~NodeJoin();
QgsSQLStatement::NodeTableDef *tableDef() const;
2017-05-22 09:01:45 +02:00
%Docstring
Table definition
:rtype: QgsSQLStatement.NodeTableDef
%End
QgsSQLStatement::Node *onExpr() const;
2017-05-22 09:01:45 +02:00
%Docstring
On expression. Will be None if usingColumns() is not empty
:rtype: QgsSQLStatement.Node
%End
QList<QString> usingColumns() const;
2017-05-22 09:01:45 +02:00
%Docstring
Columns referenced by USING
:rtype: list of str
%End
QgsSQLStatement::JoinType type() const;
2017-05-22 09:01:45 +02:00
%Docstring
Join type
:rtype: QgsSQLStatement.JoinType
%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/;
2017-05-22 09:01:45 +02:00
%Docstring
Clone with same type return
:rtype: QgsSQLStatement.NodeJoin
%End
protected:
};
class NodeColumnSorted : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
Column in a ORDER BY *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
NodeColumnSorted( QgsSQLStatement::NodeColumnRef *column /Transfer/, bool asc );
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
~NodeColumnSorted();
QgsSQLStatement::NodeColumnRef *column() const;
2017-05-22 09:01:45 +02:00
%Docstring
The name of the column.
:rtype: QgsSQLStatement.NodeColumnRef
%End
bool ascending() const;
2017-05-22 09:01:45 +02:00
%Docstring
Whether the column is sorted in ascending order
:rtype: bool
%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/;
2017-05-22 09:01:45 +02:00
%Docstring
Clone with same type return
:rtype: QgsSQLStatement.NodeColumnSorted
%End
protected:
};
class NodeSelect : QgsSQLStatement::Node
2017-05-22 09:01:45 +02:00
{
%Docstring
SELECT node *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
2017-05-22 09:01:45 +02:00
NodeSelect( const QList<QgsSQLStatement::NodeTableDef *> &tableList /Transfer/, const QList<QgsSQLStatement::NodeSelectedColumn *> &columns /Transfer/, bool distinct );
%Docstring
Constructor
%End
virtual ~NodeSelect();
2017-05-22 09:01:45 +02:00
void setJoins( const QList<QgsSQLStatement::NodeJoin *> &joins /Transfer/ );
%Docstring
Set joins
%End
void appendJoin( QgsSQLStatement::NodeJoin *join /Transfer/ );
2017-05-22 09:01:45 +02:00
%Docstring
Append a join
%End
void setWhere( QgsSQLStatement::Node *where /Transfer/ );
2017-05-22 09:01:45 +02:00
%Docstring
Set where clause
%End
void setOrderBy( const QList<QgsSQLStatement::NodeColumnSorted *> &orderBy /Transfer/ );
%Docstring
Set order by columns
%End
QList<QgsSQLStatement::NodeTableDef *> tables() const;
%Docstring
Return the list of tables
:rtype: list of QgsSQLStatement.NodeTableDef
%End
QList<QgsSQLStatement::NodeSelectedColumn *> columns() const;
%Docstring
Return the list of columns
:rtype: list of QgsSQLStatement.NodeSelectedColumn
%End
bool distinct() const;
2017-05-22 09:01:45 +02:00
%Docstring
Return if the SELECT is DISTINCT
:rtype: bool
%End
QList<QgsSQLStatement::NodeJoin *> joins() const;
%Docstring
Return the list of joins
:rtype: list of QgsSQLStatement.NodeJoin
%End
QgsSQLStatement::Node *where() const;
2017-05-22 09:01:45 +02:00
%Docstring
Return the where clause
:rtype: QgsSQLStatement.Node
%End
QList<QgsSQLStatement::NodeColumnSorted *> orderBy() const;
%Docstring
Return the list of order by columns
:rtype: list of QgsSQLStatement.NodeColumnSorted
%End
virtual QgsSQLStatement::NodeType nodeType() const;
virtual QString dump() const;
virtual void accept( QgsSQLStatement::Visitor &v ) const;
virtual QgsSQLStatement::Node *clone() const /Factory/;
2017-05-22 09:01:45 +02:00
protected:
};
class Visitor
2017-05-22 09:01:45 +02:00
{
%Docstring
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;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeUnaryOperator
%End
virtual void visit( const QgsSQLStatement::NodeBinaryOperator &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeBinaryOperator
%End
virtual void visit( const QgsSQLStatement::NodeInOperator &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeInOperator
%End
virtual void visit( const QgsSQLStatement::NodeBetweenOperator &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeBetweenOperator
%End
virtual void visit( const QgsSQLStatement::NodeFunction &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeFunction
%End
virtual void visit( const QgsSQLStatement::NodeLiteral &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeLiteral
%End
virtual void visit( const QgsSQLStatement::NodeColumnRef &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeColumnRef
%End
virtual void visit( const QgsSQLStatement::NodeSelectedColumn &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeSelectedColumn
%End
virtual void visit( const QgsSQLStatement::NodeTableDef &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeTableDef
%End
virtual void visit( const QgsSQLStatement::NodeSelect &n ) = 0;
%Docstring
Visit NodeSelect
%End
virtual void visit( const QgsSQLStatement::NodeJoin &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeJoin
%End
virtual void visit( const QgsSQLStatement::NodeColumnSorted &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeColumnSorted
%End
virtual void visit( const QgsSQLStatement::NodeCast &n ) = 0;
2017-05-22 09:01:45 +02:00
%Docstring
Visit NodeCast
%End
};
2017-05-22 09:01:45 +02:00
class RecursiveVisitor: QgsSQLStatement::Visitor
{
%Docstring
A visitor that recursively explores all children *
%End
%TypeHeaderCode
#include "qgssqlstatement.h"
%End
public:
RecursiveVisitor();
2017-05-22 09:01:45 +02:00
%Docstring
Constructor
%End
virtual void visit( const QgsSQLStatement::NodeUnaryOperator &n );
virtual void visit( const QgsSQLStatement::NodeBinaryOperator &n );
virtual void visit( const QgsSQLStatement::NodeInOperator &n );
2017-05-22 09:01:45 +02:00
virtual void visit( const QgsSQLStatement::NodeBetweenOperator &n );
virtual void visit( const QgsSQLStatement::NodeFunction &n );
2017-05-22 09:01:45 +02:00
virtual void visit( const QgsSQLStatement::NodeLiteral & );
virtual void visit( const QgsSQLStatement::NodeColumnRef & );
virtual void visit( const QgsSQLStatement::NodeSelectedColumn &n );
2017-05-22 09:01:45 +02:00
virtual void visit( const QgsSQLStatement::NodeTableDef & );
virtual void visit( const QgsSQLStatement::NodeSelect &n );
virtual void visit( const QgsSQLStatement::NodeJoin &n );
2017-05-22 09:01:45 +02:00
virtual void visit( const QgsSQLStatement::NodeColumnSorted &n );
virtual void visit( const QgsSQLStatement::NodeCast &n );
};
void acceptVisitor( QgsSQLStatement::Visitor &v ) const;
2017-05-22 09:01:45 +02:00
%Docstring
Entry function for the visitor pattern
%End
protected:
};
2017-05-22 09:01:45 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgssqlstatement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/