You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CheezeNotes/src/database.rs

13 lines
398 B

use rusqlite::{params, Connection, Result};
pub struct DatabaseConnection {
connection_string: String,
connection: Option<Connection>,
}
pub fn new(connection_string: String) -> DatabaseConnection {
let mut con = DatabaseConnection{ connection_string: connection_string.to_owned(), connection: None};
con.connection = Some(Connection::open(connection_string).unwrap());
con
}