Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::SQLite::SqlQuery< T > Class Template Reference

Public Member Functions

 SqlQuery (const char *statementName, const char *statement, const char *logName, SqlParam< T > &&... parameters)
 
bool Bind (Connection &connection, StatementAutoFinalizer &autoFinalizer, const T &... args) const
 
bool BindAndStep (Connection &connection, const T &... args) const
 
template<typename THandler , typename TCallback >
bool BindAndQuery (Connection &connection, THandler &&handler, const TCallback &callback, const T &... args) const
 
template<typename TResultEntry >
SqlQueryResultRunner< TResultEntry > BindAndThen (Connection &connection, const AZStd::function< bool(TResultEntry &)> &handler, const T &... args) const
 

Public Attributes

const char * m_statementName
 
const char * m_statement
 
const char * m_logName
 
std::tuple< SqlParam< T >... > m_parameters
 

Member Function Documentation

◆ Bind()

template<typename... T>
bool AzToolsFramework::SQLite::SqlQuery< T >::Bind ( Connection connection,
StatementAutoFinalizer autoFinalizer,
const T &...  args 
) const
inline

Bind both prepares and binds the args - call it on an empty autoFinalizer and it will prepare the query for you and return a ready-to-go autoFinalizer that has a valid statement ready to step()

◆ BindAndQuery()

template<typename... T>
template<typename THandler , typename TCallback >
bool AzToolsFramework::SQLite::SqlQuery< T >::BindAndQuery ( Connection connection,
THandler &&  handler,
const TCallback &  callback,
const T &...  args 
) const
inline

Similar to Bind, this will prepare and bind the args. Additionally, it will then call the callback with (statementName, statement, handler) The statement will be finalized automatically as part of this call

◆ BindAndStep()

template<typename... T>
bool AzToolsFramework::SQLite::SqlQuery< T >::BindAndStep ( Connection connection,
const T &...  args 
) const
inline

BindAndStep will execute the given statement and then clean up afterwards. It is for calls that perform some operation on the database rather than a query that you need the result of.

◆ BindAndThen()

template<typename... T>
template<typename TResultEntry >
SqlQueryResultRunner< TResultEntry > AzToolsFramework::SQLite::SqlQuery< T >::BindAndThen ( Connection connection,
const AZStd::function< bool(TResultEntry &)> &  handler,
const T &...  args 
) const
inline

Similar to Bind, this will prepare and bind the args. Returns a ResultRunner object that can be passed a callback and any number of arguments to forward to the callback in addition to the already supplied (statementName, statement, handler) arguments The statement will be finalized automatically when the ResultRunner goes out of scope


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