forked from mirror/gorm
fix for bad rebase
This commit is contained in:
parent
6b7d0879c5
commit
a6b243a3e9
|
@ -31,6 +31,8 @@ func NewDialect(driver string) Dialect {
|
|||
d = &mysql{}
|
||||
case "sqlite3":
|
||||
d = &sqlite3{}
|
||||
case "mssql":
|
||||
d = &mssql{}
|
||||
default:
|
||||
fmt.Printf("`%v` is not officially supported, running under compatibility mode.\n", driver)
|
||||
d = &commonDialect{}
|
||||
|
|
|
@ -38,7 +38,7 @@ func init() {
|
|||
DB, err = gorm.Open("postgres", "user=gorm DB.ame=gorm sslmode=disable")
|
||||
case "mssql":
|
||||
fmt.Println("testing mssql...")
|
||||
DB, err = gorm.Open("mssql", "server=SERVER_HERE;database=DB_HERE;user id=USER_HERE;password=PW_HERE;port=1433")
|
||||
DB, err = gorm.Open("mssql", "server=SERVER_HERE;database=rogue;user id=USER_HERE;password=PW_HERE;port=1433")
|
||||
default:
|
||||
fmt.Println("testing sqlite3...")
|
||||
DB, err = gorm.Open("sqlite3", "/tmp/gorm.db")
|
||||
|
|
1
mysql.go
1
mysql.go
|
@ -4,7 +4,6 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type mysql struct{}
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"fmt"
|
||||
"reflect"
|
||||
"github.com/lib/pq/hstore"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
type postgres struct {
|
||||
|
|
|
@ -216,8 +216,6 @@ func (s *Scope) topSql() string {
|
|||
}
|
||||
} else {
|
||||
return ""
|
||||
} else {
|
||||
return " LIMIT " + s.Search.Limit
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,11 +259,7 @@ func (scope *Scope) prepareQuerySql() {
|
|||
if scope.Search.Raw {
|
||||
scope.Raw(strings.TrimLeft(scope.CombinedConditionSql(), "WHERE "))
|
||||
} else {
|
||||
<<<<<<< HEAD
|
||||
scope.Raw(fmt.Sprintf("SELECT %v FROM %v %v", scope.selectSql(), scope.QuotedTableName(), scope.CombinedConditionSql()))
|
||||
=======
|
||||
scope.Raw(fmt.Sprintf("SELECT %v %v FROM %v %v", scope.topSql(), scope.selectSql(), scope.QuotedTableName(), scope.CombinedConditionSql()))
|
||||
>>>>>>> 15a20a4... GORM support for MSSQL, passes all tests
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue