30#include <sptk5/db/PoolDatabaseConnection.h>
38class DatabaseConnectionPool;
53 SPoolDatabaseConnection m_connection {
nullptr};
99 m_connection->close();
107 return m_connection !=
nullptr && m_connection->active();
115 return m_connection->connectionString();
123 return m_connection->connectionType();
131 return m_connection->driverDescription();
139 m_connection->beginTransaction();
147 m_connection->commitTransaction();
155 m_connection->rollbackTransaction();
163 return m_connection->inTransaction();
176 m_connection->objectList(objectType, objects);
191 m_connection->bulkInsert(tableName, columnNames, data);
204 m_connection->executeBatchFile(batchFileName, errors);
217 m_connection->executeBatchSQL(batchSQL, errors);
221using DatabaseConnection = std::shared_ptr<AutoDatabaseConnection>;
Definition: AutoDatabaseConnection.h:44
PoolDatabaseConnection * connection()
bool active() const
Definition: AutoDatabaseConnection.h:105
String driverDescription() const
Definition: AutoDatabaseConnection.h:129
void executeBatchFile(const String &batchFileName, Strings *errors=nullptr) const
Definition: AutoDatabaseConnection.h:202
void commitTransaction() const
Definition: AutoDatabaseConnection.h:145
void open(const String &connectionString="") const
Definition: AutoDatabaseConnection.h:86
const DatabaseConnectionString & connectionString() const
Definition: AutoDatabaseConnection.h:113
void objectList(DatabaseObjectType objectType, Strings &objects) const
Definition: AutoDatabaseConnection.h:174
int inTransaction() const
Definition: AutoDatabaseConnection.h:161
void close() const
Definition: AutoDatabaseConnection.h:97
DatabaseConnectionType connectionType() const
Definition: AutoDatabaseConnection.h:121
~AutoDatabaseConnection()
void executeBatchSQL(const sptk::Strings &batchSQL, Strings *errors=nullptr) const
Definition: AutoDatabaseConnection.h:215
void rollbackTransaction() const
Definition: AutoDatabaseConnection.h:153
AutoDatabaseConnection(DatabaseConnectionPool &connectionPool)
void beginTransaction() const
Definition: AutoDatabaseConnection.h:137
void bulkInsert(const String &tableName, const Strings &columnNames, const std::vector< VariantVector > &data) const
Definition: AutoDatabaseConnection.h:189
Definition: DatabaseConnectionPool.h:96
Definition: DatabaseConnectionString.h:56
SPTK generic exception class.
Definition: Exception.h:56
Definition: PoolDatabaseConnection.h:231
DatabaseObjectType
Definition: PoolDatabaseConnection.h:70
DatabaseConnectionType
Definition: PoolDatabaseConnection.h:55