libpqxx
The C++ client library for PostgreSQL
pqxx::internal::c_params Struct Referencefinal

Internal type: encode statement parameters. More...

#include <statement_parameters.hxx>

Public Member Functions

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

Public Attributes

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

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

◆ ~c_params()

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

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ reserve()

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

Pre-allocate storage for n parameters.

Member Data Documentation

◆ formats

std::vector<int> 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: