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:
Steven Masley
2024-08-09 10:21:26 -05:00
committed by GitHub
parent 27b8f201a4
commit 591385f2ca
9 changed files with 71 additions and 10 deletions
+6
View File
@@ -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