29#include "moc_qgsabstractdatabaseproviderconnection.cpp"
31using namespace Qt::StringLiterals;
79 static QMetaEnum metaEnum = QMetaEnum::fromType<QgsAbstractDatabaseProviderConnection::Capability>();
80 const QString capName { metaEnum.valueToKey( capability ) };
81 throw QgsProviderConnectionException( QObject::tr(
"Operation '%1' is not supported for this connection" ).arg( capName ) );
89 throw QgsProviderConnectionException( QObject::tr(
"Operation '%1' is not supported for this connection" ).arg(
qgsEnumValueToKey( capability ) ) );
93QString QgsAbstractDatabaseProviderConnection::sanitizeSqlForQueryLayer(
const QString &sql )
const
95 QString sanitizedSql { sql.trimmed() };
96 while ( sanitizedSql.endsWith(
';' ) )
98 sanitizedSql.chop( 1 );
156 u
"ARRAY_MAX_CARDINALITY"_s,
182 u
"BEGIN_PARTITION"_s,
220 u
"CHARACTER_LENGTH"_s,
260 u
"CONVERT_TABLE_HEADER"_s,
277 u
"CURRENT_CATALOG"_s,
279 u
"CURRENT_DEFAULT_TRANSFORM_GROUP"_s,
280 u
"CURRENT_LC_CTYPE"_s,
287 u
"CURRENT_TIMESTAMP"_s,
288 u
"CURRENT_TIMEZONE"_s,
289 u
"CURRENT_TRANSFORM_GROUP_FOR_TYPE"_s,
303 u
"DAY_MICROSECOND"_s,
450 u
"HOUR_MICROSECOND"_s,
457 u
"IDENTITY_INSERT"_s,
494 u
"IO_BEFORE_GTIDS"_s,
510 u
"JSON_TABLE_PRIMITIVE"_s,
567 u
"MASTER_SSL_VERIFY_SERVER_CERT"_s,
571 u
"MATCH_RECOGNIZE"_s,
594 u
"MINUTE_MICROSECOND"_s,
620 u
"NESTED_TABLE_ID"_s,
635 u
"NO_WRITE_TO_BINLOG"_s,
648 u
"OCCURRENCES_REGEX"_s,
670 u
"OPTIMIZER_COSTS"_s,
701 u
"PERCENTILE_CONT"_s,
702 u
"PERCENTILE_DISC"_s,
787 u
"RESULT_SET_LOCATOR"_s,
807 u
"ROUND_HALF_DOWN"_s,
808 u
"ROUND_HALF_EVEN"_s,
834 u
"SECOND_MICROSECOND"_s,
843 u
"SEMANTICKEYPHRASETABLE"_s,
844 u
"SEMANTICSIMILARITYDETAILSTABLE"_s,
845 u
"SEMANTICSIMILARITYTABLE"_s,
878 u
"SQL_CALC_FOUND_ROWS"_s,
880 u
"SQL_SMALL_RESULT"_s,
911 u
"SUBSTRING_REGEX"_s,
940 u
"TIMEZONE_MINUTE"_s,
953 u
"TRANSLATE_REGEX"_s,
1097 Q_UNUSED( overwrite );
1098 Q_UNUSED( options );
1099 Q_UNUSED( wkbType );
1128 const QList<QgsAbstractDatabaseProviderConnection::TableProperty> constTables {
tables( schema ) };
1129 for (
const auto &t : constTables )
1131 if ( t.tableName() == name )
1144 Q_UNUSED( feedback );
1145 Q_UNUSED( searchContext );
1146 Q_UNUSED( searchString );
1147 Q_UNUSED( geographicExtent );
1223 std::unique_ptr<QgsVectorLayer> vl { std::make_unique<QgsVectorLayer>(
tableUri( schema, tableName ), u
"temp_layer"_s,
mProviderKey, options ) };
1224 if ( !vl->isValid() )
1228 if ( vl->fields().lookupField( fieldName ) == -1 )
1230 throw QgsProviderConnectionException( QObject::tr(
"Could not find field '%1' in table '%2' in schema '%3'" ).arg( fieldName, tableName, schema ) );
1232 if ( !vl->dataProvider()->deleteAttributes( { vl->fields().lookupField( fieldName ) } ) )
1234 throw QgsProviderConnectionException( QObject::tr(
"Unknown error deleting field '%1' in table '%2' in schema '%3'" ).arg( fieldName, tableName, schema ) );
1244 auto vl = std::make_unique<QgsVectorLayer>(
tableUri( schema, tableName ), u
"temp_layer"_s,
mProviderKey, options );
1245 if ( !vl->isValid() )
1249 if ( vl->fields().lookupField( field.
name() ) != -1 )
1253 if ( !vl->dataProvider()->addAttributes( { field } ) )
1265 auto vl = std::make_unique<QgsVectorLayer>(
tableUri( schema, tableName ), u
"temp_layer"_s,
mProviderKey, options );
1266 if ( !vl->isValid() )
1270 int existingIndex = vl->fields().lookupField( name );
1271 if ( existingIndex == -1 )
1275 if ( vl->fields().lookupField( newName ) != -1 )
1279 if ( !vl->dataProvider()->renameAttributes( { { existingIndex, newName } } ) )
1281 throw QgsProviderConnectionException( QObject::tr(
"Unknown error renaming field '%1' in table '%2' to '%3'" ).arg( name, tableName, newName ) );
1288 return QList<QgsAbstractDatabaseProviderConnection::TableProperty>();
1295 const QList<QgsAbstractDatabaseProviderConnection::TableProperty> constTables {
tables( schema,
TableFlags(), feedback ) };
1296 for (
const auto &t : constTables )
1298 if ( t.tableName() == name )
1315 return QStringList();
1332 for (
const auto &t : std::as_const( mGeometryColumnTypes ) )
1339 mGeometryColumnTypes.push_back( toAdd );
1344 return mGeometryColumnTypes;
1367 return QStringList();
1434 QString n = mTableName;
1435 if ( mGeometryColumnCount > 1 )
1436 n +=
'.' + mGeometryColumn;
1443 Q_UNUSED( tableName );
1444 Q_UNUSED( targetSchema );
1452 Q_ASSERT( index >= 0 && index < mGeometryColumnTypes.size() );
1454 property.mGeometryColumnTypes << mGeometryColumnTypes[index];
1455 property.mSchema = mSchema;
1456 property.mTableName = mTableName;
1457 property.mGeometryColumn = mGeometryColumn;
1458 property.mPkColumns = mPkColumns;
1459 property.mGeometryColumnCount = mGeometryColumnCount;
1460 property.mFlags = mFlags;
1461 property.mComment = mComment;
1462 property.mInfo = mInfo;
1483 return mSchema == other.mSchema
1484 && mTableName == other.mTableName
1485 && mGeometryColumn == other.mGeometryColumn
1486 && mGeometryColumnCount == other.mGeometryColumnCount
1487 && mPkColumns == other.mPkColumns
1488 && mFlags == other.mFlags
1489 && mComment == other.mComment
1490 && mInfo == other.mInfo;
1496 mGeometryColumnTypes = columnTypes;
1502 return mGeometryColumnCount;
1542 QList<QgsCoordinateReferenceSystem> crss;
1543 for (
const auto &t : std::as_const( mGeometryColumnTypes ) )
1545 crss.push_back( t.crs );
1557 mPkColumns = pkColumns;
1562 return mGeometryColumn;
1589 QList<QList<QVariant> > rows;
1591 while ( mResultIterator && mResultIterator->hasNextRow() && ( !feedback || !feedback->
isCanceled() ) )
1593 const QVariantList row( mResultIterator->nextRow() );
1594 if ( row.isEmpty() )
1600 rows.push_back( row );
1608 if ( !mResultIterator )
1610 return QList<QVariant>();
1612 return mResultIterator->nextRow();
1618 if ( !mResultIterator )
1622 return mResultIterator->fetchedRowCount();
1627 if ( !mResultIterator )
1631 return mResultIterator->rowCount();
1636 const QgsSQLStatement statement { sql };
1642 const QgsSQLStatement::NodeSelect *nodeSelect =
dynamic_cast<const QgsSQLStatement::NodeSelect *
>( statement.
rootNode() );
1644 if ( !nodeSelect || !nodeSelect->
joins().empty() || !nodeSelect->
orderBy().empty() )
1649 const QList<QgsSQLStatement::NodeTableDef *> tablesList { nodeSelect->
tables() };
1651 if ( tablesList.empty() )
1656 for (
const QgsSQLStatement::NodeTableDef *tableDef : tablesList )
1658 tables.append( tableDef->name() );
1661 const QList<QgsSQLStatement::NodeSelectedColumn *> columnsList { nodeSelect->
columns() };
1663 if ( columnsList.empty() )
1668 for (
const QgsSQLStatement::NodeSelectedColumn *colDef : columnsList )
1670 columns.append( colDef->dump() );
1673 if ( nodeSelect->
where() )
1684 if ( !mResultIterator )
1688 return mResultIterator->hasNextRow();
1691void QgsAbstractDatabaseProviderConnection::QueryResult::appendColumn(
const QString &columnName )
1693 mColumns.push_back( columnName );
1696QgsAbstractDatabaseProviderConnection::QueryResult::QueryResult( std::shared_ptr<QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator> iterator )
1697 : mResultIterator( std::move( iterator ) )
1700double QgsAbstractDatabaseProviderConnection::QueryResult::queryExecutionTime()
const
1702 return mQueryExecutionTime;
1705void QgsAbstractDatabaseProviderConnection::QueryResult::setQueryExecutionTime(
double queryExecutionTime )
1707 mQueryExecutionTime = queryExecutionTime;
1711QVariantList QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::nextRow()
1713 QMutexLocker lock( &mMutex );
1714 const QVariantList row = nextRowPrivate();
1715 if ( !row.isEmpty() )
1722bool QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::hasNextRow()
const
1724 QMutexLocker lock( &mMutex );
1725 return hasNextRowPrivate();
1728long long QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::fetchedRowCount()
1730 QMutexLocker lock( &mMutex );
1731 return mFetchedRowCount;
1734long long QgsAbstractDatabaseProviderConnection::QueryResult::QueryResultIterator::rowCount()
1736 QMutexLocker lock( &mMutex );
1737 return rowCountPrivate();
DatabaseProviderConnectionCapability2
The Capability enum represents the extended operations supported by the connection.
@ SetTableComment
Can set comments for tables via setTableComment().
@ DeleteFieldDomain
Can delete existing field domain.
@ SetFieldComment
Can set comments for fields via setFieldComment().
@ EditFieldDomain
Can edit existing field domain.
@ SetFieldAlias
Can set aliases for fields via setFieldAlias().
QFlags< RelationshipCapability > RelationshipCapabilities
Relationship capabilities.
QFlags< DatabaseProviderConnectionCapability2 > DatabaseProviderConnectionCapabilities2
WkbType
The WKB type describes the number of dimensions a geometry has.
QFlags< SqlLayerDefinitionCapability > SqlLayerDefinitionCapabilities
SQL layer definition capabilities.
virtual QString defaultGeometryColumnName() const
Returns the default name to use for a geometry column for the connection.
virtual void setFieldComment(const QString &fieldName, const QString &schema, const QString &tableName, const QString &comment) const
Sets the comment for the existing field with the specified name.
virtual QList< QgsWeakRelation > relationships(const QString &schema=QString(), const QString &tableName=QString()) const
Returns a list of relationships detected in the database.
virtual void createVectorTable(const QString &schema, const QString &name, const QgsFields &fields, Qgis::WkbType wkbType, const QgsCoordinateReferenceSystem &srs, bool overwrite, const QMap< QString, QVariant > *options) const
Creates an empty table with name in the given schema (schema is ignored if not supported by the backe...
virtual QgsVectorLayer * createSqlVectorLayer(const SqlVectorLayerOptions &options) const
Creates and returns a (possibly invalid) vector layer based on a SQL statement and options.
virtual bool tableExists(const QString &schema, const QString &name) const
Checks whether a table name exists in the given schema.
TableFlag
Flags for table properties.
QList< QgsAbstractDatabaseProviderConnection::TableProperty > tablesInt(const QString &schema=QString(), const int flags=0) const
Returns information on the tables in the given schema.
virtual void updateRelationship(const QgsWeakRelation &relationship) const
Updates an existing relationship in the database.
virtual void renameField(const QString &schema, const QString &tableName, const QString &name, const QString &newName) const
Renames an existing field.
virtual void deleteFieldDomain(const QString &name, const QString &schema) const
Deletes the field domain with the specified name from the provider.
virtual void dropSchema(const QString &name, bool force=false) const
Drops an entire schema with the specified name.
Qgis::SqlLayerDefinitionCapabilities mSqlLayerDefinitionCapabilities
virtual void addField(const QgsField &field, const QString &schema, const QString &tableName) const
Adds a field.
virtual QList< QgsAbstractDatabaseProviderConnection::TableProperty > tables(const QString &schema=QString(), const QgsAbstractDatabaseProviderConnection::TableFlags &flags=QgsAbstractDatabaseProviderConnection::TableFlags(), QgsFeedback *feedback=nullptr) const
Returns information on the tables in the given schema.
Qgis::DatabaseProviderConnectionCapabilities2 mCapabilities2
Capabilities mCapabilities
virtual void vacuum(const QString &schema, const QString &name) const
Vacuum the database table with given schema and name (schema is ignored if not supported by the backe...
QSet< QString > mIllegalFieldNames
virtual QList< Qgis::FieldDomainType > supportedFieldDomainTypes() const
Returns a list of field domain types which are supported by the provider.
virtual void renameVectorTable(const QString &schema, const QString &name, const QString &newName) const
Renames a vector or aspatial table with given schema (schema is ignored if not supported by the backe...
QString providerKey() const
Returns the provider key.
virtual void createSchema(const QString &name) const
Creates a new schema with the specified name.
virtual void deleteSpatialIndex(const QString &schema, const QString &name, const QString &geometryColumn) const
Deletes the existing spatial index for the database table with given schema, name and geometryColumn ...
virtual void dropRasterTable(const QString &schema, const QString &name) const
Drops a raster table with given schema (schema is ignored if not supported by the backend) and name.
Qgis::DatabaseProviderConnectionCapabilities2 capabilities2() const
Returns extended connection capabilities.
virtual QueryResult execSql(const QString &sql, QgsFeedback *feedback=nullptr) const
Executes raw sql and returns the (possibly empty) query results, optionally feedback can be provided.
virtual QgsProviderSqlQueryBuilder * queryBuilder() const
Returns a SQL query builder for the connection, which provides an interface for provider-specific cre...
virtual void setFieldDomainName(const QString &fieldName, const QString &schema, const QString &tableName, const QString &domainName) const
Sets the field domain name for the existing field with the specified name.
virtual void deleteField(const QString &fieldName, const QString &schema, const QString &tableName, bool force=false) const
Deletes the field with the specified name.
virtual QString tableUri(const QString &schema, const QString &name) const
Returns the URI string for the given table and schema.
QFlags< TableFlag > TableFlags
QFlags< GeometryColumnCapability > GeometryColumnCapabilities
virtual void deleteRelationship(const QgsWeakRelation &relationship) const
Deletes an existing relationship in the database.
Capability
The Capability enum represents the operations supported by the connection.
@ RetrieveFieldDomain
Can retrieve field domain details from provider via fieldDomain().
@ CreateSpatialIndex
The connection can create spatial indices.
@ AddRelationship
Can add new relationships to the database via addRelationship().
@ SqlLayers
Can create vector layers from SQL SELECT queries.
@ RenameSchema
Can RENAME a schema.
@ DropVectorTable
Can DROP a vector (or aspatial) table/layer.
@ DeleteSpatialIndex
The connection can delete spatial indices for tables.
@ RetrieveRelationships
Can retrieve relationships from the database.
@ RenameRasterTable
Can RENAME a raster table/layer.
@ SetFieldDomain
Can set the domain for an existing field via setFieldDomainName().
@ DropSchema
Can DROP a schema.
@ AddFieldDomain
Can add new field domains to the database via addFieldDomain().
@ DeleteRelationship
Can delete existing relationships from the database via deleteRelationship().
@ CreateSchema
Can CREATE a schema.
@ DropRasterTable
Can DROP a raster table/layer.
@ DeleteField
Can delete an existing field/column.
@ AddField
Can add a new field/column.
@ TableExists
Can check if table exists.
@ RenameVectorTable
Can RENAME a vector (or aspatial) table/layer.
@ RenameField
Can rename existing fields via renameField().
@ MoveTableToSchema
Can move table to another schema via moveTableToAnotherSchema().
@ ExecuteSql
Can execute raw SQL queries (without returning results).
@ UpdateRelationship
Can update existing relationships in the database via updateRelationship().
@ SpatialIndexExists
The connection can determine if a spatial index exists.
@ ListFieldDomains
Can return a list of field domain names via fieldDomainNames().
@ Schemas
Can list schemas (if not set, the connection does not support schemas).
virtual void createSpatialIndex(const QString &schema, const QString &name, const QgsAbstractDatabaseProviderConnection::SpatialIndexOptions &options=QgsAbstractDatabaseProviderConnection::SpatialIndexOptions()) const
Creates a spatial index for the database table with given schema and name (schema is ignored if not s...
virtual QStringList relatedTableTypes() const
Returns a list of the related table types supported by the database format.
static bool splitSimpleQuery(const QString &sql, QStringList &columns, QStringList &tables, QString &where)
Splits a simple query in the form "SELECT column(s) FROM table(s) [WHERE ...]" into its components.
GeometryColumnCapabilities mGeometryColumnCapabilities
virtual GeometryColumnCapabilities geometryColumnCapabilities()
Returns connection geometry column capabilities (Z, M, SinglePart, Curves).
virtual Qgis::SqlLayerDefinitionCapabilities sqlLayerDefinitionCapabilities()
Returns SQL layer definition capabilities (Filters, GeometryColumn, PrimaryKeys).
virtual void renameRasterTable(const QString &schema, const QString &name, const QString &newName) const
Renames a raster table with given schema (schema is ignored if not supported by the backend) and name...
virtual void dropVectorTable(const QString &schema, const QString &name) const
Drops a vector (or aspatial) table with given schema (schema is ignored if not supported by the backe...
virtual QStringList fieldDomainNames() const
Returns a list of field domain names present on the provider.
virtual void setFieldAlias(const QString &fieldName, const QString &schema, const QString &tableName, const QString &alias) const
Sets the alias for the existing field with the specified name.
virtual void renameSchema(const QString &name, const QString &newName) const
Renames a schema with the specified name.
virtual void addFieldDomain(const QgsFieldDomain &domain, const QString &schema) const
Adds a new field domain to the database.
virtual QList< QList< QVariant > > executeSql(const QString &sql, QgsFeedback *feedback=nullptr) const
Executes raw sql and returns the (possibly empty) list of results in a multi-dimensional array,...
virtual bool spatialIndexExists(const QString &schema, const QString &name, const QString &geometryColumn) const
Determines whether a spatial index exists for the database table with given schema,...
virtual QgsAbstractDatabaseProviderConnection::TableProperty table(const QString &schema, const QString &table, QgsFeedback *feedback=nullptr) const
Returns information on a table in the given schema.
virtual QMultiMap< Qgis::SqlKeywordCategory, QStringList > sqlDictionary()
Returns a dictionary of SQL keywords supported by the provider.
virtual Qgis::RelationshipCapabilities supportedRelationshipCapabilities() const
Returns the relationship capabilities supported by the provider.
virtual SqlVectorLayerOptions sqlOptions(const QString &layerSource)
Returns the SQL layer options from a layerSource.
QFlags< Capability > Capabilities
virtual QSet< QString > illegalFieldNames() const
Returns a list of field names which are considered illegal by the connection and should not be used w...
virtual QStringList schemas() const
Returns information about the existing schemas.
virtual QList< Qgis::RelationshipCardinality > supportedRelationshipCardinalities() const
Returns a list of relationship cardinalities which are supported by the provider.
virtual QString createVectorLayerExporterDestinationUri(const QgsAbstractDatabaseProviderConnection::VectorLayerExporterOptions &options, QVariantMap &providerOptions) const
Creates a URI for use with QgsVectorLayerExporter corresponding to given destination table options fo...
virtual void moveTableToSchema(const QString &sourceSchema, const QString &tableName, const QString &targetSchema) const
Move table to a different schema.
virtual QList< Qgis::RelationshipStrength > supportedRelationshipStrengths() const
Returns a list of relationship strengths which are supported by the provider.
virtual QList< QgsLayerMetadataProviderResult > searchLayerMetadata(const QgsMetadataSearchContext &searchContext, const QString &searchString=QString(), const QgsRectangle &geographicExtent=QgsRectangle(), QgsFeedback *feedback=nullptr) const
Search the stored layer metadata in the connection, optionally limiting the search to the metadata id...
virtual void addRelationship(const QgsWeakRelation &relationship) const
Adds a new field relationship to the database.
virtual void updateFieldDomain(QgsFieldDomain *domain, const QString &schema) const
Update an existing field domain in the database, the domain is identified by name.
virtual QgsFieldDomain * fieldDomain(const QString &name) const
Returns the field domain with the specified name from the provider.
QgsAbstractDatabaseProviderConnection(const QString &name)
Creates a new connection with name by reading its configuration from the settings.
virtual void setTableComment(const QString &schema, const QString &tableName, const QString &comment) const
Sets the comment for the existing table with the specified name.
virtual QString defaultPrimaryKeyColumnName() const
Returns the default name to use for a primary key column for the connection.
virtual bool validateSqlVectorLayer(const SqlVectorLayerOptions &options, QString &message) const
Validates the SQL query options to determine if it is possible to create a vector layer based on a SQ...
Capabilities capabilities() const
Returns connection capabilities.
virtual QgsFields fields(const QString &schema, const QString &table, QgsFeedback *feedback=nullptr) const
Returns the fields of a table and schema.
QVariantMap configuration() const
Returns the connection configuration parameters.
QgsAbstractProviderConnection(const QString &name)
Creates a new connection with name by reading its configuration from the settings.
QString uri() const
Returns the connection data source URI string representation.
Represents a coordinate reference system (CRS).
Base class for feedback objects to be used for cancellation of something running in a worker thread.
bool isCanceled() const
Tells whether the operation has been canceled already.
Base class for field domains.
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
QString publicSource(bool hidePassword=false) const
Gets a version of the internal layer definition that has sensitive bits removed (for example,...
Custom exception class which is raised when an operation is not supported.
Custom exception class for provider connection related exceptions.
Provides an interface for provider-specific creation of SQL queries.
A rectangle specified with double values.
QList< QgsSQLStatement::NodeColumnSorted * > orderBy() const
Returns the list of order by columns.
QList< QgsSQLStatement::NodeSelectedColumn * > columns() const
Returns the list of columns.
QList< QgsSQLStatement::NodeJoin * > joins() const
Returns the list of joins.
QgsSQLStatement::Node * where() const
Returns the where clause.
QList< QgsSQLStatement::NodeTableDef * > tables() const
Returns the list of tables.
virtual QString dump() const =0
Abstract virtual dump method.
bool hasParserError() const
Returns true if an error occurred when parsing the input statement.
const QgsSQLStatement::Node * rootNode() const
Returns the root node of the statement.
Represents a vector layer which manages a vector based dataset.
Represent a QgsRelation with possibly unresolved layers or unmatched fields.
static Q_INVOKABLE int coordDimensions(Qgis::WkbType type)
Returns the coordinate dimension of the geometry type as an integer.
@ UnknownCount
Provider returned an unknown feature count.
QString qgsEnumValueToKey(const T &value, bool *returnOk=nullptr)
Returns the value for the given key of an enum.
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.
QString geometryColumn() const
Returns the geometry column name.
bool operator==(const QgsAbstractDatabaseProviderConnection::TableProperty &other) const
void setPrimaryKeyColumns(const QStringList &primaryKeyColumns)
Sets the primary key column names to primaryKeyColumns.
void setFlag(const TableFlag &flag)
Sets a flag.
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.
QString tableName() const
Returns the table name.
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.
void setSchema(const QString &schema)
Sets the schema.
QVariantMap info() const
Returns additional information about the table.
QString comment() const
Returns the table comment.
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.
TableFlags flags() const
Returns the table flags.
void setGeometryColumnCount(int geometryColumnCount)
Sets the geometryColumnCount.
void setFlags(const TableFlags &flags)
Sets the table flags.
void addGeometryColumnType(Qgis::WkbType type, const QgsCoordinateReferenceSystem &crs)
Appends the geometry column type with the given srid to the geometry column types list.
Stores all information required to create a QgsVectorLayerExporter for the backend.
Setting options for loading vector layers.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.