Allow to pass callable to query