Better detection of ID fields, to use = instead of LIKE
This commit is contained in:
parent
15697a6fa2
commit
8bfaa0ad9d
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ func (r sqlRestful) parseRestFilters(options rest.QueryOptions) Sqlizer {
|
|||
}
|
||||
if ff, ok := r.filterMappings[f]; ok {
|
||||
filters = append(filters, ff(f, v))
|
||||
} else if f == "id" {
|
||||
} else if strings.HasSuffix(strings.ToLower(f), "id") {
|
||||
filters = append(filters, eqFilter(f, v))
|
||||
} else {
|
||||
filters = append(filters, startsWithFilter(f, v))
|
||||
|
|
|
|||
Loading…
Reference in a new issue