commit | 2d554ddf5dfa8e63199df7e4d4ee498e5e4eff9a | [log] [tgz] |
---|---|---|
author | Sean Griffin <sean@seantheprogrammer.com> | Thu Apr 05 08:47:40 2018 -0600 |
committer | Sean Griffin <sean@seantheprogrammer.com> | Fri Apr 06 13:02:57 2018 -0600 |
tree | 94bed0462c3182ebd2d3001ded083d8e8696ae29 | |
parent | 8785523807efc40305cd95b11884ec3936f91261 [diff] |
Add a flag to help users better debug bad `Queryable` impls Since the impl we generate is so generic, when a bad `Queryable` impl is given, the error doesn't occur until they actually try to load a query. This ends up being really non-local, and gives little to no feedback about which field is actually the problem. There is a new option called `#[check_types]` which completely changes how the impl is generated, in such a way that when the `unstable` feature is enabled the error will point at the specific field that is the problem. The actual message is the same, but where it points makes debugging much easier. This flag also generates code which validates that your fields are in the right order to match your columns. Unfortunately, we cannot have this generate an actual usable impl. Trait bounds not matching in types or where clauses will always result in an error pointing at the derive itself, which is no more helpful than where we started. For that reason, we can't actually have any usable `Row` type. So this flag is for debugging purposes only. This does not help with cases where the number of fields is incorrect.
API Documentation: latest release – master branch
Diesel gets rid of the boilerplate for database interaction and eliminates runtime errors without sacrificing performance. It takes full advantage of Rust's type system to create a low overhead query builder that “feels like Rust.”
Find our extensive Getting Started tutorial at https://diesel.rs/guides/getting-started. Guides on more specific features are coming soon.
Anyone who interacts with Diesel in any space, including but not limited to this GitHub repository, must follow our code of conduct.
Licensed under either of these:
Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in the work, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.