QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
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 mIllegalFieldNames;
1021}
1022
1024{
1025 return {};
1026}
1027
1029{
1030 return {};
1031}
1032
1034{
1035 return {};
1036}
1037
1039{
1040 return Qgis::RelationshipCapabilities();
1041}
1042
1044{
1045 return {};
1046}
1047
1049{
1050 return new QgsProviderSqlQueryBuilder();
1051}
1052
1054 const QString &name,
1055 const QgsFields &fields,
1056 Qgis::WkbType wkbType,
1058 bool overwrite,
1059 const QMap<QString, QVariant> *
1060 options ) const
1061{
1062 Q_UNUSED( schema );
1063 Q_UNUSED( name );
1064 Q_UNUSED( fields );
1065 Q_UNUSED( srs );
1066 Q_UNUSED( overwrite );
1067 Q_UNUSED( options );
1068 Q_UNUSED( wkbType );
1069 throw QgsProviderConnectionException( QObject::tr( "Operation 'createVectorTable' is not supported" ) );
1070}
1071
1072void QgsAbstractDatabaseProviderConnection::renameVectorTable( const QString &, const QString &, const QString & ) const
1073{
1074 checkCapability( Capability::RenameVectorTable );
1075}
1076
1077
1079{
1080 checkCapability( Capability::SqlLayers );
1081 return SqlVectorLayerOptions();
1082}
1083
1084void QgsAbstractDatabaseProviderConnection::renameRasterTable( const QString &, const QString &, const QString & ) const
1085{
1086 checkCapability( Capability::RenameRasterTable );
1087}
1088
1089void QgsAbstractDatabaseProviderConnection::dropVectorTable( const QString &, const QString & ) const
1090{
1091 checkCapability( Capability::DropVectorTable );
1092}
1093
1094bool QgsAbstractDatabaseProviderConnection::tableExists( const QString &schema, const QString &name ) const
1095{
1096 checkCapability( Capability::TableExists );
1097 const QList<QgsAbstractDatabaseProviderConnection::TableProperty> constTables { tables( schema ) };
1098 for ( const auto &t : constTables )
1099 {
1100 if ( t.tableName() == name )
1101 {
1102 return true;
1103 }
1104 }
1105 return false;
1106}
1107
1108
1109QList<QgsLayerMetadataProviderResult> QgsAbstractDatabaseProviderConnection::searchLayerMetadata( const QgsMetadataSearchContext &searchContext, const QString &searchString, const QgsRectangle &geographicExtent, QgsFeedback *feedback ) const
1110{
1111 Q_UNUSED( feedback );
1112 Q_UNUSED( searchContext );
1113 Q_UNUSED( searchString );
1114 Q_UNUSED( geographicExtent );
1115 throw QgsNotSupportedException( QObject::tr( "Provider %1 has no %2 method" ).arg( providerKey(), QStringLiteral( "searchLayerMetadata" ) ) );
1116}
1117
1118void QgsAbstractDatabaseProviderConnection::dropRasterTable( const QString &, const QString & ) const
1119{
1120 checkCapability( Capability::DropRasterTable );
1121}
1122
1124{
1125 checkCapability( Capability::CreateSchema );
1126}
1127
1128void QgsAbstractDatabaseProviderConnection::dropSchema( const QString &, bool ) const
1129{
1130 checkCapability( Capability::DropSchema );
1131}
1132
1133void QgsAbstractDatabaseProviderConnection::renameSchema( const QString &, const QString & ) const
1134{
1135 checkCapability( Capability::RenameSchema );
1136}
1137
1138QList<QList<QVariant>> QgsAbstractDatabaseProviderConnection::executeSql( const QString &sql, QgsFeedback *feedback ) const
1139{
1140 return execSql( sql, feedback ).rows();
1141}
1142
1143
1145{
1146 checkCapability( Capability::ExecuteSql );
1147 return QueryResult();
1148}
1149
1150
1151void QgsAbstractDatabaseProviderConnection::vacuum( const QString &, const QString & ) const
1152{
1153 checkCapability( Capability::Vacuum );
1154}
1155
1157{
1158 checkCapability( Capability::CreateSpatialIndex );
1159}
1160
1162{
1163 checkCapability( Capability::SqlLayers );
1164 return nullptr;
1165}
1166
1167void QgsAbstractDatabaseProviderConnection::deleteSpatialIndex( const QString &, const QString &, const QString & ) const
1168{
1169 checkCapability( Capability::DeleteSpatialIndex );
1170}
1171
1172bool QgsAbstractDatabaseProviderConnection::spatialIndexExists( const QString &, const QString &, const QString & ) const
1173{
1174 checkCapability( Capability::SpatialIndexExists );
1175 return false;
1176}
1177
1178void QgsAbstractDatabaseProviderConnection::deleteField( const QString &fieldName, const QString &schema, const QString &tableName, bool ) const
1179{
1180 checkCapability( Capability::DeleteField );
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( fieldName ) == -1 )
1191 {
1192 throw QgsProviderConnectionException( QObject::tr( "Could not find field '%1' in table '%2' in schema '%3'" )
1193 .arg( fieldName, tableName, schema ) );
1194
1195 }
1196 if ( ! vl->dataProvider()->deleteAttributes( { vl->fields().lookupField( fieldName ) } ) )
1197 {
1198 throw QgsProviderConnectionException( QObject::tr( "Unknown error deleting field '%1' in table '%2' in schema '%3'" )
1199 .arg( fieldName, tableName, schema ) );
1200 }
1201}
1202
1203void QgsAbstractDatabaseProviderConnection::addField( const QgsField &field, const QString &schema, const QString &tableName ) const
1204{
1205 checkCapability( Capability::AddField );
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 if ( vl->fields().lookupField( field.name() ) != -1 )
1216 {
1217 throw QgsProviderConnectionException( QObject::tr( "Field '%1' in table '%2' in schema '%3' already exists" )
1218 .arg( field.name(), tableName, schema ) );
1219
1220 }
1221 if ( ! vl->dataProvider()->addAttributes( { field } ) )
1222 {
1223 throw QgsProviderConnectionException( QObject::tr( "Unknown error adding field '%1' in table '%2' in schema '%3'" )
1224 .arg( field.name(), tableName, schema ) );
1225 }
1226}
1227
1228void QgsAbstractDatabaseProviderConnection::renameField( const QString &schema, const QString &tableName, const QString &name, const QString &newName ) const
1229{
1230 checkCapability( Capability::RenameField );
1231
1232 QgsVectorLayer::LayerOptions options { false, false };
1233 options.skipCrsValidation = true;
1234 std::unique_ptr<QgsVectorLayer> vl( std::make_unique<QgsVectorLayer>( tableUri( schema, tableName ), QStringLiteral( "temp_layer" ), mProviderKey, options ) );
1235 if ( ! vl->isValid() )
1236 {
1237 throw QgsProviderConnectionException( QObject::tr( "Could not create a vector layer for table '%1' in schema '%2'" )
1238 .arg( tableName, schema ) );
1239 }
1240 int existingIndex = vl->fields().lookupField( name );
1241 if ( existingIndex == -1 )
1242 {
1243 throw QgsProviderConnectionException( QObject::tr( "Field '%1' in table '%2' in does not exist" )
1244 .arg( name, tableName ) );
1245
1246 }
1247 if ( vl->fields().lookupField( newName ) != -1 )
1248 {
1249 throw QgsProviderConnectionException( QObject::tr( "A field with name '%1' already exists in table '%2'" )
1250 .arg( newName, tableName ) );
1251
1252 }
1253 if ( ! vl->dataProvider()->renameAttributes( {{existingIndex, newName}} ) )
1254 {
1255 throw QgsProviderConnectionException( QObject::tr( "Unknown error renaming field '%1' in table '%2' to '%3'" )
1256 .arg( name, tableName, newName ) );
1257 }
1258}
1259
1260QList<QgsAbstractDatabaseProviderConnection::TableProperty> QgsAbstractDatabaseProviderConnection::tables( const QString &, const QgsAbstractDatabaseProviderConnection::TableFlags & ) const
1261{
1262 checkCapability( Capability::Tables );
1263 return QList<QgsAbstractDatabaseProviderConnection::TableProperty>();
1264}
1265
1266
1268{
1269 checkCapability( Capability::Tables );
1270 const QList<QgsAbstractDatabaseProviderConnection::TableProperty> constTables { tables( schema ) };
1271 for ( const auto &t : constTables )
1272 {
1273 if ( t.tableName() == name )
1274 {
1275 return t;
1276 }
1277 }
1278 throw QgsProviderConnectionException( QObject::tr( "Table '%1' was not found in schema '%2'" )
1279 .arg( name, schema ) );
1280}
1281
1282QList<QgsAbstractDatabaseProviderConnection::TableProperty> QgsAbstractDatabaseProviderConnection::tablesInt( const QString &schema, const int flags ) const
1283{
1284 return tables( schema, static_cast<QgsAbstractDatabaseProviderConnection::TableFlags>( flags ) );
1285}
1286
1287
1289{
1290 checkCapability( Capability::Schemas );
1291 return QStringList();
1292}
1293
1295{
1296 return mTableName;
1297}
1298
1300{
1301 mTableName = name;
1302}
1303
1305{
1306 // Do not add the type if it's already present
1308 for ( const auto &t : std::as_const( mGeometryColumnTypes ) )
1309 {
1310 if ( t == toAdd )
1311 {
1312 return;
1313 }
1314 }
1315 mGeometryColumnTypes.push_back( toAdd );
1316}
1317
1318QList<QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType> QgsAbstractDatabaseProviderConnection::TableProperty::geometryColumnTypes() const
1319{
1320 return mGeometryColumnTypes;
1321}
1322
1323
1324QgsFields QgsAbstractDatabaseProviderConnection::fields( const QString &schema, const QString &tableName ) const
1325{
1326 QgsVectorLayer::LayerOptions options { false, true };
1327 options.skipCrsValidation = true;
1328 QgsVectorLayer vl { tableUri( schema, tableName ), QStringLiteral( "temp_layer" ), mProviderKey, options };
1329 if ( vl.isValid() )
1330 {
1331 // Note: this implementation works for providers that do not hide any "special" field (geometry or PKs)
1332 return vl.fields();
1333 }
1334 else
1335 {
1336 throw QgsProviderConnectionException( QObject::tr( "Error retrieving fields information for uri: %1" ).arg( vl.publicSource() ) );
1337 }
1338}
1339
1341{
1342 checkCapability( Capability::ListFieldDomains );
1343 return QStringList();
1344}
1345
1347{
1348 checkCapability( Capability::RetrieveFieldDomain );
1349 return nullptr;
1350}
1351
1352void QgsAbstractDatabaseProviderConnection::setFieldDomainName( const QString &, const QString &, const QString &, const QString & ) const
1353{
1354 checkCapability( Capability::SetFieldDomain );
1355}
1356
1358{
1359 checkCapability( Capability::AddFieldDomain );
1360}
1361
1362QList< QgsWeakRelation > QgsAbstractDatabaseProviderConnection::relationships( const QString &, const QString & ) const
1363{
1364 checkCapability( Capability::RetrieveRelationships );
1365 return {};
1366}
1367
1369{
1370 checkCapability( Capability::AddRelationship );
1371}
1372
1374{
1375 checkCapability( Capability::UpdateRelationship );
1376}
1377
1379{
1380 checkCapability( Capability::DeleteRelationship );
1381}
1382
1384{
1385 QString n = mTableName;
1386 if ( mGeometryColumnCount > 1 ) n += '.' + mGeometryColumn;
1387 return n;
1388}
1389
1391{
1392 TableProperty property;
1393
1394 Q_ASSERT( index >= 0 && index < mGeometryColumnTypes.size() );
1395
1396 property.mGeometryColumnTypes << mGeometryColumnTypes[ index ];
1397 property.mSchema = mSchema;
1398 property.mTableName = mTableName;
1399 property.mGeometryColumn = mGeometryColumn;
1400 property.mPkColumns = mPkColumns;
1401 property.mGeometryColumnCount = mGeometryColumnCount;
1402 property.mFlags = mFlags;
1403 property.mComment = mComment;
1404 property.mInfo = mInfo;
1405 return property;
1406}
1407
1409{
1410 mFlags.setFlag( flag );
1411}
1412
1414{
1415 int res = 0;
1416 for ( const TableProperty::GeometryColumnType &ct : std::as_const( mGeometryColumnTypes ) )
1417 {
1418 res = std::max( res, QgsWkbTypes::coordDimensions( ct.wkbType ) );
1419 }
1420 return res;
1421}
1422
1424{
1425 return mSchema == other.mSchema &&
1426 mTableName == other.mTableName &&
1427 mGeometryColumn == other.mGeometryColumn &&
1428 mGeometryColumnCount == other.mGeometryColumnCount &&
1429 mPkColumns == other.mPkColumns &&
1430 mFlags == other.mFlags &&
1431 mComment == other.mComment &&
1432 mInfo == other.mInfo;
1433}
1434
1435
1436void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumnTypes( const QList<QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType> &columnTypes )
1437{
1438 mGeometryColumnTypes = columnTypes;
1439}
1440
1441
1443{
1444 return mGeometryColumnCount;
1445}
1446
1448{
1449 mGeometryColumnCount = geometryColumnCount;
1450}
1451
1453{
1454 return mInfo;
1455}
1456
1458{
1459 mInfo = info;
1460}
1461
1463{
1464 return mComment;
1465}
1466
1468{
1469 mComment = comment;
1470}
1471
1472QgsAbstractDatabaseProviderConnection::TableFlags QgsAbstractDatabaseProviderConnection::TableProperty::flags() const
1473{
1474 return mFlags;
1475}
1476
1477void QgsAbstractDatabaseProviderConnection::TableProperty::setFlags( const QgsAbstractDatabaseProviderConnection::TableFlags &flags )
1478{
1479 mFlags = flags;
1480}
1481
1482QList<QgsCoordinateReferenceSystem> QgsAbstractDatabaseProviderConnection::TableProperty::crsList() const
1483{
1484 QList<QgsCoordinateReferenceSystem> crss;
1485 for ( const auto &t : std::as_const( mGeometryColumnTypes ) )
1486 {
1487 crss.push_back( t.crs );
1488 }
1489 return crss;
1490}
1491
1493{
1494 return mPkColumns;
1495}
1496
1498{
1499 mPkColumns = pkColumns;
1500}
1501
1503{
1504 return mGeometryColumn;
1505}
1506
1508{
1509 mGeometryColumn = geometryColumn;
1510}
1511
1513{
1514 return mSchema;
1515}
1516
1518{
1519 mSchema = schema;
1520}
1521
1522
1524
1526{
1527 return mColumns;
1528}
1529
1531{
1532
1533 QList<QList<QVariant> > rows;
1534
1535 while ( mResultIterator &&
1536 mResultIterator->hasNextRow() &&
1537 ( ! feedback || ! feedback->isCanceled() ) )
1538 {
1539 const QVariantList row( mResultIterator->nextRow() );
1540 if ( row.isEmpty() )
1541 {
1542 break;
1543 }
1544 else
1545 {
1546 rows.push_back( row );
1547 }
1548 }
1549 return rows;
1550}
1551
1553{
1554 if ( ! mResultIterator )
1555 {
1556 return QList<QVariant>();
1557 }
1558 return mResultIterator->nextRow();
1559}
1560
1561
1563{
1564 if ( ! mResultIterator )
1565 {
1566 return 0;
1567 }
1568 return mResultIterator->fetchedRowCount();
1569}
1570
1572{
1573 if ( ! mResultIterator )
1574 {
1575 return static_cast<long long>( Qgis::FeatureCountState::UnknownCount );
1576 }
1577 return mResultIterator->rowCount();
1578}
1579
1580
1582{
1583 if ( ! mResultIterator )
1584 {
1585 return false;
1586 }
1587 return mResultIterator->hasNextRow();
1588}
1589
1590void QgsAbstractDatabaseProviderConnection::QueryResult::appendColumn( const QString &columnName )
1591{
1592 mColumns.push_back( columnName );
1593}
1594
1595
1596QgsAbstractDatabaseProviderConnection::QueryResult::QueryResult( std::shared_ptr<QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator> iterator )
1597 : mResultIterator( iterator )
1598{}
1599
1600double QgsAbstractDatabaseProviderConnection::QueryResult::queryExecutionTime() const
1601{
1602 return mQueryExecutionTime;
1603}
1604
1605void QgsAbstractDatabaseProviderConnection::QueryResult::setQueryExecutionTime( double queryExecutionTime )
1606{
1607 mQueryExecutionTime = queryExecutionTime;
1608}
1609
1610
1611QVariantList QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::nextRow()
1612{
1613 QMutexLocker lock( &mMutex );
1614 const QVariantList row = nextRowPrivate();
1615 if ( ! row.isEmpty() )
1616 {
1617 mFetchedRowCount++;
1618 }
1619 return row;
1620}
1621
1622bool QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::hasNextRow() const
1623{
1624 QMutexLocker lock( &mMutex );
1625 return hasNextRowPrivate();
1626}
1627
1628long long QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::fetchedRowCount()
1629{
1630 QMutexLocker lock( &mMutex );
1631 return mFetchedRowCount;
1632}
1633
1634long long QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::rowCount()
1635{
1636 QMutexLocker lock( &mMutex );
1637 return rowCountPrivate();
1638}
1639
1641
@ Constant
SQL constant.
WkbType
The WKB type describes the number of dimensions a geometry has.
Definition: qgis.h:155
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 void deleteRelationship(const QgsWeakRelation &relationship) const SIP_THROW(QgsProviderConnectionException)
Deletes an existing relationship in the database.
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 void addRelationship(const QgsWeakRelation &relationship) const SIP_THROW(QgsProviderConnectionException)
Adds a new field relationship to the database.
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 updateRelationship(const QgsWeakRelation &relationship) const SIP_THROW(QgsProviderConnectionException)
Updates an existing relationship in the database.
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 QStringList relatedTableTypes() const
Returns a list of the related table types supported by the database format.
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 Qgis::RelationshipCapabilities supportedRelationshipCapabilities() const
Returns the relationship capabilities supported by the provider.
virtual QSet< QString > illegalFieldNames() const
Returns a list of field names which are considered illegal by the connection and should not be used w...
virtual QList< Qgis::RelationshipCardinality > supportedRelationshipCardinalities() const
Returns a list of relationship cardinalities which are 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 QList< Qgis::RelationshipStrength > supportedRelationshipStrengths() const
Returns a list of relationship strengths which are supported by the provider.
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 createVectorTable(const QString &schema, const QString &name, const QgsFields &fields, Qgis::WkbType 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 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:52
QString name
Definition: qgsfield.h:61
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.
The QgsWeakRelation class represent a QgsRelation with possibly unresolved layers or unmatched fields...
static int coordDimensions(Qgis::WkbType type) SIP_HOLDGIL
Returns the coordinate dimension of the geometry type as an integer.
Definition: qgswkbtypes.h:852
@ UnknownCount
Provider returned an unknown feature count.
const QgsField & field
Definition: qgsfield.h:501
const QgsCoordinateReferenceSystem & crs
The QueryResult class represents the result of a query executed by execSql()
QList< QList< QVariant > > rows(QgsFeedback *feedback=nullptr)
Returns the result rows by calling the iterator internally and fetching all the rows,...
long long fetchedRowCount() const
Returns the number of fetched rows.
bool hasNextRow() const
Returns true if there are more rows to fetch.
QList< QVariant > nextRow() const
Returns the next result row or an empty row if there are no rows left.
long long rowCount() const
Returns the number of rows returned by a SELECT query or Qgis::FeatureCountState::UnknownCount if unk...
QStringList columns() const
Returns the column names.
The SpatialIndexOptions contains extra options relating to spatial index creation.
The SqlVectorLayerOptions stores all information required to create a SQL (query) layer.
The GeometryColumnType struct represents the combination of geometry type and CRS for the table geome...
The TableProperty class represents a database table or view.
void setTableName(const QString &name)
Sets the table name to name.
bool operator==(const QgsAbstractDatabaseProviderConnection::TableProperty &other) const
void setPrimaryKeyColumns(const QStringList &primaryKeyColumns)
Sets the primary key column names to primaryKeyColumns.
QString defaultName() const
Returns the default name for the table entry.
QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > geometryColumnTypes() const
Returns the list of geometry column types and CRSs.
void setGeometryColumn(const QString &geometryColumn)
Sets the geometry column name to geometryColumn.
TableProperty at(int index) const
Returns the table property corresponding to the geometry type at the given index.
int maxCoordinateDimensions() const
Returns the maximum coordinate dimensions of the geometries of a vector table.
int geometryColumnCount() const
Returns the number of geometry columns in the original table this entry refers to.
QList< QgsCoordinateReferenceSystem > crsList() const
Returns the list of CRSs supported by the geometry column.
QVariantMap info() const
Returns additional information about the table.
void setInfo(const QVariantMap &info)
Sets additional information about the table to info.
QStringList primaryKeyColumns() const
Returns the list of primary key column names.
void setGeometryColumnTypes(const QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > &geometryColumnTypes)
Sets the geometry column types to geometryColumnTypes.
void setComment(const QString &comment)
Sets the table comment.
QString schema() const
Returns the schema or an empty string for backends that do not support a schema.
void setGeometryColumnCount(int geometryColumnCount)
Sets the geometryColumnCount.
void addGeometryColumnType(Qgis::WkbType type, const QgsCoordinateReferenceSystem &crs)
Appends the geometry column type with the given srid to the geometry column types list.
Setting options for loading vector layers.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.