1
0

feat: allow to find users with access to a project more freely

Related to https://kolaente.dev/vikunja/frontend/issues/2196
This commit is contained in:
kolaente
2023-04-03 18:49:04 +02:00
parent 327bb3bed9
commit a7231e197e
5 changed files with 34 additions and 2 deletions

View File

@ -22,7 +22,7 @@ import (
)
// ILIKE returns an ILIKE query on postgres and a LIKE query on all other platforms.
// Postgres' is case sensitive by default.
// Postgres' is case-sensitive by default.
// To work around this, we're using ILIKE as opposed to normal LIKE statements.
// ILIKE is preferred over LOWER(text) LIKE for performance reasons.
// See https://stackoverflow.com/q/7005302/10924593
@ -31,5 +31,9 @@ func ILIKE(column, search string) builder.Cond {
return builder.Expr(column+" ILIKE ?", "%"+search+"%")
}
if Type() == schemas.SQLITE {
return builder.Expr("username = ? COLLATE NOCASE", "%"+search+"%")
}
return &builder.Like{column, "%" + search + "%"}
}