25 #include "gnc-sql-object-backend.hpp" 26 #include "gnc-sql-backend.hpp" 27 #include "gnc-sql-column-table-entry.hpp" 40 is_infant = qof_instance_get_infant (inst);
45 else if (sql_be->pristine() || is_infant)
76 g_return_if_fail (sql_be !=
nullptr);
83 else if (version != m_version)
84 PERR(
"Version mismatch in table %s, expecting %d but backend is %d." 85 "Table creation aborted.", m_table_name.c_str(), m_version, version);
92 return sql_be->object_in_db(m_table_name.c_str(), m_type_name.c_str(),
bool do_db_operation(E_DB_OPERATION op, const char *table_name, QofIdTypeConst obj_name, gpointer pObject, const EntryVec &table) const noexcept
Performs an operation on the database.
bool create_table(const std::string &table_name, const EntryVec &col_table) const noexcept
Creates a table in the database.
bool set_table_version(const std::string &table_name, uint_t version) noexcept
Registers the version for a table.
const EntryVec & m_col_table
The front-end QofIdType.
const GncGUID * qof_instance_get_guid(gconstpointer inst)
Return the GncGUID of this instance.
#define G_LOG_DOMAIN
Functions providing the SX List as a plugin page.
load and save accounts data to SQL
gboolean qof_instance_get_destroying(gconstpointer ptr)
Retrieve the flag that indicates whether or not this object is about to be destroyed.
gboolean gnc_sql_slots_save(GncSqlBackend *sql_be, const GncGUID *guid, gboolean is_infant, QofInstance *inst)
gnc_sql_slots_save - Saves slots for an object to the db.
#define PERR(format, args...)
Log a serious error.
virtual bool commit(GncSqlBackend *sql_be, QofInstance *inst)
UPDATE/INSERT a single instance of m_type_name into the database.
virtual void create_tables(GncSqlBackend *sql_be)
Conditionally create or update a database table from m_col_table.
gboolean gnc_sql_slots_delete(GncSqlBackend *sql_be, const GncGUID *guid)
gnc_sql_slots_delete - Deletes slots for an object from the db.
The type used to store guids in C.
uint_t get_table_version(const std::string &table_name) const noexcept
Returns the version number for a DB table.
Main SQL backend structure.
bool instance_in_db(const GncSqlBackend *sql_be, QofInstance *inst) const noexcept
Check the presence of an object in the backend's database.