Introduced a valueOf for SQL values and a generic constraint function for building selects