Module sql_types

Source
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§

Arraypostgres_backend
The Array SQL type.
BigInt
The big integer SQL type.
Binary
The binary SQL type.
Bool
The boolean SQL type.
CCharpostgres_backend
The "char" SQL type. This is a PostgreSQL specific type. Used for e.g. setweight. Do not use in user tables.
Cidrpostgres_backend
The CIDR SQL type. This type can only be used with feature = "network-address" or feature = "ipnet-address".
Citextpostgres_backend
The Citext SQL type. This is a PostgreSQL specific type.
Date
The date SQL type.
Datetimemysql_backend
Represents the MySQL datetime type.
Double
The double precision float SQL type.
Float
The float SQL type.
Inetpostgres_backend
The INET SQL type. This type can only be used with feature = "network-address" or feature = "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"
Jsonbpostgres_backend
The jsonb SQL type. This type can only be used with feature = "serde_json"
MacAddrpostgres_backend
The MACADDR SQL type.
Moneypostgres_backend
The PostgreSQL Money type.
Nullable
The nullable SQL type.
Numeric
The arbitrary precision numeric SQL type.
Oidpostgres_backend
The OID SQL type. This is a PostgreSQL specific type.
Rangepostgres_backend
The Range SQL type.
Recordpostgres_backend
The Record (a.k.a. tuple) SQL type.
SmallInt
The small integer SQL type.
Text
The text SQL type.
Time
The time SQL type.
Timestamp
The timestamp SQL type.
Timestamptzpostgres_backend
The “timestamp with time zone” SQL type, which PostgreSQL abbreviates to timestamptz.
TimestamptzSqlitesqlite
The SQLite timestamp with time zone type
TinyInt
The tiny integer SQL type.
Unsignedmysql_backend
Represents the MySQL unsigned type.
Untyped
Query nodes with this expression type do not have a statically at compile time known expression type.
Uuidpostgres_backend
The UUID SQL type. This type can only be used with feature = "uuid"

Traits§

AllAreNullable
Are both values of IsNull are nullable?
BoolOrNullableBool
A marker trait for accepting expressions of the type Bool and Nullable<Bool> in the same place
Foldable
Represents SQL types which can be used with SUM and AVG
HasSqlType
Indicates that a SQL type exists for a backend.
IntoNotNullable
Converts a type which may or may not be nullable into its not nullable representation.
IntoNullable
Converts a type which may or may not be nullable into its nullable representation.
MaybeNullableType
A type level constructor for maybe nullable types
OneIsNullable
Is one value of IsNull nullable?
SingleValue
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 MAX and MIN
SqlType
A marker trait for SQL types
TypeMetadata
Information about how a backend stores metadata about given SQL types

Type Aliases§

BigSerialpostgres_backend
Alias for BigInt
Bpcharpostgres_backend
Byteapostgres_backend
Alias for Binary, to ensure diesel print-schema works
Daterangepostgres_backend
Decimal
Alias for Numeric
Int4rangepostgres_backend
Int8rangepostgres_backend
Macaddrpostgres_backend
Alias for MacAddr to be able to use it with diesel print-schema.
Numrangepostgres_backend
Serialpostgres_backend
Alias for Integer
SmallSerialpostgres_backend
Alias for SmallInt
Tsrangepostgres_backend
Tstzrangepostgres_backend
VarChar
The SQL VARCHAR type

Derive Macros§

DieselNumericOps
Implement numeric operators for the current query node
SqlType
Implement necessary traits for adding a new sql type