Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
Cppgres: Postgres extensions in C++
Note
GitHub repository: cppgres/cppgres

Cppgres allows you to build Postgres extensions using C++: a high-performance, feature-rich language already supported by the same compiler toolchains used to develop for Postgres, like GCC and Clang.

Features

  • Header-only library
  • Compile and runtime safety checks
  • Automatic type mapping
  • Ergonomic executor API
  • Modern C+++20 interface & implementation
  • Direct integration with C

Quick start example

#include <cppgres.hpp>
extern "C" {
PG_MODULE_MAGIC;
}
postgres_function(demo_len, ([](std::string_view t) { return t.length(); }));
#define postgres_function(name, function)
Export a C++ function as a Postgres function.
Definition: cppgres.hpp:65