StormByte C++ Library: Database module 0.0.9999
StormByte-Database is a StormByte library module for handling database connections
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
StormByte::Database::PreparedSTMT< Row > Class Template Referenceabstract

Prepared statement for databases. More...

#include <preparedSTMT.hxx>

Inheritance diagram for StormByte::Database::PreparedSTMT< Row >:
Inheritance graph
[legend]

Public Member Functions

constexpr PreparedSTMT (const std::string &name, const std::string &query)
 
constexpr PreparedSTMT (std::string &&name, std::string &&query)
 
 PreparedSTMT (const PreparedSTMT &)=delete
 
constexpr PreparedSTMT (PreparedSTMT &&)=default
 
PreparedSTMToperator= (const PreparedSTMT &)=delete
 
constexpr PreparedSTMToperator= (PreparedSTMT &&)=default
 
virtual constexpr ~PreparedSTMT ()=default
 
virtual PreparedSTMTBind (const int &index, const std::nullptr_t &value) noexcept=0
 
virtual PreparedSTMTBind (const int &index, const int &value) noexcept=0
 
virtual PreparedSTMTBind (const int &index, const unsigned int &value) noexcept=0
 
virtual PreparedSTMTBind (const int &index, const int64_t &value) noexcept=0
 
virtual PreparedSTMTBind (const int &index, const uint64_t &value) noexcept=0
 
virtual PreparedSTMTBind (const int &index, const double &value) noexcept=0
 
virtual PreparedSTMTBind (const int &index, bool value) noexcept=0
 
virtual PreparedSTMTBind (const int &index, const std::string &value) noexcept=0
 
virtual void Reset () noexcept=0
 
virtual const RowStep () noexcept=0
 
constexpr const std::string & GetName () const noexcept
 
constexpr const std::string & GetQuery () const noexcept
 

Protected Attributes

std::string m_name
 Name of the prepared statement.
 
std::string m_query
 Query to prepare.
 
std::unique_ptr< Rowm_row
 Last result row of the prepared statement.
 

Detailed Description

template<class Row>
class StormByte::Database::PreparedSTMT< Row >

Prepared statement for databases.

Constructor & Destructor Documentation

◆ PreparedSTMT() [1/4]

template<class Row >
constexpr StormByte::Database::PreparedSTMT< Row >::PreparedSTMT ( const std::string &  name,
const std::string &  query 
)
inlineconstexpr

Default constructor

Parameters
nameThe name of the prepared statement
queryThe query to prepare

◆ PreparedSTMT() [2/4]

template<class Row >
constexpr StormByte::Database::PreparedSTMT< Row >::PreparedSTMT ( std::string &&  name,
std::string &&  query 
)
inlineconstexpr

Constructor moving string

Parameters
nameThe name of the prepared statement
queryThe query to prepare

◆ PreparedSTMT() [3/4]

template<class Row >
StormByte::Database::PreparedSTMT< Row >::PreparedSTMT ( const PreparedSTMT< Row > &  )
delete

Default copy constructor (deleted)

◆ PreparedSTMT() [4/4]

template<class Row >
constexpr StormByte::Database::PreparedSTMT< Row >::PreparedSTMT ( PreparedSTMT< Row > &&  )
constexprdefault

Default move constructor

◆ ~PreparedSTMT()

template<class Row >
virtual constexpr StormByte::Database::PreparedSTMT< Row >::~PreparedSTMT ( )
constexprvirtualdefault

Default destructor.

Reimplemented in StormByte::Database::SQLite::PreparedSTMT.

Member Function Documentation

◆ Bind() [1/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
bool  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Bind() [2/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
const double &  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Bind() [3/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
const int &  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Bind() [4/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
const int64_t &  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Bind() [5/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
const std::nullptr_t &  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Bind() [6/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
const std::string &  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Bind() [7/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
const uint64_t &  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Bind() [8/8]

template<class Row >
virtual PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::Bind ( const int &  index,
const unsigned int &  value 
)
pure virtualnoexcept

Binds a value to a prepared statement

Parameters
indexparameter index
valueValue to be bound

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ GetName()

template<class Row >
constexpr const std::string & StormByte::Database::PreparedSTMT< Row >::GetName ( ) const
inlineconstexprnoexcept

Gets the name of the prepared statement

Returns
name

◆ GetQuery()

template<class Row >
constexpr const std::string & StormByte::Database::PreparedSTMT< Row >::GetQuery ( ) const
inlineconstexprnoexcept

Gets the query of the prepared statement

Returns
query

◆ operator=() [1/2]

template<class Row >
PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::operator= ( const PreparedSTMT< Row > &  )
delete

Default copy assignment operator (deleted)

◆ operator=() [2/2]

template<class Row >
constexpr PreparedSTMT & StormByte::Database::PreparedSTMT< Row >::operator= ( PreparedSTMT< Row > &&  )
constexprdefault

Default move assignment operator

◆ Reset()

template<class Row >
virtual void StormByte::Database::PreparedSTMT< Row >::Reset ( )
pure virtualnoexcept

Resets the prepared statement

Implemented in StormByte::Database::SQLite::PreparedSTMT.

◆ Step()

template<class Row >
virtual const Row & StormByte::Database::PreparedSTMT< Row >::Step ( )
pure virtualnoexcept

Step into the prepared statement results

Implemented in StormByte::Database::SQLite::PreparedSTMT.


The documentation for this class was generated from the following file: