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

SQLModelGenerator does not respect table names #208

Open
brianmcburney opened this issue May 7, 2022 · 1 comment
Open

SQLModelGenerator does not respect table names #208

brianmcburney opened this issue May 7, 2022 · 1 comment

Comments

@brianmcburney
Copy link

brianmcburney commented May 7, 2022

Love the addition of the SQLModelGenerator. However the generated models transform the table names in undesired ways (e.g. some_random_table becomes somerandomtable).

Removing render_class_variables from the SQLModelGenerator class, or simply calling super().render_class_variables there fixes the issue. DeclarativeGenerator.render_class_variables adds the __tablename__ class variable, which is supported by SQLModel, see here.

I'm happy to open a PR, but I'm not sure if this would have unintended consequences (or if there's a better way to accomplish this).

brianmcburney pushed a commit to brianmcburney/sqlacodegen that referenced this issue May 8, 2022
@agronholm
Copy link
Owner

I am in the middle of a big refactoring now. It's best to leave such PRs until after that work has been committed.

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