JordanMarr / SqlHydra

SqlHydra is a suite of NuGet packages for working with databases in F# including code generation tools and query expressions.
MIT License
212 stars 21 forks source link

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

Closed prekel closed 2 years ago

prekel commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.