DAO - работает изменение данных

This commit is contained in:
Антон
2025-09-01 10:48:47 +03:00
parent 851023522e
commit b99173d959
2 changed files with 19 additions and 1 deletions
+10 -1
View File
@@ -93,7 +93,16 @@ pair<bool, vector<User>> MySQLUserDAO::GetAll(size_t limit, size_t offset)
bool MySQLUserDAO::Update(const User& u)
{
return false;
auto schema = session_.getSchema("up_and_down");
auto table = schema.getTable("users");
mysqlx::Result res = table.update()
.set("login", u.GetLogin())
.set("hashed_password", u.GetHashedPassword())
.where("uuid = :uuid")
.bind("uuid", u.GetUUID())
.execute();
return res.getAffectedItemsCount() > 0;
}
bool MySQLUserDAO::Delete(string id)