Refactor project structure: replace User class with ChatUser, integrate Database class, and update CMake configuration for new files

This commit is contained in:
Torsten Schulz (local)
2025-08-11 14:48:45 +02:00
parent 89956bd01a
commit b81f2de10f
14 changed files with 644 additions and 44 deletions

17
db_example.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include <iostream>
#include <pqxx/pqxx>
int main() {
try {
pqxx::connection c{"dbname=your_db user=your_user password=your_pass host=localhost"};
pqxx::work txn{c};
pqxx::result r = txn.exec("SELECT version();");
for (auto row : r) {
std::cout << row[0].c_str() << std::endl;
}
} catch (const std::exception &e) {
std::cerr << "PostgreSQL error: " << e.what() << std::endl;
return 1;
}
return 0;
}