drogon
C++14/17-based HTTP application framework
Loading...
Searching...
No Matches
drogon::orm::Transaction Class Referenceabstract
Inheritance diagram for drogon::orm::Transaction:
Collaboration diagram for drogon::orm::Transaction:

Public Member Functions

virtual void rollback ()=0
virtual void setCommitCallback (const std::function< void(bool)> &commitCallback)=0
void closeAll () override
 Close all connections in the client. usually used by Drogon in the quit() method.
Public Member Functions inherited from drogon::orm::DbClient
template<typename FUNCTION1, typename FUNCTION2, typename... Arguments>
void execSqlAsync (const std::string &sql, FUNCTION1 &&rCallback, FUNCTION2 &&exceptCallback, Arguments &&...args) noexcept
 Async and nonblocking method.
template<typename... Arguments>
std::future< ResultexecSqlAsyncFuture (const std::string &sql, Arguments &&...args) noexcept
 Async and nonblocking method.
template<typename... Arguments>
Result execSqlSync (const std::string &sql, Arguments &&...args) noexcept(false)
internal::SqlBinder operator<< (const std::string &sql)
internal::SqlBinder operator<< (std::string &&sql)
template<int N>
internal::SqlBinder operator<< (const char(&sql)[N])
internal::SqlBinder operator<< (const std::string_view &sql)
virtual std::shared_ptr< TransactionnewTransaction (const std::function< void(bool)> &commitCallback=std::function< void(bool)>(), TransactionType transType=TransactionType::Deferred) noexcept(false)=0
 Create a transaction object.
std::shared_ptr< TransactionnewTransaction (TransactionType transType) noexcept(false)
 Convenience overload: create a transaction with a specific locking mode.
virtual void newTransactionAsync (const std::function< void(const std::shared_ptr< Transaction > &)> &callback, TransactionType transType=TransactionType::Deferred)=0
 Create a transaction object in asynchronous mode.
void newTransactionAsync (TransactionType transType, const std::function< void(const std::shared_ptr< Transaction > &)> &callback)
virtual bool hasAvailableConnections () const noexcept=0
 Check if there is a connection successfully established.
ClientType type () const
const std::string & connectionInfo () const
virtual void setTimeout (double timeout)=0
 Set the Timeout value of execution of a SQL.

Additional Inherited Members

Static Public Member Functions inherited from drogon::orm::DbClient
static std::shared_ptr< DbClientnewPgClient (const std::string &connInfo, size_t connNum, bool autoBatch=false)
 Create a new database client with multiple connections;.
static std::shared_ptr< DbClientnewMysqlClient (const std::string &connInfo, size_t connNum)
static std::shared_ptr< DbClientnewSqlite3Client (const std::string &connInfo, size_t connNum)
Protected Attributes inherited from drogon::orm::DbClient
ClientType type_
std::string connectionInfo_

Member Function Documentation

◆ closeAll()

void drogon::orm::Transaction::closeAll ( )
inlineoverridevirtual

Close all connections in the client. usually used by Drogon in the quit() method.

Implements drogon::orm::DbClient.


The documentation for this class was generated from the following file: