Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign uperror message could explain `execute` vs `load` #1136
Comments
killercup
added
the
documentation
label
Sep 1, 2017
This comment has been minimized.
|
We don't have control over the error message, but we do call this out in the getting started guide. We should make that same call out in the docs for load |
sgrif
added
the
good first issue
label
Jan 17, 2018
added a commit
to brandur/diesel
that referenced
this issue
Feb 8, 2018
brandur
referenced this issue
Feb 8, 2018
Merged
Clarify use of `execute` versus `load` in documentation #1548
This comment has been minimized.
|
I took a stab at adding a little more documentation in #1548 (as suggested). IMO though, the original reporter here has a point in that this goes a little beyond a documentation problem. I've been using Diesel fairly seriously for a few weeks now and it's quite a common pattern to have a compiler protect you from misuse, but to do so in a way that doesn't help give you much of an idea as to what's actually wrong. You'll probably eventually solve the problem, but you do so by changing things until you accidentally get it right, investing lots of time reading documentation, or by cloning Diesel's source code and examining its source and examples in the test suite (I've resorted to this last technique about a hundred times). Compiler errors are often of minimal help. I don't really have a suggestion on how to fix this, but I wanted to second the fact that it's a fairly major problem, especially for newcomers to Rust and Diesel who may not be as practiced at unwinding these types of error messages. |
This comment has been minimized.
|
Another data point: #1551. Diesel is doing something useful by not allowing a |
jonathanstrong commentedAug 31, 2017
Setup
Versions
Feature Flags
Problem Description
It took me a long time to figure out that
executereturns at most one value (I'm assuming) whileloadreturns (or can return) a collection of values.I got the following error message:
(You can't see it in the error message, but I was trying to assign the query result to a
Vec<(i32, uuid::Uuid)>).It would be helpful if this error message could offer some hint about the difference between
executevsload. Just thought I would share a point of confusion from someone trying to learn the library. Thanks!Checklist