Expand description
plrust-trusted-pgrx
is a re-export crate based on pgrx which exposes
the minimal set of pgrx
internals necessary for plrust
function compilation. plrust-trusted-pgrx
also includes a number of Rust types for interoperating with Postgres types, access to Postgres’
“SPI”, logging, and trigger support.
Re-exports§
pub use datum::*;
pub use heap_tuple::*;
pub use iter::*;
pub use pg_sys::*;
pub use trigger_support::*;
Modules§
- datum
- Safe Rust wrappers for various Postgres types.
- fn_call
- heap_
tuple - Support for arbitrary composite types as a “heap tuple”.
- iter
- Return iterators from plrust functions
- pg_sys
- Lower-level Postgres internals, which are safe to use.
- prelude
- Use all the things.
- spi
- Use Postgres’ Server Programming Interface to execute arbitrary SQL.
- trigger_
support - Various types for use when a
plrust
function is a trigger function.
Macros§
- debug1
- Log to Postgres’
debug1
log level. - debug2
- Log to Postgres’
debug2
log level. - debug3
- Log to Postgres’
debug3
log level. - debug4
- Log to Postgres’
debug4
log level. - debug5
- Log to Postgres’
debug5
log level. - ereport
- Sends some kind of message to Postgres, and if it’s a PgLogLevel::ERROR or greater, Postgres’ error handling takes over and, in the case of PgLogLevel::ERROR, aborts the current transaction.
- error
- Log to Postgres’
error
log level. This will abort the current Postgres transaction. - info
- Log to Postgres’
info
log level. - log
- Log to Postgres’
log
log level. - notice
- Log to Postgres’
notice
log level. - warning
- Log to Postgres’
warning
log level.
Structs§
Enums§
- Arg
- The kinds of
fn_call
arguments. - FnCall
Error FnCallError
s represent the set of conditions that could casefn_call()
to fail in a user-recoverable manner.
Traits§
- Error
Reportable - Indicates that something can be reported as a Postgres ERROR, if that’s what it might represent.
- FnCall
Arg - Augments types that can be used as
fn_call
arguments. This is only implemented for theArg
enum.
Functions§
- fn_call
- Dynamically call a named function in the current database. The function must be one previously
defined by
CREATE FUNCTION
. Its underlyingLANGUAGE
is irrelevant – callLANGUAGE sql
,LANGUAGE plpgsql
,LANGUAGE plperl
, or (our favorite)LANGUAGE plrust
functions.