Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
cppgres.hpp File Reference
#include "cppgres/datum.hpp"
#include "cppgres/error.hpp"
#include "cppgres/exception_impl.hpp"
#include "cppgres/executor.hpp"
#include "cppgres/function.hpp"
#include "cppgres/guard.hpp"
#include "cppgres/imports.h"
#include "cppgres/memory.hpp"
#include "cppgres/set.hpp"
#include "cppgres/types.hpp"
#include "cppgres/node.hpp"
#include "cppgres/xact.hpp"

Go to the source code of this file.

Macros

#define cppgres_hpp
 
#define postgres_function(name, function)
 Export a C++ function as a Postgres function.
 

Macro Definition Documentation

◆ postgres_function

#define postgres_function (   name,
  function 
)
Value:
extern "C" { \
PG_FUNCTION_INFO_V1(name); \
Datum name(PG_FUNCTION_ARGS) { return cppgres::postgres_function(function)(fcinfo); } \
}
Postgres function implemented in C++.
Definition: function.hpp:92

Export a C++ function as a Postgres function.

Its argument types must conform to the cppgres::convertible_from_nullable_datum concept and its return type must conform to the cppgres::convertible_into_nullable_datum or cppgres::datumable_iterator concepts. This requirement is inherited from cppgres::postgres_function.

  • name Name to export it under
  • function C++ function or lambda
Note
You no longer need to use PG_FUNCTION_INFO_V1 macro.