pub async fn connect(database_uri: &str) -> Result<Self, InitError> {
        let query = if database_uri.starts_with("sqlite") {
            Query::sqlite()
        } else if database_uri.starts_with("mysql") {
            Query::mysql()
        } else {
            return Err(InitError::UnsupportedDatabase);
        };

        let connection = AnyConnection::connect(database_uri).await?;
        let mut this = Self { connection, query };
        this.initialize_database().await?;
        Ok(this)
    }
/// Connects to the database specified by the given URI.
Connects to the database specified by the given URI.
Connects to the database specified by the given URI .
pub async fn connect(database_uri: &str) -> Result<Self, InitError> {
        let query = if database_uri.starts_with("sqlite") {
            Query::sqlite()
        } else if database_uri.starts_with("mysql") {
            Query::mysql()
        } else {
            return Err(InitError::UnsupportedDatabase);
        };
        let connection = AnyConnection::connect(database_uri).await?;
        let mut this = Self { connection, query };
        this.initialize_database().await?;
        Ok(this)
    }
pub async fn connect ( database_uri : & str ) -> Result < Self , InitError > { let query = if database_uri . starts_with ( " " ) { Query :: sqlite ( ) } else if database_uri . starts_with ( " " ) { Query :: mysql ( ) } else { return Err ( InitError :: UnsupportedDatabase ) ; } ; let connection = AnyConnection :: connect ( database_uri ) . await ? ; let mut this = Self { connection , query } ; this . initialize_database ( ) . await ? ; Ok ( this ) }
Connects to the database specified by the given URI.
Connects to the database specified by the given URI .
database_uri
&str
database_uri
&str