blob: 42821185712138507e2e15f546b88099eae24502 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include <format>
#include <iostream>
#include <pqxx/pqxx>
// TODO: Parser les cartes
int main() {
// 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;
}
|