-
Notifications
You must be signed in to change notification settings - Fork 14
feat: update_all fn #472
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
base: main
Are you sure you want to change the base?
feat: update_all fn #472
Conversation
| let #name: #ty = #ident.#accessor.clone(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bodymindarts maybe you can help me fig out how I can avoid clone here.
| entities: Vec<#entity>, | ||
| ) -> Result<Vec<#entity>, #error> { | ||
| if entities.is_empty() { | ||
| return Ok(Vec::new()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can simply return entities.
|
|
||
| let sql_updates = self.columns.sql_updates(); | ||
|
|
||
| let update_fragment = format!("UPDATE {table_name} SET {sql_updates} WHERE id = $1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can't be right - it needs to handle multiple ids.
a7a3ee1 to
e852809
Compare
No description provided.