libpqxx
pqxx::prepare::invocation Class Reference

Helper class for passing parameters to, and executing, prepared statements. More...

#include <prepared_statement.hxx>

Inheritance diagram for pqxx::prepare::invocation:

Public Member Functions

 invocation (transaction_base &, const std::string &statement)
 
invocationoperator= (const invocation &)=delete
 
result exec () const
 Execute! More...
 
bool exists () const
 Has a statement of this name been defined? More...
 
invocationoperator() ()
 Pass null parameter. More...
 
template<typename T >
invocationoperator() (const T &v)
 Pass parameter value. More...
 
invocationoperator() (const binarystring &v)
 Pass binary parameter value for a BYTEA field. More...
 
template<typename T >
invocationoperator() (const T &v, bool nonnull)
 Pass parameter value. More...
 
invocationoperator() (const binarystring &v, bool nonnull)
 Pass binary parameter value for a BYTEA field. More...
 
template<typename T >
invocationoperator() (T *v, bool nonnull=true)
 Pass C-style parameter string, or null if pointer is null. More...
 
invocationoperator() (const char *v, bool nonnull=true)
 Pass C-style string parameter, or null if pointer is null. More...
 

Detailed Description

Helper class for passing parameters to, and executing, prepared statements.

Deprecated:
As of 6.0, use transaction_base::exec_prepared and friends.

Constructor & Destructor Documentation

◆ invocation()

pqxx::prepare::invocation::invocation ( transaction_base home,
const std::string &  statement 
)

Member Function Documentation

◆ exec()

pqxx::result pqxx::prepare::invocation::exec ( ) const

Execute!

References pqxx::transaction_base::conn().

◆ exists()

bool pqxx::prepare::invocation::exists ( ) const

Has a statement of this name been defined?

References pqxx::transaction_base::conn().

◆ operator()() [1/7]

invocation& pqxx::prepare::invocation::operator() ( )

Pass null parameter.

◆ operator()() [2/7]

template<typename T >
invocation& pqxx::prepare::invocation::operator() ( const T &  v)

Pass parameter value.

Parameters
vparameter value; will be represented as a string internally.

◆ operator()() [3/7]

invocation& pqxx::prepare::invocation::operator() ( const binarystring v)

Pass binary parameter value for a BYTEA field.

Parameters
vbinary string; will be passed on directly in binary form.

◆ operator()() [4/7]

template<typename T >
invocation& pqxx::prepare::invocation::operator() ( const T &  v,
bool  nonnull 
)

Pass parameter value.

Parameters
vparameter value (will be represented as a string internally).
nonnullreplaces value with null if set to false.

◆ operator()() [5/7]

invocation& pqxx::prepare::invocation::operator() ( const binarystring v,
bool  nonnull 
)

Pass binary parameter value for a BYTEA field.

Parameters
vbinary string; will be passed on directly in binary form.
nonnulldetermines whether to pass a real value, or nullptr.

◆ operator()() [6/7]

template<typename T >
invocation& pqxx::prepare::invocation::operator() ( T *  v,
bool  nonnull = true 
)

Pass C-style parameter string, or null if pointer is null.

This version is for passing C-style strings; it's a template, so any pointer type that to_string accepts will do.

Parameters
vparameter value (will be represented as a C++ string internally)
nonnullreplaces value with null if set to false

◆ operator()() [7/7]

invocation& pqxx::prepare::invocation::operator() ( const char *  v,
bool  nonnull = true 
)

Pass C-style string parameter, or null if pointer is null.

This duplicates the pointer-to-template-argument-type version of the operator, but helps compilers with less advanced template implementations disambiguate calls where C-style strings are passed.

◆ operator=()

invocation& pqxx::prepare::invocation::operator= ( const invocation )
delete

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