Skip to content
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

How can I return the number of records modified by the update statement? #449

Open
aohanhe opened this issue Nov 4, 2023 · 1 comment
Open
Labels
help wanted Extra attention is needed

Comments

@aohanhe
Copy link

aohanhe commented Nov 4, 2023

#[py_sql("update monitoring_host set online=false,last_offline_time=#{time} where host_code=#{host_code}")]
pub async fn update_offline_byhostcode(rb: &RBatis, host_code: String, time: DateTime) -> u32 {
impled!()
} 我试过这样是不行的,正确的做法是怎么样?

@Issues-translate-bot Issues-translate-bot changed the title 请问怎么样才可以返回update语句修改的记录条数? How can I return the number of records modified by the update statement? Nov 4, 2023
@zhuxiujia
Copy link
Member

zhuxiujia commented Nov 4, 2023

#[py_sql("update monitoring_host set online=false,last_offline_time=#{time} where host_code=#{host_code}")] pub async fn update_offline_byhostcode(rb: &RBatis, host_code: String, time: DateTime) -> u32 { impled!() } 我试过这样是不行的,正确的做法是怎么样?

#[py_sql("update monitoring_host set online=false,last_offline_time=#{time} where host_code=#{host_code}")]
pub async fn update_offline_byhostcode(rb: &dyn Executor, host_code: String, time: DateTime) -> Result<ExecResult, Error> {
impled!()
}

@zhuxiujia zhuxiujia added the help wanted Extra attention is needed label Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants