QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
The TableProperty class represents a database table or view. More...
#include <qgsabstractdatabaseproviderconnection.h>
Classes | |
struct | GeometryColumnType |
The GeometryColumnType struct represents the combination of geometry type and CRS for the table geometry column. More... | |
Public Member Functions | |
void | addGeometryColumnType (const QgsWkbTypes::Type &type, const QgsCoordinateReferenceSystem &crs) |
Appends the geometry column type with the given srid to the geometry column types list. More... | |
TableProperty | at (int index) const |
Returns the table property corresponding to the geometry type at the given index. More... | |
QString | comment () const |
Returns the table comment. More... | |
QList< QgsCoordinateReferenceSystem > | crsList () const |
Returns the list of CRSs supported by the geometry column. More... | |
QString | defaultName () const |
Returns the default name for the table entry. More... | |
TableFlags | flags () const |
Returns the table flags. More... | |
QString | geometryColumn () const |
Returns the geometry column name. More... | |
int | geometryColumnCount () const |
Returns the number of geometry columns in the original table this entry refers to. More... | |
QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > | geometryColumnTypes () const |
Returns the list of geometry column types and CRSs. More... | |
QVariantMap | info () const |
Returns additional information about the table. More... | |
int | maxCoordinateDimensions () const |
Returns the maximum coordinate dimensions of the geometries of a vector table. More... | |
bool | operator== (const QgsAbstractDatabaseProviderConnection::TableProperty &other) const |
QStringList | primaryKeyColumns () const |
Returns the list of primary key column names. More... | |
QString | schema () const |
Returns the schema or an empty string for backends that do not support a schema. More... | |
void | setComment (const QString &comment) |
Sets the table comment. More... | |
void | setFlag (const TableFlag &flag) |
Sets a flag. More... | |
void | setFlags (const TableFlags &flags) |
Sets the table flags. More... | |
void | setGeometryColumn (const QString &geometryColumn) |
Sets the geometry column name to geometryColumn. More... | |
void | setGeometryColumnCount (int geometryColumnCount) |
Sets the geometryColumnCount. More... | |
void | setGeometryColumnTypes (const QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > &geometryColumnTypes) |
Sets the geometry column types to geometryColumnTypes. More... | |
void | setInfo (const QVariantMap &info) |
Sets additional information about the table to info. More... | |
void | setPrimaryKeyColumns (const QStringList &primaryKeyColumns) |
Sets the primary key column names to primaryKeyColumns. More... | |
void | setSchema (const QString &schema) |
Sets the schema. More... | |
void | setTableName (const QString &name) |
Sets the table name to name. More... | |
QString | tableName () const |
Returns the table name. More... | |
The TableProperty class represents a database table or view.
In case the table is a vector spatial table and it has multiple geometry columns, separate entries for each geometry column must be created.
In case the table is a vector spatial table and the geometry column can contain multiple geometry types and/or CRSs, a clone of the property for the individual geometry type/CRS can be retrieved with at(i)
Definition at line 81 of file qgsabstractdatabaseproviderconnection.h.
void QgsAbstractDatabaseProviderConnection::TableProperty::addGeometryColumnType | ( | const QgsWkbTypes::Type & | type, |
const QgsCoordinateReferenceSystem & | crs | ||
) |
Appends the geometry column type with the given srid to the geometry column types list.
Definition at line 257 of file qgsabstractdatabaseproviderconnection.cpp.
QgsAbstractDatabaseProviderConnection::TableProperty QgsAbstractDatabaseProviderConnection::TableProperty::at | ( | int | index | ) | const |
Returns the table property corresponding to the geometry type at the given index.
Definition at line 298 of file qgsabstractdatabaseproviderconnection.cpp.
QString QgsAbstractDatabaseProviderConnection::TableProperty::comment | ( | ) | const |
Returns the table comment.
Definition at line 370 of file qgsabstractdatabaseproviderconnection.cpp.
QList< QgsCoordinateReferenceSystem > QgsAbstractDatabaseProviderConnection::TableProperty::crsList | ( | ) | const |
Returns the list of CRSs supported by the geometry column.
Definition at line 390 of file qgsabstractdatabaseproviderconnection.cpp.
QString QgsAbstractDatabaseProviderConnection::TableProperty::defaultName | ( | ) | const |
Returns the default name for the table entry.
It is usually the table name but in case there are multiple geometry columns, the geometry column name is appended to the table name.
Definition at line 291 of file qgsabstractdatabaseproviderconnection.cpp.
QgsAbstractDatabaseProviderConnection::TableFlags QgsAbstractDatabaseProviderConnection::TableProperty::flags | ( | ) | const |
Returns the table flags.
Definition at line 380 of file qgsabstractdatabaseproviderconnection.cpp.
QString QgsAbstractDatabaseProviderConnection::TableProperty::geometryColumn | ( | ) | const |
Returns the geometry column name.
Definition at line 410 of file qgsabstractdatabaseproviderconnection.cpp.
int QgsAbstractDatabaseProviderConnection::TableProperty::geometryColumnCount | ( | ) | const |
Returns the number of geometry columns in the original table this entry refers to.
This information is used internally to build the
Definition at line 350 of file qgsabstractdatabaseproviderconnection.cpp.
QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > QgsAbstractDatabaseProviderConnection::TableProperty::geometryColumnTypes | ( | ) | const |
Returns the list of geometry column types and CRSs.
The method returns a list of GeometryColumnType
Definition at line 271 of file qgsabstractdatabaseproviderconnection.cpp.
QVariantMap QgsAbstractDatabaseProviderConnection::TableProperty::info | ( | ) | const |
Returns additional information about the table.
Provider classes may use this property to store custom bits of information.
Definition at line 360 of file qgsabstractdatabaseproviderconnection.cpp.
int QgsAbstractDatabaseProviderConnection::TableProperty::maxCoordinateDimensions | ( | ) | const |
Returns the maximum coordinate dimensions of the geometries of a vector table.
This information is calculated from the geometry columns types.
Definition at line 321 of file qgsabstractdatabaseproviderconnection.cpp.
bool QgsAbstractDatabaseProviderConnection::TableProperty::operator== | ( | const QgsAbstractDatabaseProviderConnection::TableProperty & | other | ) | const |
Definition at line 331 of file qgsabstractdatabaseproviderconnection.cpp.
QStringList QgsAbstractDatabaseProviderConnection::TableProperty::primaryKeyColumns | ( | ) | const |
Returns the list of primary key column names.
Definition at line 400 of file qgsabstractdatabaseproviderconnection.cpp.
QString QgsAbstractDatabaseProviderConnection::TableProperty::schema | ( | ) | const |
Returns the schema or an empty string for backends that do not support a schema.
Definition at line 420 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setComment | ( | const QString & | comment | ) |
Sets the table comment.
Definition at line 375 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setFlag | ( | const TableFlag & | flag | ) |
Sets a flag.
Definition at line 316 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setFlags | ( | const TableFlags & | flags | ) |
Sets the table flags.
Definition at line 385 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumn | ( | const QString & | geometryColumn | ) |
Sets the geometry column name to geometryColumn.
Definition at line 415 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumnCount | ( | int | geometryColumnCount | ) |
Sets the geometryColumnCount.
Definition at line 355 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumnTypes | ( | const QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > & | geometryColumnTypes | ) |
Sets the geometry column types to geometryColumnTypes.
Definition at line 344 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setInfo | ( | const QVariantMap & | info | ) |
Sets additional information about the table to info.
Provider classes may use this property to store custom bits of information.
Definition at line 365 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setPrimaryKeyColumns | ( | const QStringList & | primaryKeyColumns | ) |
Sets the primary key column names to primaryKeyColumns.
Definition at line 405 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setSchema | ( | const QString & | schema | ) |
Sets the schema.
Definition at line 425 of file qgsabstractdatabaseproviderconnection.cpp.
void QgsAbstractDatabaseProviderConnection::TableProperty::setTableName | ( | const QString & | name | ) |
Sets the table name to name.
Definition at line 252 of file qgsabstractdatabaseproviderconnection.cpp.
QString QgsAbstractDatabaseProviderConnection::TableProperty::tableName | ( | ) | const |
Returns the table name.
Definition at line 247 of file qgsabstractdatabaseproviderconnection.cpp.