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: config.rs
    path of file: ./repos/roapi/roapi/src
    
    the code of the file until where you have to start completion: use columnq::datafusion::config::ConfigOptions;
use columnq::SessionConfig;
use serde_derive::Deserialize;
use snafu::{whatever, Whatever};

use columnq::encoding;
use columnq::table::parse_table_uri_arg;
use columnq::table::KeyValueSource;
use columnq::table::TableSource;
use std::collections::HashMap;
use std::fs;
use std::time::Duration;

#[derive(Deserialize, Default, Clone)]
pub struct AddrConfig {
    pub http: Option<String>,
    pub postgres: Option<String>,
    pub flight_sql: Option<String>,
}

#[derive(Deserialize, Default, Clone)]
pub struct FlightSqlTlsConfig {
    pub cert: String,
    pub key: String,
    pub client_ca: String,
}

#[derive(Deserialize, Default, Clone)]
pub struct BasicAuth {
    pub username: String,
    pub password: String,
}

#[derive(Deserialize, Default, Clone)]
pub struct FlightSqlConfig {
    pub tls: Option<FlightSqlTlsConfig>,
    pub auth_token: Option<String>,
    pub auth_basic: Option<BasicAuth>,
}

#[derive(Deserialize, Default, Clone)]
pub struct Config {
    #[serde(default)]
    pub addr: AddrConfig,
    pub tables: Vec<TableSource>,
    pub reload_interval: Option<Duration>,
    #[serde(default)]
    pub disable_read_only: bool,
    #[serde(default)]
    pub kvstores: Vec<KeyValueSource>,
    #[serde(default)]
    pub response_format: encoding::ContentType,
    #[serde(default)]
    pub datafusion: Option<HashMap<String, String>>,
    #[serde(default)]
    pub flight_sql_config: Option<FlightSqlConfig>,
}

fn table_arg() -> clap::Arg {
    clap::Arg::new("table")
        .help("Table sources to load. Table option can be provided as optional setting as part of the table URI, for example: `blogs=s3://bucket/key,format=delta`. Set table uri to `stdin` if you want to consume table data from stdi
    
pub fn get_configuration() -> Result<Config, Whatever> {
    let matches = clap::Command::new("roapi")
        .version(env!("CARGO_PKG_VERSION"))
        .author("QP Hou")
        .about(
            "Create full-fledged APIs for static datasets without writing a single line of code.",
        )
        .arg_required_else_help(true)
        .args(&[
            address_http_arg(),
            address_postgres_arg(),
            address_flight_sql_arg(),
            config_arg(),
            read_only_arg(),
            reload_interval_arg(),
            response_format_arg(),
            table_arg(),
        ])
        .get_matches();

    let mut config: Config = match matches.get_one::<String>("config") {
        None => Config::default(),
        Some(config_path) => {
            let config_content = whatever!(
                fs::read_to_string(config_path),
                "Failed to read config file: {config_path}",
            );
            if config_path.ends_with(".yaml") || config_path.ends_with(".yml") {
                whatever!(
                    serde_yaml::from_str(&config_content),
                    "Failed to parse YAML config",
                )
            } else if config_path.ends_with(".toml") {
                whatever!(
                    toml::from_str(&config_content),
                    "Failed to parse TOML config"
                )
            } else {
                whatever!("Unsupported config file format: {}", config_path);
            }
        }
    };

    if let Some(tables) = matches.get_many::<String>("table") {
        for v in tables {
            config.tables.push(whatever!(
                parse_table_uri_arg(v),
                "Failed to parse table uri: {v}"
            ));
        }
    }

    if let Some(addr) = matches.get_one::<String>("addr-http") {
        config.addr.http = Some(addr.to_owned());
    }

    if let Some(addr) = matches.get_one::<String>("addr-postgres") {
        config.addr.postgres = Some(addr.to_owned());
    }

    if let Some(addr) = matches.get_one::<String>("addr-flight-sql") {
        config.addr.flight_sql = Some(addr.to_owned());
    }

    if matches.contains_id("disable-read-only") {
        config.disable_read_only = true;
    }

    if let Some(reload_interval) = matches.get_one::<u64>("reload-interval") {
        if !config.disable_read_only {
            whatever!("Table reload not supported in read-only mode. Try specify the --disable-read-only option.");
        }
        config.reload_interval = Some(Duration::from_secs(reload_interval.to_owned()));
    }

    if let Some(response_format) = matches.get_one::<String>("response-format") {
        config.response_format = whatever!(
            serde_yaml::from_str(response_format),
            "Failed parse response-format",
        );
    }

    Ok(config)
}