From 4167f92f3d36b7384c4c5f8bf7501bba52e91a0c Mon Sep 17 00:00:00 2001 From: Aotrix Date: Sun, 29 Jun 2025 02:16:13 +0200 Subject: refactoring and added start menu --- include/postgresHandler.hpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 include/postgresHandler.hpp (limited to 'include/postgresHandler.hpp') diff --git a/include/postgresHandler.hpp b/include/postgresHandler.hpp new file mode 100644 index 0000000..2c3f6f4 --- /dev/null +++ b/include/postgresHandler.hpp @@ -0,0 +1,36 @@ +#pragma once +#include "hearthstoneAPIHandler.hpp" +#include +#include + +/** + * Execute a SQL query from a libpqxx transaction + * + * @param aTransaction The SQL transaction object used to execute the query + * @param aQuery The SQL query + * @return The result of the executed SQL query + */ +const pqxx::result executeQuery(pqxx::work &aTransaction, + std::string_view aQuery); + +/** + * Get the type id of the value element in the "key": value regex match + * For instance, if the regex match is "isZilliaxCosmeticModule":false + * Then the type id is the one correponding to BOOL + * + * @param kSregexIt the regex match for a "key": value card information + * @return the type identifier of the value element + */ +const unsigned int +getTypeIndexOfRegexIterator(const std::sregex_iterator &kSregexIt); +/** + * Add a list of cards (TODO: Complete documentation and function) + * + * @param kCards + * @param aTransaction + */ +void addCardsToDatabase(HearthstoneAPIHandler &aAPIIntermediate, + pqxx::work &aTransaction, + const std::string &kURLOfCardsPage); + +void refresh_cards_table(); -- cgit v1.2.3