GnuCash
5.6-150-g038405b370+
|
Encapsulate a libdbi dbi_conn connection. More...
#include <gnc-dbisqlconnection.hpp>
Public Member Functions | |
GncDbiSqlConnection (DbType type, QofBackend *qbe, dbi_conn conn, SessionOpenMode mode) | |
GncSqlResultPtr | execute_select_statement (const GncSqlStatementPtr &) noexcept override |
int | execute_nonselect_statement (const GncSqlStatementPtr &) noexcept override |
Returns false if error. | |
GncSqlStatementPtr | create_statement_from_sql (const std::string &) const noexcept override |
bool | does_table_exist (const std::string &) const noexcept override |
Returns true if successful. | |
bool | begin_transaction () noexcept override |
Returns TRUE if successful, false if error. | |
bool | rollback_transaction () noexcept override |
Returns TRUE if successful, FALSE if error. | |
bool | commit_transaction () noexcept override |
Returns TRUE if successful, FALSE if error. | |
bool | create_table (const std::string &, const ColVec &) const noexcept override |
Returns TRUE if successful, FALSE if error. | |
bool | create_index (const std::string &, const std::string &, const EntryVec &) const noexcept override |
Returns TRUE if successful, FALSE if error. | |
bool | add_columns_to_table (const std::string &, const ColVec &) const noexcept override |
Returns TRUE if successful, FALSE if error. | |
std::string | quote_string (const std::string &) const noexcept override |
int | dberror () const noexcept override |
Get the connection error value. More... | |
QofBackend * | qbe () const noexcept |
dbi_conn | conn () const noexcept |
void | set_error (QofBackendError error, unsigned int repeat, bool retry) noexcept override |
void | init_error () noexcept |
bool | verify () noexcept override |
Check if the dbi connection is valid. More... | |
bool | retry_connection (const char *msg) noexcept override |
bool | table_operation (TableOpType op) noexcept |
Perform a specified SQL operation on every table in a database. More... | |
std::string | add_columns_ddl (const std::string &table_name, const ColVec &info_vec) const noexcept |
bool | drop_indexes () noexcept |
Public Member Functions inherited from GncSqlConnection | |
virtual | ~GncSqlConnection ()=default |
Returns NULL if error. | |
Encapsulate a libdbi dbi_conn connection.
Definition at line 41 of file gnc-dbisqlconnection.hpp.
|
inlineoverridevirtualnoexcept |
Get the connection error value.
If not 0 will normally be meaningless outside of implementation code.
Implements GncSqlConnection.
Definition at line 63 of file gnc-dbisqlconnection.hpp.
|
noexcept |
Perform a specified SQL operation on every table in a database.
Possible operations are:
The intent of the last two is to be able to move an existing table aside, query its contents with a transformation (in 2.4.x this is already done as the contents are loaded completely when a Qof session is started), save them to a new table according to a new database format, and finally drop the backup table; if there's an error during the process, rollback allows returning the table to its original state.
sql_conn | The sql connection (via dbi) to which the transactions will be sent |
table_namess | StrVec of tables to operate on. |
op | The operation to perform. |
Definition at line 663 of file gnc-dbisqlconnection.cpp.
|
overridevirtualnoexcept |
Check if the dbi connection is valid.
If not attempt to re-establish it Returns TRUE if there is a valid connection in the end or FALSE otherwise
Implements GncSqlConnection.
Definition at line 557 of file gnc-dbisqlconnection.cpp.