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

UpdateResult and DeleteResult return affected as undefined for Aurora Data API driver #7386

Closed
2 of 21 tasks
coyoteecd opened this issue Feb 17, 2021 · 0 comments · Fixed by #7433
Closed
2 of 21 tasks

Comments

@coyoteecd
Copy link
Contributor

coyoteecd commented Feb 17, 2021

Issue Description

Aurora Data API driver started as a clone of MysqlDriver and for DeleteQueryBuilder, it copies the number of deleted rows from result.affectedRows. But Aurora Data API driver returns this in a numberOfRecordsUpdated property, therefore affected is left undefined.

For UpdateQueryBuilder, affected is not handled at all (the driver implementation was copied before #5628 landed in master). The same fix needs to be applied there as well.

Expected Behavior

When using repository.insert(entity), the InsertResult.affected value should reflect what's being returned by the low-level API via the numberOfRecordsUpdated property.
Likewise, when using repository.update(entity), the UpdateResult.affected should do the same as insert.

Actual Behavior

In both cases, affected is undefined.

My Environment

Dependency Version
Operating System Windows 10
Node.js version v12.14.0
Typescript version v4.1.3
TypeORM version v0.2.31

Relevant Database Driver(s)

  • aurora-data-api
  • aurora-data-api-pg
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.
coyoteecd added a commit to coyoteecd/typeorm that referenced this issue Feb 17, 2021
coyoteecd added a commit to coyoteecd/typeorm that referenced this issue Feb 19, 2021
coyoteecd added a commit to coyoteecd/typeorm that referenced this issue Feb 26, 2021
AlexMesser pushed a commit that referenced this issue Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant