Skip to main content

Database

Trait Database 

pub trait Database:
    Sized
    + 'static
    + Send
    + Debug {
    type Connection: Connection<Database = Self>;
    type TransactionManager: TransactionManager<Database = Self>;
    type Row: Row<Database = Self>;
    type QueryResult: 'static + Send + Sync + Default + Extend<Self::QueryResult>;
    type Column: Column<Database = Self>;
    type TypeInfo: TypeInfo;
    type Value: Value<Database = Self> + 'static;
    type ValueRef<'r>: ValueRef<'r, Database = Self>;
    type Arguments<'q>: Arguments<'q, Database = Self>;
    type ArgumentBuffer<'q>;
    type Statement<'q>: Statement<'q, Database = Self>;
Show 2 associated constants and 0 method const NAME: &'static str; const URL_SCHEMES: &'static [&'static str];
}
Expand description

A database driver.

This trait encapsulates a complete set of traits that implement a driver for a specific database (e.g., MySQL, PostgreSQL).

Required Associated Constants§

const NAME: &'static str

The display name for this database driver.

const URL_SCHEMES: &'static [&'static str]

The schemes for database URLs that should match this driver.

Required Associated Types§

type Connection: Connection<Database = Self>

The concrete Connection implementation for this database.

type TransactionManager: TransactionManager<Database = Self>

The concrete TransactionManager implementation for this database.

type Row: Row<Database = Self>

The concrete Row implementation for this database.

type QueryResult: 'static + Send + Sync + Default + Extend<Self::QueryResult>

The concrete QueryResult implementation for this database.

type Column: Column<Database = Self>

The concrete Column implementation for this database.

type TypeInfo: TypeInfo

The concrete TypeInfo implementation for this database.

type Value: Value<Database = Self> + 'static

The concrete type used to hold an owned copy of the not-yet-decoded value that was received from the database.

type ValueRef<'r>: ValueRef<'r, Database = Self>

The concrete type used to hold a reference to the not-yet-decoded value that has just been received from the database.

type Arguments<'q>: Arguments<'q, Database = Self>

The concrete Arguments implementation for this database.

type ArgumentBuffer<'q>

The concrete type used as a buffer for arguments while encoding.

type Statement<'q>: Statement<'q, Database = Self>

The concrete Statement implementation for this database.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

§

impl Database for Any

§

const NAME: &'static str = "Any"

§

const URL_SCHEMES: &'static [&'static str]

§

type Connection = AnyConnection

§

type TransactionManager = AnyTransactionManager

§

type Row = AnyRow

§

type QueryResult = AnyQueryResult

§

type Column = AnyColumn

§

type TypeInfo = AnyTypeInfo

§

type Value = AnyValue

§

type ValueRef<'r> = AnyValueRef<'r>

§

type Arguments<'q> = AnyArguments<'q>

§

type ArgumentBuffer<'q> = AnyArgumentBuffer<'q>

§

type Statement<'q> = AnyStatement<'q>

§

impl Database for MySql

§

impl Database for Postgres

§

impl Database for Sqlite