This commit is contained in:
John Guo
2022-10-08 21:42:30 +08:00
committed by GitHub
parent d7ae5624c8
commit 7cb5fbe684
2 changed files with 6 additions and 6 deletions

View File

@ -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, " ") {

View File

@ -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)
}