rename to isOracle() so it is not public
This commit is contained in:
parent
c01a2da8e9
commit
f2959c880e
@ -146,7 +146,7 @@ func createCallback(scope *Scope) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if scope.IsOracle() {
|
if scope.isOracle() {
|
||||||
var stringId string
|
var stringId string
|
||||||
var intId uint32
|
var intId uint32
|
||||||
primaryIsString := false
|
primaryIsString := false
|
||||||
|
10
scope.go
10
scope.go
@ -511,7 +511,7 @@ func (scope *Scope) scan(rows *sql.Rows, columns []string, fields []*Field) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for fieldIndex, field := range selectFields {
|
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 {
|
if field.Field.Kind() == reflect.Ptr {
|
||||||
values[index] = field.Field.Addr().Interface()
|
values[index] = field.Field.Addr().Interface()
|
||||||
} else {
|
} else {
|
||||||
@ -1035,14 +1035,14 @@ func (scope *Scope) count(value interface{}) *Scope {
|
|||||||
scope.prepareQuerySQL()
|
scope.prepareQuerySQL()
|
||||||
scope.Search = &search{}
|
scope.Search = &search{}
|
||||||
scope.Search.Select("count(*)")
|
scope.Search.Select("count(*)")
|
||||||
if scope.IsOracle() {
|
if scope.isOracle() {
|
||||||
scope.Search.Table(fmt.Sprintf("( %s )", scope.SQL))
|
scope.Search.Table(fmt.Sprintf("( %s )", scope.SQL))
|
||||||
} else {
|
} else {
|
||||||
scope.Search.Table(fmt.Sprintf("( %s ) AS count_table", scope.SQL))
|
scope.Search.Table(fmt.Sprintf("( %s ) AS count_table", scope.SQL))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scope.Search.Select("count(*) FROM ( SELECT count(*) as name ")
|
scope.Search.Select("count(*) FROM ( SELECT count(*) as name ")
|
||||||
if scope.IsOracle() {
|
if scope.isOracle() {
|
||||||
scope.Search.group += " )"
|
scope.Search.group += " )"
|
||||||
} else {
|
} else {
|
||||||
scope.Search.group += " ) AS count_table"
|
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) {
|
if scope.Dialect().HasForeignKey(scope.TableName(), keyName) {
|
||||||
return
|
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()
|
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
|
return
|
||||||
}
|
}
|
||||||
@ -1450,6 +1450,6 @@ func (scope *Scope) hasConditions() bool {
|
|||||||
len(scope.Search.notConditions) > 0
|
len(scope.Search.notConditions) > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (scope *Scope) IsOracle() bool {
|
func (scope *Scope) isOracle() bool {
|
||||||
return scope.Dialect().GetName() == "oci8"
|
return scope.Dialect().GetName() == "oci8"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user