QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Classes | Public Member Functions | List of all members
QgsAbstractDatabaseProviderConnection::TableProperty Struct Reference

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< QgsCoordinateReferenceSystemcrsList () 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::GeometryColumnTypegeometryColumnTypes () 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...
 

Detailed Description

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 264 of file qgsabstractdatabaseproviderconnection.h.

Member Function Documentation

◆ addGeometryColumnType()

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 1226 of file qgsabstractdatabaseproviderconnection.cpp.

◆ at()

QgsAbstractDatabaseProviderConnection::TableProperty QgsAbstractDatabaseProviderConnection::TableProperty::at ( int  index) const

Returns the table property corresponding to the geometry type at the given index.

Definition at line 1269 of file qgsabstractdatabaseproviderconnection.cpp.

◆ comment()

QString QgsAbstractDatabaseProviderConnection::TableProperty::comment ( ) const

Returns the table comment.

Definition at line 1341 of file qgsabstractdatabaseproviderconnection.cpp.

◆ crsList()

QList< QgsCoordinateReferenceSystem > QgsAbstractDatabaseProviderConnection::TableProperty::crsList ( ) const

Returns the list of CRSs supported by the geometry column.

Definition at line 1361 of file qgsabstractdatabaseproviderconnection.cpp.

◆ defaultName()

QString QgsAbstractDatabaseProviderConnection::TableProperty::defaultName ( ) const

Returns the default name for the table entry.

This is usually the table name but in case there are multiple geometry columns, the geometry column name is appended to the table name.

See also
geometryColumnCount()

Definition at line 1262 of file qgsabstractdatabaseproviderconnection.cpp.

◆ flags()

QgsAbstractDatabaseProviderConnection::TableFlags QgsAbstractDatabaseProviderConnection::TableProperty::flags ( ) const

Returns the table flags.

Definition at line 1351 of file qgsabstractdatabaseproviderconnection.cpp.

◆ geometryColumn()

QString QgsAbstractDatabaseProviderConnection::TableProperty::geometryColumn ( ) const

Returns the geometry column name.

Definition at line 1381 of file qgsabstractdatabaseproviderconnection.cpp.

◆ geometryColumnCount()

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

See also
defaultName().

Definition at line 1321 of file qgsabstractdatabaseproviderconnection.cpp.

◆ geometryColumnTypes()

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 1240 of file qgsabstractdatabaseproviderconnection.cpp.

◆ info()

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 1331 of file qgsabstractdatabaseproviderconnection.cpp.

◆ maxCoordinateDimensions()

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.

See also
geometryColumnTypes()

Definition at line 1292 of file qgsabstractdatabaseproviderconnection.cpp.

◆ operator==()

bool QgsAbstractDatabaseProviderConnection::TableProperty::operator== ( const QgsAbstractDatabaseProviderConnection::TableProperty other) const

Definition at line 1302 of file qgsabstractdatabaseproviderconnection.cpp.

◆ primaryKeyColumns()

QStringList QgsAbstractDatabaseProviderConnection::TableProperty::primaryKeyColumns ( ) const

Returns the list of primary key column names.

Definition at line 1371 of file qgsabstractdatabaseproviderconnection.cpp.

◆ schema()

QString QgsAbstractDatabaseProviderConnection::TableProperty::schema ( ) const

Returns the schema or an empty string for backends that do not support a schema.

Definition at line 1391 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setComment()

void QgsAbstractDatabaseProviderConnection::TableProperty::setComment ( const QString &  comment)

Sets the table comment.

Definition at line 1346 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setFlag()

void QgsAbstractDatabaseProviderConnection::TableProperty::setFlag ( const TableFlag flag)

Sets a flag.

Definition at line 1287 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setFlags()

void QgsAbstractDatabaseProviderConnection::TableProperty::setFlags ( const TableFlags &  flags)

Sets the table flags.

Definition at line 1356 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setGeometryColumn()

void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumn ( const QString &  geometryColumn)

Sets the geometry column name to geometryColumn.

Definition at line 1386 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setGeometryColumnCount()

void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumnCount ( int  geometryColumnCount)

Sets the geometryColumnCount.

Definition at line 1326 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setGeometryColumnTypes()

void QgsAbstractDatabaseProviderConnection::TableProperty::setGeometryColumnTypes ( const QList< QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType > &  geometryColumnTypes)

Sets the geometry column types to geometryColumnTypes.

Definition at line 1315 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setInfo()

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 1336 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setPrimaryKeyColumns()

void QgsAbstractDatabaseProviderConnection::TableProperty::setPrimaryKeyColumns ( const QStringList &  primaryKeyColumns)

Sets the primary key column names to primaryKeyColumns.

Definition at line 1376 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setSchema()

void QgsAbstractDatabaseProviderConnection::TableProperty::setSchema ( const QString &  schema)

Sets the schema.

Definition at line 1396 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setTableName()

void QgsAbstractDatabaseProviderConnection::TableProperty::setTableName ( const QString &  name)

Sets the table name to name.

See also
defaultName()

Definition at line 1221 of file qgsabstractdatabaseproviderconnection.cpp.

◆ tableName()

QString QgsAbstractDatabaseProviderConnection::TableProperty::tableName ( ) const

Returns the table name.

See also
defaultName()

Definition at line 1216 of file qgsabstractdatabaseproviderconnection.cpp.


The documentation for this struct was generated from the following files: