The real problems are:
1. Boilerpalte we get in the code which extract query results. This issue is not universal. Psycopg in Python produces a lot less boilerplate than, for instance, JDBC. This problem is a lot more visible in statically typed languages.
2. Boilerplate we get creating queries. Conditionally turning part of queries on and off produces a lot of code. This is mostly due to SQL syntax being more friendly to human rather than machine. Infix logical operators in conditions, commas etc., makes it hard to write code which generates SQL.
3. SQL is not good at reusing query parts. Views don't solve all problems.
The first problem is better to solve with code generation at compile time making it possible to perform all kinds of type check etc. Generating SQL is not that easy without introducing some kind of intermediate language which is more code friendly. I think some kind of templating could solve the problem so that it would look essntialy like SQL but with ability switch part of the query on and off. The hardest part is reuse which I don't know how to address. For instance, adding a join to some ACL table with conditions to exclude entities the client is not authorized to access.