summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAotrix <[email protected]>2025-03-28 01:13:01 +0100
committerAotrix <[email protected]>2025-03-28 01:13:01 +0100
commit62cf53d167a2db73dc9aee7e1e5e1083a82fb75e (patch)
treea92bc5182f86aa4eb87172754311a31333e9c8da /src/main.cpp
parent42af8fc2d5f582e6bcd98d8c483180b5fbe093da (diff)
found an error in refresh_cards_table
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/main.cpp b/src/main.cpp
index fdd59cb..d0aa649 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,27 +1,7 @@
-#include "hearthstoneAPIHandler.h"
#include "postgresHandler.h"
-#include <iostream>
#include <pqxx/pqxx>
int main() {
- HearthstoneAPIHandler hs_handler;
- pqxx::connection cx{
- "postgresql://aotrix@localhost:5432/hearthstonegameinfo"};
- pqxx::work tx{cx};
-
- try {
- std::string cards = hs_handler.get_cards(
- "/?locale=fr_FR&gameMode=constructed&pageSize=40");
- std::cout << cards << std::endl;
- add_cards_to_database(cards, tx);
- tx.commit();
- } catch (pqxx::sql_error const &e) {
- std::cerr << "SQL error: " << e.what() << std::endl;
- std::cerr << "Query was: " << e.query() << std::endl;
- return 2;
- } catch (std::exception const &e) {
- std::cerr << "Error: " << e.what() << std::endl;
- return 1;
- }
+ refresh_cards_table();
return 0;
}