18 #ifndef QGSTRANSACTION_H
19 #define QGSTRANSACTION_H
27 #include "qgis_core.h"
81 QString connectionString()
const;
90 bool addLayer(
QgsVectorLayer *layer,
bool addLayersInEditMode =
false );
102 bool begin( QString &errorMsg
SIP_OUT,
int statementTimeout = 20 );
107 bool commit( QString &errorMsg
SIP_OUT );
112 bool rollback( QString &errorMsg
SIP_OUT );
124 virtual bool executeSql(
const QString &sql, QString &error
SIP_OUT,
bool isDirty =
false,
const QString &name = QString() ) = 0;
137 QString createSavepoint( QString &error
SIP_OUT );
144 virtual QString createSavepoint(
const QString &savePointId, QString &error
SIP_OUT );
150 virtual bool rollbackToSavepoint(
const QString &name, QString &error
SIP_OUT );
156 void dirtyLastSavePoint();
162 QList< QString >
savePoints()
const {
return QList< QString >::fromVector( mSavepoints ); }
172 static QString connectionString(
const QString &layerUri )
SIP_SKIP;
180 void afterRollback();
185 void dirtied(
const QString &sql,
const QString &name );
196 void onLayerDeleted();
200 QSet<QgsVectorLayer *> mLayers;
204 static QString removeLayerIdOrName(
const QString &
str );
206 virtual bool beginTransaction( QString &error,
int statementTimeout ) = 0;
207 virtual bool commitTransaction( QString &error ) = 0;
208 virtual bool rollbackTransaction( QString &error ) = 0;
211 #endif // QGSTRANSACTION_H