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

Fix Column and metadata in SQLModel Generator #306

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

THUzxj
Copy link

@THUzxj THUzxj commented Dec 1, 2023

I encountered a similar problem with #302 and I tried to fix it, including

  • Force to use Column instead of mapped_column, through passing is_table=True
  • Modify generate_base to generate metadata variable if Model exists

Maybe we can also refactor generate_models to decouple the function of getting models and collecting imports.

It is probably just a temporary solution to the issue. Thus it's up to you whether to merge. Thanks.

@coveralls
Copy link

Coverage Status

coverage: 99.035%. remained the same
when pulling d1fec15 on THUzxj:master
into 6b8bc90 on agronholm:master.

@agronholm
Copy link
Owner

I am working on a proper fix for the problem. Most of the time, Column should not be used by the generator.

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

Successfully merging this pull request may close these issues.

None yet

3 participants