Give a more specific error message for unsigned types #757
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We don't yet support these types in MySQL, but the error a user will
recieve is not terribly helpful, since the type will contain a space so
the
table!
macro invocation will just have bad tokens.This gives a more specific error message for unsigned types, as well as
ensuring that we get a reasonable error for other types would result in
a bad macro invocation. (I'm not actually aware of any other types which
have a space, but I'd rather not dig through the entire manual right
now)
In theory we could exclude unsigned floats from this, since unsigned
floats aren't actually a thing and that "type" in MySQL is basically
just a check constraint, but I'd rather hold off and actually represent
in Diesel that the type is different when we add support for unsigned
integer types.
Fixes #754.