You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UPDATE "tablename" SET "value" = NULL WHERE "id" = ?
What is the full error you are seeing?
panicked at 'called `Result::unwrap()` on an `Err` value: Error(DbResult(QueryBuilderError(StringError("There are no changes to save. This query cannot be built"))), State { next_error: None, backtrace: None
})', /checkout/src/libcore/result.rs:859
By default, any Option fields on the struct are skipped if their value is None. If you would like to assign NULL to the field instead, you can annotate your struct with #[changeset_options(treat_none_as_null = "true")].
Which versions of Rust and Diesel are you using?
rustc 1.19.0-nightly (06fb4d256 2017-04-30)
diesel 0.12
Which feature flags are you using?
postgres, chrono, serde
What are you trying to accomplish?
generate a query to update fields to null
e.g.
What is the full error you are seeing?
Because None is a noop:
diesel/diesel/src/query_builder/update_statement/changeset.rs
Line 45 in e52d171
And struct with only None values can not pass this:
diesel/diesel/src/query_builder/update_statement/mod.rs
Line 58 in d44c50f
How can we reproduce this?
define a struct with only Option fields and derive AsChangeset
Then update using this struct
Please quote as much of your code as needed to reproduce (best link to a public repository or a Gist)
N/A
Please post as much of your database schema as is relevant to your error
N/A
The text was updated successfully, but these errors were encountered: