Thank you for your answer.
I just mentioned the rails part for a reference of what I am trying to accomplish, not for referencing a better system or bad handling of sql.
My main problem is not getting an sql query but getting the results from the query into my structs. Do I have to do this manually or does diesel provide some convenience functions for this?