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
{{ message }}
Repository navigation
Syntax Error when saving active model that sets nothing #1376
Hey @lihe07, thanks for bring this up to the spotlight. I think this is something that we need to "fix".
IMO when updating / saving a existing ActiveModel with all its value being Unchanged or NotSet, the expected behaviour should be no-op. That's to skip firing any SQL statement.
To achieve that we need to check the values field of sea_query::UpdateStatement is empty at executor/update.rs.
Activity
billy1624 commentedon Jan 9, 2023
Hey @lihe07, thanks for bring this up to the spotlight. I think this is something that we need to "fix".
IMO when updating / saving a existing ActiveModel with all its value being
UnchangedorNotSet, the expected behaviour should be no-op. That's to skip firing any SQL statement.To achieve that we need to check the
valuesfield ofsea_query::UpdateStatementis empty atexecutor/update.rs.lihe07 commentedon Jan 9, 2023
@billy1624 Thanks! I'd be happy to work this out if I can!
(and I don't need a patch for my project either)
billy1624 commentedon Jan 10, 2023
Hey @lihe07, thanks for the interest!! Sorry, I didn't realise you want to take this. Please check my PR at #1384
lihe07 commentedon Jan 12, 2023
Never mind! I'll keep an eye out too, if there's anything I can do to help.