ModelAttribute

public enum ModelAttribute : Equatable

Warning

Although this has public access, it is intended for internal & codegen use and should not be used directly by host applications. The behavior of this may change without warning.
  • Represents a database index, often used for frequent query optimizations.

    Declaration

    Swift

    case index(fields: [ModelFieldName], name: String?)
  • This model is used by the Amplify system or a plugin, and should not be used by the app developer

    Declaration

    Swift

    case isSystem
  • Defines the primary key for the schema.

    Declaration

    Swift

    case primaryKey(fields: [ModelFieldName])
  • Convenience factory method to initialize a .primaryKey attribute by using the model coding keys

    Declaration

    Swift

    public static func primaryKey(fields: [CodingKey]) -> ModelAttribute