#[derive(PostgresType)]
{
// Attributes available to this derive:
#[inoutfuncs]
#[pgvarlena_inoutfuncs]
#[bikeshed_postgres_type_manually_impl_from_into_datum]
#[requires]
#[pgrx]
}
Expand description
Generate necessary bindings for using the type with PostgreSQL.
ⓘ
use pgrx::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, PostgresType)]
struct Dog {
treats_received: i64,
pets_gotten: i64,
}
#[derive(Debug, Serialize, Deserialize, PostgresType)]
enum Animal {
Dog(Dog),
}
Optionally accepts the following attributes:
inoutfuncs(some_in_fn, some_out_fn)
: Define custom in/out functions for the type.pgvarlena_inoutfuncs(some_in_fn, some_out_fn)
: Define custom in/out functions for thePgVarlena
of this type.sql
: Same arguments as#[pgrx(sql = ..)]
.