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

Postgres identifier exceeds limit on eager relations #7508

Closed
2 of 21 tasks
nurdism opened this issue Mar 28, 2021 · 0 comments · Fixed by #7509
Closed
2 of 21 tasks

Postgres identifier exceeds limit on eager relations #7508

nurdism opened this issue Mar 28, 2021 · 0 comments · Fixed by #7509

Comments

@nurdism
Copy link
Contributor

nurdism commented Mar 28, 2021

Issue Description

Postgres identifier exceeds limit on eager relations

Expected Behavior

eager relations "relation alias" or identifier should not exceed Postgres's (or the driver's) limit

Actual Behavior

eager relations identifier do not get shortened when a query is built

Steps to Reproduce

https://github.com/nurdism/typeorm_issue

My Environment

Dependency Version
Operating System Debian Linux
Node.js version v14.16.0
Typescript version v4.2.3
TypeORM version v0.2.31

Additional Context

I've found the issue, its here, the function is missing the length check for the relationAlias var. My question is, should I use StringUtils.shorten(relationAlias) (used here) or StringUtils.hash(relationAlias) (used here)
or should I use the has function

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.
nurdism pushed a commit to nurdism/typeorm that referenced this issue Mar 29, 2021
nurdism pushed a commit to nurdism/typeorm that referenced this issue Mar 29, 2021
AlexMesser pushed a commit that referenced this issue Apr 3, 2021
)

* fix: issue #7508

* new util DriverUtils.buildAlias

* fix: typo in statement

* wip: run tests with just hash

* fix compile

* added buildAlias options

Co-authored-by: Craig Betterly <craig@closem.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant