I'm trying to connect my Golang app to MSSQL 2014.
I have been successful using - https://github.com/denisenkom/go-mssqldb For this, I only had enable a static port on my MSSQL & things were good, I was able to get data.
But what I want to achieve is to connect to MSSQL without needing to open up a static port on MSSQL, as my PHP app already does this using PDO.
I also tried using - https://github.com/minus5/gofreetds but was unable to install FreeTDS on Windows. But even in that I was seeing somewhere to setup a port for MSSQL, so I stopped.
Another golang pkg that I came across was - https://github.com/alexbrainman/odbc But due to lack of doc, I'm still stuck. Unit tests for this pkg fail, saying the user login failed. But the login creds are working fine.
Has anyone been successful in achieving this.
For a database port # always be there. Either default or user-defined. MSSQL default port # are 1433 for TCP/IP and 1434 for USD connection. denisenkom/go-msmsqldb
driver already using default port # if you don't provide one.
denisenkom/go-msmsqldb
driver supports three ways (ADO, ODBC, URL) of connection string format. Choose yours as documented here https://github.com/denisenkom/go-mssqldb#connection-parameters-and-dsn