16 #ifndef QGSABSTRACTDATABASEPROVIDERCONNECTION_H 17 #define QGSABSTRACTDATABASEPROVIDERCONNECTION_H 21 #include "qgis_core.h" 59 MaterializedView = 1 << 5,
81 SIP_PYOBJECT __repr__();
83 QString str = QStringLiteral(
"<QgsAbstractDatabaseProviderConnection.TableProperty: '%1'>" ).arg( sipCpp->tableName() );
84 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
95 SIP_PYOBJECT __repr__();
97 QString str = QStringLiteral(
"<QgsAbstractDatabaseProviderConnection.TableProperty.GeometryColumnType: '%1, %2'>" ).arg(
QgsWkbTypes::displayString( sipCpp->wkbType ), sipCpp->crs.authid() );
98 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
106 return this->crs == other.
crs && this->wkbType == other.
wkbType;
116 QString tableName()
const;
122 void setTableName(
const QString &name );
133 QList<QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType> geometryColumnTypes()
const;
138 void setGeometryColumnTypes(
const QList<QgsAbstractDatabaseProviderConnection::TableProperty::GeometryColumnType> &geometryColumnTypes );
147 QString defaultName()
const;
153 TableProperty at(
int index )
const;
158 QString schema()
const;
163 void setSchema(
const QString &schema );
168 QString geometryColumn()
const;
173 void setGeometryColumn(
const QString &geometryColumn );
178 QStringList primaryKeyColumns()
const;
183 void setPrimaryKeyColumns(
const QStringList &primaryKeyColumns );
188 QList<QgsCoordinateReferenceSystem> crsList()
const;
193 TableFlags flags()
const;
198 void setFlags(
const TableFlags &flags );
203 QString comment()
const;
208 void setComment(
const QString &comment );
216 QVariantMap info()
const;
224 void setInfo(
const QVariantMap &info );
231 int geometryColumnCount()
const;
236 void setGeometryColumnCount(
int geometryColumnCount );
248 int maxCoordinateDimensions()
const;
254 QList<GeometryColumnType> mGeometryColumnTypes;
260 QString mGeometryColumn;
262 int mGeometryColumnCount;
264 QStringList mPkColumns;
276 CreateVectorTable = 1 << 1,
277 DropRasterTable = 1 << 2,
278 DropVectorTable = 1 << 3,
279 RenameVectorTable = 1 << 4,
280 RenameRasterTable = 1 << 5,
281 CreateSchema = 1 << 6,
283 RenameSchema = 1 << 8,
289 TableExists = 1 << 14,
295 Q_FLAG( Capabilities )
316 Capabilities capabilities()
const;
388 virtual
void renameSchema( const QString &name, const QString &newName ) const
SIP_THROW( QgsProviderConnectionException );
395 virtual QList<QList<QVariant>> executeSql( const QString &sql ) const
SIP_THROW( QgsProviderConnectionException );
402 virtual
void vacuum( const QString &schema, const QString &name ) const
SIP_THROW( QgsProviderConnectionException );
431 virtual QStringList schemas() const
SIP_THROW( QgsProviderConnectionException );
441 void checkCapability(
Capability capability ) const;
444 Capabilities mCapabilities =
nullptr SIP_SKIP;
450 #endif // QGSABSTRACTDATABASEPROVIDERCONNECTION_H The QgsAbstractDatabaseProviderConnection class provides common functionality for DB based connection...
QgsWkbTypes::Type wkbType
Capability
The Capability enum represent the operations supported by the connection.
Container of fields for a vector layer.
QgsCoordinateReferenceSystem crs
const QgsCoordinateReferenceSystem & crs
The QgsAbstractProviderConnection provides an interface for data provider connections.
bool operator==(const GeometryColumnType &other) const
The GeometryColumnType struct represents the combination of geometry type and CRS for the table geome...
Type
The WKB type describes the number of dimensions a geometry has.
The TableProperty class represents a database table or view.
TableFlag
Flags for table properties.
This class represents a coordinate reference system (CRS).
static QString displayString(Type type)
Returns a display string type for a WKB type, e.g., the geometry name used in WKT geometry representa...
Custom exception class for provider connection related exceptions.