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