After an insert, update, delete the number of rows affected is reported.
This also makes it clearer the command was executed succesfully. Times are now printed with no more then two decimals. This prevents confusion between thousand and decimal seperators.
This commit is contained in:
parent
5831f18008
commit
fa9787adfd
5 changed files with 68 additions and 36 deletions
|
|
@ -122,6 +122,26 @@ ErrorDetails Result::diagDetails()
|
|||
return ErrorDetails::createErrorDetailsFromPGresult(result);
|
||||
}
|
||||
|
||||
int Result::tuplesAffected() const
|
||||
{
|
||||
int i;
|
||||
char * res = PQcmdTuples(result);
|
||||
if (res) {
|
||||
try {
|
||||
i = std::stoi(res);
|
||||
}
|
||||
catch (std::invalid_argument& ) {
|
||||
i = -1;
|
||||
}
|
||||
catch (std::out_of_range& ) {
|
||||
i = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
i = -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
int Result::getRows() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue