24 #ifndef __GNC_SQL_CONNECTION_HPP__ 25 #define __GNC_SQL_CONNECTION_HPP__ 35 using GncSqlColumnTableEntryPtr = std::shared_ptr<GncSqlColumnTableEntry>;
36 using EntryVec = std::vector<GncSqlColumnTableEntryPtr>;
37 using PairVec = std::vector<std::pair<std::string, std::string>>;
39 using ColVec = std::vector<GncSqlColumnInfo>;
48 virtual const char* to_sql()
const = 0;
52 using GncSqlStatementPtr = std::unique_ptr<GncSqlStatement>;
63 virtual GncSqlResultPtr execute_select_statement (
const GncSqlStatementPtr&)
68 virtual GncSqlStatementPtr create_statement_from_sql (
const std::string&)
79 virtual bool create_table (
const std::string&,
const ColVec&)
82 virtual bool create_index (
const std::string&,
const std::string&,
83 const EntryVec&)
const noexcept = 0;
87 virtual std::string quote_string (
const std::string&)
92 virtual int dberror()
const noexcept = 0;
94 bool retry) noexcept = 0;
95 virtual bool verify() noexcept = 0;
96 virtual bool retry_connection(
const char* msg) noexcept = 0;
101 #endif //__GNC_SQL_CONNECTION_HPP__ information required to create a column in a table.
const gchar * QofIdTypeConst
QofIdTypeConst declaration.
QofBackendError
The errors that can be reported to the GUI & other front-end users.
virtual bool create_index(const std::string &, const std::string &, const EntryVec &) const noexcept=0
Returns TRUE if successful, FALSE if error.
virtual int execute_nonselect_statement(const GncSqlStatementPtr &) noexcept=0
Returns false if error.
virtual int dberror() const noexcept=0
Get the connection error value.
virtual bool commit_transaction() noexcept=0
Returns TRUE if successful, FALSE if error.
virtual bool add_columns_to_table(const std::string &, const ColVec &) const noexcept=0
Returns TRUE if successful, FALSE if error.
virtual bool create_table(const std::string &, const ColVec &) const noexcept=0
Returns TRUE if successful, FALSE if error.
Encapsulate the connection to the database.
Pure virtual class to iterate over a query result set.
virtual bool begin_transaction() noexcept=0
Returns TRUE if successful, false if error.
virtual bool rollback_transaction() noexcept=0
Returns TRUE if successful, FALSE if error.
Contains all of the information required to copy information between an object and the database for a...
virtual bool does_table_exist(const std::string &) const noexcept=0
Returns true if successful.
virtual ~GncSqlConnection()=default
Returns NULL if error.