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

Add force_class option #348

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

Conversation

multimeric
Copy link

The current logic is that, if a table has no primary key, it doesn't use the declarative class generator. However, sqlite has the hidden rowid column which acts as a primary key. For this reason, I want to generate a dataclass and then add rowid as the primary key so that I get all the nice type safety of a dataclass. There are probably also other use cases for ignoring this rule.

Thus, this PR adds a new option called force_class that will generate a dataclass even if there is no obvious primary key.

@DevkumarPatel
Copy link

@multimeric when are we expecting this to go to production?.

@multimeric
Copy link
Author

I don't follow. You can install directly from my fork if you want.

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.

2 participants