get_harms

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-08-28 19:14:08 +02:00
parent 5534da7f29
commit d7d6425a0f

22
src/bin/get-harms.rs Normal file
View File

@@ -0,0 +1,22 @@
/*
* advotracker - Hotline tackingtool for Advocats
*
* Copyright 2020 Ralf Zerres <ralf.zerres@networkx.de>
* SPDX-License-Identifier: (0BSD or MIT)
*/
fn main() {
use advotracker_db::functions::db_connection::establish_connection;
use advotracker_db::models::harms::Harm;
let connection = establish_connection();
// function call
let vec_rows = Harm::get_all(&connection);
let rows = vec_rows.iter();
println!("Matching harms (count: {})", rows.len());
for row in rows {
println!("{:?}: {:?} {:?} {:?} {:?}",
row.id, row.id_harm, row.id_policyholder, row.id_callback, row.date_recording);
}
}