libpqxx
The C++ client library for PostgreSQL
Loading...
Searching...
No Matches
pqxx::internal::c_params Struct Reference

Internal type: encode statement parameters. More...

Public Member Functions

 c_params ()=default
 c_params (c_params const &)=delete
 Copying these objects is pointless and expensive. Don't do it.
 c_params (c_params &&)=default
void reserve (std::size_t n) &
 Pre-allocate storage for n parameters.

Public Attributes

std::vector< char const * > values
 As used by libpq: pointers to parameter values.
std::vector< int > lengths
 As used by libpq: lengths of non-null arguments, in bytes.
std::vector< formatformats
 As used by libpq: effectively boolean "is this a binary parameter?".

Detailed Description

Internal type: encode statement parameters.

Compiles arguments for prepared statements and parameterised queries into a format that can be passed into libpq.

Objects of this type are meant to be short-lived: a c_params lives and dies entirely within the call to execute. So, for example, if you pass in a non-null pointer as a parameter, params may simply use that pointer as a parameter value, without arranging longer-term storage for the data to which it points. All values referenced by parameters must remain "live" until the parameterised or prepared statement has been executed.

Constructor & Destructor Documentation

◆ c_params() [1/3]

pqxx::internal::c_params::c_params ( )
default

◆ c_params() [2/3]

pqxx::internal::c_params::c_params ( c_params const & )
delete

Copying these objects is pointless and expensive. Don't do it.

◆ c_params() [3/3]

pqxx::internal::c_params::c_params ( c_params && )
default

Member Function Documentation

◆ reserve()

void pqxx::internal::c_params::reserve ( std::size_t n) &

Pre-allocate storage for n parameters.

Member Data Documentation

◆ formats

std::vector<format> pqxx::internal::c_params::formats

As used by libpq: effectively boolean "is this a binary parameter?".

◆ lengths

std::vector<int> pqxx::internal::c_params::lengths

As used by libpq: lengths of non-null arguments, in bytes.

◆ values

std::vector<char const *> pqxx::internal::c_params::values

As used by libpq: pointers to parameter values.


The documentation for this struct was generated from the following files:
  • /builddir/build/BUILD/libpqxx-7.10.5-build/libpqxx-7.10.5/redhat-linux-build/include/pqxx/internal/statement_parameters.hxx
  • /builddir/build/BUILD/libpqxx-7.10.5-build/libpqxx-7.10.5/redhat-linux-build/src/params.cxx