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

This commit is contained in:
Антон
2025-09-28 08:18:27 +03:00
parent 9eac7d683f
commit 7469a61ca4
+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) bool MySQLUserDAO::Update(const user& u)
{ {
auto schema = session_.getSchema("up_and_down"); const string sql_script = "UPDATE `up_and_down`.`user` SET login = '"s + u.login +
auto table = schema.getTable("users"); "' WHERE guid = '" + u.uuid + "';"s;
mysqlx::Result res = table.update()
.set("login", u.login)
.set("hashed_password", u.hashed_password)
.where("uuid = :uuid")
.bind("uuid", u.uuid)
.execute();
return !!res.getAffectedItemsCount(); auto schema = session_.sql(sql_script).execute();
return !!schema.getAffectedItemsCount();
} }
bool MySQLUserDAO::Delete(const string& uuid) bool MySQLUserDAO::Delete(const string& uuid)