mirror of https://github.com/go-gorm/gorm.git
Setup mssql test env
This commit is contained in:
parent
66982a7047
commit
403487d5dd
|
@ -58,8 +58,13 @@ func OpenTestConnection() (db *gorm.DB, err error) {
|
||||||
fmt.Println("testing foundation...")
|
fmt.Println("testing foundation...")
|
||||||
db, err = gorm.Open("foundation", "dbname=gorm port=15432 sslmode=disable")
|
db, err = gorm.Open("foundation", "dbname=gorm port=15432 sslmode=disable")
|
||||||
case "mssql":
|
case "mssql":
|
||||||
|
// CREATE LOGIN gorm WITH PASSWORD = 'LoremIpsum86';
|
||||||
|
// CREATE DATABASE gorm;
|
||||||
|
// USE gorm;
|
||||||
|
// CREATE USER gorm FROM LOGIN gorm;
|
||||||
|
// sp_changedbowner 'gorm';
|
||||||
fmt.Println("testing mssql...")
|
fmt.Println("testing mssql...")
|
||||||
db, err = gorm.Open("mssql", "server=SERVER_HERE;database=rogue;user id=USER_HERE;password=PW_HERE;port=1433")
|
db, err = gorm.Open("mssql", "sqlserver://gorm:LoremIpsum86@localhost:1433?database=gorm")
|
||||||
default:
|
default:
|
||||||
fmt.Println("testing sqlite3...")
|
fmt.Println("testing sqlite3...")
|
||||||
db, err = gorm.Open("sqlite3", filepath.Join(os.TempDir(), "gorm.db"))
|
db, err = gorm.Open("sqlite3", filepath.Join(os.TempDir(), "gorm.db"))
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
dialects=("postgres" "mysql" "sqlite")
|
dialects=("postgres" "mysql" "sqlite" "mssql")
|
||||||
|
|
||||||
for dialect in "${dialects[@]}" ; do
|
for dialect in "${dialects[@]}" ; do
|
||||||
GORM_DIALECT=${dialect} go test
|
GORM_DIALECT=${dialect} go test
|
||||||
|
|
Loading…
Reference in New Issue