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

Added rowsAffected to PostgreSQLResult #143

Merged
merged 3 commits into from
Sep 7, 2020
Merged

Conversation

arturaz
Copy link
Contributor

@arturaz arturaz commented Sep 5, 2020

Currently PostgreSQLExecutionContext.query does not have a way to know how many rows did that particular
query affected. The only way to get that information is to use PostgreSQLExecutionContext.execute.

Unfortunately execute uses slower, less efficient encoding to talk to the PostgreSQL
server and does not support all data types that query supports.

This allows you to use PostgreSQLExecutionContext.query for INSERT, UPDATE, DELETE statements
and get the affected row count.

…QLExecutionContext.query`

Currently `PostgreSQLExecutionContext.query` does not have a way to know how many rows did that particular
query affected. The only way to get that information is to use `PostgreSQLExecutionContext.execute`.

Unfortunately `execute` uses slower, less efficient encoding to talk to the PostgreSQL
server and does not support all data types that `query` supports.

This allows you to use `PostgreSQLExecutionContext.query` for INSERT, UPDATE, DELETE statements
and get the affected row count.
Copy link
Collaborator

@isoos isoos left a comment

Choose a reason for hiding this comment

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

Looks good, I'm asking for a few small changes, and please also use dartfmt to format the source code.

lib/src/execution_context.dart Outdated Show resolved Hide resolved
lib/src/connection.dart Outdated Show resolved Hide resolved
@arturaz
Copy link
Contributor Author

arturaz commented Sep 6, 2020

Looks good, I'm asking for a few small changes, and please also use dartfmt to format the source code.

Updated.

Copy link
Collaborator

@isoos isoos left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good!

@isoos isoos merged commit 64c6ed2 into stablekernel:master Sep 7, 2020
@isoos
Copy link
Collaborator

isoos commented Sep 7, 2020

Published as part of 2.2.0

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