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

Replace kwargs with SqlContext in get_sql #23

Merged
merged 5 commits into from
Jan 10, 2025

Conversation

henadzit
Copy link
Contributor

@henadzit henadzit commented Jan 3, 2025

This PR replaces kwargs of get_sql with the SqlContext dataclass. This improves performance of SQL generation because the removal of kwargs eliminates the need to create a dict on each get_sql invocation. Also the dataclass explicitly documents all possible parameters as opposed to kwargs that made it quite hard to track.

For performance metrics, see the tortoise-orm PR, which is dependent on this PR.

This PR also adds the warn_unused_ignores = true mypy option and removes unnecessary type ignores.

This PR bumps version to 0.5.0.

Copy link
Member

@abondar abondar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, looks like very tedious changes

Thank you for taking it on

@abondar abondar merged commit 1ab383c into tortoise:main Jan 10, 2025
6 checks passed
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