Class for parsing SQL statements.
More...
#include <qgssqlstatement.h>
|
enum | BinaryOperator {
boOr
, boAnd
, boEQ
, boNE
,
boLE
, boGE
, boLT
, boGT
,
boLike
, boNotLike
, boILike
, boNotILike
,
boIs
, boIsNot
, boPlus
, boMinus
,
boMul
, boDiv
, boIntDiv
, boMod
,
boPow
, boConcat
} |
| list of binary operators More...
|
|
enum | JoinType {
jtDefault
, jtLeft
, jtLeftOuter
, jtRight
,
jtRightOuter
, jtCross
, jtInner
, jtFull
} |
| list of join types More...
|
|
enum | NodeType {
ntUnaryOperator
, ntBinaryOperator
, ntInOperator
, ntBetweenOperator
,
ntFunction
, ntLiteral
, ntColumnRef
, ntSelectedColumn
,
ntSelect
, ntTableDef
, ntJoin
, ntColumnSorted
,
ntCast
} |
| Node type. More...
|
|
enum | UnaryOperator { uoNot
, uoMinus
} |
| list of unary operators More...
|
|
Class for parsing SQL statements.
- Since
- QGIS 2.16
Definition at line 35 of file qgssqlstatement.h.
◆ BinaryOperator
list of binary operators
- Note
- if any change is made here, the definition of QgsSQLStatement::BinaryOperatorText[] must be adapted.
Enumerator |
---|
boOr | |
boAnd | |
boEQ | |
boNE | |
boLE | |
boGE | |
boLT | |
boGT | |
boLike | |
boNotLike | |
boILike | |
boNotILike | |
boIs | |
boIsNot | |
boPlus | |
boMinus | |
boMul | |
boDiv | |
boIntDiv | |
boMod | |
boPow | |
boConcat | |
Definition at line 136 of file qgssqlstatement.h.
◆ JoinType
list of join types
- Note
- if any change is made here, the definition of QgsSQLStatement::JoinTypeText[] must be adapted.
Enumerator |
---|
jtDefault | |
jtLeft | |
jtLeftOuter | |
jtRight | |
jtRightOuter | |
jtCross | |
jtInner | |
jtFull | |
Definition at line 173 of file qgssqlstatement.h.
◆ NodeType
Node type.
Enumerator |
---|
ntUnaryOperator | |
ntBinaryOperator | |
ntInOperator | |
ntBetweenOperator | |
ntFunction | |
ntLiteral | |
ntColumnRef | |
ntSelectedColumn | |
ntSelect | |
ntTableDef | |
ntJoin | |
ntColumnSorted | |
ntCast | |
Definition at line 199 of file qgssqlstatement.h.
◆ UnaryOperator
list of unary operators
- Note
- if any change is made here, the definition of QgsSQLStatement::UnaryOperatorText[] must be adapted.
Definition at line 126 of file qgssqlstatement.h.
◆ QgsSQLStatement() [1/3]
QgsSQLStatement::QgsSQLStatement |
( |
const QString & |
statement | ) |
|
◆ QgsSQLStatement() [2/3]
◆ ~QgsSQLStatement()
QgsSQLStatement::~QgsSQLStatement |
( |
| ) |
|
|
virtual |
◆ QgsSQLStatement() [3/3]
QgsSQLStatement::QgsSQLStatement |
( |
const QString & |
statement, |
|
|
bool |
allowFragments |
|
) |
| |
|
protected |
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.
- Since
- QGIS 3.16
Definition at line 136 of file qgssqlstatement.cpp.
◆ acceptVisitor()
◆ doBasicValidationChecks()
bool QgsSQLStatement::doBasicValidationChecks |
( |
QString & |
errorMsgOut | ) |
const |
Performs basic validity checks.
Basically checking that columns referencing a table, references a specified table. Returns true
if the validation is successful
Definition at line 251 of file qgssqlstatement.cpp.
◆ dump()
QString QgsSQLStatement::dump |
( |
| ) |
const |
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 statement() instead.
Definition at line 64 of file qgssqlstatement.cpp.
◆ hasParserError()
bool QgsSQLStatement::hasParserError |
( |
| ) |
const |
Returns true
if an error occurred when parsing the input statement.
Definition at line 166 of file qgssqlstatement.cpp.
◆ operator=()
◆ parserErrorString()
QString QgsSQLStatement::parserErrorString |
( |
| ) |
const |
◆ quotedIdentifier()
QString QgsSQLStatement::quotedIdentifier |
( |
QString |
name | ) |
|
|
static |
◆ quotedIdentifierIfNeeded()
QString QgsSQLStatement::quotedIdentifierIfNeeded |
( |
const QString & |
name | ) |
|
|
static |
◆ quotedString()
QString QgsSQLStatement::quotedString |
( |
QString |
text | ) |
|
|
static |
◆ rootNode()
Returns the root node of the statement.
The root node is nullptr
if parsing has failed.
Definition at line 176 of file qgssqlstatement.cpp.
◆ statement()
QString QgsSQLStatement::statement |
( |
| ) |
const |
Returns 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.
Definition at line 56 of file qgssqlstatement.cpp.
◆ stripMsQuotedIdentifier()
QString QgsSQLStatement::stripMsQuotedIdentifier |
( |
QString |
text | ) |
|
|
static |
◆ stripQuotedIdentifier()
QString QgsSQLStatement::stripQuotedIdentifier |
( |
QString |
text | ) |
|
|
static |
◆ BINARY_OPERATOR_TEXT
const char * QgsSQLStatement::BINARY_OPERATOR_TEXT |
|
static |
Initial value:=
{
"OR", "AND",
"=", "<>", "<=", ">=", "<", ">", "LIKE", "NOT LIKE", "ILIKE", "NOT ILIKE", "IS", "IS NOT",
"+", "-", "*", "/", "//", "%", "^",
"||"
}
- Note
- not available in Python bindings
Definition at line 186 of file qgssqlstatement.h.
◆ JOIN_TYPE_TEXT
const char * QgsSQLStatement::JOIN_TYPE_TEXT |
|
static |
Initial value:=
{
"", "LEFT", "LEFT OUTER", "RIGHT", "RIGHT OUTER", "CROSS", "INNER", "FULL"
}
- Note
- not available in Python bindings
Definition at line 192 of file qgssqlstatement.h.
◆ mAllowFragments
bool QgsSQLStatement::mAllowFragments = false |
|
protected |
◆ mParserErrorString
QString QgsSQLStatement::mParserErrorString |
|
protected |
◆ mRootNode
◆ mStatement
QString QgsSQLStatement::mStatement |
|
protected |
◆ UNARY_OPERATOR_TEXT
const char * QgsSQLStatement::UNARY_OPERATOR_TEXT |
|
static |
Initial value:- Note
- not available in Python bindings
Definition at line 189 of file qgssqlstatement.h.
The documentation for this class was generated from the following files: