/// Construct new database structure and database file if needed
///
/// # Arguments
/// `path` - Path to database file
///
/// # Panics
///
/// Attempts to connect to sqlite database and will `panic!` if connection fails.
Construct new database structure and database file if needed
Construct new database structure and database file if needed
pub fn new(path: &str) -> Self {
        if !::std::path::Path::new(path).exists() {
            println!("Creating database {}", path);
        }
        Database {
            connection: SqliteConnection::establish(&String::from(path)).expect(&format!(
                "Could not create SQLite database connection to: {}",
                path
            )),
        }
    }
pub fn new ( path : & str ) -> Self { if ! :: std :: path :: Path :: new ( path ) . exists ( ) { println ! ( " " path ) ; } Database { connection : SqliteConnection :: establish ( & String :: from ( path ) ) . expect ( & format ! ( " " path ) ) , } }
Construct new database structure and database file if needed
Construct new database structure and database file if needed
path
&str
panics
Attempts to connect to sqlite database and will `panic!` if connection fails.
Attempts to connect to sqlite database and will ` panic! ` if connection fails .