Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #1965 #2177

Merged
merged 1 commit into from
Oct 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion database/gdb/gdb_driver_wrapper_db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, " ") {
Expand Down
5 changes: 0 additions & 5 deletions database/gdb/gdb_model_utility.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down