ledger-core
|
#include <DatabaseConnection.hpp>
Public Member Functions | |
virtual std::shared_ptr< DatabaseStatement > | prepareStatement (const std::string &query, bool repeatable)=0 |
virtual void | begin ()=0 |
virtual void | rollback ()=0 |
virtual void | commit ()=0 |
virtual void | close ()=0 |
virtual std::shared_ptr< DatabaseBlob > | newBlob ()=0 |
An active connection to a database. This API is fully synchronous and all objects created by this interface need to return synchronously. A connection is used to prepare statements, managing transactions and creating abstractions of database objects.
|
pure virtual |
Begin a SQL transaction on this connection.
Implemented in Connection.
|
pure virtual |
Close the current connection. After this call the connection should never be called again.
Implemented in Connection.
|
pure virtual |
End the current transaction and persist all changes that occurred between the call of begin
and commit
.
Implemented in Connection.
|
pure virtual |
|
pure virtual |
Prepare a statement object using the given SQL query. The statement object will then be responsible of executing the query and handle results. Statement objects may be reused over time if their repeatable
flag is set to true.
query | A SQL query to execute (e.g. "SELECT * FROM users WHERE name = 'Joe'") |
repeatable | A flag to indicate whether or not the statement is repeatable |
Implemented in Connection.
|
pure virtual |
End the current transaction and rollback all changes that occurred between the call of begin
and rollback
.
Implemented in Connection.