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

Table name collision when tables has the same name in different schemas (Postgres) #3

Closed
prekel opened this issue Sep 22, 2021 · 3 comments

Comments

@prekel
Copy link

prekel commented Sep 22, 2021

Thank you for support Postgres!

But I cannot find how to select a specific schema for code generation. So, if there are tables with the same names in different schemas (in the screenshot on the right: users in auth and users in public), there will be collision and non-compilable generated code.

image

@JordanMarr
Copy link
Owner

JordanMarr commented Sep 22, 2021

I knew this was going to be a thing, but i didn’t think it would be a thing so quickly! 😅

But I should be able to fix it fairly easily by fully qualifying the generated lazy functions. (Currently they are named only after the table name which would cause a build error).

@JordanMarr
Copy link
Owner

I have uploaded a new beta build for you to try that fully qualifies the generated HydraReader properties.
You should be able to update with this:

dotnet tool update --local SqlHydra.Npgsql --version 0.500.0-beta.1

@JordanMarr
Copy link
Owner

JordanMarr commented Sep 23, 2021

FYI I just updated all the packages as v0.500.1 and rolled out this fix along with a few others:
https://www.nuget.org/packages?q=sqlhydra

I also do plan on adding a schema/table filter soon.

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