1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::*;

impl RqliteConnection {
    pub async fn establish(
        options: &RqliteConnectOptions,
    ) -> Result<Self, sqlx_core::error::Error> {
        let res = options.inner.connect().await;
        match res {
            Ok(conn) => Ok(Self { inner: conn }),
            Err(err) => Err(Error::Io(std::io::Error::new(
                std::io::ErrorKind::Other,
                format!("{}", err).as_str(),
            ))),
        }
    }
}