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
Calling save on a model for which no changes have been made generates invalid sql which causes an unclear error message.
Tested against MariaDB, but have reason to believe it should occur with all database backends
This behaviour seems to be originating from within the Update::one() method
Steps to Reproduce
let db = Database::connect("mysql://some_connection_url").await.unwrap();// UserActive in this case is an alias to an ActiveModellet user = UserActive{ ...}
user.insert(&db).await.unwrap()// Some quantity of code that may or may not change the user.
let active_user:UserActive = user.into();
active_user.save(&db).await.unwrap();
Expected Behavior
Either a clearer error message stating that the model hasn't changed - thus save cannot be called or no error at all and the call to save to be a no-op
Actual Behavior
Raises:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE `users`.`id` = ?' at line 1"
Reproduces How Often
100%
Versions
MariaDB: Ver 15.1 Distrib 10.9.4-MariaDB, for Linux (x86_64) using readline 5.1
sea-orm: 0.10.5
Additional Information
The text was updated successfully, but these errors were encountered:
Description
Calling save on a model for which no changes have been made generates invalid sql which causes an unclear error message.
Tested against MariaDB, but have reason to believe it should occur with all database backends
This behaviour seems to be originating from within the
Update::one()
methodSteps to Reproduce
Expected Behavior
Either a clearer error message stating that the model hasn't changed - thus save cannot be called or no error at all and the call to save to be a no-op
Actual Behavior
Raises:
Reproduces How Often
100%
Versions
Additional Information
The text was updated successfully, but these errors were encountered: