db query builder tests up
db query builder bugfixes