Expand description
Handing for easily converting Postgres Datum types into their corresponding Rust types and converting Rust types into their corresponding Postgres types
Re-exports
pub use numeric::AnyNumeric;
pub use numeric::Numeric;
Modules
Structs
- An array of some type (eg.
TEXT[]
,int[]
) - An
inet
type from PostgreSQL - Represents Postgres’
internal
data type, which is documented as: - From the PG docs https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-INTERVAL-INPUT Internally interval values are stored as months, days, and microseconds. This is done because the number of days in a month varies, and a day can have 23 or 25hours if a daylight savings time adjustment is involved. The months and days fields are integers while the microseconds field can store fractional seconds. Because intervals are usually created from constant strings or timestamp subtraction, this storage method works well in most cases…
- A
json
type from PostgreSQL - A
jsonb
type from PostgreSQL - A wholly Rust-
String
owned copy of ajson
type from PostgreSQL - Wraps a Postgres
varlena *
, presenting it as if it’s a Rust type of a fixed size. - A safe deconstruction of a Postgres
pg_sys::RangeType
struct. - A Universally Unique Identifier (
UUID
) from PostgreSQL - An
Array
compatible type which can have itscore::any::TypeId
s registered for Rust to SQL mapping. - A type which can have its
core::any::TypeId
s registered for Rust to SQL mapping. - A
PgVarlena
compatible type which can have itscore::any::TypeId
s registered for Rust to SQL mapping.
Enums
- A Postgres Range’s “lower” or “upper” value
- If converting a Datum to a Rust type fails, this is the set of possible reasons why.
Constants
Traits
- Convert a
(pg_sys::Datum, is_null:bool
pair into a Rust type - Convert a Rust type into a
pg_sys::Datum
. - A tagging trait to indicate a user type is also meant to be used by Postgres Implemented automatically by
#[derive(PostgresType)]
- This trait allows a struct to be a valid subtype for a RangeType
- A type which can have it’s
core::any::TypeId
s registered for Rust to SQL mapping.