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 87 template <DbType Type>
95 void session_end()
override;
96 void load(QofBook*, QofBackendLoadType)
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);
122 gnc_push_locale(
const int category,
const std::string locale)
124 std::string retval(setlocale(category,
nullptr));
125 setlocale(category, locale.c_str());
130 gnc_pop_locale(
const int category, std::string locale)
132 setlocale(category, locale.c_str());
136 std::string adjust_sql_options_string(
const std::string&);
140 #endif //GNC_BACKEND_DBI_HPP void set_dbi_error(QofBackendError error, unsigned int repeat, bool retry) noexcept
FIXME: Just a pass-through to m_conn:
QofBackendError
The errors that can be reported to the GUI & other front-end users.
GncSqlConnection * m_conn
SQL connection.
void safe_sync(QofBook *) override
Safely resave a database by renaming all of its tables, recreating everything, and then dropping the ...
Row of SQL Query results.
void load(QofBook *, QofBackendLoadType) override
Load the minimal set of application data needed for the application to be operable at initial startup...
SessionOpenMode
Mode for opening sessions.
Encapsulate the connection to the database.
void session_begin(QofSession *, const char *, SessionOpenMode) override
Open the file or connect to the server.
Main SQL backend structure.