pg_async
|
Result set (tip::db::pg::resultset) is passed to client via supplied callback when a query receives results from the server. A tip::db::pg::resultset is an object that provides an interface to reading and converting underlying data buffers. It is lightweight and is designed to be copied around by value. It can be stored in memory for later use.
A resultset object mimics standard container interface for the data rows. It provides random access to data rows via indexing operator and random access iterators.
A resultset row mimics standard container interface for the fields. It provides index operators for accessing fields by their index or by their name. It also provides random access iterators for iterating the fields.
Result set provides interface for reading field definitions.
Field values are extracted via the system of buffer parsers. Default format for PosgreSQL protocol is text, so most if a data type is extractable from a stream, it can be extracted from a text data buffer. If a special parsing routine is required, a text data parser must be provided. All datatypes can be extracted as strings.
For binary data format a data parser must be provided.
An exception tip::db::pg::value_is_null will be thrown if the field is null. A boost::optional can be used as a nullable datatype, the value will be cleared, and no exception will be thrown. A coalesce
function can be used to get a default value if the field is null.
A std::tuple can be used to extract data from row fields
concept of an interface for a datatype that can be stored/retrieved from the database. Template functions enabled for such an interface.
non-select command results