-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skip_insertion
results in a compiler error
#4006
Comments
Thanks for opening this bug report. This is expected behaviour given your diesel version. The |
Shouldn't the error message be different at least? Because while it may not yet be supported in that version; the error message is at the very least confusing. |
That's correct. Seems like we somehow accidentally backported a PR that changes the error message only. I'm happy to merge a PR that reverts that + prepares another release. 45915ac is the relevant commit |
This is now fixed with the release of diesel 2.2, as that release contains support for this attribute. |
Setup
Compiling the following:
with
Versions
Feature Flags
Problem Description
It errors out with:
In general, the following work (as in, they don't error out in the derive macro):
embed
column_name = ...
sql_type = ...
serialize_as = ...
deserialize_as = ...
select_expression = ...
select_expression_type = ...
And these don't work:
skip_insertion
treat_none_as_default_value
treat_none_as_null
What are you trying to accomplish?
Trying to use the
Insertable
derive macroWhat is the expected output?
Either that it doesn't error out, or in case that the input is incorrect, an error message that is less confusing
What is the actual output?
An error message that would suggest that the input is well formed
Are you seeing any additional errors?
No
Steps to reproduce
cargo new --bin diesel-test
, changeCargo.toml
&main.rs
appropriately,cargo +stable build
Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: