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

Added ability to specify QueryLoader and Query class #14

Merged

Conversation

xlevus
Copy link
Contributor

@xlevus xlevus commented Feb 3, 2020

I need the ability to customize the generation of the Queries class to add additional functionality.

This should allow me to do that.

@nackjicholson
Copy link
Owner

@xlevus Thank you so much for your contributions! This is a good non-breaking change to the API to allow you to plugin whatever extensions you need for your Queries class.

I definitely never intended for anyone to do that, but it's cool. I am curious about these additional things you're doing to your Queries class though. What are your extra needs/requirements?

@nackjicholson nackjicholson merged commit ce526c4 into nackjicholson:master Jul 8, 2020
@xlevus
Copy link
Contributor Author

xlevus commented Jul 8, 2020

The main use-case for this was to add a small bit of functionality to support table sharding.

Given you can't (easily) parameterize the table name, our Queries subclass just piped the SQL string through "".format().

@nackjicholson
Copy link
Owner

I just opened another issue #21 that links to another couple of similar sounding issues in honza/anosql. Would a feature like that be of help?

Some feature that could somehow use psycopg2.sql.Identifier underneath.

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