From 004b9f8e799d9f5913cd8f5d7292ba6d8f11b505 Mon Sep 17 00:00:00 2001 From: David Santamaria Date: Sat, 30 May 2026 18:18:18 +0200 Subject: [PATCH] fix: pass query args in list FindAll (trending/newest/all 500'd) go-sqlbuilder 1.41 parameterizes LIMIT as a placeholder (1.7 inlined it), so FindAll's 'sql, _ := sb.Build(); Query(sql)' sent a literal '?' to MySQL -> Error 1064, 500ing every /lists/ endpoint. Capture and pass args like Get does. Verified against MySQL 8 locally: trending/newest/all return data (or 404 when empty) instead of 500. Co-Authored-By: Claude Opus 4.8 (1M context) --- internal/list/repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/list/repository.go b/internal/list/repository.go index 586f6d5..1c6e5cd 100755 --- a/internal/list/repository.go +++ b/internal/list/repository.go @@ -41,8 +41,8 @@ func (repo *Repository) FindAll(filter string) []Aggregate { sb.OrderBy("list.created_at").Desc() } sb.Limit(5) - sql, _ := sb.Build() - rows, err := repo.db.DB.Query(sql) + sql, args := sb.Build() + rows, err := repo.db.DB.Query(sql, args...) if err != nil { panic(err.Error()) }