mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
@ -47,7 +47,12 @@ func (d *DriverWrapperDB) Tables(ctx context.Context, schema ...string) (tables
|
||||
//
|
||||
// It's using cache feature to enhance the performance, which is never expired util the
|
||||
// process restarts.
|
||||
func (d *DriverWrapperDB) TableFields(ctx context.Context, table string, schema ...string) (fields map[string]*TableField, err error) {
|
||||
func (d *DriverWrapperDB) TableFields(
|
||||
ctx context.Context, table string, schema ...string,
|
||||
) (fields map[string]*TableField, err error) {
|
||||
if table == "" {
|
||||
return nil, nil
|
||||
}
|
||||
charL, charR := d.GetChars()
|
||||
table = gstr.Trim(table, charL+charR)
|
||||
if gstr.Contains(table, " ") {
|
||||
|
||||
@ -35,11 +35,6 @@ func (m *Model) TableFields(tableStr string, schema ...string) (fields map[strin
|
||||
table = m.db.GetCore().guessPrimaryTableName(tableStr)
|
||||
usedSchema = gutil.GetOrDefaultStr(m.schema, schema...)
|
||||
)
|
||||
|
||||
if table == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return m.db.TableFields(m.GetCtx(), table, usedSchema)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user