pub enum Pool {
PostgreSQL(Pool<PostgresConnectionManager<NoTls>>),
SQLite(Pool<SqliteConnectionManager>),
}Variants§
PostgreSQL(Pool<PostgresConnectionManager<NoTls>>)
SQLite(Pool<SqliteConnectionManager>)
Implementations§
Source§impl Pool
impl Pool
pub fn postgres(config: Config) -> Result<Self, Error>
pub fn sqlite(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn as_kind(&self) -> PoolKind
pub fn batch_execute(&self, exec: impl AsRef<str>) -> Result<(), Error>
pub fn transaction( &self, run: impl FnOnce(Transaction<'_>) -> Result<(), Error>, ) -> Result<(), Error>
pub fn schema<T: Schema>(&self) -> Result<(), Error>
Trait Implementations§
Source§impl<'r> TryFrom<&'r Pool> for Connection
impl<'r> TryFrom<&'r Pool> for Connection
Auto Trait Implementations§
impl Freeze for Pool
impl !RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl !UnwindSafe for Pool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more