Crate pgx_macros
source ·Macros
Declare SQL to be included in generated extension script.
Declare SQL (from a file) to be included in generated extension script.
Attribute Macros
Used with
#[pg_operator]. 1 value which is the function nameUsed with
#[pg_operator]. no valuesAssociated macro for
#[pg_test] to provide context back to your test framework to indicate
that the test system is being initializedUsed with
#[pg_operator]. 1 value which is the function nameUsed with
#[pg_operator]. no valuesUsed with
#[pg_operator]. 1 value which is the function nameUsed with
#[pg_operator]. 1 value which is the operator name itselfDeclare a
pgx::Aggregate implementation on a type as able to used by Postgres as an aggregate.Declare a function as
#[pg_extern] to indicate that it can be used by Postgres as a UDF.Declare a function as
#[pg_guard] to indicate that it is called from a Postgres extern "C"
function so that Rust panic!()s (and Postgres elog(ERROR)s) will be properly handled by pgxDeclare a function as
#[pg_operator] to indicate that it represents a Postgres operator
cargo pgx schema will automatically generate the underlying SQLDeclare a Rust module and its contents to be in a schema.
#[pg_test] functions are test functions (akin to #[test]), but they run in-process inside
Postgres during cargo pgx test.A helper attribute for various contexts.
Used with
#[pg_operator]. 1 value which is the function nameAssociated macro for
#[pg_extern] or #[macro@pg_operator]. Used to set the SEARCH_PATH option
on the CREATE FUNCTION statement.Derive Macros
Generate necessary bindings for using the enum with PostgreSQL.
Generate necessary code using the type in operators like
== and !=.Generate necessary code for stable hashing the type so it can be used with
USING hash indexes.Generate necessary code using the type in operators like
>, <, <=, and >=.Generate necessary bindings for using the type with PostgreSQL.