Cppgres
Build Postgres extensions in C++
|
Postgres function implemented in C++. More...
#include <function.hpp>
Public Types | |
using | traits = utils::function_traits::function_traits< Func > |
using | argument_types = typename traits::argument_types |
using | return_type = utils::function_traits::invoke_result_from_tuple_t< Func, argument_types > |
Public Member Functions | |
postgres_function (Func f) | |
auto | operator() (FunctionCallInfo fc) -> ::Datum |
Public Attributes | |
Func | func |
Static Public Attributes | |
static constexpr std::size_t | arity = traits::arity |
Postgres function implemented in C++.
It wraps a function to handle conversion of arguments and return, enforce arity, convert C++ exceptions to errors. Additionally, it handles Set-Returning Functions (SRFs), implemented by functions returning cppgres::datumable_iterator.
Func | function (or lambda) that conforms to the cppgres::datumable_function concept. |
|
inline |
Invoke the function as per Postgres convention