DAO - Полное завершение класса

This commit is contained in:
Антон
2025-09-01 12:32:21 +03:00
parent 7e5970b01f
commit cc95543407
4 changed files with 15 additions and 4 deletions
+9 -2
View File
@@ -105,9 +105,16 @@ bool MySQLUserDAO::Update(const User& u)
return !!res.getAffectedItemsCount();
}
bool MySQLUserDAO::Delete(string id)
bool MySQLUserDAO::Delete(string uuid)
{
return false;
auto schema = session_.getSchema("up_and_down");
auto table = schema.getTable("users");
mysqlx::Result res = table.remove()
.where("uuid = :uuid")
.bind("uuid", uuid)
.execute();
return !!res.getAffectedItemsCount();
}
std::optional<User> MySQLUserDAO::GetSingleUserBySQLResult(mysqlx::SqlResult&& sql_result)