Expand description
Types which represent a SQL data type.
The structs in this module are only used as markers to represent a SQL type. They should never be used in your structs. If you’d like to know the rust types which can be used for a given SQL type, see the documentation for that SQL type. Additional types may be provided by other crates.
To see which SQL type can be used with a given Rust type,
see the “Implementors” section of FromSql.
Any backend specific types are re-exported through this module
Modules§
- is_
nullable - Possible values for
SqlType::IsNullable - ops
- Represents the output of numeric operators in SQL
Structs§
- Array
- The
ArraySQL type. - BigInt
- The big integer SQL type.
- Binary
- The binary SQL type.
- Bool
- The boolean SQL type.
- CChar
- The
"char"SQL type. This is a PostgreSQL specific type. Used for e.g. setweight. Do not use in user tables. - Cidr
- The
CIDRSQL type. This type can only be used withfeature = "network-address"orfeature = "ipnet-address". - Citext
- The
CitextSQL type. This is a PostgreSQL specific type. - Date
- The date SQL type.
- Double
- The double precision float SQL type.
- Float
- The float SQL type.
- Inet
- The
INETSQL type. This type can only be used withfeature = "network-address"orfeature = "ipnet-address". - Integer
- The integer SQL type.
- Interval
- The interval SQL type.
- Json
- The JSON SQL type. This type can only be used with
feature = "serde_json" - Jsonb
- The
jsonbSQL type. This type can only be used withfeature = "serde_json" - MacAddr
- The
MACADDRSQL type. - Money
- The PostgreSQL Money type.
- Nullable
- The nullable SQL type.
- Numeric
- The arbitrary precision numeric SQL type.
- Oid
- The
OIDSQL type. This is a PostgreSQL specific type. - Range
- The
RangeSQL type. - Record
- The
Record(a.k.a. tuple) SQL type. - Small
Int - The small integer SQL type.
- Text
- The text SQL type.
- Time
- The time SQL type.
- Timestamp
- The timestamp SQL type.
- Timestamptz
- The “timestamp with time zone” SQL type, which PostgreSQL abbreviates
to
timestamptz. - TinyInt
- The tiny integer SQL type.
- Untyped
- Query nodes with this expression type do not have a statically at compile time known expression type.
- Uuid
- The
UUIDSQL type. This type can only be used withfeature = "uuid"
Traits§
- AllAre
Nullable - Are both values of
IsNullare nullable? - Bool
OrNullable Bool - A marker trait for accepting expressions of the type
BoolandNullable<Bool>in the same place - Foldable
- Represents SQL types which can be used with
SUMandAVG - HasSql
Type - Indicates that a SQL type exists for a backend.
- Into
NotNullable - Converts a type which may or may not be nullable into its not nullable representation.
- Into
Nullable - Converts a type which may or may not be nullable into its nullable representation.
- Maybe
Nullable Type - A type level constructor for maybe nullable types
- OneIs
Nullable - Is one value of
IsNullnullable? - Single
Value - A marker trait indicating that a SQL type represents a single value, as opposed to a list of values.
- SqlOrd
- Marker trait for types which can be used with
MAXandMIN - SqlType
- A marker trait for SQL types
- Type
Metadata - Information about how a backend stores metadata about given SQL types
Type Aliases§
- BigSerial
- Alias for
BigInt - Bpchar
- Bytea
- Alias for
Binary, to ensurediesel print-schemaworks - Daterange
- Decimal
- Alias for
Numeric - Int4range
- Int8range
- Macaddr
- Alias for
MacAddrto be able to use it withdiesel print-schema. - Numrange
- Serial
- Alias for
Integer - Small
Serial - Alias for
SmallInt - Tsrange
- Tstzrange
- VarChar
- The SQL
VARCHARtype
Derive Macros§
- Diesel
Numeric Ops - Implement numeric operators for the current query node
- SqlType
- Implement necessary traits for adding a new sql type