so6 0.2.0

Framework for manage background data migration with PostgreSQL
Documentation
use colored::Colorize;
use pg_client_config::load_config;
use postgres::{Client, Config, NoTls};
use std::sync::OnceLock;

pub struct Database {
    config: Config,
}
impl Database {
    pub fn new() -> Database {
        let config = Config::from(load_config(None).expect("couldn't read postgres config"));
        Database { config }
    }

    pub fn client(&self) -> Client {
        self.config.connect(NoTls).expect(
            "Couldn't connect to the database"
                .red()
                .to_string()
                .as_str(),
        )
    }
}

pub static DATABASE: OnceLock<Database> = OnceLock::new();