export tag identifier
This commit is contained in:
parent
ffac8e3577
commit
7bd37d81f0
|
@ -209,6 +209,11 @@ func (engine *Engine) SetColumnMapper(mapper names.Mapper) {
|
|||
engine.tagParser.SetColumnMapper(mapper)
|
||||
}
|
||||
|
||||
// SetTagIdentifier set the tag identifier
|
||||
func (engine *Engine) SetTagIdentifier(tagIdentifier string) {
|
||||
engine.tagParser.SetIdentifier(tagIdentifier)
|
||||
}
|
||||
|
||||
// Quote Use QuoteStr quote the string sql
|
||||
func (engine *Engine) Quote(value string) string {
|
||||
value = strings.TrimSpace(value)
|
||||
|
|
|
@ -167,6 +167,14 @@ func (eg *EngineGroup) SetMapper(mapper names.Mapper) {
|
|||
}
|
||||
}
|
||||
|
||||
// SetTagIdentifier set the tag identifier
|
||||
func (eg *EngineGroup) SetTagIdentifier(tagIdentifier string) {
|
||||
eg.Engine.SetTagIdentifier(tagIdentifier)
|
||||
for i := 0; i < len(eg.slaves); i++ {
|
||||
eg.slaves[i].SetTagIdentifier(tagIdentifier)
|
||||
}
|
||||
}
|
||||
|
||||
// SetMaxIdleConns set the max idle connections on pool, default is 2
|
||||
func (eg *EngineGroup) SetMaxIdleConns(conns int) {
|
||||
eg.Engine.DB().SetMaxIdleConns(conns)
|
||||
|
|
|
@ -101,6 +101,7 @@ type EngineInterface interface {
|
|||
SetCacher(string, caches.Cacher)
|
||||
SetConnMaxLifetime(time.Duration)
|
||||
SetColumnMapper(names.Mapper)
|
||||
SetTagIdentifier(string)
|
||||
SetDefaultCacher(caches.Cacher)
|
||||
SetLogger(logger interface{})
|
||||
SetLogLevel(log.LogLevel)
|
||||
|
|
|
@ -63,6 +63,11 @@ func (parser *Parser) SetColumnMapper(mapper names.Mapper) {
|
|||
parser.columnMapper = mapper
|
||||
}
|
||||
|
||||
func (parser *Parser) SetIdentifier(identifier string) {
|
||||
parser.ClearCaches()
|
||||
parser.identifier = identifier
|
||||
}
|
||||
|
||||
func (parser *Parser) ParseWithCache(v reflect.Value) (*schemas.Table, error) {
|
||||
t := v.Type()
|
||||
tableI, ok := parser.tableCache.Load(t)
|
||||
|
|
Loading…
Reference in New Issue