better WITH handling in QueryBuilder
added promises in QueryBuilder