Skip to content

Commit 3196188

Browse files
committed
Merge branch 'fix-empty-filter' of https://github.com/a-shpak/querysql into a-shpak-fix-empty-filter
2 parents c0a41e3 + ec49cb3 commit 3196188

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sql.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ func GetSQL(data Filter, config *SQLConfig, dbArr ...DBDriver) (string, []interf
6363
}
6464

6565
if data.Kids == nil {
66+
if data.Field == "" {
67+
return "", make([]interface{}, 0), nil
68+
}
69+
6670
if !checkWhitelist(data.Field, config) {
6771
return "", nil, fmt.Errorf("field name is not in whitelist: %s", data.Field)
6872
}

0 commit comments

Comments
 (0)