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