VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
Connection.hpp File Reference
#include <concepts>
#include <cstdint>
#include <string>
#include <string_view>
#include <sqlpp23/mysql/mysql.h>
#include <sqlpp23/postgresql/postgresql.h>
#include <sqlpp23/sqlite3/sqlite3.h>
#include <sqlpp23/sqlpp23.h>
#include <type_traits>
#include <variant>

Go to the source code of this file.

Namespaces

namespace  VoltMod
 

Typedefs

using VoltMod::PostgresConnection = sqlpp::postgresql::connection
 
using VoltMod::MariaDbConnection = sqlpp::mysql::connection
 
using VoltMod::SqliteConnection = sqlpp::sqlite3::connection
 
using VoltMod::AnyConnection = std::variant< std::monostate, PostgresConnection, MariaDbConnection, SqliteConnection >
 

Functions

template<class Conn , class Statement >
int64_t VoltMod::Insert (Conn &conn, const Statement &insert, std::string_view table, std::string_view key="id")
 
template<class Conn , class Update , class Statement >
void VoltMod::Upsert (Conn &conn, const Update &update, const Statement &insert)
 

Variables

template<class Conn >
constexpr bool VoltMod::IsPostgres = std::same_as<std::remove_cvref_t<Conn>, PostgresConnection>
 
template<class Conn >
constexpr bool VoltMod::IsMariaDb = std::same_as<std::remove_cvref_t<Conn>, MariaDbConnection>
 
template<class Conn >
constexpr bool VoltMod::IsSqlite = std::same_as<std::remove_cvref_t<Conn>, SqliteConnection>