Add call to load_sql

This commit is contained in:
flyingscorpio@clevo 2022-12-10 11:33:23 +01:00
parent 4349e35060
commit 9c1711e8fa
2 changed files with 5 additions and 2 deletions

View file

@ -55,8 +55,6 @@ fn establish_connection() -> Result<PgConnection, CacheError> {
fn load_sql() { fn load_sql() {
let connection = &mut establish_connection().unwrap(); let connection = &mut establish_connection().unwrap();
let results = cache let results = cache
.filter(true)
.limit(5)
.load::<Cache>(connection) .load::<Cache>(connection)
.expect("Error loading cache"); .expect("Error loading cache");
@ -67,3 +65,7 @@ fn load_sql() {
println!("---"); println!("---");
}; };
} }
pub fn sql_cache() {
load_sql();
}

View file

@ -17,6 +17,7 @@ use mouth::Mouth;
/// Entry point of the library, propagates errors to `main`. /// Entry point of the library, propagates errors to `main`.
pub fn run() -> Result<(), Box<dyn Error>> { pub fn run() -> Result<(), Box<dyn Error>> {
cache::sql_cache();
Ok(()) Ok(())
} }