DatabaseUUIDEncodingStrategy
public enum DatabaseUUIDEncodingStrategy
DatabaseUUIDEncodingStrategy
specifies how EncodableRecord
types that
also adopt the standard Encodable
protocol encode their UUID
properties.
For example:
struct Player: EncodableProtocol, Encodable {
static let databaseUUIDEncodingStrategy = DatabaseUUIDEncodingStrategy.uppercaseString
// encoded in a string like "E621E1F8-C36C-495A-93FC-0C247A3E6E5F"
var uuid: UUID
}
-
The strategy that uses formatting from the UUID type.
It encodes UUIDs as 16-bytes data blobs.
Declaration
Swift
case deferredToUUID
-
Encodes UUIDs as uppercased strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”
Declaration
Swift
case uppercaseString
-
Encodes UUIDs as lowercased strings such as “e621e1f8-c36c-495a-93fc-0c247a3e6e5f”
Declaration
Swift
case lowercaseString
-
Encodes UUIDs as uppercased strings such as “E621E1F8-C36C-495A-93FC-0C247A3E6E5F”
Declaration
Swift
@available(*, deprecated, renamed: "uppercaseString") public static var string: `Self` { get }