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

Description

Database requests related types.

Classes

class  ozo::cancel_handle< Executor >
 Cancel operation handle. More...
 
class  ozo::value
 Database request result value proxy. More...
 
class  ozo::row
 Database request result row proxy. More...
 
class  ozo::basic_result< T >
 Database raw result representation. More...
 

Types

using ozo::shared_result = basic_result< pg::shared_result >
 Database raw result representation. More...
 
using ozo::result = basic_result< pg::result >
 Database raw result representation. More...
 
template<typename ... Ts>
using ozo::rows_of = std::vector< typed_row< Ts... > >
 Shortcut for easy result container definition. More...
 
template<typename ... Ts>
using ozo::lrows_of = std::list< typed_row< Ts... > >
 Shortcut for easy result container definition. More...
 

Types

◆ lrows_of

template<typename ... Ts>
using ozo::lrows_of = typedef std::list<typed_row<Ts...> >

Shortcut for easy result container definition.

This shortcut defines std::list container for row tuples.

Note
It is very important to keep a sequence of types according to fields in query statement (see the example below).

Example

// Query statement
const auto query =
"SELECT id , name FROM users_info WHERE amount>="_SQL + std::int64_t(25);
// ---- ======
// V V
// ------------ ===========
ozo::request(conn_info[io], query, ozo::into(rows), boost::asio::use_future);
Template Parameters
Ts— types of columns in result

◆ result

using ozo::result = typedef basic_result<pg::result>

Database raw result representation.

Stores raw request result. The result object is useful then it needs to get an access to raw data representation or the underlying libpq handle.

◆ rows_of

template<typename ... Ts>
using ozo::rows_of = typedef std::vector<typed_row<Ts...> >

Shortcut for easy result container definition.

This shortcut defines std::vector container for row tuples.

Note
It is very important to keep a sequence of types according to fields in query statement (see the example below).

Example

// Query statement
const auto query =
"SELECT id , name FROM users_info WHERE amount>="_SQL + std::int64_t(25);
// ---- ======
// V V
// ------------ ===========
ozo::request(conn_info[io], query, ozo::into(rows), boost::asio::use_future);
Template Parameters
Ts— types of columns in result

◆ shared_result

using ozo::shared_result = typedef basic_result<pg::shared_result>

Database raw result representation.

Copyable version of ozo::result. The result object is useful then it needs to get an access to raw data representation or the underlying libpq handle.

Get this type of result may be obtained from ozo::result:

//...
ozo::share_result shared_res(std::move(res));
ozo::request
decltype(auto) request(ConnectionProvider &&provider, BinaryQueryConvertible &&query, TimeConstraint time_constraint, Out out, CompletionToken &&token)
Executes query and retrives a result from a database with time constraint.
ozo::rows_of
std::vector< typed_row< Ts... > > rows_of
Shortcut for easy result container definition.
Definition: shortcuts.h:37
ozo::lrows_of
std::list< typed_row< Ts... > > lrows_of
Shortcut for easy result container definition.
Definition: shortcuts.h:63
ozo::into
constexpr auto into(T &v)
Shortcut for create result container back inserter.
Definition: shortcuts.h:85
ozo::basic_result
Database raw result representation.
Definition: result.h:263