Custom database queries support