#include <ozo/io/binary_query.h>
Binary protocol query representation.
The binary_query
being used for query sending to a database.
- Models
BinaryQueryConvertible
|
template<class Text , class Params , class OidMap , class Allocator = std::allocator<char>> |
| binary_query (Text text, const Params ¶ms, const OidMap &oid_map, const Allocator &allocator=Allocator{}) |
|
const char * | text () const noexcept |
|
const oid_t * | types () const noexcept |
|
const int * | formats () const noexcept |
|
const int * | lengths () const noexcept |
|
const char *const * | values () const noexcept |
|
std::ptrdiff_t | params_count () const noexcept |
|
◆ binary_query()
template<class Text , class Params , class OidMap , class Allocator = std::allocator<char>>
ozo::binary_query::binary_query |
( |
Text |
text, |
|
|
const Params & |
params, |
|
|
const OidMap & |
oid_map, |
|
|
const Allocator & |
allocator = Allocator{} |
|
) |
| |
Construct a new binary query object.
- Parameters
-
text | — query text object, should model QueryText concept. |
params | — query parameters object, should model HanaSequence concept. |
oid_map | — OidMap which is used within connection. |
allocator | — allocator object which should be used to allocate internal data, default is std::allocator<char> . |
◆ formats()
const int* ozo::binary_query::formats |
( |
| ) |
const |
|
noexcept |
Get query parameter formats array. For the binary_array
all the formats are binary_format
.
- Returns
const int*
— the query parameter formats array.
◆ lengths()
const int* ozo::binary_query::lengths |
( |
| ) |
const |
|
noexcept |
Get query parameter lengths array. Each element represents length of the respective parameter binary representation from values()
.
- Returns
const int*
— the query parameter lengths array.
◆ params_count()
std::ptrdiff_t ozo::binary_query::params_count |
( |
| ) |
const |
|
noexcept |
Get query parameters count.
- Returns
std::ptrdiff_t
— the query parameters count.
◆ text()
const char* ozo::binary_query::text |
( |
| ) |
const |
|
noexcept |
Get raw query text buffer.
- Returns
const char*
— pointer to the buffer.
◆ types()
const oid_t* ozo::binary_query::types |
( |
| ) |
const |
|
noexcept |
Get query parameter types array.
- Returns
const oid_t*
— the query parameter types array.
◆ values()
const char* const* ozo::binary_query::values |
( |
| ) |
const |
|
noexcept |
Get query parameter binary representations array.
- Returns
const char* const*
— an array with pointers to the binary representations.