lots of querybuilder fixes

and database id method removed