QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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...
 
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 77 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 156 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 183 of file qgsabstractdatabaseproviderconnection.cpp.

◆ comment()

QString QgsAbstractDatabaseProviderConnection::TableProperty::comment ( ) const

Returns the table comment.

Definition at line 243 of file qgsabstractdatabaseproviderconnection.cpp.

◆ crsList()

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

Returns the list of CRSs supported by the geometry column.

Definition at line 263 of file qgsabstractdatabaseproviderconnection.cpp.

◆ defaultName()

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 appendend to the table name.

See also
geometryColumnCount()

Definition at line 176 of file qgsabstractdatabaseproviderconnection.cpp.

◆ flags()

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

Returns the table flags.

Definition at line 253 of file qgsabstractdatabaseproviderconnection.cpp.

◆ geometryColumn()

QString QgsAbstractDatabaseProviderConnection::TableProperty::geometryColumn ( ) const

Returns the geometry column name.

Definition at line 283 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 223 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 170 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 233 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 206 of file qgsabstractdatabaseproviderconnection.cpp.

◆ primaryKeyColumns()

QStringList QgsAbstractDatabaseProviderConnection::TableProperty::primaryKeyColumns ( ) const

Returns the list of primary key column names.

Definition at line 273 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 293 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setComment()

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

Sets the table comment.

Definition at line 248 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setFlag()

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

Sets a flag.

Definition at line 201 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setFlags()

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

Sets the table flags.

Definition at line 258 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setGeometryColumn()

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

Sets the geometry column name to geometryColumn.

Definition at line 288 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setGeometryColumnCount()

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

Sets the geometryColumnCount.

Definition at line 228 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 217 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 238 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setPrimaryKeyColumns()

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

Sets the primary key column names to primaryKeyColumns.

Definition at line 278 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setSchema()

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

Sets the schema.

Definition at line 298 of file qgsabstractdatabaseproviderconnection.cpp.

◆ setTableName()

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

Sets the table name to name.

See also
defaultName()

Definition at line 151 of file qgsabstractdatabaseproviderconnection.cpp.

◆ tableName()

QString QgsAbstractDatabaseProviderConnection::TableProperty::tableName ( ) const

Returns the table name.

See also
defaultName()

Definition at line 146 of file qgsabstractdatabaseproviderconnection.cpp.


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