stablekernel / postgresql-dart

Dart PostgreSQL driver: supports extended query format, binary protocol and statement reuse.
https://www.dartdocs.org/documentation/postgres/latest
BSD 3-Clause "New" or "Revised" License
129 stars 32 forks source link

Added rowsAffected to PostgreSQLResult #143

Closed arturaz closed 4 years ago

arturaz commented 4 years ago

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.

arturaz commented 4 years ago

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

Updated.

isoos commented 4 years ago

Published as part of 2.2.0