Skip to main content

SqlTyped

Trait SqlTyped 

Source
pub trait SqlTyped {
    const SQL_TYPE: &'static str;
}
Expand description

Associates a Rust type with its SQL type name so a typed NULL can be declared without a value (see null).

SQL_TYPE must match what ToSql::sql_type returns for a value of the same type.

Required Associated Constants§

Source

const SQL_TYPE: &'static str

The SQL type name for this Rust type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SqlTyped for NaiveDate

Available on crate feature chrono only.
Source§

const SQL_TYPE: &'static str = "DATE"

Source§

impl SqlTyped for String

Source§

const SQL_TYPE: &'static str = "NVARCHAR"

Source§

impl SqlTyped for Uuid

Available on crate feature uuid only.
Source§

const SQL_TYPE: &'static str = "UNIQUEIDENTIFIER"

Source§

impl SqlTyped for Vec<u8>

Source§

const SQL_TYPE: &'static str = "VARBINARY"

Source§

impl SqlTyped for bool

Source§

const SQL_TYPE: &'static str = "BIT"

Source§

impl SqlTyped for f32

Source§

const SQL_TYPE: &'static str = "REAL"

Source§

impl SqlTyped for f64

Source§

const SQL_TYPE: &'static str = "FLOAT"

Source§

impl SqlTyped for i16

Source§

const SQL_TYPE: &'static str = "SMALLINT"

Source§

impl SqlTyped for i32

Source§

const SQL_TYPE: &'static str = "INT"

Source§

impl SqlTyped for i64

Source§

const SQL_TYPE: &'static str = "BIGINT"

Source§

impl SqlTyped for u8

Source§

const SQL_TYPE: &'static str = "TINYINT"

Implementors§