Microsoft SQL Server adapter for REL.
package main
import (
"context"
_ "github.com/microsoft/go-mssqldb"
"github.com/go-rel/mssql"
"github.com/go-rel/rel"
)
func main() {
// open mssql connection.
adapter, err := mssql.Open("sqlserver://sa:REL2021-mssql@localhost:1433?database=rel")
if err != nil {
panic(err)
}
defer adapter.Close()
// initialize REL's repo.
repo := rel.New(adapter)
repo.Ping(context.TODO())
}
- github.com/microsoft/go-mssqldb
- github.com/denisenkom/go-mssqldb
- Microsoft SQL Server 2017
- Microsoft SQL Server 2019
docker run -it --rm -p 1434:1433 -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=REL2021-mssql" -e "MSSQL_PID=Developer" mcr.microsoft.com/mssql/server:2019-latest
MSSQL_DATABASE="sqlserver://sa:REL2021-mssql@localhost:1434" go test ./...