sqlbag icon indicating copy to clipboard operation
sqlbag copied to clipboard

SSL connect_args breaks with `S`

Open rockwotj opened this issue 5 years ago • 1 comments

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

Because connect_args is a dict

rockwotj avatar Nov 10 '20 19:11 rockwotj

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).

djrobstep avatar Nov 11 '20 03:11 djrobstep