sqlx_firebird/options/
connect.rs1use std::time::Duration;
7
8use futures_core::future::BoxFuture;
9use log::LevelFilter;
10use sqlx_core::connection::ConnectOptions;
11use sqlx_core::{Error, Url};
12
13use super::FbConnectOptions;
14use crate::FbConnection;
15
16impl ConnectOptions for FbConnectOptions {
17 type Connection = FbConnection;
18
19 fn from_url(url: &Url) -> Result<Self, Error> {
20 Self::parse_from_url(url)
21 }
22
23 fn connect(&self) -> BoxFuture<'_, Result<Self::Connection, Error>>
24 where
25 Self::Connection: Sized,
26 {
27 Box::pin(FbConnection::establish(self))
28 }
29
30 fn log_statements(mut self, level: LevelFilter) -> Self {
31 self.log_settings.log_statements(level);
32 self
33 }
34
35 fn log_slow_statements(mut self, level: LevelFilter, duration: Duration) -> Self {
36 self.log_settings.log_slow_statements(level, duration);
37 self
38 }
39}
40