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

Elide 5.0 - SQLQueryEngine: Ambiguous table aliases #1053

Closed
hellohanchen opened this issue Oct 29, 2019 · 1 comment
Closed

Elide 5.0 - SQLQueryEngine: Ambiguous table aliases #1053

hellohanchen opened this issue Oct 29, 2019 · 1 comment

Comments

@hellohanchen
Copy link
Contributor

Ambiguous table aliases from SQLQueryEngine.toSQL().

Expected Behavior

No ambiguity generated.

Current Behavior

Currently, in SQLQueryEngine.toSQL() method, we are generating table aliases based on class name only, this would cause ambiguity when we have a relationship like tb1.country.country. As country shows up twice in this query, the generated aliases would be ambiguous.

Possible Solution

Maybe the table alias should contain the information from the path like user.country, such as

select * from user join country AS user_country ON ...

There are multiple solutions we can try.

Testing

Add data model that would cause ambiguity and make unit tests and integration tests for it.

@chczy
Copy link
Collaborator

chczy commented Jan 10, 2020

Merged.

@chczy chczy closed this as completed Jan 10, 2020
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

No branches or pull requests

2 participants