OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
Query Interface Reference

#include <ozo/query.h>

Description

Query concept

Query consists of two parts:

  • text, which should models QueryText concept,
  • parameters sequence, whish should models #HanaSequence.

Type which models the Query concept automatically models BinaryQueryConvertible.

This is very simple but powerful concept, which allows to use different query representations with the library. Type query models Query concept if this code is valid:

static_assert(ozo::QueryText<decltype(ozo::get_query_text(query))>);
static_assert(ozo::HanaSequence<decltype(ozo::get_query_params(query))>);

To adapt custom type as Query for the library it is needed to customize ozo::get_query_text() and ozo::get_query_params() via its' implementations. See both functions description for more details.

Query may be constructed via ozo::make_query function or ozo::query_builder.

ozo::get_query_params
constexpr auto get_query_params(Query &&query)
Get the query parameters.
ozo::get_query_text
constexpr auto get_query_text(Query &&query)
Get the query text object.