rename to isOracle() so it is not public

This commit is contained in:
Jim Lambert 2020-02-14 10:11:35 -05:00
parent c01a2da8e9
commit f2959c880e
2 changed files with 6 additions and 6 deletions

View File

@ -146,7 +146,7 @@ func createCallback(scope *Scope) {
return
}
if scope.IsOracle() {
if scope.isOracle() {
var stringId string
var intId uint32
primaryIsString := false

View File

@ -511,7 +511,7 @@ func (scope *Scope) scan(rows *sql.Rows, columns []string, fields []*Field) {
}
for fieldIndex, field := range selectFields {
if field.DBName == column || (scope.IsOracle() && strings.EqualFold(field.DBName, column)) {
if field.DBName == column || (scope.isOracle() && strings.EqualFold(field.DBName, column)) {
if field.Field.Kind() == reflect.Ptr {
values[index] = field.Field.Addr().Interface()
} else {
@ -1035,14 +1035,14 @@ func (scope *Scope) count(value interface{}) *Scope {
scope.prepareQuerySQL()
scope.Search = &search{}
scope.Search.Select("count(*)")
if scope.IsOracle() {
if scope.isOracle() {
scope.Search.Table(fmt.Sprintf("( %s )", scope.SQL))
} else {
scope.Search.Table(fmt.Sprintf("( %s ) AS count_table", scope.SQL))
}
} else {
scope.Search.Select("count(*) FROM ( SELECT count(*) as name ")
if scope.IsOracle() {
if scope.isOracle() {
scope.Search.group += " )"
} else {
scope.Search.group += " ) AS count_table"
@ -1259,7 +1259,7 @@ func (scope *Scope) addForeignKey(field string, dest string, onDelete string, on
if scope.Dialect().HasForeignKey(scope.TableName(), keyName) {
return
}
if scope.IsOracle() {
if scope.isOracle() {
scope.Raw(fmt.Sprintf(`ALTER TABLE %s ADD CONSTRAINT %s FOREIGN KEY (%s) REFERENCES %s`, scope.QuotedTableName(), scope.quoteIfPossible(keyName), scope.quoteIfPossible(field), dest)).Exec()
return
}
@ -1450,6 +1450,6 @@ func (scope *Scope) hasConditions() bool {
len(scope.Search.notConditions) > 0
}
func (scope *Scope) IsOracle() bool {
func (scope *Scope) isOracle() bool {
return scope.Dialect().GetName() == "oci8"
}