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