11#include <nlohmann/json.hpp>
12#include "private-impl/soci_custom_types.hpp"
14#include "../app/app.h"
21 using json = nlohmann::json;
54 [[nodiscard]] std::shared_ptr<soci::session>
session()
const;
77 std::unique_ptr<soci::connection_pool> m_connPool;
93 logger_impl::start_query(query);
102 logger_impl* do_clone()
const override
Database Management Class.
Definition database.h:28
std::shared_ptr< soci::session > session() const
Get access to a session from the pool.
Definition database.cpp:141
DatabaseUnit()
Definition database.cpp:17
void disconnect() const
CLose all database connections and destroy connection pools.
Definition database.cpp:82
const std::string __class_name__
Definition database.h:75
soci::connection_pool & connectionPool() const
Definition database.cpp:146
void migrate() const
Run database migrations, creates the default system tables.
Definition database.cpp:97
bool connect(DbType backend, const std::string &conn_str)
Initializes the connection pool & connects to specific database.
Definition database.cpp:19
static std::string tmToISODate(const std::tm &t)
Convert c++ std::tm date/time value to ISO formatted string.
Definition database.cpp:159
bool isConnected() const
Check if the database is connected.
Definition database.cpp:151
static void trace(fmt::format_string< Args... > msg, Args &&... args)
Definition logging.h:47
Logger implementation for soci, allowing us to override the default logging behaviour with our own cu...
Definition database.h:85
void start_query(std::string const &query) override
Called before query is executed by soci, we can log the query here.
Definition database.h:91
Wrapper around spdlog's functionality.
nlohmann::json json
Definition mantis.h:35
router.h
Definition app.h:30
DbType
Enum for which database is currently selected.
Definition app.h:44