Group some functions needed in tests in a Trait and make the having clause in the QueryCompiler apply the full table name
Merge branch '3.0' into 3.0-connection-prefix