db properly returns null on empty queries