mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: implement fuzzy name matching for templates (#14211)
* chore: add fuzzy name search for templates * chore: implement fuzzy name matching for templates Templates search query defaults to a fuzzy name match
This commit is contained in:
@@ -28,6 +28,12 @@ WHERE
|
||||
LOWER("name") = LOWER(@exact_name)
|
||||
ELSE true
|
||||
END
|
||||
-- Filter by name, matching on substring
|
||||
AND CASE
|
||||
WHEN @fuzzy_name :: text != '' THEN
|
||||
lower(name) ILIKE '%' || lower(@fuzzy_name) || '%'
|
||||
ELSE true
|
||||
END
|
||||
-- Filter by ids
|
||||
AND CASE
|
||||
WHEN array_length(@ids :: uuid[], 1) > 0 THEN
|
||||
|
||||
Reference in New Issue
Block a user