Skip to content

Commit

Permalink
fix: forgot to use $1 in SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
ghivert committed Jul 29, 2024
1 parent 73da6bc commit b3312f7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/backend/src/backend/postgres/queries.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,13 @@ pub fn module_search(db: pgo.Connection, q: String) {
ON p.id = r.package_id
WHERE m.name LIKE '%' || $1 || '%'
AND r.version = (
SELECT MAX(version)
SELECT MAX(r.version)
FROM package_release r
JOIN package_module m
ON m.package_release_id = r.id
WHERE m.name LIKE '%' || 'cake' || '%'
JOIN package_module mod
ON mod.package_release_id = r.id
WHERE mod.name = m.name
AND version SIMILAR TO '[0-9]*.[0-9]*.[0-9]*'
AND r.package_id = p.id
AND r.id = m.package_release_id
)
ORDER BY package_rank DESC, ordering DESC, type_name, signature_kind, module_name"
Expand Down

0 comments on commit b3312f7

Please sign in to comment.