add switch of brief stack for package gerror (#2153)

This commit is contained in:
John Guo
2022-09-27 10:11:33 +08:00
committed by GitHub
parent 141ca62c6d
commit 66aa0c7050
9 changed files with 42 additions and 18 deletions

View File

@ -33,11 +33,8 @@ func (m *Model) QuoteWord(s string) string {
func (m *Model) TableFields(tableStr string, schema ...string) (fields map[string]*TableField, err error) {
var (
table = m.db.GetCore().guessPrimaryTableName(tableStr)
usedSchema = m.schema
usedSchema = gutil.GetOrDefaultStr(m.schema, schema...)
)
if len(schema) > 0 && schema[0] != "" {
usedSchema = schema[0]
}
return m.db.TableFields(m.GetCtx(), table, usedSchema)
}