boost_sqlite 1
A sqlite C++ library
Loading...
Searching...
No Matches
boost::sqlite::statement Struct Reference

A statement used for a prepared-statement. More...

#include <include/boost/sqlite/statement.hpp>

Public Member Functions

core::string_view declared_type (int id) const
 Returns the expanded sql used to construct the prepared statement.
 
core::string_view expanded_sql ()
 Returns the expanded sql used to construct the prepared statement.
 
core::string_view sql ()
 Returns the sql used to construct the prepared statement.
 
template<typename ArgRange = std::initializer_list<param_ref>>
resultset execute (ArgRange &&params, system::error_code &ec, error_info &info) &&
 execute the prepared statement once.
 
template<typename ArgRange = std::initializer_list<param_ref>>
resultset execute (ArgRange &&params) &&
 execute the prepared statement once.
 
resultset execute (std::initializer_list< std::pair< string_view, param_ref > > params, system::error_code &ec, error_info &info) &&
 execute the prepared statement once.
 
resultset execute (std::initializer_list< std::pair< string_view, param_ref > > params) &&
 execute the prepared statement once.
 
template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > execute (ArgRange &&params, system::error_code &ec, error_info &ei) &&
 execute the prepared statement once.
 
template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > execute (ArgRange &&params) &&
 execute the prepared statement once.
 
template<typename T >
static_resultset< T > execute (std::initializer_list< std::pair< string_view, param_ref > > params, system::error_code &ec, error_info &ei) &&
 execute the prepared statement once.
 
template<typename T >
static_resultset< T > execute (std::initializer_list< std::pair< string_view, param_ref > > params) &&
 execute the prepared statement once.
 
template<typename ArgRange = std::initializer_list<param_ref>>
resultset execute (ArgRange &&params, system::error_code &ec, error_info &info) &
 execute the prepared statement and reset it afterwards.
 
template<typename ArgRange = std::initializer_list<param_ref>>
resultset execute (ArgRange &&params) &
 execute the prepared statement and reset it afterwards.
 
resultset execute (std::initializer_list< std::pair< string_view, param_ref > > params, system::error_code &ec, error_info &info) &
 execute the prepared statement and reset it afterwards.
 
resultset execute (std::initializer_list< std::pair< string_view, param_ref > > params) &
 execute the prepared statement and reset it afterwards.
 
template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > execute (ArgRange &&params, system::error_code &ec, error_info &ei) &
 execute the prepared statement and reset it afterwards.
 
template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > execute (ArgRange &&params) &
 execute the prepared statement and reset it afterwards.
 
template<typename T >
static_resultset< T > execute (std::initializer_list< std::pair< string_view, param_ref > > params, system::error_code &ec, error_info &ei) &
 execute the prepared statement and reset it afterwards.
 
template<typename T >
static_resultset< T > execute (std::initializer_list< std::pair< string_view, param_ref > > params) &
 execute the prepared statement and reset it afterwards.
 

Detailed Description

A statement used for a prepared-statement.

Definition at line 198 of file statement.hpp.

Member Function Documentation

◆ declared_type()

core::string_view boost::sqlite::statement::declared_type ( int id) const
inline

Returns the expanded sql used to construct the prepared statement.

Returns the declared type of the column

Definition at line 470 of file statement.hpp.

◆ execute() [1/16]

template<typename ArgRange = std::initializer_list<param_ref>>
resultset boost::sqlite::statement::execute ( ArgRange && params) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));
main object for a connection to a database.
Representation of a result from a database.
Definition resultset.hpp:41
A statement used for a prepared-statement.

Definition at line 355 of file statement.hpp.

◆ execute() [2/16]

template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > boost::sqlite::statement::execute ( ArgRange && params) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 407 of file statement.hpp.

◆ execute() [3/16]

template<typename ArgRange = std::initializer_list<param_ref>>
resultset boost::sqlite::statement::execute ( ArgRange && params) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 230 of file statement.hpp.

◆ execute() [4/16]

template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > boost::sqlite::statement::execute ( ArgRange && params) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 280 of file statement.hpp.

◆ execute() [5/16]

template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > boost::sqlite::statement::execute ( ArgRange && params,
system::error_code & ec,
error_info & ei ) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 391 of file statement.hpp.

◆ execute() [6/16]

template<typename T , typename ArgRange = std::initializer_list<param_ref>>
static_resultset< T > boost::sqlite::statement::execute ( ArgRange && params,
system::error_code & ec,
error_info & ei ) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 264 of file statement.hpp.

◆ execute() [7/16]

template<typename ArgRange = std::initializer_list<param_ref>>
resultset boost::sqlite::statement::execute ( ArgRange && params,
system::error_code & ec,
error_info & info ) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 339 of file statement.hpp.

◆ execute() [8/16]

template<typename ArgRange = std::initializer_list<param_ref>>
resultset boost::sqlite::statement::execute ( ArgRange && params,
system::error_code & ec,
error_info & info ) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 216 of file statement.hpp.

◆ execute() [9/16]

resultset boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 380 of file statement.hpp.

◆ execute() [10/16]

template<typename T >
static_resultset< T > boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 434 of file statement.hpp.

◆ execute() [11/16]

resultset boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 253 of file statement.hpp.

◆ execute() [12/16]

template<typename T >
static_resultset< T > boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 307 of file statement.hpp.

◆ execute() [13/16]

template<typename T >
static_resultset< T > boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params,
system::error_code & ec,
error_info & ei ) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 418 of file statement.hpp.

◆ execute() [14/16]

template<typename T >
static_resultset< T > boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params,
system::error_code & ec,
error_info & ei ) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 291 of file statement.hpp.

◆ execute() [15/16]

resultset boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params,
system::error_code & ec,
error_info & info ) &
inline

execute the prepared statement and reset it afterwards.

Warning
The handle is shared between the statement & resultset. The statemens need to be kept alive.
Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map, a vector or a stuple of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 366 of file statement.hpp.

◆ execute() [16/16]

resultset boost::sqlite::statement::execute ( std::initializer_list< std::pair< string_view, param_ref > > params,
system::error_code & ec,
error_info & info ) &&
inline

execute the prepared statement once.

Parameters
paramsThe arguments to be passed to the prepared statement. This can be a map or a vector of param_ref.
ecThe system::error_code used to deliver errors for the exception less overload.
infoThe error_info used to deliver errors for the exception less overload.
Returns
The resultset of the query.
extern sqlite::connection conn;
statement st = conn.prepare("select id from users where name = $1;");
resultset q = std::move(st).execute(std::make_tuple("peter"));

Definition at line 240 of file statement.hpp.


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