Run query to database query object