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:
[legend]

## Public Member Functions

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

## exists()

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

Has a statement of this name been defined?

## operator()() [1/7]

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

Pass null parameter.

## operator()() [2/7]

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

Pass binary parameter value for a BYTEA field.

Parameters

  v | binary string; will be passed on directly in binary form.

## operator()() [3/7]

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

Pass binary parameter value for a BYTEA field.

Parameters

  v | binary string; will be passed on directly in binary form.
  nonnull | determines whether to pass a real value, or nullptr.

## operator()() [4/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()() [5/7]

template<typename T >

invocation& pqxx::prepare::invocation::operator() | ( | const T & | v | ) |

Pass parameter value.

Parameters

  v | parameter value; will be represented as a string internally.

## operator()() [6/7]

template<typename T >

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

Pass parameter value.

Parameters

  v | parameter value (will be represented as a string internally).
  nonnull | replaces value with null if set to false.

## operator()() [7/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

  v | parameter value (will be represented as a C++ string internally)
  nonnull | replaces value with null if set to `false`

## operator=()

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

delete

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

- prepared_statement.hxx
- prepared_statement.cxx