class Card::Query::SqlStatement

At present, SqlStatement contains (imho) too much knowledge about card constructs. For example, all the permission and trash handling is here.

In principle, the Query class should “interpret” statements into a few objects and a clean Query hierarchy. The SqlStatement class should be able to traverse that hierarchy and do little more than run “to_sql” on its parts, and in so doing construct a valid SQL statement.

convert @query sort rep into order by statement order information is stored in @mods, @mods, and @mods