Expand description
Converting between Rust values and PostgreSQL values.
| Rust | PostgreSQL |
|---|---|
bool | boolean |
i16, i32, i64 | smallint, integer, bigint (any of them, checked for range); oid |
f32, f64 | real, double precision |
&str, String | text, varchar, char(n), name; as parameters, any type the server can parse from text (uuid, numeric, date, json…); as results, any column this table does not list |
&[u8], Vec<u8> | bytea |
SystemTime | timestamptz |
Option<T> | NULL or a value |
Integers convert between the three integer types when the value fits, and fail with an error naming the parameter or column when it does not, so a conversion never loses anything silently.
Structs§
- Type
- A PostgreSQL type, identified by its OID.