Closed LDan1117 closed 5 months ago
I totally agree, this needs to change for mssql/odbc, the abstraction doesnt fit!
What do you think about a connection string argument that would be mutually exclusive with the db host/db user/password arguments?
Hi, this change is in the v2 milestone and will be released this week.
you can customize the connection string yourself using --mssql-connection-string
Is your feature request related to a problem? Please describe. Yes. I've been playing with this nice tool and discovered that
msodbcsql18
is barely usable with SQL Server instances running in Docker locally. The thing is that version 18 brings breaking changes by switchingEncrypt
option totrue
by default. This leads to a problem with self-signed certificates not being trusted by the driver.More information on that can be found here: https://techcommunity.microsoft.com/t5/sql-server-blog/odbc-driver-18-0-for-sql-server-released/ba-p/3169228
Describe the solution you'd like Currently, it's possible to provide
db-host
,db-user
, anddb-password
via both environment variables and CLI arguments. However, it's not possible to further customize the connection string. The proposal forpynonymizer
is to accept a connection string from its arguments. This will allow clients to customize the connection information and will improve forward compatibility of the tool with future releases of ODBC drivers.Describe alternatives you've considered It looks like it's possible to inject additional connection string arguments via
db-host
argument by escaping the hostname with;
. Though it feels like a hack rather than a proper solution and I haven't tried that. Chances are it will not work at all. https://github.com/rwnx/pynonymizer/blob/master/pynonymizer/database/mssql/__init__.py#L127Additional context I put together a Dockerfile that can be used to easily reproduce the issue - https://github.com/LDan1117/pynonymizer.docker/blob/main/Dockerfile#L10 Just replace
msodbcsql17
withmsodbcsql18
.