Refactor project structure: replace User class with ChatUser, integrate Database class, and update CMake configuration for new files
This commit is contained in:
23
database.h
Normal file
23
database.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef YC_LIB_DATABASE_H
|
||||
#define YC_LIB_DATABASE_H
|
||||
|
||||
#include <memory>
|
||||
#include <pqxx/pqxx>
|
||||
#include "config.h"
|
||||
|
||||
namespace Yc {
|
||||
namespace Lib {
|
||||
|
||||
class Database {
|
||||
public:
|
||||
Database(std::shared_ptr<Config> config);
|
||||
~Database() = default;
|
||||
pqxx::result exec(const std::string& query);
|
||||
private:
|
||||
std::unique_ptr<pqxx::connection> _connection;
|
||||
};
|
||||
|
||||
} // namespace Lib
|
||||
} // namespace Yc
|
||||
|
||||
#endif // YC_LIB_DATABASE_H
|
||||
Reference in New Issue
Block a user