You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dbconn.rs
    path of file: ./repos/chiselstrike/server/src/datastore
    
    the code of the file until where you have to start completion: // SPDX-FileCopyrightText: Â© 2021 ChiselStrike <info@chiselstrike.com>

use anyhow::Context;
use anyhow::Result;
use sea_query::{PostgresQueryBuilder, QueryBuilder, SchemaBuilder, SqliteQueryBuilder};
use sqlx::any::{An
    
    pub async fn connect(uri: &str, max_connections: usize) -> Result<Self> {
        let pool = AnyPoolOptions::new()
            .max_connections(max_connections as u32)
            .after_connect(move |conn, _meta| {
                Box::pin(async move {
                    if matches!(conn.kind(), AnyKind::Sqlite) {
                        conn.execute("PRAGMA journal_mode=WAL;").await?;
                    }
                    Ok(())
                })
            })
            .connect(uri)
            .await
            .with_context(|| format!("failed to connect to {}", uri))?;
        Ok(Self { pool })
    }