29#include <Qsci/qscilexer.h>
40 connect( mTablesCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSQLComposerDialog::mTablesCombo_currentIndexChanged );
41 connect( mColumnsCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSQLComposerDialog::mColumnsCombo_currentIndexChanged );
42 connect( mSpatialPredicatesCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSQLComposerDialog::mSpatialPredicatesCombo_currentIndexChanged );
43 connect( mFunctionsCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSQLComposerDialog::mFunctionsCombo_currentIndexChanged );
44 connect( mOperatorsCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsSQLComposerDialog::mOperatorsCombo_currentIndexChanged );
45 connect( mAddJoinButton, &QPushButton::clicked,
this, &QgsSQLComposerDialog::mAddJoinButton_clicked );
46 connect( mRemoveJoinButton, &QPushButton::clicked,
this, &QgsSQLComposerDialog::mRemoveJoinButton_clicked );
47 connect( mTableJoins, &QTableWidget::itemSelectionChanged,
this, &QgsSQLComposerDialog::mTableJoins_itemSelectionChanged );
49 mQueryEdit->setWrapMode( QsciScintilla::WrapWord );
50 mQueryEdit->installEventFilter(
this );
51 mColumnsEditor->installEventFilter(
this );
52 mTablesEditor->installEventFilter(
this );
53 mTableJoins->installEventFilter(
this );
54 mWhereEditor->installEventFilter(
this );
55 mOrderEditor->installEventFilter(
this );
56 mTablesCombo->view()->installEventFilter(
this );
59 connect( mButtonBox->button( QDialogButtonBox::Reset ), &QAbstractButton::clicked,
60 this, &QgsSQLComposerDialog::reset );
62 connect( mQueryEdit, &QsciScintilla::textChanged,
63 this, &QgsSQLComposerDialog::splitSQLIntoFields );
64 connect( mColumnsEditor, &QTextEdit::textChanged,
65 this, &QgsSQLComposerDialog::buildSQLFromFields );
66 connect( mTablesEditor, &QLineEdit::textChanged,
67 this, &QgsSQLComposerDialog::buildSQLFromFields );
68 connect( mWhereEditor, &QTextEdit::textChanged,
69 this, &QgsSQLComposerDialog::buildSQLFromFields );
70 connect( mOrderEditor, &QTextEdit::textChanged,
71 this, &QgsSQLComposerDialog::buildSQLFromFields );
72 connect( mTableJoins, &QTableWidget::cellChanged,
73 this, &QgsSQLComposerDialog::buildSQLFromFields );
74 connect( mButtonBox, &QDialogButtonBox::helpRequested,
75 this, &QgsSQLComposerDialog::showHelp );
78 baseList << QStringLiteral(
"SELECT" );
79 baseList << QStringLiteral(
"FROM" );
80 baseList << QStringLiteral(
"JOIN" );
81 baseList << QStringLiteral(
"ON" );
82 baseList << QStringLiteral(
"USING" );
83 baseList << QStringLiteral(
"WHERE" );
84 baseList << QStringLiteral(
"AND" );
85 baseList << QStringLiteral(
"OR" );
86 baseList << QStringLiteral(
"NOT" );
87 baseList << QStringLiteral(
"IS" );
88 baseList << QStringLiteral(
"NULL" );
89 baseList << QStringLiteral(
"LIKE" );
90 baseList << QStringLiteral(
"ORDER" );
91 baseList << QStringLiteral(
"BY" );
94 QStringList operatorsList;
95 operatorsList << QStringLiteral(
"AND" );
96 operatorsList << QStringLiteral(
"OR" );
97 operatorsList << QStringLiteral(
"NOT" );
98 operatorsList << QStringLiteral(
"=" );
99 operatorsList << QStringLiteral(
"<" );
100 operatorsList << QStringLiteral(
"<=" );
101 operatorsList << QStringLiteral(
">" );
102 operatorsList << QStringLiteral(
">=" );
103 operatorsList << QStringLiteral(
"<>" );
104 operatorsList << QStringLiteral(
"BETWEEN" );
105 operatorsList << QStringLiteral(
"NOT BETWEEN" );
106 operatorsList << QStringLiteral(
"IS" );
107 operatorsList << QStringLiteral(
"IS NOT" );
108 operatorsList << QStringLiteral(
"IN" );
109 operatorsList << QStringLiteral(
"LIKE" );
112 mAggregatesCombo->hide();
113 mFunctionsCombo->hide();
114 mSpatialPredicatesCombo->hide();
115 mStringFunctionsCombo->hide();
117 delete mPageColumnsValues;
118 mPageColumnsValues =
nullptr;
120 mRemoveJoinButton->setEnabled(
false );
122 mTableJoins->setRowCount( 0 );
123 mTableJoins->setItem( 0, 0,
new QTableWidgetItem( QString() ) );
124 mTableJoins->setItem( 0, 1,
new QTableWidgetItem( QString() ) );
132 delete mQueryEdit->lexer()->apis();
133 mQueryEdit->lexer()->setAPIs(
nullptr );
138 if ( event->type() == QEvent::FocusIn )
140 if ( obj == mTablesCombo->view() )
141 lastSearchedText.clear();
143 mFocusedObject = obj;
147 if ( event->type() == QEvent::KeyPress && obj == mTablesCombo->view() )
149 QString currentString = ( ( QKeyEvent * )event )->text();
150 if ( !currentString.isEmpty() && ( ( currentString[0] >=
'a' && currentString[0] <=
'z' ) ||
151 ( currentString[0] >=
'A' && currentString[0] <=
'Z' ) ||
152 ( currentString[0] >=
'0' && currentString[0] <=
'9' ) ||
153 currentString[0] ==
':' || currentString[0] ==
'_' || currentString[0] ==
' ' ||
154 currentString[0] ==
'(' || currentString[0] ==
')' ) )
158 const int attemptCount = ( lastSearchedText.isEmpty() ) ? 1 : 2;
159 for (
int attempt = 0; attempt < attemptCount; attempt ++ )
162 lastSearchedText += currentString;
164 lastSearchedText = currentString;
169 int iBestCandidate = 0;
170 int idxInTextOfBestCandidate = 1000;
171 for (
int i = 1; i < mTablesCombo->count(); i++ )
173 const int idxInText = mTablesCombo->itemText( i ).indexOf( lastSearchedText, Qt::CaseInsensitive );
174 if ( idxInText >= 0 && idxInText < idxInTextOfBestCandidate )
177 idxInTextOfBestCandidate = idxInText;
180 if ( iBestCandidate > 0 )
182 mTablesCombo->view()->setCurrentIndex( mTablesCombo->model()->index( 0, 0 ).sibling( iBestCandidate, 0 ) );
186 lastSearchedText.clear();
190 return QDialog::eventFilter( obj, event );
195 mTableSelectedCallback = tableSelectedCallback;
200 mSQLValidatorCallback = sqlValidatorCallback;
206 mQueryEdit->setText(
sql );
211 return mQueryEdit->text();
214void QgsSQLComposerDialog::accept()
216 if ( mSQLValidatorCallback )
218 QString errorMsg, warningMsg;
219 if ( !mSQLValidatorCallback->
isValid(
sql(), errorMsg, warningMsg ) )
221 if ( errorMsg.isEmpty() )
222 errorMsg = tr(
"An error occurred during evaluation of the SQL statement." );
223 QMessageBox::critical(
this, tr(
"SQL Evaluation" ), errorMsg );
226 if ( !warningMsg.isEmpty() )
228 QMessageBox::warning(
this, tr(
"SQL Evaluation" ), warningMsg );
238void QgsSQLComposerDialog::buildSQLFromFields()
240 if ( mAlreadyModifyingFields )
242 mAlreadyModifyingFields =
true;
243 QString
sql( QStringLiteral(
"SELECT " ) );
245 sql += QLatin1String(
"DISTINCT " );
246 sql += mColumnsEditor->toPlainText();
247 sql += QLatin1String(
" FROM " );
248 sql += mTablesEditor->text();
250 const int rows = mTableJoins->rowCount();
251 for (
int i = 0; i < rows; i++ )
253 QTableWidgetItem *itemTable = mTableJoins->item( i, 0 );
254 QTableWidgetItem *itemOn = mTableJoins->item( i, 1 );
255 if ( itemTable && !itemTable->text().isEmpty() &&
256 itemOn && !itemOn->text().isEmpty() )
258 sql += QLatin1String(
" JOIN " );
259 sql += itemTable->text();
260 sql += QLatin1String(
" ON " );
261 sql += itemOn->text();
265 if ( !mWhereEditor->toPlainText().isEmpty() )
267 sql += QLatin1String(
" WHERE " );
268 sql += mWhereEditor->toPlainText();
270 if ( !mOrderEditor->toPlainText().isEmpty() )
272 sql += QLatin1String(
" ORDER BY " );
273 sql += mOrderEditor->toPlainText();
275 mQueryEdit->setText(
sql );
277 mAlreadyModifyingFields =
false;
280void QgsSQLComposerDialog::splitSQLIntoFields()
282 if ( mAlreadyModifyingFields )
285 if (
sql.hasParserError() )
291 const QList<QgsSQLStatement::NodeSelectedColumn *> columns = nodeSelect->
columns();
293 const auto constColumns = columns;
296 if ( !columnText.isEmpty() )
297 columnText += QLatin1String(
", " );
298 columnText += column->dump();
301 const QList<QgsSQLStatement::NodeTableDef *> tables = nodeSelect->
tables();
303 const auto constTables = tables;
306 if ( !tablesText.isEmpty() )
307 tablesText += QLatin1String(
", " );
309 tablesText += table->dump();
315 whereText = where->
dump();
318 const QList<QgsSQLStatement::NodeColumnSorted *> orderColumns = nodeSelect->
orderBy();
319 const auto constOrderColumns = orderColumns;
322 if ( !orderText.isEmpty() )
323 orderText += QLatin1String(
", " );
324 orderText += column->dump();
327 const QList<QgsSQLStatement::NodeJoin *> joins = nodeSelect->
joins();
329 mAlreadyModifyingFields =
true;
330 mColumnsEditor->setPlainText( columnText );
331 mTablesEditor->setText( tablesText );
332 mWhereEditor->setPlainText( whereText );
333 mOrderEditor->setPlainText( orderText );
335 mTableJoins->setRowCount( joins.size() + 1 );
337 const auto constJoins = joins;
341 mTableJoins->setItem( iRow, 0,
new QTableWidgetItem( join->tableDef()->dump() ) );
342 if ( join->onExpr() )
343 mTableJoins->setItem( iRow, 1,
new QTableWidgetItem( join->onExpr()->dump() ) );
345 mTableJoins->setItem( iRow, 1,
new QTableWidgetItem( QString() ) );
348 mTableJoins->setItem( iRow, 0,
new QTableWidgetItem( QString() ) );
349 mTableJoins->setItem( iRow, 1,
new QTableWidgetItem( QString() ) );
351 mAlreadyModifyingFields =
false;
356 const auto constList = list;
357 for (
const QString &name : constList )
358 mapTableEntryTextToName[name] = name;
359 mTablesCombo->addItems( list );
365 QStringList listCombo;
367 const auto constListNameTitle = listNameTitle;
370 listApi << pair.first;
371 QString entryText( pair.first );
372 if ( !pair.second.isEmpty() && pair.second != pair.first )
374 if ( pair.second.size() < 40 )
375 entryText +=
" (" + pair.second +
")";
377 entryText +=
" (" + pair.second.mid( 0, 20 ) + QChar( 0x2026 ) + pair.second.mid( pair.second.size() - 20 ) +
")";
379 listCombo << entryText;
380 mapTableEntryTextToName[entryText] = pair.first;
382 mTablesCombo->addItems( listCombo );
388 QList<PairNameType> listPair;
389 const auto constList = list;
390 for (
const QString &name : constList )
395static QString sanitizeType( QString type )
397 if ( type.startsWith( QLatin1String(
"xs:" ) ) )
398 return type.mid( 3 );
399 if ( type.startsWith( QLatin1String(
"xsd:" ) ) )
400 return type.mid( 4 );
401 if ( type == QLatin1String(
"gml:AbstractGeometryType" ) )
402 return QStringLiteral(
"geometry" );
408 mAlreadySelectedTables.insert( tableName );
409 if ( mColumnsCombo->count() > 1 )
410 mColumnsCombo->insertSeparator( mColumnsCombo->count() );
412 QStringList listCombo;
414 const auto constList = list;
417 listApi << pair.first;
418 QString entryText( pair.first );
419 if ( !pair.second.isEmpty() )
421 entryText +=
" (" + sanitizeType( pair.second ) +
")";
423 listCombo << entryText;
424 mapColumnEntryTextToName[entryText] = pair.first;
426 mColumnsCombo->addItems( listCombo );
433 mOperatorsCombo->addItems( list );
441 return QObject::tr(
"%1 to %n argument(s)",
nullptr, f.
maxArgs ).arg( f.
minArgs );
448 return QObject::tr(
"%n argument(s)",
nullptr, f.
minArgs );
452 return QObject::tr(
"%n argument(s) or more",
nullptr, f.
minArgs );
458void QgsSQLComposerDialog::getFunctionList(
const QList<Function> &list,
459 QStringList &listApi,
460 QStringList &listCombo,
461 QMap<QString, QString> &mapEntryTextToName )
463 const auto constList = list;
464 for (
const Function &f : constList )
467 QString entryText( f.
name );
468 entryText += QLatin1Char(
'(' );
473 if ( f.
minArgs >= 0 && i >= f.
minArgs ) entryText += QLatin1Char(
'[' );
474 if ( i > 0 ) entryText += QLatin1String(
", " );
482 const QString sanitizedType( sanitizeType( f.
argumentList[i].type ) );
486 entryText += QLatin1String(
": " );
487 entryText += sanitizedType;
490 if ( f.
minArgs >= 0 && i >= f.
minArgs ) entryText += QLatin1Char(
']' );
492 if ( entryText.size() > 60 )
495 entryText += QLatin1Char(
'(' );
496 entryText += getFunctionAbbridgedParameters( f );
501 entryText += getFunctionAbbridgedParameters( f );
503 entryText += QLatin1Char(
')' );
505 entryText +=
": " + sanitizeType( f.
returnType );
506 listCombo << entryText;
507 mapEntryTextToName[entryText] = f.
name +
"(";
513 QList<Function> listFunction;
514 const auto constList = list;
515 for (
const QString &name : constList )
527 QStringList listCombo;
528 getFunctionList( list, listApi, listCombo, mapSpatialPredicateEntryTextToName );
529 mSpatialPredicatesCombo->addItems( listCombo );
530 mSpatialPredicatesCombo->show();
536 QList<Function> listFunction;
537 const auto constList = list;
538 for (
const QString &name : constList )
550 QStringList listCombo;
551 getFunctionList( list, listApi, listCombo, mapFunctionEntryTextToName );
552 mFunctionsCombo->addItems( listCombo );
553 mFunctionsCombo->show();
557void QgsSQLComposerDialog::loadTableColumns(
const QString &table )
559 if ( mTableSelectedCallback )
561 if ( !mAlreadySelectedTables.contains( table ) )
564 mAlreadySelectedTables.insert( table );
569static void resetCombo( QComboBox *combo )
576 QMetaObject::invokeMethod( combo,
"setCurrentIndex", Qt::QueuedConnection, Q_ARG(
int, 0 ) );
579void QgsSQLComposerDialog::mTablesCombo_currentIndexChanged(
int )
581 const int index = mTablesCombo->currentIndex();
584 QObject *obj = mFocusedObject;
585 const QString newText = mapTableEntryTextToName[mTablesCombo->currentText()];
586 loadTableColumns( newText );
587 if ( obj == mTablesEditor )
589 const QString currentText = mTablesEditor->text();
590 if ( currentText.isEmpty() )
591 mTablesEditor->setText( newText );
593 mTablesEditor->setText( currentText +
", " + newText );
595 else if ( obj == mTableJoins )
597 if ( mTableJoins->selectedItems().size() == 1 )
599 mTableJoins->selectedItems().at( 0 )->setText( newText );
602 else if ( obj == mWhereEditor )
604 mWhereEditor->insertPlainText( newText );
606 else if ( obj == mOrderEditor )
608 mOrderEditor->insertPlainText( newText );
610 else if ( obj == mQueryEdit )
612 mQueryEdit->insertText( newText );
614 resetCombo( mTablesCombo );
617void QgsSQLComposerDialog::mColumnsCombo_currentIndexChanged(
int )
619 const int index = mColumnsCombo->currentIndex();
622 QObject *obj = mFocusedObject;
623 const QString newText = mapColumnEntryTextToName[mColumnsCombo->currentText()];
624 if ( obj == mColumnsEditor )
626 const QString currentText = mColumnsEditor->toPlainText();
627 if ( currentText.isEmpty() )
628 mColumnsEditor->insertPlainText( newText );
630 mColumnsEditor->insertPlainText(
",\n" + newText );
632 else if ( obj == mTableJoins )
634 if ( mTableJoins->selectedItems().size() == 1 &&
635 mTableJoins->selectedItems().at( 0 )->column() == 1 )
637 const QString currentText( mTableJoins->selectedItems().at( 0 )->text() );
638 if ( !currentText.isEmpty() && !currentText.contains( QLatin1String(
"=" ) ) )
639 mTableJoins->selectedItems().at( 0 )->setText( currentText +
" = " + newText );
641 mTableJoins->selectedItems().at( 0 )->setText( currentText + newText );
644 else if ( obj == mWhereEditor )
646 mWhereEditor->insertPlainText( newText );
648 else if ( obj == mOrderEditor )
650 mOrderEditor->insertPlainText( newText );
652 else if ( obj == mQueryEdit )
654 mQueryEdit->insertText( newText );
656 resetCombo( mColumnsCombo );
659void QgsSQLComposerDialog::mFunctionsCombo_currentIndexChanged(
int )
661 functionCurrentIndexChanged( mFunctionsCombo, mapFunctionEntryTextToName );
664void QgsSQLComposerDialog::mSpatialPredicatesCombo_currentIndexChanged(
int )
666 functionCurrentIndexChanged( mSpatialPredicatesCombo, mapSpatialPredicateEntryTextToName );
669void QgsSQLComposerDialog::functionCurrentIndexChanged( QComboBox *combo,
670 const QMap<QString, QString> &mapEntryTextToName )
672 const int index = combo->currentIndex();
675 QObject *obj = mFocusedObject;
676 const QString newText = mapEntryTextToName[combo->currentText()];
677 if ( obj == mColumnsEditor )
679 mColumnsEditor->insertPlainText( newText );
681 else if ( obj == mWhereEditor )
683 mWhereEditor->insertPlainText( newText );
685 else if ( obj == mQueryEdit )
687 mQueryEdit->insertText( newText );
692void QgsSQLComposerDialog::mOperatorsCombo_currentIndexChanged(
int )
694 const int index = mOperatorsCombo->currentIndex();
697 QObject *obj = mFocusedObject;
698 const QString newText = mOperatorsCombo->currentText();
699 if ( obj == mColumnsEditor )
701 mColumnsEditor->insertPlainText( newText );
703 else if ( obj == mWhereEditor )
705 mWhereEditor->insertPlainText( newText );
707 else if ( obj == mTableJoins )
709 if ( mTableJoins->selectedItems().size() == 1 &&
710 mTableJoins->selectedItems().at( 0 )->column() == 1 )
712 const QString currentText( mTableJoins->selectedItems().at( 0 )->text() );
713 mTableJoins->selectedItems().at( 0 )->setText( currentText + newText );
716 else if ( obj == mQueryEdit )
718 mQueryEdit->insertText( newText );
720 resetCombo( mOperatorsCombo );
723void QgsSQLComposerDialog::mAddJoinButton_clicked()
725 int insertRow = mTableJoins->currentRow();
726 const int rowCount = mTableJoins->rowCount();
728 insertRow = rowCount;
729 mTableJoins->setRowCount( rowCount + 1 );
730 for (
int row = rowCount ; row > insertRow + 1; row -- )
732 mTableJoins->setItem( row, 0, mTableJoins->takeItem( row - 1, 0 ) );
733 mTableJoins->setItem( row, 1, mTableJoins->takeItem( row - 1, 1 ) );
735 mTableJoins->setItem( ( insertRow == rowCount ) ? insertRow : insertRow + 1, 0, new QTableWidgetItem( QString() ) );
736 mTableJoins->setItem( ( insertRow == rowCount ) ? insertRow : insertRow + 1, 1, new QTableWidgetItem( QString() ) );
739void QgsSQLComposerDialog::mRemoveJoinButton_clicked()
741 int row = mTableJoins->currentRow();
744 const int rowCount = mTableJoins->rowCount();
745 for ( ; row < rowCount - 1; row ++ )
747 mTableJoins->setItem( row, 0, mTableJoins->takeItem( row + 1, 0 ) );
748 mTableJoins->setItem( row, 1, mTableJoins->takeItem( row + 1, 1 ) );
750 mTableJoins->setRowCount( rowCount - 1 );
752 buildSQLFromFields();
755void QgsSQLComposerDialog::reset()
757 mQueryEdit->setText( mResetSql );
760void QgsSQLComposerDialog::mTableJoins_itemSelectionChanged()
762 mRemoveJoinButton->setEnabled( mTableJoins->selectedItems().size() == 1 );
769 delete mQueryEdit->lexer()->apis();
770 QsciAPIs *apis =
new QsciAPIs( mQueryEdit->lexer() );
772 const auto constMApiList = mApiList;
773 for (
const QString &
str : constMApiList )
779 mQueryEdit->lexer()->setAPIs( apis );
784 mJoinsLabels->setVisible( on );
785 mTableJoins->setVisible( on );
786 mAddJoinButton->setVisible( on );
787 mRemoveJoinButton->setVisible( on );
788 mTablesCombo->setVisible( on );
790 QString mainTypenameFormatted;
791 if ( !mainTypename.isEmpty() )
792 mainTypenameFormatted =
"(" + mainTypename +
")";
793 mQueryEdit->setToolTip( tr(
"This is the SQL query editor. The SQL statement can select data from several tables, \n"
794 "but it must compulsory include the main typename %1 in the selected tables, \n"
795 "and only the geometry column of the main typename can be used as the geometry column of the resulting layer." ).arg( mainTypenameFormatted ) );
798void QgsSQLComposerDialog::showHelp()
800 QgsHelp::openHelp( QStringLiteral(
"working_with_ogc/ogc_client_support.html#ogc-wfs" ) );
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
Callback to do validation check on dialog validation.
virtual bool isValid(const QString &sql, QString &errorReason, QString &warningMsg)=0
method should return true if the SQL is valid. Otherwise return false and set the errorReason
Callback to do actions on table selection.
virtual void tableSelected(const QString &name)=0
method called when a table is selected
bool eventFilter(QObject *obj, QEvent *event) override
QgsSQLComposerDialog(QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
constructor
void addSpatialPredicates(const QStringList &list)
add a list of spatial predicates
void setSQLValidatorCallback(SQLValidatorCallback *sqlValidatorCallback)
Set a callback that will be called when the OK button is pushed.
void setTableSelectedCallback(TableSelectedCallback *tableSelectedCallback)
Set a callback that will be called when a new table is selected, so that new column names can be adde...
QPair< QString, QString > PairNameType
pair (name, type)
void addOperators(const QStringList &list)
add a list of operators
~QgsSQLComposerDialog() override
void addColumnNames(const QStringList &list, const QString &tableName)
add a list of column names
void setSupportMultipleTables(bool bMultipleTables, const QString &mainTypename=QString())
Sets if multiple tables/joins are supported. Default is false.
void addApis(const QStringList &list)
add a list of API for autocompletion
void setSql(const QString &sql)
initialize the SQL statement
void addFunctions(const QStringList &list)
add a list of functions
void addTableNames(const QStringList &list)
add a list of table names
QPair< QString, QString > PairNameTitle
pair (name, title)
QString sql() const
Gets the SQL statement.
QList< QgsSQLStatement::NodeColumnSorted * > orderBy() const
Returns the list of order by columns.
QList< QgsSQLStatement::NodeSelectedColumn * > columns() const
Returns the list of columns.
bool distinct() const
Returns if the SELECT is DISTINCT.
QList< QgsSQLStatement::NodeJoin * > joins() const
Returns the list of joins.
QgsSQLStatement::Node * where() const
Returns the where clause.
QList< QgsSQLStatement::NodeTableDef * > tables() const
Returns the list of tables.
virtual QString dump() const =0
Abstract virtual dump method.
Class for parsing SQL statements.
static QString quotedIdentifierIfNeeded(const QString &name)
Returns a quoted column reference (in double quotes) if needed, or otherwise the original string.
Interface for a dialog that can edit subset strings.
Represents a vector layer which manages a vector based data sets.
virtual bool setSubsetString(const QString &subset)
Sets the string (typically sql) used to define a subset of the layer.
description of server functions
QString returnType
Returns type, or empty if unknown.
int maxArgs
maximum number of argument (or -1 if unknown)
int minArgs
minimum number of argument (or -1 if unknown)
QList< Argument > argumentList
list of arguments. May be empty despite minArgs > 0