summaryrefslogtreecommitdiff
path: root/src/main.cpp
blob: 27397f061df326aa5938ce882bd8c702f53ba00e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#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};

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