FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
85 stars 47 forks source link

Detect which SQL Server Driver is installed #171

Closed junpataleta closed 6 years ago

junpataleta commented 6 years ago

The driver for the sqlsrv connection string is currently hardcoded to 'ODBC Driver 13 for SQL Server'. This might not always be the case (e.g. updated mssql-tools in Ubuntu 16.04 now use 'ODBC Driver 17 for SQL Server'). So it's more proper to detect whether the installed ODBC driver and use the installed driver's name. If it's not installed, throw an exception and point devs to the docs URL to help them get started if they're not familiar about setting up ODBC drivers for SQL Server.