| 201 | } |
| 202 | |
| 203 | RunResult::RunResult(StatementHandlePtr stmt, std::vector<Error> errors) noexcept |
| 204 | : mStatement { std::move(stmt) } |
| 205 | , mErrors { std::move(errors) } |
| 206 | { |
| 207 | // mStatement can't be nullptr here, by construction |
| 208 | assert(mStatement != nullptr); |
| 209 | |
| 210 | const auto rc = sqlite3_step(*mStatement); |
| 211 | |
| 212 | mHasRows = rc == SQLITE_ROW; |
| 213 | |
| 214 | if (rc == SQLITE_DONE) |
| 215 | mModifiedRowsCount = sqlite3_changes(sqlite3_db_handle(*mStatement)); |
| 216 | |
| 217 | if (rc != SQLITE_DONE && !mHasRows) |
| 218 | mErrors.emplace_back(Error(rc)); |
| 219 | } |
| 220 | |
| 221 | RunResult::RunResult(RunResult&& rhs) noexcept |
| 222 | { |