generated from Sithas/conan_template
Корректный, хоть и грубый захват JSON'а
This commit is contained in:
@@ -23,6 +23,18 @@ optional<User> MySQLUserDAO::GetByGUID(string guid)
|
||||
|
||||
std::optional<User> MySQLUserDAO::GetByLogin(std::string login)
|
||||
{
|
||||
auto sql_result = session_.sql("SELECT * FROM `up_and_down`.`users` WHERE (login = '" + login + "') LIMIT 1;"s).execute();
|
||||
list<mysqlx::Row> rows = sql_result.fetchAll();
|
||||
|
||||
if (rows.size())
|
||||
{
|
||||
auto row_data = *rows.begin();
|
||||
|
||||
string replicated_login = row_data[1].get<string>();
|
||||
|
||||
cout << "SUCCESS!" << endl;
|
||||
}
|
||||
|
||||
return nullopt;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user