mirror of
https://github.com/boostorg/mysql.git
synced 2026-01-30 08:02:26 +00:00
Row reading reworks
- Removed distinction between row and owning_row - Changed semantics for fetch_one to row& + bool - Renamed all fetch_* fns to read_* - Added row.clear()
This commit is contained in:
@@ -74,7 +74,7 @@ void main_impl(int argc, char** argv)
|
||||
boost::mysql::unix_resultset result = conn.query(sql);
|
||||
|
||||
// Get all the rows in the resultset
|
||||
std::vector<boost::mysql::owning_row> employees = result.fetch_all();
|
||||
std::vector<boost::mysql::row> employees = result.read_all();
|
||||
for (const auto& employee: employees)
|
||||
{
|
||||
print_employee(employee);
|
||||
@@ -88,7 +88,7 @@ void main_impl(int argc, char** argv)
|
||||
|
||||
// Check we have updated our poor intern salary
|
||||
result = conn.query("SELECT salary FROM employee WHERE first_name = 'Underpaid'");
|
||||
auto rows = result.fetch_all();
|
||||
auto rows = result.read_all();
|
||||
ASSERT(rows.size() == 1);
|
||||
double salary = rows[0].values()[0].get<double>();
|
||||
ASSERT(salary == 10000);
|
||||
|
||||
Reference in New Issue
Block a user