Rename `type_cast` to `type_cast_from_database`

In some cases there is a difference between the two, we should always
be doing one or the other. For convenience, `type_cast` is still a
private method on type, so new types that do not need different behavior
don't need to implement two methods, but it has been moved to private so
it cannot be used accidentally.
Merge pull request #15592 from sgrif/sg-type-cast-from-database

Rename `type_cast` to `type_cast_from_database`