Skip to content

fix: impl and get affected rowcount from resp data #635

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

hantmac
Copy link
Member

@hantmac hantmac commented Jun 11, 2025

Get affected_rows from response data.

@sundy-li sundy-li requested a review from youngsofun June 11, 2025 14:02
@@ -65,7 +65,10 @@ impl IConnection for RestAPIConnection {
async fn exec(&self, sql: &str) -> Result<i64> {
info!("exec: {}", sql);
let page = self.client.query_all(sql).await?;
Ok(page.stats.progresses.write_progress.rows as i64)

let affected_rows = page.affected_rows().map_err(Error::InvalidResponse)?;
Copy link
Member

@everpcpc everpcpc Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

affected_rows and other helper functions could be located not in core but also in this impl. Then we could take advantages of query_iter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can not take the advantage of query_iter when we parse the affected rows, because we need to query_all and use affected rows in the final page info.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could easily handle response in query_iter in driver rather than query_all in core.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could easily handle response in query_iter in driver rather than query_all in core.

That sounds make sense.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we could make use of the value parser in driver.

@hantmac hantmac force-pushed the fix/impl-rowcount branch from c0acbcc to 16d2dff Compare June 14, 2025 09:43
@hantmac hantmac changed the title fix: impl and get rowcount from resp data fix: impl and get affected rowcount from resp data Jun 14, 2025
@hantmac hantmac requested a review from everpcpc June 17, 2025 02:20
@hantmac hantmac force-pushed the fix/impl-rowcount branch from cfd37ba to 5bde9a9 Compare June 27, 2025 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants