pub trait FieldType: ToSql + FromSql {
    type RefType: ?Sized + ToSql;

    const SQLTYPE: SqlType;
}
Expand description

Type suitable for being a database column.

Required Associated Types§

source

type RefType: ?Sized + ToSql

Reference type. Used for ergonomics with String (which has reference type str). For most, it is Self

Required Associated Constants§

Implementations on Foreign Types§

source§

impl FieldType for String

source§

const SQLTYPE: SqlType = SqlType::Text

§

type RefType = str

source§

impl FieldType for f32

source§

const SQLTYPE: SqlType = SqlType::Real

§

type RefType = f32

source§

impl FieldType for i16

source§

const SQLTYPE: SqlType = SqlType::Int

§

type RefType = i16

source§

impl FieldType for bool

source§

const SQLTYPE: SqlType = SqlType::Bool

§

type RefType = bool

source§

impl FieldType for i64

source§

const SQLTYPE: SqlType = SqlType::BigInt

§

type RefType = i64

source§

impl<T> FieldType for Option<T>where T: FieldType,

source§

const SQLTYPE: SqlType = T::SQLTYPE

§

type RefType = Option<T>

source§

impl FieldType for u32

source§

const SQLTYPE: SqlType = SqlType::BigInt

§

type RefType = u32

source§

impl FieldType for i32

source§

const SQLTYPE: SqlType = SqlType::Int

§

type RefType = i32

source§

impl FieldType for u8

source§

const SQLTYPE: SqlType = SqlType::Int

§

type RefType = u8

source§

impl FieldType for u16

source§

const SQLTYPE: SqlType = SqlType::Int

§

type RefType = u16

source§

impl FieldType for i8

source§

const SQLTYPE: SqlType = SqlType::Int

§

type RefType = i8

source§

impl FieldType for Vec<u8>

source§

const SQLTYPE: SqlType = SqlType::Blob

§

type RefType = Vec<u8, Global>

source§

impl FieldType for f64

source§

const SQLTYPE: SqlType = SqlType::Real

§

type RefType = f64

Implementors§

source§

impl<T> FieldType for ForeignKey<T>where T: DataObject,

source§

const SQLTYPE: SqlType = <<T as DataObject>::PKType>::SQLTYPE

§

type RefType = <<T as DataObject>::PKType as FieldType>::RefType