59 lines
1.5 KiB
Rust
59 lines
1.5 KiB
Rust
/*
|
|
* 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::users::User;
|
|
|
|
let connection = establish_connection();
|
|
|
|
// function call
|
|
let vec_rows = User::get_all(&connection);
|
|
let rows = vec_rows.iter();
|
|
println!("Matching roles (count: {})", rows.len());
|
|
for row in rows {
|
|
println!("{:?}: {:?}", row.id, row.last_name);
|
|
}
|
|
|
|
/*
|
|
use advotracker_database::models::User;
|
|
use advotracker_database::schema::users::dsl::*;
|
|
let results = users
|
|
.load::<User>(&connection)
|
|
.expect("Error loading users");
|
|
|
|
//.filter(email_confirmed.eq(1))
|
|
//.limit(5)
|
|
//.filter(email_confirmed.eq(Confirmed))
|
|
//.limit(5)
|
|
|
|
println!("Displaying {} users", results.len());
|
|
for user in results {
|
|
println!("{}", user.id);
|
|
println!("----------\n");
|
|
println!("{:?}", user.first_name);
|
|
println!("{:?}", user.last_name);
|
|
println!("{:?}", user.alias);
|
|
println!("{:?}", user.email);
|
|
}
|
|
*/
|
|
|
|
/*
|
|
use advotracker_database::models::Role;
|
|
let results = roles
|
|
.load::<Role>(&connection)
|
|
.expect("Error loading Roles");
|
|
|
|
println!("Displaying {} roles", results.len());
|
|
for role in results {
|
|
println!("{}", role.id);
|
|
println!("----------\n");
|
|
println!("{:?}", role.name);
|
|
}
|
|
*/
|
|
}
|