Skip to content

Commit

Permalink
fix: correctly manage strings for module names
Browse files Browse the repository at this point in the history
  • Loading branch information
ghivert committed Aug 1, 2024
1 parent ceb7f1b commit 7393198
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/backend/src/backend/postgres/queries.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import gleam/dict.{type Dict}
import gleam/dynamic
import gleam/hexpm
import gleam/int
import gleam/io
import gleam/json
import gleam/list
import gleam/option.{type Option, None, Some}
Expand Down Expand Up @@ -512,7 +511,7 @@ pub fn module_and_name_search(db: pgo.Connection, query: String) {
JOIN splitted_name s_n
ON true
WHERE s.name = s_n.full_name[2]
AND m.name LIKE '%' || s_n.full_name[1] || '%'
AND m.name LIKE '%' || lower(s_n.full_name[1]) || '%'
ORDER BY package_rank DESC, ordering DESC, type_name, signature_kind, module_name
LIMIT 100"
|> pgo.execute(db, [query], decode_type_search)
Expand Down Expand Up @@ -670,7 +669,7 @@ pub fn module_search(db: pgo.Connection, q: String) {
ON m.package_release_id = r.id
JOIN package p
ON p.id = r.package_id
WHERE m.name LIKE '%' || $1 || '%'
WHERE m.name LIKE '%' || lower($1) || '%'
AND r.version = (
SELECT MAX(r.version)
FROM package_release r
Expand Down

0 comments on commit 7393198

Please sign in to comment.