Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
cppgres::record Struct Reference

Runtime-typed value of record type. More...

#include <record.hpp>

Public Member Functions

 record (HeapTupleHeader heap_tuple, abstract_memory_context &ctx)
 
 record (HeapTupleHeader heap_tuple, abstract_memory_context &&ctx)
 
template<std::input_iterator Iter>
requires convertible_into_nullable_datum<typename std::iterator_traits<Iter>::value_type>
 record (tuple_descriptor &tupdesc, Iter begin, Iter end)
 
template<convertible_into_nullable_datum... D>
 record (tuple_descriptor &tupdesc, D &&...args)
 
int attributes () const
 Number of attributes in the record.
 
type attribute_type (int n) const
 Type of attribute using a 0-based index.
 
std::string_view attribute_name (int n) const
 Name of attribute using a 0-based index.
 
nullable_datum get_attribute (int n)
 Get attribute value (datum) using a 0-based index.
 
nullable_datum operator[] (std::string_view name)
 Get attribute by name.
 
nullable_datum operator[] (int n)
 Get attribute by 0-based index.
 
 operator HeapTuple () const
 
tuple_descriptor get_tuple_descriptor () const
 Returns tuple descriptor.
 
 record (const record &other)
 
 record (const record &&other)
 
recordoperator= (const record &other)
 

Friends

struct datum_conversion< record >
 

Detailed Description

Runtime-typed value of record type.

These records don't have a structure known upfront, for example, when a value of this type (record) are passed into a function.

Member Function Documentation

◆ attribute_name()

std::string_view cppgres::record::attribute_name ( int  n) const
inline

Name of attribute using a 0-based index.

Exceptions
std::out_of_range

◆ attribute_type()

type cppgres::record::attribute_type ( int  n) const
inline

Type of attribute using a 0-based index.

Exceptions
std::out_of_range

◆ get_attribute()

nullable_datum cppgres::record::get_attribute ( int  n)
inline

Get attribute value (datum) using a 0-based index.

Exceptions
std::out_of_range

◆ operator[]() [1/2]

nullable_datum cppgres::record::operator[] ( int  n)
inline

Get attribute by 0-based index.

Exceptions
std::out_of_range

◆ operator[]() [2/2]

nullable_datum cppgres::record::operator[] ( std::string_view  name)
inline

Get attribute by name.

Exceptions
std::out_of_range

The documentation for this struct was generated from the following file: