fix(pglite): compare starred as a boolean in annotation filters

The starred filter used COALESCE(starred, 0) > 0, which PostgreSQL
rejects for a boolean column ('COALESCE types boolean and integer cannot
be matched'); the Favourites lists returned 500.
This commit is contained in:
Deluan 2026-09-05 02:04:51 -04:00
parent 01cb20817c
commit 61f7934a3b

View File

@ -95,10 +95,7 @@ func annotationBoolFilter(field string) func(string, any) Sqlizer {
if !ok {
return nil
}
if strings.ToLower(v) == "true" {
return Expr(fmt.Sprintf("COALESCE(%s, 0) > 0", field))
}
return Expr(fmt.Sprintf("COALESCE(%s, 0) = 0", field))
return Expr(fmt.Sprintf("COALESCE(%s, false) = %t", field, strings.ToLower(v) == "true"))
}
}