droplet 1.1.0
A multipurpose Discord bot with the hacker in mind
Loading...
Searching...
No Matches
database Namespace Reference

Functions

template<size_t I = 0, typename... Types>
constexpr void assignResults (const pqxx::result &result, std::vector< std::variant< Types... > > &args)
 
template<typename... Types>
auto execQuery (const std::string &query, Types &&... args) noexcept -> bool
 executes a query on the database
 
template<typename... Types>
auto execSelect (const std::string &query, Types &&... args) noexcept -> RowDTOAdapter
 executes a Select on the database
 
template<typename... Types>
auto execSelectAll (const std::string &query, Types &&... args) noexcept -> std::vector< RowDTOAdapter >
 executes a Select on the database
 

Function Documentation

◆ assignResults()

template<size_t I = 0, typename... Types>
constexpr void database::assignResults ( const pqxx::result & result,
std::vector< std::variant< Types... > > & args )
constexpr

◆ execQuery()

template<typename... Types>
auto database::execQuery ( const std::string & query,
Types &&... args ) -> bool
noexcept

executes a query on the database

Parameters
querySQL query to be executed
argsthe arguments the query takes
Returns
error code if the query was executed

◆ execSelect()

template<typename... Types>
auto database::execSelect ( const std::string & query,
Types &&... args ) -> RowDTOAdapter
noexcept

executes a Select on the database

Parameters
querySQL select query to be executed
argsthe arguments the query takes
Returns
RowDTOAdapter that represents the selected database row

◆ execSelectAll()

template<typename... Types>
auto database::execSelectAll ( const std::string & query,
Types &&... args ) -> std::vector<RowDTOAdapter>
noexcept

executes a Select on the database

Parameters
querySQL select query to be executed
argsthe arguments the query takes
Returns
std::vector<RowDTOAdapter> that represents the selected database rows