Module spi

Source
Expand description

Safe access to Postgres’ Server Programming Interface (SPI).

Re-exports§

pub use SpiResult as Result;

Structs§

OwnedPreparedStatement
Static lifetime-bound prepared statement
PreparedStatement
Client lifetime-bound prepared statement
Spi
SpiClient
SpiCursor
An SPI Cursor from a query
SpiHeapTupleData
Represents the set of pg_sys::Datums in a pg_sys::HeapTuple
SpiHeapTupleDataEntry
Represents a single pg_sys::Datum inside a SpiHeapTupleData
SpiTupleTable
UnknownVariant

Enums§

SpiError
Set of possible errors pgrx might return while working with Postgres SPI.
SpiErrorCodes
These match the Postgres #defined constants prefixed SPI_ERROR_* that you can find in pg_sys. It is hypothetically possible for a Postgres-defined status code to be 0, AKA NULL, however, this should not usually occur in Rust code paths. If it does happen, please report such bugs to the pgrx repo.
SpiOkCodes
These match the Postgres #defined constants prefixed SPI_OK_* that you can find in pg_sys.

Traits§

Query
A generalized interface to what constitutes a query

Functions§

quote_identifier
A safe wrapper around pg_sys::quote_identifier. Returns a properly quoted identifier. For instance for a column or table name such as "my-table-name"
quote_literal
A safe wrapper around pg_sys::quote_literal_cstr. Returns a properly quoted literal such as a TEXT literal like 'my string with spaces'.
quote_qualified_identifier
A safe wrapper around pg_sys::quote_qualified_identifier. Returns a properly quoted name of the following format qualifier.ident. A common usecase is to qualify a table_name for example "my schema"."my table".

Type Aliases§

Error
SpiResult