-
Couldn't load subscription status.
- Fork 26
Labels
Description
Is your feature request related to a problem? Please describe.
Today mssql-python passes the connection string to the underlying implementation i.e. the ODBC driver for SQL server.
While doing so, the driver exposes the problems with connection string with ODBC.
- Permissive connection string handling. Unsupported / bad keywords like
Thisdoesntexist=FooBar, is accepted and ignored. The problem is that using a connection string parameter which is not supported by ODBC and not seeing it being effective is hard to debug. - First instance wins: For long complex connection strings, if the keys are repeated then the first occurrence of the key and its value are honored. e.g.
uid=test1;TrustServerCertificate=yes;uid=test2, thenuid=test1is honored. - Special keywords like
Driver/Appare a no-op withmssql-python.Appis always overridden.
Describe the solution you'd like
- Error out on duplicate keys.
- Error out if the keys are not supported.
- Disallow setting of reserved connection string keywords like
Driver/Appif they are going to be overridden. - Allow ODBC style escaping using
{}. - Don't error out on the first violation, e.g. if a connection string has repeated keys and unsupported keys, then don't error out with a duplicate key error, fixing which would lead to unsupported keys error. If possible, provide a list of all the errors in one go.
- The parameters which haven't been tested with the python experience, should not be allowed and allow-listed when mssql-python is ready to surface the experience.
The proposal is generally to move to a more usable handling of connection string and overall mssql-python drivers' experience.