Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/go-rel/mssql
Microsoft SQL server adapter for REL written in Golang.
https://github.com/go-rel/mssql
database golang hacktoberfest mssql orm sqlserver sqlserver-2017 sqlserver-2019
Last synced: 21 days ago
JSON representation
Microsoft SQL server adapter for REL written in Golang.
- Host: GitHub
- URL: https://github.com/go-rel/mssql
- Owner: go-rel
- License: mit
- Created: 2021-03-06T08:50:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T07:51:39.000Z (7 months ago)
- Last Synced: 2024-04-22T12:50:37.811Z (7 months ago)
- Topics: database, golang, hacktoberfest, mssql, orm, sqlserver, sqlserver-2017, sqlserver-2019
- Language: Go
- Homepage: https://go-rel.github.io/
- Size: 140 KB
- Stars: 1
- Watchers: 3
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# mssql
[![GoDoc](https://godoc.org/github.com/go-rel/mssql?status.svg)](https://pkg.go.dev/github.com/go-rel/mssql)
[![Integration](https://github.com/go-rel/mssql/actions/workflows/integration.yml/badge.svg?branch=main)](https://github.com/go-rel/mssql/actions/workflows/integration.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-rel/mssql)](https://goreportcard.com/report/github.com/go-rel/mssql)
[![codecov](https://codecov.io/gh/go-rel/mssql/branch/main/graph/badge.svg?token=3VBLHCCG4N)](https://codecov.io/gh/go-rel/mssql)
[![Gitter chat](https://badges.gitter.im/go-rel/rel.png)](https://gitter.im/go-rel/rel)Microsoft SQL Server adapter for REL.
## Example
```go
package mainimport (
"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())
}```
## Supported Driver
- github.com/microsoft/go-mssqldb
- github.com/denisenkom/go-mssqldb## Supported Database
- Microsoft SQL Server 2017
- Microsoft SQL Server 2019## Testing
### Start Microsoft SQL server in Docker
```console
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
```### Run tests
```console
MSSQL_DATABASE="sqlserver://sa:REL2021-mssql@localhost:1434" go test ./...
```