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

Only import psycopg2 where it is used #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eestrada
Copy link

Otherwise this module fails to import in environments where a different DB connector from psycopg2 is used. My current employer won't allow the use of pscyopg2 for licensing reasons (don't blame me, look to the legal department). So something like pg8000 needs to be used.

Importing this within the relevant function is a gross solution, but it seemed less gross to me than a try/except statement at the top of the file. However, I'm happy with any solution that doesn't require me to use the psycopg2 as my DB connector in order to use this extension module.

Otherwise this module fails to import in environments where a different
DB connector from psycopg2 is used.
@mahmoudimus
Copy link
Owner

That's a fair compromise. We can totally do that or if we want to detect it, we can have a driver abstraction. Appreciate the PR.

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

2 participants