Рабочая сборка с третьей ручкой

This commit is contained in:
Антон
2025-09-28 08:18:27 +03:00
parent b131f9d4e8
commit 14481fa055
+5 -9
View File
@@ -101,16 +101,12 @@ pair<bool, vector<user>> MySQLUserDAO::GetAll(size_t limit, size_t offset)
bool MySQLUserDAO::Update(const user& u)
{
auto schema = session_.getSchema("up_and_down");
auto table = schema.getTable("users");
mysqlx::Result res = table.update()
.set("login", u.login)
.set("hashed_password", u.hashed_password)
.where("uuid = :uuid")
.bind("uuid", u.uuid)
.execute();
const string sql_script = "UPDATE `up_and_down`.`user` SET login = '"s + u.login +
"' WHERE guid = '" + u.uuid + "';"s;
return !!res.getAffectedItemsCount();
auto schema = session_.sql(sql_script).execute();
return !!schema.getAffectedItemsCount();
}
bool MySQLUserDAO::Delete(const string& uuid)