Cppgres
Build Postgres extensions in C++
|
Tuple descriptor operator. More...
#include <record.hpp>
Public Member Functions | |
tuple_descriptor (int nattrs, memory_context ctx=memory_context()) | |
Create a tuple descriptor for a given number of attributes. | |
tuple_descriptor (TupleDesc tupdesc, bool blessed=true) | |
Create a tuple descriptor for a given TupleDesc | |
tuple_descriptor (tuple_descriptor &other) | |
Copy constructor. | |
tuple_descriptor (tuple_descriptor &&other) | |
Move constructor. | |
tuple_descriptor & | operator= (const tuple_descriptor &other) |
Copy assignment. | |
int | attributes () const |
Number of attributes. | |
::FormData_pg_attribute & | operator[] (int n) const |
Get a reference to Form_pg_attribute | |
type | get_type (int n) const |
void | set_type (int n, const type &type) |
Set attribute type. | |
std::string_view | get_name (int n) |
void | set_name (int n, const name &name) |
Set attribute name. | |
operator TupleDesc () | |
returns a pointer to TupleDesc | |
bool | equal_types (const tuple_descriptor &other) |
Determines whether two tuple descriptors have equal row types. | |
bool | operator== (const tuple_descriptor &other) |
Compare two TupleDesc structures for logical equality. | |
bool | is_blessed () const |
Returns true if the tuple descriptor is blessed. | |
operator TupleDesc () const | |
Tuple descriptor operator.
Allows to create new or manipulate existing tuple descriptors
|
inline |
Create a tuple descriptor for a given number of attributes.
nattrs | number of attributes |
ctx | memory context, current transaction context by default |
|
inline |
Create a tuple descriptor for a given TupleDesc
tupdesc | existing attribute |
blessed | true if already blessed (default) |
|
inline |
Copy constructor.
Creates a copy instance of the tuple descriptor in the current memory contet
|
inline |
Determines whether two tuple descriptors have equal row types.
This is used to check whether two record types are compatible, whether function return row types are the same, and other similar situations.
|
inline |
returns a pointer to TupleDesc
At this point, it'll be prepared and blessed.
|
inline |
Copy assignment.
Creates a copy instance of the tuple descriptor in the current memory contet
|
inline |
Compare two TupleDesc structures for logical equality.
|
inline |
Get a reference to Form_pg_attribute
std::out_of_range | when attribute index is out of range |
|
inline |
Set attribute name.
n | Zero-based attribute index |
name | new attribute name |
std::out_of_range | when attribute index is out of range |
|
inline |
Set attribute type.
n | Zero-based attribute index |
type | new attribute type |
std::out_of_range | when attribute index is out of range |