QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsabstractdatabaseproviderconnection.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsabstractdatabaseproviderconnection.cpp - QgsAbstractDatabaseProviderConnection
3
4 ---------------------
5 begin : 2.8.2019
6 copyright : (C) 2019 by Alessandro Pasotti
7 email : elpaso at itopen dot it
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 ***************************************************************************/
17#include "moc_qgsabstractdatabaseproviderconnection.cpp"
18#include "qgsvectorlayer.h"
19#include "qgsexception.h"
20#include "qgsweakrelation.h"
21#include "qgsfeedback.h"
23
24#include <QVariant>
25#include <QObject>
26
32
33QgsAbstractDatabaseProviderConnection::QgsAbstractDatabaseProviderConnection( const QString &uri, const QVariantMap &configuration ):
34 QgsAbstractProviderConnection( uri, configuration )
35{
36
37}
38
43
48
53
58
59
60QString QgsAbstractDatabaseProviderConnection::tableUri( const QString &schema, const QString &name ) const
61{
62 Q_UNUSED( schema )
63 Q_UNUSED( name )
64 throw QgsProviderConnectionException( QObject::tr( "Operation 'tableUri' is not supported" ) );
65}
66
67
69void QgsAbstractDatabaseProviderConnection::checkCapability( QgsAbstractDatabaseProviderConnection::Capability capability ) const
70{
71 if ( ! mCapabilities.testFlag( capability ) )
72 {
73 static QMetaEnum metaEnum = QMetaEnum::fromType<QgsAbstractDatabaseProviderConnection::Capability>();
74 const QString capName { metaEnum.valueToKey( capability ) };
75 throw QgsProviderConnectionException( QObject::tr( "Operation '%1' is not supported for this connection" ).arg( capName ) );
76 }
77}
78
79void QgsAbstractDatabaseProviderConnection::checkCapability( Qgis::DatabaseProviderConnectionCapability2 capability ) const
80{
81 if ( ! mCapabilities2.testFlag( capability ) )
82 {
83 throw QgsProviderConnectionException( QObject::tr( "Operation '%1' is not supported for this connection" ).arg( qgsEnumValueToKey( capability ) ) );
84 }
85}
86
88
93
94QMultiMap<Qgis::SqlKeywordCategory, QStringList> QgsAbstractDatabaseProviderConnection::sqlDictionary()
95{
96 return
97 {
98 // Common constants
99 {
101 QStringLiteral( "NULL" ),
102 QStringLiteral( "FALSE" ),
103 QStringLiteral( "TRUE" ),
104 }
105 },
106 // Common SQL reserved words
107 // From: GET https://en.wikipedia.org/wiki/SQL_reserved_words| grep 'style="background: #ececec; color: black; font-weight: bold;'| sed -e 's/.*>//'|sort
108 {
110 {
111 QStringLiteral( "ABORT " ),
112 QStringLiteral( "ABORTSESSION" ),
113 QStringLiteral( "ABS" ),
114 QStringLiteral( "ABSOLUTE" ),
115 QStringLiteral( "ACCESS" ),
116 QStringLiteral( "ACCESSIBLE" ),
117 QStringLiteral( "ACCESS_LOCK" ),
118 QStringLiteral( "ACCOUNT" ),
119 QStringLiteral( "ACOS" ),
120 QStringLiteral( "ACOSH" ),
121 QStringLiteral( "ACTION" ),
122 QStringLiteral( "ADD" ),
123 QStringLiteral( "ADD_MONTHS" ),
124 QStringLiteral( "ADMIN" ),
125 QStringLiteral( "AFTER" ),
126 QStringLiteral( "AGGREGATE" ),
127 QStringLiteral( "ALIAS" ),
128 QStringLiteral( "ALL" ),
129 QStringLiteral( "ALLOCATE" ),
130 QStringLiteral( "ALLOW" ),
131 QStringLiteral( "ALTER" ),
132 QStringLiteral( "ALTERAND" ),
133 QStringLiteral( "AMP" ),
134 QStringLiteral( "ANALYSE" ),
135 QStringLiteral( "ANALYZE" ),
136 QStringLiteral( "AND" ),
137 QStringLiteral( "ANSIDATE" ),
138 QStringLiteral( "ANY" ),
139 QStringLiteral( "ARE" ),
140 QStringLiteral( "ARRAY" ),
141 QStringLiteral( "ARRAY_AGG" ),
142 QStringLiteral( "ARRAY_EXISTS" ),
143 QStringLiteral( "ARRAY_MAX_CARDINALITY" ),
144 QStringLiteral( "AS" ),
145 QStringLiteral( "ASC" ),
146 QStringLiteral( "ASENSITIVE" ),
147 QStringLiteral( "ASIN" ),
148 QStringLiteral( "ASINH" ),
149 QStringLiteral( "ASSERTION" ),
150 QStringLiteral( "ASSOCIATE" ),
151 QStringLiteral( "ASUTIME" ),
152 QStringLiteral( "ASYMMETRIC" ),
153 QStringLiteral( "AT" ),
154 QStringLiteral( "ATAN" ),
155 QStringLiteral( "ATAN2" ),
156 QStringLiteral( "ATANH" ),
157 QStringLiteral( "ATOMIC" ),
158 QStringLiteral( "AUDIT" ),
159 QStringLiteral( "AUTHORIZATION" ),
160 QStringLiteral( "AUX" ),
161 QStringLiteral( "AUXILIARY" ),
162 QStringLiteral( "AVE" ),
163 QStringLiteral( "AVERAGE" ),
164 QStringLiteral( "AVG" ),
165 QStringLiteral( "BACKUP" ),
166 QStringLiteral( "BEFORE" ),
167 QStringLiteral( "BEGIN" ),
168 QStringLiteral( "BEGIN_FRAME" ),
169 QStringLiteral( "BEGIN_PARTITION" ),
170 QStringLiteral( "BETWEEN" ),
171 QStringLiteral( "BIGINT" ),
172 QStringLiteral( "BINARY" ),
173 QStringLiteral( "BIT" ),
174 QStringLiteral( "BLOB" ),
175 QStringLiteral( "BOOLEAN" ),
176 QStringLiteral( "BOTH" ),
177 QStringLiteral( "BREADTH" ),
178 QStringLiteral( "BREAK" ),
179 QStringLiteral( "BROWSE" ),
180 QStringLiteral( "BT" ),
181 QStringLiteral( "BUFFERPOOL" ),
182 QStringLiteral( "BULK" ),
183 QStringLiteral( "BUT" ),
184 QStringLiteral( "BY" ),
185 QStringLiteral( "BYTE" ),
186 QStringLiteral( "BYTEINT" ),
187 QStringLiteral( "BYTES" ),
188 QStringLiteral( "CALL" ),
189 QStringLiteral( "CALLED" ),
190 QStringLiteral( "CAPTURE" ),
191 QStringLiteral( "CARDINALITY" ),
192 QStringLiteral( "CASCADE" ),
193 QStringLiteral( "CASCADED" ),
194 QStringLiteral( "CASE" ),
195 QStringLiteral( "CASE_N" ),
196 QStringLiteral( "CASESPECIFIC" ),
197 QStringLiteral( "CAST" ),
198 QStringLiteral( "CATALOG" ),
199 QStringLiteral( "CCSID" ),
200 QStringLiteral( "CD" ),
201 QStringLiteral( "CEIL" ),
202 QStringLiteral( "CEILING" ),
203 QStringLiteral( "CHANGE" ),
204 QStringLiteral( "CHAR" ),
205 QStringLiteral( "CHAR2HEXINT" ),
206 QStringLiteral( "CHARACTER" ),
207 QStringLiteral( "CHARACTER_LENGTH" ),
208 QStringLiteral( "CHARACTERS" ),
209 QStringLiteral( "CHAR_LENGTH" ),
210 QStringLiteral( "CHARS" ),
211 QStringLiteral( "CHECK" ),
212 QStringLiteral( "CHECKPOINT" ),
213 QStringLiteral( "CLASS" ),
214 QStringLiteral( "CLASSIFIER" ),
215 QStringLiteral( "CLOB" ),
216 QStringLiteral( "CLONE" ),
217 QStringLiteral( "CLOSE" ),
218 QStringLiteral( "CLUSTER" ),
219 QStringLiteral( "CLUSTERED" ),
220 QStringLiteral( "CM" ),
221 QStringLiteral( "COALESCE" ),
222 QStringLiteral( "COLLATE" ),
223 QStringLiteral( "COLLATION" ),
224 QStringLiteral( "COLLECT" ),
225 QStringLiteral( "COLLECTION" ),
226 QStringLiteral( "COLLID" ),
227 QStringLiteral( "COLUMN" ),
228 QStringLiteral( "COLUMN_VALUE" ),
229 QStringLiteral( "COMMENT" ),
230 QStringLiteral( "COMMIT" ),
231 QStringLiteral( "COMPLETION" ),
232 QStringLiteral( "COMPRESS" ),
233 QStringLiteral( "COMPUTE" ),
234 QStringLiteral( "CONCAT" ),
235 QStringLiteral( "CONCURRENTLY" ),
236 QStringLiteral( "CONDITION" ),
237 QStringLiteral( "CONNECT" ),
238 QStringLiteral( "CONNECTION" ),
239 QStringLiteral( "CONSTRAINT" ),
240 QStringLiteral( "CONSTRAINTS" ),
241 QStringLiteral( "CONSTRUCTOR" ),
242 QStringLiteral( "CONTAINS" ),
243 QStringLiteral( "CONTAINSTABLE" ),
244 QStringLiteral( "CONTENT" ),
245 QStringLiteral( "CONTINUE" ),
246 QStringLiteral( "CONVERT" ),
247 QStringLiteral( "CONVERT_TABLE_HEADER" ),
248 QStringLiteral( "COPY" ),
249 QStringLiteral( "CORR" ),
250 QStringLiteral( "CORRESPONDING" ),
251 QStringLiteral( "COS" ),
252 QStringLiteral( "COSH" ),
253 QStringLiteral( "COUNT" ),
254 QStringLiteral( "COVAR_POP" ),
255 QStringLiteral( "COVAR_SAMP" ),
256 QStringLiteral( "CREATE" ),
257 QStringLiteral( "CROSS" ),
258 QStringLiteral( "CS" ),
259 QStringLiteral( "CSUM" ),
260 QStringLiteral( "CT" ),
261 QStringLiteral( "CUBE" ),
262 QStringLiteral( "CUME_DIST" ),
263 QStringLiteral( "CURRENT" ),
264 QStringLiteral( "CURRENT_CATALOG" ),
265 QStringLiteral( "CURRENT_DATE" ),
266 QStringLiteral( "CURRENT_DEFAULT_TRANSFORM_GROUP" ),
267 QStringLiteral( "CURRENT_LC_CTYPE" ),
268 QStringLiteral( "CURRENT_PATH" ),
269 QStringLiteral( "CURRENT_ROLE" ),
270 QStringLiteral( "CURRENT_ROW" ),
271 QStringLiteral( "CURRENT_SCHEMA" ),
272 QStringLiteral( "CURRENT_SERVER" ),
273 QStringLiteral( "CURRENT_TIME" ),
274 QStringLiteral( "CURRENT_TIMESTAMP" ),
275 QStringLiteral( "CURRENT_TIMEZONE" ),
276 QStringLiteral( "CURRENT_TRANSFORM_GROUP_FOR_TYPE" ),
277 QStringLiteral( "CURRENT_USER" ),
278 QStringLiteral( "CURRVAL" ),
279 QStringLiteral( "CURSOR" ),
280 QStringLiteral( "CV" ),
281 QStringLiteral( "CYCLE" ),
282 QStringLiteral( "DATA" ),
283 QStringLiteral( "DATABASE" ),
284 QStringLiteral( "DATABASES" ),
285 QStringLiteral( "DATABLOCKSIZE" ),
286 QStringLiteral( "DATE" ),
287 QStringLiteral( "DATEFORM" ),
288 QStringLiteral( "DAY" ),
289 QStringLiteral( "DAY_HOUR" ),
290 QStringLiteral( "DAY_MICROSECOND" ),
291 QStringLiteral( "DAY_MINUTE" ),
292 QStringLiteral( "DAYS" ),
293 QStringLiteral( "DAY_SECOND" ),
294 QStringLiteral( "DBCC" ),
295 QStringLiteral( "DBINFO" ),
296 QStringLiteral( "DEALLOCATE" ),
297 QStringLiteral( "DEC" ),
298 QStringLiteral( "DECFLOAT" ),
299 QStringLiteral( "DECIMAL" ),
300 QStringLiteral( "DECLARE" ),
301 QStringLiteral( "DEFAULT" ),
302 QStringLiteral( "DEFERRABLE" ),
303 QStringLiteral( "DEFERRED" ),
304 QStringLiteral( "DEFINE" ),
305 QStringLiteral( "DEGREES" ),
306 QStringLiteral( "DEL" ),
307 QStringLiteral( "DELAYED" ),
308 QStringLiteral( "DELETE" ),
309 QStringLiteral( "DENSE_RANK" ),
310 QStringLiteral( "DENY" ),
311 QStringLiteral( "DEPTH" ),
312 QStringLiteral( "DEREF" ),
313 QStringLiteral( "DESC" ),
314 QStringLiteral( "DESCRIBE" ),
315 QStringLiteral( "DESCRIPTOR" ),
316 QStringLiteral( "DESTROY" ),
317 QStringLiteral( "DESTRUCTOR" ),
318 QStringLiteral( "DETERMINISTIC" ),
319 QStringLiteral( "DIAGNOSTIC" ),
320 QStringLiteral( "DIAGNOSTICS" ),
321 QStringLiteral( "DICTIONARY" ),
322 QStringLiteral( "DISABLE" ),
323 QStringLiteral( "DISABLED" ),
324 QStringLiteral( "DISALLOW" ),
325 QStringLiteral( "DISCONNECT" ),
326 QStringLiteral( "DISK" ),
327 QStringLiteral( "DISTINCT" ),
328 QStringLiteral( "DISTINCTROW" ),
329 QStringLiteral( "DISTRIBUTED" ),
330 QStringLiteral( "DIV" ),
331 QStringLiteral( "DO" ),
332 QStringLiteral( "DOCUMENT" ),
333 QStringLiteral( "DOMAIN" ),
334 QStringLiteral( "DOUBLE" ),
335 QStringLiteral( "DROP" ),
336 QStringLiteral( "DSSIZE" ),
337 QStringLiteral( "DUAL" ),
338 QStringLiteral( "DUMP" ),
339 QStringLiteral( "DYNAMIC" ),
340 QStringLiteral( "EACH" ),
341 QStringLiteral( "ECHO" ),
342 QStringLiteral( "EDITPROC" ),
343 QStringLiteral( "ELEMENT" ),
344 QStringLiteral( "ELSE" ),
345 QStringLiteral( "ELSEIF" ),
346 QStringLiteral( "EMPTY" ),
347 QStringLiteral( "ENABLED" ),
348 QStringLiteral( "ENCLOSED" ),
349 QStringLiteral( "ENCODING" ),
350 QStringLiteral( "ENCRYPTION" ),
351 QStringLiteral( "END" ),
352 QStringLiteral( "END-EXEC" ),
353 QStringLiteral( "END_FRAME" ),
354 QStringLiteral( "ENDING" ),
355 QStringLiteral( "END_PARTITION" ),
356 QStringLiteral( "EQ" ),
357 QStringLiteral( "EQUALS" ),
358 QStringLiteral( "ERASE" ),
359 QStringLiteral( "ERRLVL" ),
360 QStringLiteral( "ERROR" ),
361 QStringLiteral( "ERRORFILES" ),
362 QStringLiteral( "ERRORTABLES" ),
363 QStringLiteral( "ESCAPE" ),
364 QStringLiteral( "ESCAPED" ),
365 QStringLiteral( "ET" ),
366 QStringLiteral( "EVERY" ),
367 QStringLiteral( "EXCEPT" ),
368 QStringLiteral( "EXCEPTION" ),
369 QStringLiteral( "EXCLUSIVE" ),
370 QStringLiteral( "EXEC" ),
371 QStringLiteral( "EXECUTE" ),
372 QStringLiteral( "EXISTS" ),
373 QStringLiteral( "EXIT" ),
374 QStringLiteral( "EXP" ),
375 QStringLiteral( "EXPLAIN" ),
376 QStringLiteral( "EXTERNAL" ),
377 QStringLiteral( "EXTRACT" ),
378 QStringLiteral( "FALLBACK" ),
379 QStringLiteral( "FALSE" ),
380 QStringLiteral( "FASTEXPORT" ),
381 QStringLiteral( "FENCED" ),
382 QStringLiteral( "FETCH" ),
383 QStringLiteral( "FIELDPROC" ),
384 QStringLiteral( "FILE" ),
385 QStringLiteral( "FILLFACTOR" ),
386 QStringLiteral( "FILTER" ),
387 QStringLiteral( "FINAL" ),
388 QStringLiteral( "FIRST" ),
389 QStringLiteral( "FIRST_VALUE" ),
390 QStringLiteral( "FLOAT" ),
391 QStringLiteral( "FLOAT4" ),
392 QStringLiteral( "FLOAT8" ),
393 QStringLiteral( "FLOOR" ),
394 QStringLiteral( "FOR" ),
395 QStringLiteral( "FORCE" ),
396 QStringLiteral( "FOREIGN" ),
397 QStringLiteral( "FORMAT" ),
398 QStringLiteral( "FOUND" ),
399 QStringLiteral( "FRAME_ROW" ),
400 QStringLiteral( "FREE" ),
401 QStringLiteral( "FREESPACE" ),
402 QStringLiteral( "FREETEXT" ),
403 QStringLiteral( "FREETEXTTABLE" ),
404 QStringLiteral( "FREEZE" ),
405 QStringLiteral( "FROM" ),
406 QStringLiteral( "FULL" ),
407 QStringLiteral( "FULLTEXT" ),
408 QStringLiteral( "FUNCTION" ),
409 QStringLiteral( "FUSION" ),
410 QStringLiteral( "GE" ),
411 QStringLiteral( "GENERAL" ),
412 QStringLiteral( "GENERATED" ),
413 QStringLiteral( "GET" ),
414 QStringLiteral( "GIVE" ),
415 QStringLiteral( "GLOBAL" ),
416 QStringLiteral( "GO" ),
417 QStringLiteral( "GOTO" ),
418 QStringLiteral( "GRANT" ),
419 QStringLiteral( "GRAPHIC" ),
420 QStringLiteral( "GROUP" ),
421 QStringLiteral( "GROUPING" ),
422 QStringLiteral( "GROUPS" ),
423 QStringLiteral( "GT" ),
424 QStringLiteral( "HANDLER" ),
425 QStringLiteral( "HASH" ),
426 QStringLiteral( "HASHAMP" ),
427 QStringLiteral( "HASHBAKAMP" ),
428 QStringLiteral( "HASHBUCKET" ),
429 QStringLiteral( "HASHROW" ),
430 QStringLiteral( "HAVING" ),
431 QStringLiteral( "HELP" ),
432 QStringLiteral( "HIGH_PRIORITY" ),
433 QStringLiteral( "HOLD" ),
434 QStringLiteral( "HOLDLOCK" ),
435 QStringLiteral( "HOST" ),
436 QStringLiteral( "HOUR" ),
437 QStringLiteral( "HOUR_MICROSECOND" ),
438 QStringLiteral( "HOUR_MINUTE" ),
439 QStringLiteral( "HOURS" ),
440 QStringLiteral( "HOUR_SECOND" ),
441 QStringLiteral( "IDENTIFIED" ),
442 QStringLiteral( "IDENTITY" ),
443 QStringLiteral( "IDENTITYCOL" ),
444 QStringLiteral( "IDENTITY_INSERT" ),
445 QStringLiteral( "IF" ),
446 QStringLiteral( "IGNORE" ),
447 QStringLiteral( "ILIKE" ),
448 QStringLiteral( "IMMEDIATE" ),
449 QStringLiteral( "IN" ),
450 QStringLiteral( "INCLUSIVE" ),
451 QStringLiteral( "INCONSISTENT" ),
452 QStringLiteral( "INCREMENT" ),
453 QStringLiteral( "INDEX" ),
454 QStringLiteral( "INDICATOR" ),
455 QStringLiteral( "INFILE" ),
456 QStringLiteral( "INHERIT" ),
457 QStringLiteral( "INITIAL" ),
458 QStringLiteral( "INITIALIZE" ),
459 QStringLiteral( "INITIALLY" ),
460 QStringLiteral( "INITIATE" ),
461 QStringLiteral( "INNER" ),
462 QStringLiteral( "INOUT" ),
463 QStringLiteral( "INPUT" ),
464 QStringLiteral( "INS" ),
465 QStringLiteral( "INSENSITIVE" ),
466 QStringLiteral( "INSERT" ),
467 QStringLiteral( "INSTEAD" ),
468 QStringLiteral( "INT" ),
469 QStringLiteral( "INT1" ),
470 QStringLiteral( "INT2" ),
471 QStringLiteral( "INT3" ),
472 QStringLiteral( "INT4" ),
473 QStringLiteral( "INT8" ),
474 QStringLiteral( "INTEGER" ),
475 QStringLiteral( "INTEGERDATE" ),
476 QStringLiteral( "INTERSECT" ),
477 QStringLiteral( "INTERSECTION" ),
478 QStringLiteral( "INTERVAL" ),
479 QStringLiteral( "INTO" ),
480 QStringLiteral( "IO_AFTER_GTIDS" ),
481 QStringLiteral( "IO_BEFORE_GTIDS" ),
482 QStringLiteral( "IS" ),
483 QStringLiteral( "ISNULL" ),
484 QStringLiteral( "ISOBID" ),
485 QStringLiteral( "ISOLATION" ),
486 QStringLiteral( "ITERATE" ),
487 QStringLiteral( "JAR" ),
488 QStringLiteral( "JOIN" ),
489 QStringLiteral( "JOURNAL" ),
490 QStringLiteral( "JSON_ARRAY" ),
491 QStringLiteral( "JSON_ARRAYAGG" ),
492 QStringLiteral( "JSON_EXISTS" ),
493 QStringLiteral( "JSON_OBJECT" ),
494 QStringLiteral( "JSON_OBJECTAGG" ),
495 QStringLiteral( "JSON_QUERY" ),
496 QStringLiteral( "JSON_TABLE" ),
497 QStringLiteral( "JSON_TABLE_PRIMITIVE" ),
498 QStringLiteral( "JSON_VALUE" ),
499 QStringLiteral( "KEEP" ),
500 QStringLiteral( "KEY" ),
501 QStringLiteral( "KEYS" ),
502 QStringLiteral( "KILL" ),
503 QStringLiteral( "KURTOSIS" ),
504 QStringLiteral( "LABEL" ),
505 QStringLiteral( "LAG" ),
506 QStringLiteral( "LANGUAGE" ),
507 QStringLiteral( "LARGE" ),
508 QStringLiteral( "LAST" ),
509 QStringLiteral( "LAST_VALUE" ),
510 QStringLiteral( "LATERAL" ),
511 QStringLiteral( "LC_CTYPE" ),
512 QStringLiteral( "LE" ),
513 QStringLiteral( "LEAD" ),
514 QStringLiteral( "LEADING" ),
515 QStringLiteral( "LEAVE" ),
516 QStringLiteral( "LEFT" ),
517 QStringLiteral( "LESS" ),
518 QStringLiteral( "LEVEL" ),
519 QStringLiteral( "LIKE" ),
520 QStringLiteral( "LIKE_REGEX" ),
521 QStringLiteral( "LIMIT" ),
522 QStringLiteral( "LINEAR" ),
523 QStringLiteral( "LINENO" ),
524 QStringLiteral( "LINES" ),
525 QStringLiteral( "LISTAGG" ),
526 QStringLiteral( "LN" ),
527 QStringLiteral( "LOAD" ),
528 QStringLiteral( "LOADING" ),
529 QStringLiteral( "LOCAL" ),
530 QStringLiteral( "LOCALE" ),
531 QStringLiteral( "LOCALTIME" ),
532 QStringLiteral( "LOCALTIMESTAMP" ),
533 QStringLiteral( "LOCATOR" ),
534 QStringLiteral( "LOCATORS" ),
535 QStringLiteral( "LOCK" ),
536 QStringLiteral( "LOCKING" ),
537 QStringLiteral( "LOCKMAX" ),
538 QStringLiteral( "LOCKSIZE" ),
539 QStringLiteral( "LOG" ),
540 QStringLiteral( "LOG10" ),
541 QStringLiteral( "LOGGING" ),
542 QStringLiteral( "LOGON" ),
543 QStringLiteral( "LONG" ),
544 QStringLiteral( "LONGBLOB" ),
545 QStringLiteral( "LONGTEXT" ),
546 QStringLiteral( "LOOP" ),
547 QStringLiteral( "LOWER" ),
548 QStringLiteral( "LOW_PRIORITY" ),
549 QStringLiteral( "LT" ),
550 QStringLiteral( "MACRO" ),
551 QStringLiteral( "MAINTAINED" ),
552 QStringLiteral( "MAP" ),
553 QStringLiteral( "MASTER_BIND" ),
554 QStringLiteral( "MASTER_SSL_VERIFY_SERVER_CERT" ),
555 QStringLiteral( "MATCH" ),
556 QStringLiteral( "MATCHES" ),
557 QStringLiteral( "MATCH_NUMBER" ),
558 QStringLiteral( "MATCH_RECOGNIZE" ),
559 QStringLiteral( "MATERIALIZED" ),
560 QStringLiteral( "MAVG" ),
561 QStringLiteral( "MAX" ),
562 QStringLiteral( "MAXEXTENTS" ),
563 QStringLiteral( "MAXIMUM" ),
564 QStringLiteral( "MAXVALUE" ),
565 QStringLiteral( "MCHARACTERS" ),
566 QStringLiteral( "MDIFF" ),
567 QStringLiteral( "MEDIUMBLOB" ),
568 QStringLiteral( "MEDIUMINT" ),
569 QStringLiteral( "MEDIUMTEXT" ),
570 QStringLiteral( "MEMBER" ),
571 QStringLiteral( "MERGE" ),
572 QStringLiteral( "METHOD" ),
573 QStringLiteral( "MICROSECOND" ),
574 QStringLiteral( "MICROSECONDS" ),
575 QStringLiteral( "MIDDLEINT" ),
576 QStringLiteral( "MIN" ),
577 QStringLiteral( "MINDEX" ),
578 QStringLiteral( "MINIMUM" ),
579 QStringLiteral( "MINUS" ),
580 QStringLiteral( "MINUTE" ),
581 QStringLiteral( "MINUTE_MICROSECOND" ),
582 QStringLiteral( "MINUTES" ),
583 QStringLiteral( "MINUTE_SECOND" ),
584 QStringLiteral( "MLINREG" ),
585 QStringLiteral( "MLOAD" ),
586 QStringLiteral( "MLSLABEL" ),
587 QStringLiteral( "MOD" ),
588 QStringLiteral( "MODE" ),
589 QStringLiteral( "MODIFIES" ),
590 QStringLiteral( "MODIFY" ),
591 QStringLiteral( "MODULE" ),
592 QStringLiteral( "MONITOR" ),
593 QStringLiteral( "MONRESOURCE" ),
594 QStringLiteral( "MONSESSION" ),
595 QStringLiteral( "MONTH" ),
596 QStringLiteral( "MONTHS" ),
597 QStringLiteral( "MSUBSTR" ),
598 QStringLiteral( "MSUM" ),
599 QStringLiteral( "MULTISET" ),
600 QStringLiteral( "NAMED" ),
601 QStringLiteral( "NAMES" ),
602 QStringLiteral( "NATIONAL" ),
603 QStringLiteral( "NATURAL" ),
604 QStringLiteral( "NCHAR" ),
605 QStringLiteral( "NCLOB" ),
606 QStringLiteral( "NE" ),
607 QStringLiteral( "NESTED_TABLE_ID" ),
608 QStringLiteral( "NEW" ),
609 QStringLiteral( "NEW_TABLE" ),
610 QStringLiteral( "NEXT" ),
611 QStringLiteral( "NEXTVAL" ),
612 QStringLiteral( "NO" ),
613 QStringLiteral( "NOAUDIT" ),
614 QStringLiteral( "NOCHECK" ),
615 QStringLiteral( "NOCOMPRESS" ),
616 QStringLiteral( "NONCLUSTERED" ),
617 QStringLiteral( "NONE" ),
618 QStringLiteral( "NORMALIZE" ),
619 QStringLiteral( "NOT" ),
620 QStringLiteral( "NOTNULL" ),
621 QStringLiteral( "NOWAIT" ),
622 QStringLiteral( "NO_WRITE_TO_BINLOG" ),
623 QStringLiteral( "NTH_VALUE" ),
624 QStringLiteral( "NTILE" ),
625 QStringLiteral( "NULL" ),
626 QStringLiteral( "NULLIF" ),
627 QStringLiteral( "NULLIFZERO" ),
628 QStringLiteral( "NULLS" ),
629 QStringLiteral( "NUMBER" ),
630 QStringLiteral( "NUMERIC" ),
631 QStringLiteral( "NUMPARTS" ),
632 QStringLiteral( "OBID" ),
633 QStringLiteral( "OBJECT" ),
634 QStringLiteral( "OBJECTS" ),
635 QStringLiteral( "OCCURRENCES_REGEX" ),
636 QStringLiteral( "OCTET_LENGTH" ),
637 QStringLiteral( "OF" ),
638 QStringLiteral( "OFF" ),
639 QStringLiteral( "OFFLINE" ),
640 QStringLiteral( "OFFSET" ),
641 QStringLiteral( "OFFSETS" ),
642 QStringLiteral( "OLD" ),
643 QStringLiteral( "OLD_TABLE" ),
644 QStringLiteral( "OMIT" ),
645 QStringLiteral( "ON" ),
646 QStringLiteral( "ONE" ),
647 QStringLiteral( "ONLINE" ),
648 QStringLiteral( "ONLY" ),
649 QStringLiteral( "OPEN" ),
650 QStringLiteral( "OPENDATASOURCE" ),
651 QStringLiteral( "OPENQUERY" ),
652 QStringLiteral( "OPENROWSET" ),
653 QStringLiteral( "OPENXML" ),
654 QStringLiteral( "OPERATION" ),
655 QStringLiteral( "OPTIMIZATION" ),
656 QStringLiteral( "OPTIMIZE" ),
657 QStringLiteral( "OPTIMIZER_COSTS" ),
658 QStringLiteral( "OPTION" ),
659 QStringLiteral( "OPTIONALLY" ),
660 QStringLiteral( "OR" ),
661 QStringLiteral( "ORDER" ),
662 QStringLiteral( "ORDINALITY" ),
663 QStringLiteral( "ORGANIZATION" ),
664 QStringLiteral( "OUT" ),
665 QStringLiteral( "OUTER" ),
666 QStringLiteral( "OUTFILE" ),
667 QStringLiteral( "OUTPUT" ),
668 QStringLiteral( "OVER" ),
669 QStringLiteral( "OVERLAPS" ),
670 QStringLiteral( "OVERLAY" ),
671 QStringLiteral( "OVERRIDE" ),
672 QStringLiteral( "PACKAGE" ),
673 QStringLiteral( "PAD" ),
674 QStringLiteral( "PADDED" ),
675 QStringLiteral( "PARAMETER" ),
676 QStringLiteral( "PARAMETERS" ),
677 QStringLiteral( "PART" ),
678 QStringLiteral( "PARTIAL" ),
679 QStringLiteral( "PARTITION" ),
680 QStringLiteral( "PARTITIONED" ),
681 QStringLiteral( "PARTITIONING" ),
682 QStringLiteral( "PASSWORD" ),
683 QStringLiteral( "PATH" ),
684 QStringLiteral( "PATTERN" ),
685 QStringLiteral( "PCTFREE" ),
686 QStringLiteral( "PER" ),
687 QStringLiteral( "PERCENT" ),
688 QStringLiteral( "PERCENTILE_CONT" ),
689 QStringLiteral( "PERCENTILE_DISC" ),
690 QStringLiteral( "PERCENT_RANK" ),
691 QStringLiteral( "PERIOD" ),
692 QStringLiteral( "PERM" ),
693 QStringLiteral( "PERMANENT" ),
694 QStringLiteral( "PIECESIZE" ),
695 QStringLiteral( "PIVOT" ),
696 QStringLiteral( "PLACING" ),
697 QStringLiteral( "PLAN" ),
698 QStringLiteral( "PORTION" ),
699 QStringLiteral( "POSITION" ),
700 QStringLiteral( "POSITION_REGEX" ),
701 QStringLiteral( "POSTFIX" ),
702 QStringLiteral( "POWER" ),
703 QStringLiteral( "PRECEDES" ),
704 QStringLiteral( "PRECISION" ),
705 QStringLiteral( "PREFIX" ),
706 QStringLiteral( "PREORDER" ),
707 QStringLiteral( "PREPARE" ),
708 QStringLiteral( "PRESERVE" ),
709 QStringLiteral( "PREVVAL" ),
710 QStringLiteral( "PRIMARY" ),
711 QStringLiteral( "PRINT" ),
712 QStringLiteral( "PRIOR" ),
713 QStringLiteral( "PRIQTY" ),
714 QStringLiteral( "PRIVATE" ),
715 QStringLiteral( "PRIVILEGES" ),
716 QStringLiteral( "PROC" ),
717 QStringLiteral( "PROCEDURE" ),
718 QStringLiteral( "PROFILE" ),
719 QStringLiteral( "PROGRAM" ),
720 QStringLiteral( "PROPORTIONAL" ),
721 QStringLiteral( "PROTECTION" ),
722 QStringLiteral( "PSID" ),
723 QStringLiteral( "PTF" ),
724 QStringLiteral( "PUBLIC" ),
725 QStringLiteral( "PURGE" ),
726 QStringLiteral( "QUALIFIED" ),
727 QStringLiteral( "QUALIFY" ),
728 QStringLiteral( "QUANTILE" ),
729 QStringLiteral( "QUERY" ),
730 QStringLiteral( "QUERYNO" ),
731 QStringLiteral( "RADIANS" ),
732 QStringLiteral( "RAISERROR" ),
733 QStringLiteral( "RANDOM" ),
734 QStringLiteral( "RANGE" ),
735 QStringLiteral( "RANGE_N" ),
736 QStringLiteral( "RANK" ),
737 QStringLiteral( "RAW" ),
738 QStringLiteral( "READ" ),
739 QStringLiteral( "READS" ),
740 QStringLiteral( "READTEXT" ),
741 QStringLiteral( "READ_WRITE" ),
742 QStringLiteral( "REAL" ),
743 QStringLiteral( "RECONFIGURE" ),
744 QStringLiteral( "RECURSIVE" ),
745 QStringLiteral( "REF" ),
746 QStringLiteral( "REFERENCES" ),
747 QStringLiteral( "REFERENCING" ),
748 QStringLiteral( "REFRESH" ),
749 QStringLiteral( "REGEXP" ),
750 QStringLiteral( "REGR_AVGX" ),
751 QStringLiteral( "REGR_AVGY" ),
752 QStringLiteral( "REGR_COUNT" ),
753 QStringLiteral( "REGR_INTERCEPT" ),
754 QStringLiteral( "REGR_R2" ),
755 QStringLiteral( "REGR_SLOPE" ),
756 QStringLiteral( "REGR_SXX" ),
757 QStringLiteral( "REGR_SXY" ),
758 QStringLiteral( "REGR_SYY" ),
759 QStringLiteral( "RELATIVE" ),
760 QStringLiteral( "RELEASE" ),
761 QStringLiteral( "RENAME" ),
762 QStringLiteral( "REPEAT" ),
763 QStringLiteral( "REPLACE" ),
764 QStringLiteral( "REPLICATION" ),
765 QStringLiteral( "REPOVERRIDE" ),
766 QStringLiteral( "REQUEST" ),
767 QStringLiteral( "REQUIRE" ),
768 QStringLiteral( "RESIGNAL" ),
769 QStringLiteral( "RESOURCE" ),
770 QStringLiteral( "RESTART" ),
771 QStringLiteral( "RESTORE" ),
772 QStringLiteral( "RESTRICT" ),
773 QStringLiteral( "RESULT" ),
774 QStringLiteral( "RESULT_SET_LOCATOR" ),
775 QStringLiteral( "RESUME" ),
776 QStringLiteral( "RET" ),
777 QStringLiteral( "RETRIEVE" ),
778 QStringLiteral( "RETURN" ),
779 QStringLiteral( "RETURNING" ),
780 QStringLiteral( "RETURNS" ),
781 QStringLiteral( "REVALIDATE" ),
782 QStringLiteral( "REVERT" ),
783 QStringLiteral( "REVOKE" ),
784 QStringLiteral( "RIGHT" ),
785 QStringLiteral( "RIGHTS" ),
786 QStringLiteral( "RLIKE" ),
787 QStringLiteral( "ROLE" ),
788 QStringLiteral( "ROLLBACK" ),
789 QStringLiteral( "ROLLFORWARD" ),
790 QStringLiteral( "ROLLUP" ),
791 QStringLiteral( "ROUND_CEILING" ),
792 QStringLiteral( "ROUND_DOWN" ),
793 QStringLiteral( "ROUND_FLOOR" ),
794 QStringLiteral( "ROUND_HALF_DOWN" ),
795 QStringLiteral( "ROUND_HALF_EVEN" ),
796 QStringLiteral( "ROUND_HALF_UP" ),
797 QStringLiteral( "ROUND_UP" ),
798 QStringLiteral( "ROUTINE" ),
799 QStringLiteral( "ROW" ),
800 QStringLiteral( "ROWCOUNT" ),
801 QStringLiteral( "ROWGUIDCOL" ),
802 QStringLiteral( "ROWID" ),
803 QStringLiteral( "ROWNUM" ),
804 QStringLiteral( "ROW_NUMBER" ),
805 QStringLiteral( "ROWS" ),
806 QStringLiteral( "ROWSET" ),
807 QStringLiteral( "RULE" ),
808 QStringLiteral( "RUN" ),
809 QStringLiteral( "RUNNING" ),
810 QStringLiteral( "SAMPLE" ),
811 QStringLiteral( "SAMPLEID" ),
812 QStringLiteral( "SAVE" ),
813 QStringLiteral( "SAVEPOINT" ),
814 QStringLiteral( "SCHEMA" ),
815 QStringLiteral( "SCHEMAS" ),
816 QStringLiteral( "SCOPE" ),
817 QStringLiteral( "SCRATCHPAD" ),
818 QStringLiteral( "SCROLL" ),
819 QStringLiteral( "SEARCH" ),
820 QStringLiteral( "SECOND" ),
821 QStringLiteral( "SECOND_MICROSECOND" ),
822 QStringLiteral( "SECONDS" ),
823 QStringLiteral( "SECQTY" ),
824 QStringLiteral( "SECTION" ),
825 QStringLiteral( "SECURITY" ),
826 QStringLiteral( "SECURITYAUDIT" ),
827 QStringLiteral( "SEEK" ),
828 QStringLiteral( "SEL" ),
829 QStringLiteral( "SELECT" ),
830 QStringLiteral( "SEMANTICKEYPHRASETABLE" ),
831 QStringLiteral( "SEMANTICSIMILARITYDETAILSTABLE" ),
832 QStringLiteral( "SEMANTICSIMILARITYTABLE" ),
833 QStringLiteral( "SENSITIVE" ),
834 QStringLiteral( "SEPARATOR" ),
835 QStringLiteral( "SEQUENCE" ),
836 QStringLiteral( "SESSION" ),
837 QStringLiteral( "SESSION_USER" ),
838 QStringLiteral( "SET" ),
839 QStringLiteral( "SETRESRATE" ),
840 QStringLiteral( "SETS" ),
841 QStringLiteral( "SETSESSRATE" ),
842 QStringLiteral( "SETUSER" ),
843 QStringLiteral( "SHARE" ),
844 QStringLiteral( "SHOW" ),
845 QStringLiteral( "SHUTDOWN" ),
846 QStringLiteral( "SIGNAL" ),
847 QStringLiteral( "SIMILAR" ),
848 QStringLiteral( "SIMPLE" ),
849 QStringLiteral( "SIN" ),
850 QStringLiteral( "SINH" ),
851 QStringLiteral( "SIZE" ),
852 QStringLiteral( "SKEW" ),
853 QStringLiteral( "SKIP" ),
854 QStringLiteral( "SMALLINT" ),
855 QStringLiteral( "SOME" ),
856 QStringLiteral( "SOUNDEX" ),
857 QStringLiteral( "SOURCE" ),
858 QStringLiteral( "SPACE" ),
859 QStringLiteral( "SPATIAL" ),
860 QStringLiteral( "SPECIFIC" ),
861 QStringLiteral( "SPECIFICTYPE" ),
862 QStringLiteral( "SPOOL" ),
863 QStringLiteral( "SQL" ),
864 QStringLiteral( "SQL_BIG_RESULT" ),
865 QStringLiteral( "SQL_CALC_FOUND_ROWS" ),
866 QStringLiteral( "SQLEXCEPTION" ),
867 QStringLiteral( "SQL_SMALL_RESULT" ),
868 QStringLiteral( "SQLSTATE" ),
869 QStringLiteral( "SQLTEXT" ),
870 QStringLiteral( "SQLWARNING" ),
871 QStringLiteral( "SQRT" ),
872 QStringLiteral( "SS" ),
873 QStringLiteral( "SSL" ),
874 QStringLiteral( "STANDARD" ),
875 QStringLiteral( "START" ),
876 QStringLiteral( "STARTING" ),
877 QStringLiteral( "STARTUP" ),
878 QStringLiteral( "STATE" ),
879 QStringLiteral( "STATEMENT" ),
880 QStringLiteral( "STATIC" ),
881 QStringLiteral( "STATISTICS" ),
882 QStringLiteral( "STAY" ),
883 QStringLiteral( "STDDEV_POP" ),
884 QStringLiteral( "STDDEV_SAMP" ),
885 QStringLiteral( "STEPINFO" ),
886 QStringLiteral( "STOGROUP" ),
887 QStringLiteral( "STORED" ),
888 QStringLiteral( "STORES" ),
889 QStringLiteral( "STRAIGHT_JOIN" ),
890 QStringLiteral( "STRING_CS" ),
891 QStringLiteral( "STRUCTURE" ),
892 QStringLiteral( "STYLE" ),
893 QStringLiteral( "SUBMULTISET" ),
894 QStringLiteral( "SUBSCRIBER" ),
895 QStringLiteral( "SUBSET" ),
896 QStringLiteral( "SUBSTR" ),
897 QStringLiteral( "SUBSTRING" ),
898 QStringLiteral( "SUBSTRING_REGEX" ),
899 QStringLiteral( "SUCCEEDS" ),
900 QStringLiteral( "SUCCESSFUL" ),
901 QStringLiteral( "SUM" ),
902 QStringLiteral( "SUMMARY" ),
903 QStringLiteral( "SUSPEND" ),
904 QStringLiteral( "SYMMETRIC" ),
905 QStringLiteral( "SYNONYM" ),
906 QStringLiteral( "SYSDATE" ),
907 QStringLiteral( "SYSTEM" ),
908 QStringLiteral( "SYSTEM_TIME" ),
909 QStringLiteral( "SYSTEM_USER" ),
910 QStringLiteral( "SYSTIMESTAMP" ),
911 QStringLiteral( "TABLE" ),
912 QStringLiteral( "TABLESAMPLE" ),
913 QStringLiteral( "TABLESPACE" ),
914 QStringLiteral( "TAN" ),
915 QStringLiteral( "TANH" ),
916 QStringLiteral( "TBL_CS" ),
917 QStringLiteral( "TEMPORARY" ),
918 QStringLiteral( "TERMINATE" ),
919 QStringLiteral( "TERMINATED" ),
920 QStringLiteral( "TEXTSIZE" ),
921 QStringLiteral( "THAN" ),
922 QStringLiteral( "THEN" ),
923 QStringLiteral( "THRESHOLD" ),
924 QStringLiteral( "TIME" ),
925 QStringLiteral( "TIMESTAMP" ),
926 QStringLiteral( "TIMEZONE_HOUR" ),
927 QStringLiteral( "TIMEZONE_MINUTE" ),
928 QStringLiteral( "TINYBLOB" ),
929 QStringLiteral( "TINYINT" ),
930 QStringLiteral( "TINYTEXT" ),
931 QStringLiteral( "TITLE" ),
932 QStringLiteral( "TO" ),
933 QStringLiteral( "TOP" ),
934 QStringLiteral( "TRACE" ),
935 QStringLiteral( "TRAILING" ),
936 QStringLiteral( "TRAN" ),
937 QStringLiteral( "TRANSACTION" ),
938 QStringLiteral( "TRANSLATE" ),
939 QStringLiteral( "TRANSLATE_CHK" ),
940 QStringLiteral( "TRANSLATE_REGEX" ),
941 QStringLiteral( "TRANSLATION" ),
942 QStringLiteral( "TREAT" ),
943 QStringLiteral( "TRIGGER" ),
944 QStringLiteral( "TRIM" ),
945 QStringLiteral( "TRIM_ARRAY" ),
946 QStringLiteral( "TRUE" ),
947 QStringLiteral( "TRUNCATE" ),
948 QStringLiteral( "TRY_CONVERT" ),
949 QStringLiteral( "TSEQUAL" ),
950 QStringLiteral( "TYPE" ),
951 QStringLiteral( "UC" ),
952 QStringLiteral( "UESCAPE" ),
953 QStringLiteral( "UID" ),
954 QStringLiteral( "UNDEFINED" ),
955 QStringLiteral( "UNDER" ),
956 QStringLiteral( "UNDO" ),
957 QStringLiteral( "UNION" ),
958 QStringLiteral( "UNIQUE" ),
959 QStringLiteral( "UNKNOWN" ),
960 QStringLiteral( "UNLOCK" ),
961 QStringLiteral( "UNNEST" ),
962 QStringLiteral( "UNPIVOT" ),
963 QStringLiteral( "UNSIGNED" ),
964 QStringLiteral( "UNTIL" ),
965 QStringLiteral( "UPD" ),
966 QStringLiteral( "UPDATE" ),
967 QStringLiteral( "UPDATETEXT" ),
968 QStringLiteral( "UPPER" ),
969 QStringLiteral( "UPPERCASE" ),
970 QStringLiteral( "USAGE" ),
971 QStringLiteral( "USE" ),
972 QStringLiteral( "USER" ),
973 QStringLiteral( "USING" ),
974 QStringLiteral( "UTC_DATE" ),
975 QStringLiteral( "UTC_TIME" ),
976 QStringLiteral( "UTC_TIMESTAMP" ),
977 QStringLiteral( "VALIDATE" ),
978 QStringLiteral( "VALIDPROC" ),
979 QStringLiteral( "VALUE" ),
980 QStringLiteral( "VALUE_OF" ),
981 QStringLiteral( "VALUES" ),
982 QStringLiteral( "VARBINARY" ),
983 QStringLiteral( "VARBYTE" ),
984 QStringLiteral( "VARCHAR" ),
985 QStringLiteral( "VARCHAR2" ),
986 QStringLiteral( "VARCHARACTER" ),
987 QStringLiteral( "VARGRAPHIC" ),
988 QStringLiteral( "VARIABLE" ),
989 QStringLiteral( "VARIADIC" ),
990 QStringLiteral( "VARIANT" ),
991 QStringLiteral( "VAR_POP" ),
992 QStringLiteral( "VAR_SAMP" ),
993 QStringLiteral( "VARYING" ),
994 QStringLiteral( "VCAT" ),
995 QStringLiteral( "VERBOSE" ),
996 QStringLiteral( "VERSIONING" ),
997 QStringLiteral( "VIEW" ),
998 QStringLiteral( "VIRTUAL" ),
999 QStringLiteral( "VOLATILE" ),
1000 QStringLiteral( "VOLUMES" ),
1001 QStringLiteral( "WAIT" ),
1002 QStringLiteral( "WAITFOR" ),
1003 QStringLiteral( "WHEN" ),
1004 QStringLiteral( "WHENEVER" ),
1005 QStringLiteral( "WHERE" ),
1006 QStringLiteral( "WHILE" ),
1007 QStringLiteral( "WIDTH_BUCKET" ),
1008 QStringLiteral( "WINDOW" ),
1009 QStringLiteral( "WITH" ),
1010 QStringLiteral( "WITHIN" ),
1011 QStringLiteral( "WITHIN_GROUP" ),
1012 QStringLiteral( "WITHOUT" ),
1013 QStringLiteral( "WLM" ),
1014 QStringLiteral( "WORK" ),
1015 QStringLiteral( "WRITE" ),
1016 QStringLiteral( "WRITETEXT" ),
1017 QStringLiteral( "XMLCAST" ),
1018 QStringLiteral( "XMLEXISTS" ),
1019 QStringLiteral( "XMLNAMESPACES" ),
1020 QStringLiteral( "XOR" ),
1021 QStringLiteral( "YEAR" ),
1022 QStringLiteral( "YEAR_MONTH" ),
1023 QStringLiteral( "YEARS" ),
1024 QStringLiteral( "ZEROFILL" ),
1025 QStringLiteral( "ZEROIFNULL" ),
1026 QStringLiteral( "ZONE" ),
1027 }
1028 }
1029 };
1030}
1031
1036
1038{
1039 return {};
1040}
1041
1043{
1044 return {};
1045}
1046
1048{
1049 return {};
1050}
1051
1056
1058{
1059 return {};
1060}
1061
1066
1068 const QString &name,
1069 const QgsFields &fields,
1070 Qgis::WkbType wkbType,
1072 bool overwrite,
1073 const QMap<QString, QVariant> *
1074 options ) const
1075{
1076 Q_UNUSED( schema );
1077 Q_UNUSED( name );
1078 Q_UNUSED( fields );
1079 Q_UNUSED( srs );
1080 Q_UNUSED( overwrite );
1081 Q_UNUSED( options );
1082 Q_UNUSED( wkbType );
1083 throw QgsProviderConnectionException( QObject::tr( "Operation 'createVectorTable' is not supported" ) );
1084}
1085
1086void QgsAbstractDatabaseProviderConnection::renameVectorTable( const QString &, const QString &, const QString & ) const
1087{
1088 checkCapability( Capability::RenameVectorTable );
1089}
1090
1091
1097
1098void QgsAbstractDatabaseProviderConnection::renameRasterTable( const QString &, const QString &, const QString & ) const
1099{
1100 checkCapability( Capability::RenameRasterTable );
1101}
1102
1103void QgsAbstractDatabaseProviderConnection::dropVectorTable( const QString &, const QString & ) const
1104{
1105 checkCapability( Capability::DropVectorTable );
1106}
1107
1108bool QgsAbstractDatabaseProviderConnection::tableExists( const QString &schema, const QString &name ) const
1109{
1110 checkCapability( Capability::TableExists );
1111 const QList<QgsAbstractDatabaseProviderConnection::TableProperty> constTables { tables( schema ) };
1112 for ( const auto &t : constTables )
1113 {
1114 if ( t.tableName() == name )
1115 {
1116 return true;
1117 }
1118 }
1119 return false;
1120}
1121
1122
1123QList<QgsLayerMetadataProviderResult> QgsAbstractDatabaseProviderConnection::searchLayerMetadata( const QgsMetadataSearchContext &searchContext, const QString &searchString, const QgsRectangle &geographicExtent, QgsFeedback *feedback ) const
1124{
1125 Q_UNUSED( feedback );
1126 Q_UNUSED( searchContext );
1127 Q_UNUSED( searchString );
1128 Q_UNUSED( geographicExtent );
1129 throw QgsNotSupportedException( QObject::tr( "Provider %1 has no %2 method" ).arg( providerKey(), QStringLiteral( "searchLayerMetadata" ) ) );
1130}
1131
1132void QgsAbstractDatabaseProviderConnection::dropRasterTable( const QString &, const QString & ) const
1133{
1134 checkCapability( Capability::DropRasterTable );
1135}
1136
1138{
1139 checkCapability( Capability::CreateSchema );
1140}
1141
1142void QgsAbstractDatabaseProviderConnection::dropSchema( const QString &, bool ) const
1143{
1144 checkCapability( Capability::DropSchema );
1145}
1146
1147void QgsAbstractDatabaseProviderConnection::renameSchema( const QString &, const QString & ) const
1148{
1149 checkCapability( Capability::RenameSchema );
1150}
1151
1152QList<QList<QVariant>> QgsAbstractDatabaseProviderConnection::executeSql( const QString &sql, QgsFeedback *feedback ) const
1153{
1154 return execSql( sql, feedback ).rows();
1155}
1156
1157
1163
1164
1165void QgsAbstractDatabaseProviderConnection::vacuum( const QString &, const QString & ) const
1166{
1167 checkCapability( Capability::Vacuum );
1168}
1169
1174
1176{
1177 checkCapability( Capability::SqlLayers );
1178 return nullptr;
1179}
1180
1181void QgsAbstractDatabaseProviderConnection::deleteSpatialIndex( const QString &, const QString &, const QString & ) const
1182{
1183 checkCapability( Capability::DeleteSpatialIndex );
1184}
1185
1186bool QgsAbstractDatabaseProviderConnection::spatialIndexExists( const QString &, const QString &, const QString & ) const
1187{
1188 checkCapability( Capability::SpatialIndexExists );
1189 return false;
1190}
1191
1192void QgsAbstractDatabaseProviderConnection::deleteField( const QString &fieldName, const QString &schema, const QString &tableName, bool ) const
1193{
1194 checkCapability( Capability::DeleteField );
1195
1196 QgsVectorLayer::LayerOptions options { false, false };
1197 options.skipCrsValidation = true;
1198 std::unique_ptr<QgsVectorLayer> vl { std::make_unique<QgsVectorLayer>( tableUri( schema, tableName ), QStringLiteral( "temp_layer" ), mProviderKey, options ) };
1199 if ( ! vl->isValid() )
1200 {
1201 throw QgsProviderConnectionException( QObject::tr( "Could not create a vector layer for table '%1' in schema '%2'" )
1202 .arg( tableName, schema ) );
1203 }
1204 if ( vl->fields().lookupField( fieldName ) == -1 )
1205 {
1206 throw QgsProviderConnectionException( QObject::tr( "Could not find field '%1' in table '%2' in schema '%3'" )
1207 .arg( fieldName, tableName, schema ) );
1208
1209 }
1210 if ( ! vl->dataProvider()->deleteAttributes( { vl->fields().lookupField( fieldName ) } ) )
1211 {
1212 throw QgsProviderConnectionException( QObject::tr( "Unknown error deleting field '%1' in table '%2' in schema '%3'" )
1213 .arg( fieldName, tableName, schema ) );
1214 }
1215}
1216
1217void QgsAbstractDatabaseProviderConnection::addField( const QgsField &field, const QString &schema, const QString &tableName ) const
1218{
1219 checkCapability( Capability::AddField );
1220
1221 QgsVectorLayer::LayerOptions options { false, false };
1222 options.skipCrsValidation = true;
1223 std::unique_ptr<QgsVectorLayer> vl( std::make_unique<QgsVectorLayer>( tableUri( schema, tableName ), QStringLiteral( "temp_layer" ), mProviderKey, options ) );
1224 if ( ! vl->isValid() )
1225 {
1226 throw QgsProviderConnectionException( QObject::tr( "Could not create a vector layer for table '%1' in schema '%2'" )
1227 .arg( tableName, schema ) );
1228 }
1229 if ( vl->fields().lookupField( field.name() ) != -1 )
1230 {
1231 throw QgsProviderConnectionException( QObject::tr( "Field '%1' in table '%2' in schema '%3' already exists" )
1232 .arg( field.name(), tableName, schema ) );
1233
1234 }
1235 if ( ! vl->dataProvider()->addAttributes( { field } ) )
1236 {
1237 throw QgsProviderConnectionException( QObject::tr( "Unknown error adding field '%1' in table '%2' in schema '%3'" )
1238 .arg( field.name(), tableName, schema ) );
1239 }
1240}
1241
1242void QgsAbstractDatabaseProviderConnection::renameField( const QString &schema, const QString &tableName, const QString &name, const QString &newName ) const
1243{
1244 checkCapability( Capability::RenameField );
1245
1246 QgsVectorLayer::LayerOptions options { false, false };
1247 options.skipCrsValidation = true;
1248 std::unique_ptr<QgsVectorLayer> vl( std::make_unique<QgsVectorLayer>( tableUri( schema, tableName ), QStringLiteral( "temp_layer" ), mProviderKey, options ) );
1249 if ( ! vl->isValid() )
1250 {
1251 throw QgsProviderConnectionException( QObject::tr( "Could not create a vector layer for table '%1' in schema '%2'" )
1252 .arg( tableName, schema ) );
1253 }
1254 int existingIndex = vl->fields().lookupField( name );
1255 if ( existingIndex == -1 )
1256 {
1257 throw QgsProviderConnectionException( QObject::tr( "Field '%1' in table '%2' in does not exist" )
1258 .arg( name, tableName ) );
1259
1260 }
1261 if ( vl->fields().lookupField( newName ) != -1 )
1262 {
1263 throw QgsProviderConnectionException( QObject::tr( "A field with name '%1' already exists in table '%2'" )
1264 .arg( newName, tableName ) );
1265
1266 }
1267 if ( ! vl->dataProvider()->renameAttributes( {{existingIndex, newName}} ) )
1268 {
1269 throw QgsProviderConnectionException( QObject::tr( "Unknown error renaming field '%1' in table '%2' to '%3'" )
1270 .arg( name, tableName, newName ) );
1271 }
1272}
1273
1274QList<QgsAbstractDatabaseProviderConnection::TableProperty> QgsAbstractDatabaseProviderConnection::tables( const QString &, const QgsAbstractDatabaseProviderConnection::TableFlags &, QgsFeedback * ) const
1275{
1276 checkCapability( Capability::Tables );
1277 return QList<QgsAbstractDatabaseProviderConnection::TableProperty>();
1278}
1279
1280
1282{
1283 checkCapability( Capability::Tables );
1284 const QList<QgsAbstractDatabaseProviderConnection::TableProperty> constTables { tables( schema, TableFlags(), feedback ) };
1285 for ( const auto &t : constTables )
1286 {
1287 if ( t.tableName() == name )
1288 {
1289 return t;
1290 }
1291 }
1292 throw QgsProviderConnectionException( QObject::tr( "Table '%1' was not found in schema '%2'" )
1293 .arg( name, schema ) );
1294}
1295
1296QList<QgsAbstractDatabaseProviderConnection::TableProperty> QgsAbstractDatabaseProviderConnection::tablesInt( const QString &schema, const int flags ) const
1297{
1298 return tables( schema, static_cast<QgsAbstractDatabaseProviderConnection::TableFlags>( flags ) );
1299}
1300
1301
1303{
1304 checkCapability( Capability::Schemas );
1305 return QStringList();
1306}
1307
1309{
1310 return mTableName;
1311}
1312
1314{
1315 mTableName = name;
1316}
1317
1319{
1320 // Do not add the type if it's already present
1322 for ( const auto &t : std::as_const( mGeometryColumnTypes ) )
1323 {
1324 if ( t == toAdd )
1325 {
1326 return;
1327 }
1328 }
1329 mGeometryColumnTypes.push_back( toAdd );
1330}
1331
1332QList<QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType> QgsAbstractDatabaseProviderConnection::TableProperty::geometryColumnTypes() const
1333{
1334 return mGeometryColumnTypes;
1335}
1336
1337
1338QgsFields QgsAbstractDatabaseProviderConnection::fields( const QString &schema, const QString &tableName, QgsFeedback * ) const
1339{
1340 QgsVectorLayer::LayerOptions options { false, true };
1341 options.skipCrsValidation = true;
1342 QgsVectorLayer vl { tableUri( schema, tableName ), QStringLiteral( "temp_layer" ), mProviderKey, options };
1343 if ( vl.isValid() )
1344 {
1345 // Note: this implementation works for providers that do not hide any "special" field (geometry or PKs)
1346 return vl.fields();
1347 }
1348 else
1349 {
1350 throw QgsProviderConnectionException( QObject::tr( "Error retrieving fields information for uri: %1" ).arg( vl.publicSource() ) );
1351 }
1352}
1353
1355{
1356 checkCapability( Capability::ListFieldDomains );
1357 return QStringList();
1358}
1359
1361{
1362 checkCapability( Capability::RetrieveFieldDomain );
1363 return nullptr;
1364}
1365
1366void QgsAbstractDatabaseProviderConnection::setFieldDomainName( const QString &, const QString &, const QString &, const QString & ) const
1367{
1368 checkCapability( Capability::SetFieldDomain );
1369}
1370
1372{
1373 checkCapability( Capability::AddFieldDomain );
1374}
1375
1376void QgsAbstractDatabaseProviderConnection::setFieldAlias( const QString &, const QString &, const QString &, const QString & ) const
1377{
1379}
1380
1381void QgsAbstractDatabaseProviderConnection::setFieldComment( const QString &, const QString &, const QString &, const QString & ) const
1382{
1384}
1385
1386QList< QgsWeakRelation > QgsAbstractDatabaseProviderConnection::relationships( const QString &, const QString & ) const
1387{
1388 checkCapability( Capability::RetrieveRelationships );
1389 return {};
1390}
1391
1396
1401
1406
1408{
1409 QString n = mTableName;
1410 if ( mGeometryColumnCount > 1 ) n += '.' + mGeometryColumn;
1411 return n;
1412}
1413
1415{
1416 TableProperty property;
1417
1418 Q_ASSERT( index >= 0 && index < mGeometryColumnTypes.size() );
1419
1420 property.mGeometryColumnTypes << mGeometryColumnTypes[ index ];
1421 property.mSchema = mSchema;
1422 property.mTableName = mTableName;
1423 property.mGeometryColumn = mGeometryColumn;
1424 property.mPkColumns = mPkColumns;
1425 property.mGeometryColumnCount = mGeometryColumnCount;
1426 property.mFlags = mFlags;
1427 property.mComment = mComment;
1428 property.mInfo = mInfo;
1429 return property;
1430}
1431
1436
1438{
1439 int res = 0;
1440 for ( const TableProperty::GeometryColumnType &ct : std::as_const( mGeometryColumnTypes ) )
1441 {
1442 res = std::max( res, QgsWkbTypes::coordDimensions( ct.wkbType ) );
1443 }
1444 return res;
1445}
1446
1448{
1449 return mSchema == other.mSchema &&
1450 mTableName == other.mTableName &&
1451 mGeometryColumn == other.mGeometryColumn &&
1452 mGeometryColumnCount == other.mGeometryColumnCount &&
1453 mPkColumns == other.mPkColumns &&
1454 mFlags == other.mFlags &&
1455 mComment == other.mComment &&
1456 mInfo == other.mInfo;
1457}
1458
1459
1460void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumnTypes( const QList<QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType> &columnTypes )
1461{
1462 mGeometryColumnTypes = columnTypes;
1463}
1464
1465
1467{
1468 return mGeometryColumnCount;
1469}
1470
1472{
1473 mGeometryColumnCount = geometryColumnCount;
1474}
1475
1477{
1478 return mInfo;
1479}
1480
1482{
1483 mInfo = info;
1484}
1485
1487{
1488 return mComment;
1489}
1490
1492{
1493 mComment = comment;
1494}
1495
1500
1505
1506QList<QgsCoordinateReferenceSystem> QgsAbstractDatabaseProviderConnection::TableProperty::crsList() const
1507{
1508 QList<QgsCoordinateReferenceSystem> crss;
1509 for ( const auto &t : std::as_const( mGeometryColumnTypes ) )
1510 {
1511 crss.push_back( t.crs );
1512 }
1513 return crss;
1514}
1515
1517{
1518 return mPkColumns;
1519}
1520
1522{
1523 mPkColumns = pkColumns;
1524}
1525
1527{
1528 return mGeometryColumn;
1529}
1530
1532{
1533 mGeometryColumn = geometryColumn;
1534}
1535
1537{
1538 return mSchema;
1539}
1540
1542{
1543 mSchema = schema;
1544}
1545
1546
1548
1550{
1551 return mColumns;
1552}
1553
1555{
1556
1557 QList<QList<QVariant> > rows;
1558
1559 while ( mResultIterator &&
1560 mResultIterator->hasNextRow() &&
1561 ( ! feedback || ! feedback->isCanceled() ) )
1562 {
1563 const QVariantList row( mResultIterator->nextRow() );
1564 if ( row.isEmpty() )
1565 {
1566 break;
1567 }
1568 else
1569 {
1570 rows.push_back( row );
1571 }
1572 }
1573 return rows;
1574}
1575
1577{
1578 if ( ! mResultIterator )
1579 {
1580 return QList<QVariant>();
1581 }
1582 return mResultIterator->nextRow();
1583}
1584
1585
1587{
1588 if ( ! mResultIterator )
1589 {
1590 return 0;
1591 }
1592 return mResultIterator->fetchedRowCount();
1593}
1594
1596{
1597 if ( ! mResultIterator )
1598 {
1599 return static_cast<long long>( Qgis::FeatureCountState::UnknownCount );
1600 }
1601 return mResultIterator->rowCount();
1602}
1603
1604
1606{
1607 if ( ! mResultIterator )
1608 {
1609 return false;
1610 }
1611 return mResultIterator->hasNextRow();
1612}
1613
1614void QgsAbstractDatabaseProviderConnection::QueryResult::appendColumn( const QString &columnName )
1615{
1616 mColumns.push_back( columnName );
1617}
1618
1619
1620QgsAbstractDatabaseProviderConnection::QueryResult::QueryResult( std::shared_ptr<QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator> iterator )
1621 : mResultIterator( iterator )
1622{}
1623
1624double QgsAbstractDatabaseProviderConnection::QueryResult::queryExecutionTime() const
1625{
1626 return mQueryExecutionTime;
1627}
1628
1629void QgsAbstractDatabaseProviderConnection::QueryResult::setQueryExecutionTime( double queryExecutionTime )
1630{
1631 mQueryExecutionTime = queryExecutionTime;
1632}
1633
1634
1635QVariantList QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::nextRow()
1636{
1637 QMutexLocker lock( &mMutex );
1638 const QVariantList row = nextRowPrivate();
1639 if ( ! row.isEmpty() )
1640 {
1641 mFetchedRowCount++;
1642 }
1643 return row;
1644}
1645
1646bool QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::hasNextRow() const
1647{
1648 QMutexLocker lock( &mMutex );
1649 return hasNextRowPrivate();
1650}
1651
1652long long QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::fetchedRowCount()
1653{
1654 QMutexLocker lock( &mMutex );
1655 return mFetchedRowCount;
1656}
1657
1658long long QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::rowCount()
1659{
1660 QMutexLocker lock( &mMutex );
1661 return rowCountPrivate();
1662}
1663
1665
DatabaseProviderConnectionCapability2
The Capability enum represents the extended operations supported by the connection.
Definition qgis.h:5018
@ SetFieldComment
Can set comments for fields via setFieldComment()
@ SetFieldAlias
Can set aliases for fields via setFieldAlias()
@ Constant
SQL constant.
QFlags< RelationshipCapability > RelationshipCapabilities
Relationship capabilities.
Definition qgis.h:4146
QFlags< DatabaseProviderConnectionCapability2 > DatabaseProviderConnectionCapabilities2
Definition qgis.h:5023
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition qgis.h:256
QFlags< SqlLayerDefinitionCapability > SqlLayerDefinitionCapabilities
SQL layer definition capabilities.
Definition qgis.h:1030
virtual void setFieldComment(const QString &fieldName, const QString &schema, const QString &tableName, const QString &comment) const
Sets the comment for the existing field with the specified name.
virtual QList< QgsWeakRelation > relationships(const QString &schema=QString(), const QString &tableName=QString()) const
Returns a list of relationships detected in the database.
virtual void createVectorTable(const QString &schema, const QString &name, const QgsFields &fields, Qgis::WkbType wkbType, const QgsCoordinateReferenceSystem &srs, bool overwrite, const QMap< QString, QVariant > *options) const
Creates an empty table with name in the given schema (schema is ignored if not supported by the backe...
virtual QgsVectorLayer * createSqlVectorLayer(const SqlVectorLayerOptions &options) const
Creates and returns a (possibly invalid) vector layer based on the sql statement and optional options...
virtual bool tableExists(const QString &schema, const QString &name) const
Checks whether a table name exists in the given schema.
QList< QgsAbstractDatabaseProviderConnection::TableProperty > tablesInt(const QString &schema=QString(), const int flags=0) const
Returns information on the tables in the given schema.
virtual void updateRelationship(const QgsWeakRelation &relationship) const
Updates an existing relationship in the database.
virtual void renameField(const QString &schema, const QString &tableName, const QString &name, const QString &newName) const
Renames an existing field.
virtual void dropSchema(const QString &name, bool force=false) const
Drops an entire schema with the specified name.
Qgis::SqlLayerDefinitionCapabilities mSqlLayerDefinitionCapabilities
virtual void addField(const QgsField &field, const QString &schema, const QString &tableName) const
Adds a field.
virtual QList< QgsAbstractDatabaseProviderConnection::TableProperty > tables(const QString &schema=QString(), const QgsAbstractDatabaseProviderConnection::TableFlags &flags=QgsAbstractDatabaseProviderConnection::TableFlags(), QgsFeedback *feedback=nullptr) const
Returns information on the tables in the given schema.
Qgis::DatabaseProviderConnectionCapabilities2 mCapabilities2
virtual void vacuum(const QString &schema, const QString &name) const
Vacuum the database table with given schema and name (schema is ignored if not supported by the backe...
virtual QList< Qgis::FieldDomainType > supportedFieldDomainTypes() const
Returns a list of field domain types which are supported by the provider.
virtual void renameVectorTable(const QString &schema, const QString &name, const QString &newName) const
Renames a vector or aspatial table with given schema (schema is ignored if not supported by the backe...
QString providerKey() const
Returns the provider key.
virtual void createSchema(const QString &name) const
Creates a new schema with the specified name.
virtual void deleteSpatialIndex(const QString &schema, const QString &name, const QString &geometryColumn) const
Deletes the existing spatial index for the database table with given schema, name and geometryColumn ...
virtual void dropRasterTable(const QString &schema, const QString &name) const
Drops a raster table with given schema (schema is ignored if not supported by the backend) and name.
Qgis::DatabaseProviderConnectionCapabilities2 capabilities2() const
Returns extended connection capabilities.
virtual QueryResult execSql(const QString &sql, QgsFeedback *feedback=nullptr) const
Executes raw sql and returns the (possibly empty) query results, optionally feedback can be provided.
virtual QgsProviderSqlQueryBuilder * queryBuilder() const
Returns a SQL query builder for the connection, which provides an interface for provider-specific cre...
virtual void setFieldDomainName(const QString &fieldName, const QString &schema, const QString &tableName, const QString &domainName) const
Sets the field domain name for the existing field with the specified name.
virtual void deleteField(const QString &fieldName, const QString &schema, const QString &tableName, bool force=false) const
Deletes the field with the specified name.
virtual QString tableUri(const QString &schema, const QString &name) const
Returns the URI string for the given table and schema.
QFlags< GeometryColumnCapability > GeometryColumnCapabilities
virtual void deleteRelationship(const QgsWeakRelation &relationship) const
Deletes an existing relationship in the database.
Capability
The Capability enum represents the operations supported by the connection.
@ RetrieveFieldDomain
Can retrieve field domain details from provider via fieldDomain()
@ CreateSpatialIndex
The connection can create spatial indices.
@ AddRelationship
Can add new relationships to the database via addRelationship()
@ SqlLayers
Can create vector layers from SQL SELECT queries.
@ DropVectorTable
Can DROP a vector (or aspatial) table/layer.
@ DeleteSpatialIndex
The connection can delete spatial indices for tables.
@ RetrieveRelationships
Can retrieve relationships from the database.
@ SetFieldDomain
Can set the domain for an existing field via setFieldDomainName()
@ AddFieldDomain
Can add new field domains to the database via addFieldDomain()
@ DeleteRelationship
Can delete existing relationships from the database via deleteRelationship()
@ RenameVectorTable
Can RENAME a vector (or aspatial) table/layer.
@ RenameField
Can rename existing fields via renameField()
@ ExecuteSql
Can execute raw SQL queries (without returning results)
@ UpdateRelationship
Can update existing relationships in the database via updateRelationship()
@ SpatialIndexExists
The connection can determine if a spatial index exists.
@ ListFieldDomains
Can return a list of field domain names via fieldDomainNames()
@ Schemas
Can list schemas (if not set, the connection does not support schemas)
virtual void createSpatialIndex(const QString &schema, const QString &name, const QgsAbstractDatabaseProviderConnection::SpatialIndexOptions &options=QgsAbstractDatabaseProviderConnection::SpatialIndexOptions()) const
Creates a spatial index for the database table with given schema and name (schema is ignored if not s...
virtual QStringList relatedTableTypes() const
Returns a list of the related table types supported by the database format.
virtual GeometryColumnCapabilities geometryColumnCapabilities()
Returns connection geometry column capabilities (Z, M, SinglePart, Curves).
virtual Qgis::SqlLayerDefinitionCapabilities sqlLayerDefinitionCapabilities()
Returns SQL layer definition capabilities (Filters, GeometryColumn, PrimaryKeys).
virtual void renameRasterTable(const QString &schema, const QString &name, const QString &newName) const
Renames a raster table with given schema (schema is ignored if not supported by the backend) and name...
virtual void dropVectorTable(const QString &schema, const QString &name) const
Drops a vector (or aspatial) table with given schema (schema is ignored if not supported by the backe...
virtual QStringList fieldDomainNames() const
Returns a list of field domain names present on the provider.
virtual void setFieldAlias(const QString &fieldName, const QString &schema, const QString &tableName, const QString &alias) const
Sets the alias for the existing field with the specified name.
virtual void renameSchema(const QString &name, const QString &newName) const
Renames a schema with the specified name.
virtual void addFieldDomain(const QgsFieldDomain &domain, const QString &schema) const
Adds a new field domain to the database.
virtual QList< QList< QVariant > > executeSql(const QString &sql, QgsFeedback *feedback=nullptr) const
Executes raw sql and returns the (possibly empty) list of results in a multi-dimensional array,...
virtual bool spatialIndexExists(const QString &schema, const QString &name, const QString &geometryColumn) const
Determines whether a spatial index exists for the database table with given schema,...
virtual QgsAbstractDatabaseProviderConnection::TableProperty table(const QString &schema, const QString &table, QgsFeedback *feedback=nullptr) const
Returns information on a table in the given schema.
virtual QMultiMap< Qgis::SqlKeywordCategory, QStringList > sqlDictionary()
Returns a dictionary of SQL keywords supported by the provider.
virtual Qgis::RelationshipCapabilities supportedRelationshipCapabilities() const
Returns the relationship capabilities supported by the provider.
virtual SqlVectorLayerOptions sqlOptions(const QString &layerSource)
Returns the SQL layer options from a layerSource.
virtual QSet< QString > illegalFieldNames() const
Returns a list of field names which are considered illegal by the connection and should not be used w...
virtual QStringList schemas() const
Returns information about the existing schemas.
virtual QList< Qgis::RelationshipCardinality > supportedRelationshipCardinalities() const
Returns a list of relationship cardinalities which are supported by the provider.
virtual QList< Qgis::RelationshipStrength > supportedRelationshipStrengths() const
Returns a list of relationship strengths which are supported by the provider.
virtual QList< QgsLayerMetadataProviderResult > searchLayerMetadata(const QgsMetadataSearchContext &searchContext, const QString &searchString=QString(), const QgsRectangle &geographicExtent=QgsRectangle(), QgsFeedback *feedback=nullptr) const
Search the stored layer metadata in the connection, optionally limiting the search to the metadata id...
virtual void addRelationship(const QgsWeakRelation &relationship) const
Adds a new field relationship to the database.
virtual QgsFieldDomain * fieldDomain(const QString &name) const
Returns the field domain with the specified name from the provider.
QgsAbstractDatabaseProviderConnection(const QString &name)
Creates a new connection with name by reading its configuration from the settings.
Capabilities capabilities() const
Returns connection capabilities.
virtual QgsFields fields(const QString &schema, const QString &table, QgsFeedback *feedback=nullptr) const
Returns the fields of a table and schema.
The QgsAbstractProviderConnection provides an interface for data provider connections.
This class represents a coordinate reference system (CRS).
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition qgsfeedback.h:44
bool isCanceled() const
Tells whether the operation has been canceled already.
Definition qgsfeedback.h:53
Base class for field domains.
Encapsulate a field in an attribute table or data source.
Definition qgsfield.h:53
QString name
Definition qgsfield.h:62
Container of fields for a vector layer.
Definition qgsfields.h:46
Custom exception class which is raised when an operation is not supported.
Custom exception class for provider connection related exceptions.
Provides an interface for provider-specific creation of SQL queries.
A rectangle specified with double values.
Represents a vector layer which manages a vector based data sets.
The QgsWeakRelation class represent a QgsRelation with possibly unresolved layers or unmatched fields...
static int coordDimensions(Qgis::WkbType type)
Returns the coordinate dimension of the geometry type as an integer.
@ UnknownCount
Provider returned an unknown feature count.
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
Definition qgis.h:6149
const QgsCoordinateReferenceSystem & crs
The QueryResult class represents the result of a query executed by execSql()
QList< QList< QVariant > > rows(QgsFeedback *feedback=nullptr)
Returns the result rows by calling the iterator internally and fetching all the rows,...
long long fetchedRowCount() const
Returns the number of fetched rows.
bool hasNextRow() const
Returns true if there are more rows to fetch.
QList< QVariant > nextRow() const
Returns the next result row or an empty row if there are no rows left.
long long rowCount() const
Returns the number of rows returned by a SELECT query or Qgis::FeatureCountState::UnknownCount if unk...
QStringList columns() const
Returns the column names.
The SpatialIndexOptions contains extra options relating to spatial index creation.
The SqlVectorLayerOptions stores all information required to create a SQL (query) layer.
The GeometryColumnType struct represents the combination of geometry type and CRS for the table geome...
The TableProperty class represents a database table or view.
void setTableName(const QString &name)
Sets the table name to name.
bool operator==(const QgsAbstractDatabaseProviderConnection::TableProperty &other) const
void setPrimaryKeyColumns(const QStringList &primaryKeyColumns)
Sets the primary key column names to primaryKeyColumns.
QString defaultName() const
Returns the default name for the table entry.
QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > geometryColumnTypes() const
Returns the list of geometry column types and CRSs.
void setGeometryColumn(const QString &geometryColumn)
Sets the geometry column name to geometryColumn.
TableProperty at(int index) const
Returns the table property corresponding to the geometry type at the given index.
int maxCoordinateDimensions() const
Returns the maximum coordinate dimensions of the geometries of a vector table.
int geometryColumnCount() const
Returns the number of geometry columns in the original table this entry refers to.
QList< QgsCoordinateReferenceSystem > crsList() const
Returns the list of CRSs supported by the geometry column.
QVariantMap info() const
Returns additional information about the table.
void setInfo(const QVariantMap &info)
Sets additional information about the table to info.
QStringList primaryKeyColumns() const
Returns the list of primary key column names.
void setGeometryColumnTypes(const QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > &geometryColumnTypes)
Sets the geometry column types to geometryColumnTypes.
QString schema() const
Returns the schema or an empty string for backends that do not support a schema.
void setGeometryColumnCount(int geometryColumnCount)
Sets the geometryColumnCount.
void addGeometryColumnType(Qgis::WkbType type, const QgsCoordinateReferenceSystem &crs)
Appends the geometry column type with the given srid to the geometry column types list.
Setting options for loading vector layers.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.