Refactor SqlQuery case class as trait with companion object, so that it ...

...will be possible better check its creation
Move it up (before edge cases section)