Skip to content

Instantly share code, notes, and snippets.

@stephanbuys
Created August 1, 2017 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephanbuys/10bdce8038b1c9c27aa30f6a51d15b23 to your computer and use it in GitHub Desktop.
Save stephanbuys/10bdce8038b1c9c27aa30f6a51d15b23 to your computer and use it in GitHub Desktop.
diesel::debug_sql;
let posts_with_sql = posts.filter(published.eq(true))
.limit(5);
println!("SelectStatement: {:#?}", posts_with_sql);
let results = posts_with_sql
.load::<Post>(&connection)
.expect("Error loading posts");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment