Currently, to cast a field to a given type, you need to supply the string representation of the underlying SQL type. This is neither type safe nor portable. We should introduce a strongly typed representation that can be adjusted for target dialects.