DatabaseType

Trait DatabaseType 

Source
pub trait DatabaseType {
    type DB: Database + DatabaseInfo;
}
Expand description

数据库类型提取 trait

用于从 Pool 或 Transaction 中自动推断数据库类型 这样用户就不需要显式指定 find_by_id::<sqlx::MySql, _>,而是可以直接调用 find_by_id_auto(pool, id)

Required Associated Types§

Source

type DB: Database + DatabaseInfo

关联的数据库类型

Implementations on Foreign Types§

Source§

impl DatabaseType for &Pool<MySql>

Available on crate feature mysql only.
Source§

impl DatabaseType for &Pool<Postgres>

Available on crate feature postgres only.
Source§

impl DatabaseType for &Pool<Sqlite>

Available on crate feature sqlite only.
Source§

impl DatabaseType for &mut MySqlConnection

Available on crate feature mysql only.
Source§

impl DatabaseType for &mut PgConnection

Available on crate feature postgres only.
Source§

impl DatabaseType for &mut SqliteConnection

Available on crate feature sqlite only.
Source§

impl DatabaseType for Pool<MySql>

Available on crate feature mysql only.
Source§

impl DatabaseType for Pool<Postgres>

Available on crate feature postgres only.
Source§

impl DatabaseType for Pool<Sqlite>

Available on crate feature sqlite only.
Source§

impl DatabaseType for MySqlConnection

Available on crate feature mysql only.
Source§

impl DatabaseType for PgConnection

Available on crate feature postgres only.
Source§

impl DatabaseType for SqliteConnection

Available on crate feature sqlite only.
Source§

impl<'tx> DatabaseType for &mut Transaction<'tx, MySql>

Available on crate feature mysql only.
Source§

impl<'tx> DatabaseType for &mut Transaction<'tx, Postgres>

Available on crate feature postgres only.
Source§

impl<'tx> DatabaseType for &mut Transaction<'tx, Sqlite>

Available on crate feature sqlite only.

Implementors§