pub async fn build(self) -> DalResult<Connection<'a, DB>> {
        let mut transaction = self.connection.start_transaction().await?;

        let level = self.isolation_level.unwrap_or(if self.is_readonly {
            IsolationLevel::RepeatableRead
        } else {
            IsolationLevel::ReadCommitted
        });
        let level = match level {
            IsolationLevel::ReadCommitted => "READ COMMITTED",
            IsolationLevel::RepeatableRead => "REPEATABLE READ",
            IsolationLevel::Serializable => "SERIALIZABLE",
        };
        let mut set_transaction_args = format!(" ISOLATION LEVEL {level}");

        if self.is_readonly {
            set_transaction_args += " READ ONLY";
        }

        if !set_transaction_args.is_empty() {
            sqlx::query(&format!("SET TRANSACTION{set_transaction_args}"))
                .instrument("set_transaction_characteristics")
                .with_arg("isolation_level", &self.isolation_level)
                .with_arg("readonly", &self.is_readonly)
                .execute(&mut transaction)
                .await?;
        }
        Ok(transaction)
    }
Builds the transaction with the provided characteristics.
core/lib/db_connection/src/connection.rs