mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-12 12:47:29 -06:00
first implementation of search feature
This commit is contained in:
parent
cb54324430
commit
0fe853b1ee
20 changed files with 763 additions and 19 deletions
|
|
@ -223,7 +223,12 @@ func (ps *postgresService) GetWhere(where []db.Where, i interface{}) error {
|
|||
|
||||
q := ps.conn.Model(i)
|
||||
for _, w := range where {
|
||||
q = q.Where("? = ?", pg.Safe(w.Key), w.Value)
|
||||
if w.CaseInsensitive {
|
||||
q = q.Where("LOWER(?) = LOWER(?)", pg.Safe(w.Key), w.Value)
|
||||
} else {
|
||||
q = q.Where("? = ?", pg.Safe(w.Key), w.Value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if err := q.Select(); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue