diff options
| author | Aotrix <[email protected]> | 2025-03-25 22:00:39 +0100 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2025-03-25 22:00:39 +0100 |
| commit | 50a6cf2e28758f83eecc0e46f39e044be519a8e4 (patch) | |
| tree | a46984017bfa4cdeca66e581f640bb1812a22ecf /src/main.cpp | |
| parent | 6ba1abb1458c4b4ffad3723f15ad52a504b8c264 (diff) | |
you can now add columns in cards table!
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp index 780883f..de64d9e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,20 +5,16 @@ int main() { HearthstoneAPIHandler hs_handler; - // TODO: use a parser on get_cards returned value - // 642; 678 - const unsigned int card_id = 678; - std::cout << hs_handler.get_cards(std::format("{}?locale=fr_FR", card_id)) - << std::endl; - pqxx::connection cx{ "postgresql://aotrix@localhost:5432/hearthstonegameinfo"}; pqxx::work tx{cx}; - display_query_result(execute_query(tx, "SELECT * FROM cards")); - // TODO: for test purposes - // use get_cards output instead? - add_cards_to_database( - hs_handler.get_cards(std::format("{}?locale=fr_FR", card_id)), tx); + const unsigned int card_id = 217; + std::string card = + hs_handler.get_cards(std::format("{}?locale=fr_FR", card_id)); + std::cout << card << std::endl; + add_cards_to_database(card, tx); + + tx.commit(); return 0; } |
