#[macro_use] extern crate diesel; use diesel::prelude::*; use diesel::PgConnection; use diesel_sort_struct_fields::sort_columns; #[sort_columns] table! { users (id) { name -> Nullable, id -> Integer, } } #[derive(Queryable, Debug)] pub struct User { id: i32, name: Option, } fn loading_users() { let db = connect_to_db(); users::table .select(users::all_columns) .load::(&db) .unwrap(); } fn connect_to_db() -> PgConnection { unimplemented!() } fn main() {}