metadata driven sql selects