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

SSL connect_args breaks with S #6

Open
rockwotj opened this issue Nov 10, 2020 · 1 comment
Open

SSL connect_args breaks with S #6

rockwotj opened this issue Nov 10, 2020 · 1 comment

Comments

@rockwotj
Copy link

This line breaks: https://github.com/djrobstep/sqlbag/blob/master/sqlbag/sqla.py#L160

Because connect_args is a dict

@djrobstep
Copy link
Owner

djrobstep commented Nov 11, 2020

Yes this needs fixing.

There are a couple of workarounds:

1 is to pass parameters via a connection url instead

2 is to pass in a hashable dict, this implementation for instance will suffice:

class hashabledict(dict):
    def __hash__(self):
        return hash(tuple(sorted(self.items())))

This is definitely a workaround so make sure you're aware of the consequences of overriding __hash__ (as long as you don't change the dictionary after creation, things should probably be fine tho).

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

No branches or pull requests

2 participants