Supported types

Base types

PostgreSQL typeRust type
bool, booleanbool
"char"i8
smallint, int2, smallserial, serial2i16
int, int4, serial, serial4i32
bigint, int8, bigserial, serial8i64
real, float4f32
double precision, float8f64
textString
varcharString
bpcharString
byteaVec<u8>
timestamp without time zone, timestampchrono::NaiveDateTime
timestamp with time zone, timestamptzchrono::DateTime<chrono::FixedOffset>
datechrono::NaiveDate
timechrono::NaiveTime
jsonserde_json::Value
jsonbserde_json::Value
uuiduuid::Uuid
inetstd::net::IpAddr
macaddreui48::MacAddress
numericrust_decimal::Decimal

Custom types

Custom types like enums, composites and domains will be generated automatically by inspecting your database. The only requirement for your custom types is that they should be based on other supported types (base or custom).

Clorinde is aware of your types' namespaces (what PostgreSQL calls schemas), so it will correctly handle custom types like my_schema.my_custom_type.

Note

Domains are unwrapped into their inner types in your Rust queries.

Array types

Clorinde supports one-dimensional arrays when the element type is also a type supported. That is, Clorinde supports example_elem_type[] if example_elem_type is itself a type supported by Clorinde (base or custom).