summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 57dd2d7..4282118 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,10 +1,20 @@
+#include <format>
#include <iostream>
#include <pqxx/pqxx>
// TODO: Parser les cartes
int main() {
- std::cout << "Decomposer le problème en des sous-problèmes" << std::endl;
// TODO: Récupérer le nombre de cartes
+ pqxx::connection cx{
+ "postgresql://aotrix@localhost:5432/hearthstonegameinfo"};
+ pqxx::work tx{cx};
+ pqxx::result r{tx.exec("SELECT * FROM cards")};
+ for (auto row : r) {
+ std::cout << std::format(
+ "{}; {}; {}; {}; {}", row[0].as<std::string>(),
+ row[1].as<std::string>(), row[2].as<std::string>(),
+ row[3].as<std::string>(), row[4].as<std::string>());
+ }
return 0;
}