ModelField
public struct ModelField
Warning
Although this haspublic
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.
-
Declaration
Swift
public let name: ModelFieldName
-
Declaration
Swift
public let type: ModelFieldType
-
Declaration
Swift
public let isRequired: Bool
-
Declaration
Swift
public let isReadOnly: Bool
-
Declaration
Swift
public let isArray: Bool
-
Declaration
Swift
public let attributes: [ModelFieldAttribute]
-
Declaration
Swift
public let association: ModelAssociation?
-
Declaration
Swift
public let authRules: AuthRules
-
Declaration
Swift
public var isPrimaryKey: Bool { get }
-
Declaration
Swift
public init( name: String, type: ModelFieldType, isRequired: Bool = false, isReadOnly: Bool = false, isArray: Bool = false, attributes: [ModelFieldAttribute] = [], association: ModelAssociation? = nil, authRules: AuthRules = [] )
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var hasAssociation: Bool { get }
-
If the field represents an association returns the
Model.Type
.Seealso
ModelFieldType
Seealso
ModelFieldAssociation
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
@available(*, deprecated, message: "Use of associated model type is deprecated, use `associatedModelName` instead.") var associatedModel: Model.Type? { get }
-
If the field represents an association returns the
ModelName
.Seealso
ModelFieldType
Seealso
ModelFieldAssociation
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var associatedModelName: ModelName? { get }
-
This calls
associatedModelName
but enforces that the field must represent an association. In case the field type is not aModel
it callspreconditionFailure
. Consumers should fix their models in order to recover from it, since associations are only possible between twoModel
.Note
as a maintainer, make sure you use this computed property only when context allows (i.e. the field is a valid relationship, such as foreign keys).Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
@available(*, deprecated, message: "Use of requiredAssociatedModel with Model.Type is deprecated, use `requiredAssociatedModelName`\nthat return ModelName instead.") var requiredAssociatedModel: Model.Type { get }
-
This calls
associatedModelName
but enforces that the field must represent an association. In case the field type is not aModel
it callspreconditionFailure
. Consumers should fix their models in order to recover from it, since associations are only possible between twoModel
.Note
as a maintainer, make sure you use this computed property only when context allows (i.e. the field is a valid relationship, such as foreign keys).Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var requiredAssociatedModelName: ModelName { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var isAssociationOwner: Bool { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var _isBelongsToOrHasOne: Bool { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var associatedField: ModelField? { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var associatedFieldNames: [String] { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var isOneToOne: Bool { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var isOneToMany: Bool { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var isManyToOne: Bool { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
@available(*, deprecated, message: "Use `embeddedType` is deprecated, use `embeddedTypeSchema` instead.") var embeddedType: Embeddable.Type? { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var embeddedTypeSchema: ModelSchema? { get }
-
Warning
Although this haspublic
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. Though it is not used by host application making any change to thesepublic
types should be backward compatible, otherwise it will be a breaking change.Declaration
Swift
var isEmbeddedType: Bool { get }