thehydroimpulse/postgres-extension.rs

PG_FUNCTION_ARGS

thehydroimpulse opened this issue · 0 comments

This is used for postgres-compatible functions. The macro is simply:

// src/include/fmgr.h 
#define PG_FUNCTION_ARGS FunctionCallInfo fcinfo

And you'd use it as:

Datum hello( PG_FUNCTION_ARGS );

We just need to define all the structures from C in Rust and we can define the function:

extern fn foobar(args: FunctionCallInfo) -> Datum {
    // ...
}