Remove port from an mssql dsn when using named instances.
Motivation and Context
MSSQL named instances use dynamic port numbers. You can either connect directly to the port, or to the named instance.
Providing a DB URL like mssql://user:pass@host\instance/db?driver=FreeTDS will result in a DSN which looks like DRIVER=FreeTDS;SERVER=host\instance,1433;UID=user;PWD=pass; because the default port is added. This fails to connect, because the instance is not listening on port 1443.
Description
Remove port from an mssql dsn when using named instances.
Motivation and Context
MSSQL named instances use dynamic port numbers. You can either connect directly to the port, or to the named instance. Providing a DB URL like
mssql://user:pass@host\instance/db?driver=FreeTDS
will result in a DSN which looks likeDRIVER=FreeTDS;SERVER=host\instance,1433;UID=user;PWD=pass;
because the default port is added. This fails to connect, because the instance is not listening on port 1443.https://github.com/tortoise/tortoise-orm/issues/1566
How Has This Been Tested?
I have only tested locally with and without named instances.
Checklist: