Pgsql::Connection::connect functions now all report connection errors
by throwing exception.
This commit is contained in:
parent
05bca069e3
commit
c5f6da48ce
5 changed files with 35 additions and 39 deletions
|
|
@ -434,7 +434,7 @@ std::tuple<bool, CrudModel::ModifiedRow> CrudModel::updateRow(const PendingRow &
|
|||
int row_number = pending_row.row();
|
||||
Pgsql::Connection db_update_conn;
|
||||
auto dbconfig = m_database->config();
|
||||
db_update_conn.connect(dbconfig.connectionString().toStdString().c_str());
|
||||
db_update_conn.connect(dbconfig.connectionString());
|
||||
try {
|
||||
auto result = db_update_conn.queryParam(buffer, params);
|
||||
if (result && result.rows() == 1) {
|
||||
|
|
@ -528,7 +528,7 @@ std::tuple<bool, QString> CrudModel::removeRows(const std::set<IntegerRange<int>
|
|||
try {
|
||||
Pgsql::Connection db_update_conn;
|
||||
auto dbconfig = m_database->config();
|
||||
db_update_conn.connect(dbconfig.connectionString().toStdString().c_str());
|
||||
db_update_conn.connect(dbconfig.connectionString());
|
||||
|
||||
// First delete rows in table
|
||||
QString delete_statement = createDeleteStatement();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue