Skip to content

Python query param limit #1530

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

Merged
merged 6 commits into from
Aug 29, 2022
Merged

Conversation

danicc097
Copy link
Contributor

Related to #1498 , but gives support for a query_parameter_limit in Python codegen, very much desirable for my use case with FastAPI.

Initially I wanted to also include Go, but I've failed miserably since all Go code generation uses a single param and don't know about the best way to proceed that requires minimal changes

update pluginPythonCode

unexported default limit
Copy link
Collaborator

@kyleconroy kyleconroy left a comment

Choose a reason for hiding this comment

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

I updated the issue with a bit of different behavior

We can set the value to a pointer in the configuration YAML / JSON so that zero is a valid option. Anything less than zero should be an error.

@kyleconroy
Copy link
Collaborator

@danicc097 Sorry for taking forever on this code review. I can promise a quick review if you're able to fix the merge conflicts. If not, I totally understand.

@danicc097
Copy link
Contributor Author

@kyleconroy I noticed Python currently has a default limit of 4, the change to 1 would be breaking. Want to keep it anyway for consistency?

@kyleconroy
Copy link
Collaborator

We should keep the default the same, even if it isn't the same as Go's

@kyleconroy kyleconroy merged commit 1e40dc8 into sqlc-dev:main Aug 29, 2022
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