gorm/tests/dummy_dialecter.go

30 lines
501 B
Go
Raw Normal View History

2020-02-05 06:14:58 +03:00
package tests
import (
"github.com/jinzhu/gorm"
2020-02-22 15:57:29 +03:00
"github.com/jinzhu/gorm/schema"
2020-02-05 06:14:58 +03:00
)
type DummyDialector struct {
}
func (DummyDialector) Initialize(*gorm.DB) error {
return nil
}
2020-02-22 15:57:29 +03:00
func (DummyDialector) Migrator(*gorm.DB) gorm.Migrator {
2020-02-05 06:14:58 +03:00
return nil
}
func (DummyDialector) BindVar(stmt *gorm.Statement, v interface{}) string {
return "?"
}
func (DummyDialector) QuoteChars() [2]byte {
return [2]byte{'`', '`'} // `name`
}
2020-02-22 15:57:29 +03:00
func (DummyDialector) DataTypeOf(*schema.Field) string {
return ""
}