mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
New function GncSqlConnection::dberror().
GncDbiSqlResult::dberror() just calls it instead of retrieving the dbi_conn to call dbi_conn_error() itself.
This commit is contained in:
parent
583c951adc
commit
e0d5cc5b0b
@ -2044,12 +2044,6 @@ GncDbiSqlResult::begin()
|
|||||||
return m_sentinel;
|
return m_sentinel;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
GncDbiSqlResult::dberror()
|
|
||||||
{
|
|
||||||
return dbi_conn_error(m_conn->conn(), nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t
|
uint64_t
|
||||||
GncDbiSqlResult::size() const noexcept
|
GncDbiSqlResult::size() const noexcept
|
||||||
{
|
{
|
||||||
|
@ -109,6 +109,8 @@ public:
|
|||||||
bool add_columns_to_table (const std::string&, const ColVec&)
|
bool add_columns_to_table (const std::string&, const ColVec&)
|
||||||
const noexcept override;
|
const noexcept override;
|
||||||
std::string quote_string (const std::string&) const noexcept override;
|
std::string quote_string (const std::string&) const noexcept override;
|
||||||
|
int dberror() const noexcept override {
|
||||||
|
return dbi_conn_error(m_conn, nullptr); }
|
||||||
QofBackend* qbe () const noexcept { return m_qbe; }
|
QofBackend* qbe () const noexcept { return m_qbe; }
|
||||||
dbi_conn conn() const noexcept { return m_conn; }
|
dbi_conn conn() const noexcept { return m_conn; }
|
||||||
GncDbiProvider* provider() { return m_provider; }
|
GncDbiProvider* provider() { return m_provider; }
|
||||||
@ -181,8 +183,8 @@ public:
|
|||||||
m_conn{conn}, m_dbi_result{result}, m_iter{this}, m_row{&m_iter},
|
m_conn{conn}, m_dbi_result{result}, m_iter{this}, m_row{&m_iter},
|
||||||
m_sentinel{nullptr} {}
|
m_sentinel{nullptr} {}
|
||||||
~GncDbiSqlResult();
|
~GncDbiSqlResult();
|
||||||
int dberror();
|
|
||||||
uint64_t size() const noexcept;
|
uint64_t size() const noexcept;
|
||||||
|
int dberror() { return m_conn->dberror(); }
|
||||||
GncSqlRow& begin();
|
GncSqlRow& begin();
|
||||||
GncSqlRow& end() { return m_sentinel; }
|
GncSqlRow& end() { return m_sentinel; }
|
||||||
protected:
|
protected:
|
||||||
|
@ -188,6 +188,10 @@ public:
|
|||||||
const noexcept = 0;
|
const noexcept = 0;
|
||||||
virtual std::string quote_string (const std::string&)
|
virtual std::string quote_string (const std::string&)
|
||||||
const noexcept = 0;
|
const noexcept = 0;
|
||||||
|
/** Get the connection error value.
|
||||||
|
* If not 0 will normally be meaningless outside of implementation code.
|
||||||
|
*/
|
||||||
|
virtual int dberror() const noexcept = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,6 +104,7 @@ public:
|
|||||||
const noexcept override { return false; }
|
const noexcept override { return false; }
|
||||||
virtual std::string quote_string (const std::string& str)
|
virtual std::string quote_string (const std::string& str)
|
||||||
const noexcept override { return std::string{str}; }
|
const noexcept override { return std::string{str}; }
|
||||||
|
int dberror() const noexcept override { return 0; }
|
||||||
private:
|
private:
|
||||||
GncMockSqlResult m_result;
|
GncMockSqlResult m_result;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user