RawRepresentable

protocol RawRepresentable

DatabaseValueConvertible is free for RawRepresentable types whose raw value is itself DatabaseValueConvertible.

// If the RawValue adopts DatabaseValueConvertible...
enum Color : Int {
    case red
    case white
    case rose
}

// ... then the RawRepresentable type can freely adopt DatabaseValueConvertible:
extension Color : DatabaseValueConvertible { /* empty */ }