Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
cppgres::postgres_function< Func > Struct Template Reference

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
 

Detailed Description

template<datumable_function Func>
struct cppgres::postgres_function< Func >

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.

Template Parameters
Funcfunction (or lambda) that conforms to the cppgres::datumable_function concept.

Member Function Documentation

◆ operator()()

template<datumable_function Func>
auto cppgres::postgres_function< Func >::operator() ( FunctionCallInfo  fc) -> ::Datum
inline

Invoke the function as per Postgres convention


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