diff options
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; } |
