Open joaquinicolas opened 7 years ago
Yes, it has support for SQL Server Always On Availability Groups. Just set up the connection with the DNS name of the cluster (which is mapped to multiple IP addresses) and it should work fine.
or setup a failover partner by adding failoverpartner
, failoverport
to the query:
query := url.Values{}
query.Add("failoverpartner", conf.FailOverHostname)
query.Add("failoverport", fmt.Sprintf("%d", conf.FailOverPort))
u := &url.URL{
Scheme: "sqlserver",
User: url.UserPassword(conf.Username, conf.Password),
Host: fmt.Sprintf("%s:%d", conf.Hostname, conf.Port),
RawQuery: query.Encode(),
}
db, err := sqlx.Open("sqlserver", u.String())
if err != nil {
panic(err)
}
Hi, the driver has support to failover? Thanks!