pub enum DataType {
Show 24 variants
Bool,
S8,
S16,
S32,
S64,
F32,
F64,
U8,
U16,
U32,
U64,
I8,
I16,
I32,
I64,
Uuid,
UuidRand,
UuidSlug,
Utc,
Text,
Ident,
Url,
Json,
Bytes,
}
Expand description
restq supports comprehensive data types
based on rust and postgresql type, combined together
format: <data_type>?
? - indicates it is optional, nullable in database context
example:
text? - nullable text
text(8..) - text with at least 8 characters long
text(..255) - text must not be more than 255 characters long.
u32(1) - u32 with default value of 1
u32(>10) - check value should be greater than 10
u32(10<column<=20) - check the value should be greater than 10 and less than or equal to 20
u32(<discount) - check value should be lesser than discount
column
f32(0.0) - f32 with 0.0 as the default value
Variants§
Bool
bool
S8
8 bit serial integer
S16
16 bit serial integer
S32
32 bit serial integer
S64
64 bit serial integer
F32
f32
F64
f64
U8
u8
U16
u16
U32
u32
U64
u64
I8
i8
I16
i16
I32
i32
I64
i64
Uuid
Uuid, no default specified
UuidRand
Uuid with random as the default
UuidSlug
create a new uuid and generate a url friendly base64 using blob_uuid
Utc
Utc time with now as the default
Text
text/strings, generic text, no interpretation
Ident
A valid identifier string defined by begining of alpha_or_underscore character and optionally followed by alphnumeric characters
Url
A valid url
Json
json type
Bytes
bytes