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§
- Possible values for
SqlType::IsNullable
- Represents the output of numeric operators in SQL
Structs§
- Array
postgres_backend
TheArray
SQL type. - The big integer SQL type.
- The binary SQL type.
- The boolean SQL type.
- CChar
postgres_backend
The"char"
SQL type. This is a PostgreSQL specific type. Used for e.g. setweight. Do not use in user tables. - Cidr
postgres_backend
TheCIDR
SQL type. This type can only be used withfeature = "network-address"
orfeature = "ipnet-address"
. - The date SQL type.
- Datetime
mysql_backend
Represents the MySQL datetime type. - The double precision float SQL type.
- The float SQL type.
- Inet
postgres_backend
TheINET
SQL type. This type can only be used withfeature = "network-address"
orfeature = "ipnet-address"
. - The integer SQL type.
- The interval SQL type.
- The JSON SQL type. This type can only be used with
feature = "serde_json"
- Jsonb
postgres_backend
Thejsonb
SQL type. This type can only be used withfeature = "serde_json"
- MacAddr
postgres_backend
TheMACADDR
SQL type. - Money
postgres_backend
The PostgreSQL Money type. - The nullable SQL type.
- The arbitrary precision numeric SQL type.
- Oid
postgres_backend
TheOID
SQL type. This is a PostgreSQL specific type. - Range
postgres_backend
TheRange
SQL type. - Record
postgres_backend
TheRecord
(a.k.a. tuple) SQL type. - The small integer SQL type.
- The text SQL type.
- The time SQL type.
- The timestamp SQL type.
- Timestamptz
postgres_backend
The “timestamp with time zone” SQL type, which PostgreSQL abbreviates totimestamptz
. - TimestamptzSqlite
sqlite
The SQLite timestamp with time zone type - The tiny integer SQL type.
- Unsigned
mysql_backend
Represents the MySQL unsigned type. - Query nodes with this expression type do not have a statically at compile time known expression type.
- Uuid
postgres_backend
TheUUID
SQL type. This type can only be used withfeature = "uuid"
Traits§
- Are both values of
IsNull
are nullable? - A marker trait for accepting expressions of the type
Bool
andNullable<Bool>
in the same place - Represents SQL types which can be used with
SUM
andAVG
- Indicates that a SQL type exists for a backend.
- Converts a type which may or may not be nullable into its not nullable representation.
- Converts a type which may or may not be nullable into its nullable representation.
- A type level constructor for maybe nullable types
- Is one value of
IsNull
nullable? - A marker trait indicating that a SQL type represents a single value, as opposed to a list of values.
- Marker trait for types which can be used with
MAX
andMIN
- A marker trait for SQL types
- Information about how a backend stores metadata about given SQL types
Type Aliases§
- BigSerial
postgres_backend
Alias forBigInt
- Bpchar
postgres_backend
- Bytea
postgres_backend
Alias forBinary
, to ensurediesel print-schema
works - Daterange
postgres_backend
- Alias for
Numeric
- Int4range
postgres_backend
- Int8range
postgres_backend
- Macaddr
postgres_backend
Alias forMacAddr
to be able to use it withdiesel print-schema
. - Numrange
postgres_backend
- Serial
postgres_backend
Alias forInteger
- SmallSerial
postgres_backend
Alias forSmallInt
- Tsrange
postgres_backend
- Tstzrange
postgres_backend
- The SQL
VARCHAR
type
Derive Macros§
- Implement numeric operators for the current query node
- Implement necessary traits for adding a new sql type