From d7d6425a0fc65c11aa3ea9939db8ef46ad3304da Mon Sep 17 00:00:00 2001 From: Ralf Zerres Date: Fri, 28 Aug 2020 19:14:08 +0200 Subject: [PATCH] get_harms Signed-off-by: Ralf Zerres --- src/bin/get-harms.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/bin/get-harms.rs diff --git a/src/bin/get-harms.rs b/src/bin/get-harms.rs new file mode 100644 index 0000000..bc2c23a --- /dev/null +++ b/src/bin/get-harms.rs @@ -0,0 +1,22 @@ +/* + * advotracker - Hotline tackingtool for Advocats + * + * Copyright 2020 Ralf Zerres + * 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); + } +}