[][src]Trait diesel::backend::Backend

pub trait Backend where
    Self: Sized,
    Self: HasSqlType<SmallInt>,
    Self: HasSqlType<Integer>,
    Self: HasSqlType<BigInt>,
    Self: HasSqlType<Float>,
    Self: HasSqlType<Double>,
    Self: HasSqlType<VarChar>,
    Self: HasSqlType<Text>,
    Self: HasSqlType<Binary>,
    Self: HasSqlType<Date>,
    Self: HasSqlType<Time>,
    Self: HasSqlType<Timestamp>, 
{ type QueryBuilder: QueryBuilder<Self>; type BindCollector: BindCollector<Self>; type RawValue: ?Sized; type ByteOrder: ByteOrder; }

A database backend

This trait represents the concept of a backend (e.g. "MySQL" vs "SQLite"). It is separate from a Connection to that backend. One backend may have multiple concrete connection implementations.

Implementations of this trait should not assume details about how the connection is implemented. For example, the Pg backend does not assume that libpq is being used. Implementations of this trait can and should care about details of the wire protocol used to communicated with the database.

Associated Types

type QueryBuilder: QueryBuilder<Self>

The concrete QueryBuilder implementation for this backend.

type BindCollector: BindCollector<Self>

The concrete BindCollector implementation for this backend.

Most backends should use RawBytesBindCollector.

type RawValue: ?Sized

The raw representation of a database value given to FromSql.

Since most backends transmit data as opaque blobs of bytes, this type is usually [u8].

type ByteOrder: ByteOrder

What byte order is used to transmit integers?

This type is only used if RawValue is [u8].

Loading content...

Implementors

impl Backend for Mysql[src]

type QueryBuilder = MysqlQueryBuilder

type BindCollector = MysqlBindCollector

type RawValue = [u8]

type ByteOrder = NativeEndian

impl Backend for Pg[src]

impl Backend for Sqlite[src]

Loading content...