diff --git a/src/DAO/MySQLUserDAO.cpp b/src/DAO/MySQLUserDAO.cpp index 96e562e..ed5f1f5 100644 --- a/src/DAO/MySQLUserDAO.cpp +++ b/src/DAO/MySQLUserDAO.cpp @@ -1,5 +1,7 @@ #include "MySQLUserDAO.h" +#include + using namespace std; using namespace string_literals; @@ -21,8 +23,6 @@ optional MySQLUserDAO::GetByGUID(string guid) vector MySQLUserDAO::GetAll() { - auto const sql_query = session_.getSchemas(); - sql_query. vector users {}; return {}; diff --git a/src/main.cpp b/src/main.cpp index 48796c4..4c840f0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,6 +18,7 @@ #include "./session/WebsocketSession.h" #include "./listener/Listener.h" #include "./db/mysql_connector.h" +#include "entities/User.h" namespace beast = boost::beast; namespace http = beast::http; @@ -44,6 +45,21 @@ int main(int argc, char* argv[]) string mysql_credentials = argv[5]; uad::SetMySqlSession(new mysqlx::Session(mysql_credentials)); + auto& session = uad::GetMySqlSession(); + + auto schema = session.getSchema("up_and_down"); + + auto collections_names = schema.getCollectionNames(); + auto users_collection = schema.getCollection("users"); + auto users_collection_2 = session.sql("SELECT * FROM up_and_down.users;").execute(); + + auto users_rows = users_collection_2.fetchAll(); + + auto rows = *users_rows.begin(); + + const auto& user_guid = static_cast(rows.get(0)); + const auto& user_login = static_cast(rows.get(1)); + const auto& user_hashed_password = static_cast(rows.get(2)); net::io_context ioc{threads};