pub async fn freeze<DB: DbMarker>(pool: ConnectionPool<DB>) -> anyhow::Result<Self> {
        use sqlx::Executor as _;
        let mut conn = pool.acquire_connection_retried(None).await?;
        conn.execute(
            "UPDATE pg_database SET datallowconn = false WHERE datname = current_database()",
        )
        .await
        .context("SET dataallowconn = false")?;
        drop(conn);
        pool.inner.close().await;
        Ok(Self(pool.database_url))
    }
Closes the connection pool, disallows connecting to the underlying db,
so that the db can be used as a template.
core/lib/db_connection/src/connection_pool.rs