23#ifndef GNC_BACKEND_DBI_HPP
24#define GNC_BACKEND_DBI_HPP
29#define GETPID() GetCurrentProcessId()
33#define GETPID() getpid()
36#include <gnc-sql-backend.hpp>
37#include <gnc-sql-connection.hpp>
41#define GNC_HOST_NAME_MAX 255
95 void session_end()
override;
98 bool connected()
const noexcept {
return m_conn !=
nullptr; }
103 m_conn->set_error(error, repeat, retry);
105 void retry_connection(
const char* msg)
const noexcept
107 m_conn->retry_connection(msg);
110 bool exists() {
return m_exists; }
111 void set_exists(
bool exists) { m_exists = exists; }
113 dbi_conn conn_setup(PairVec& options,
UriStrings& uri);
114 bool conn_test_dbi_library(dbi_conn conn);
115 bool set_standard_connection_options(dbi_conn conn,
const UriStrings& uri);
116 bool create_database(dbi_conn conn,
const char* db);
122gnc_push_locale(
const int category,
const std::string locale)
124 std::string retval(setlocale(category,
nullptr));
125 setlocale(category, locale.c_str());
130gnc_pop_locale(
const int category, std::string locale)
132 setlocale(category, locale.c_str());
136std::string adjust_sql_options_string(
const std::string&);
void load(QofBook *, QofBackendLoadType) override
Load the minimal set of application data needed for the application to be operable at initial startup...
void safe_sync(QofBook *) override
Safely resave a database by renaming all of its tables, recreating everything, and then dropping the ...
void set_dbi_error(QofBackendError error, unsigned int repeat, bool retry) noexcept
FIXME: Just a pass-through to m_conn:
void session_begin(QofSession *, const char *, SessionOpenMode) override
Open the file or connect to the server.
Main SQL backend structure.
GncSqlConnection * m_conn
SQL connection.
Encapsulate the connection to the database.
Row of SQL Query results.
QofBackendError
The errors that can be reported to the GUI & other front-end users.
SessionOpenMode
Mode for opening sessions.