Property

public struct Property<E: EntityInspectable & __EntityRelatable, V: EntityPropertyTypeConvertible, R>
where E == E.EntityBindingType.EntityType

Metadata of object properties, used by the framework to determine how to store the values.

These are created by the code generator for you.

Usually, you only deal with this class when writing queries. The property names you use in your queries are actually instances of Property, and you can use operators and comparison methods like isLessThan() on them to express your queries. Below you see a list of methods that are available to you for property queries, apart from the operators described under Query Syntax.

  • Entity type that contains the property this object is describing.

    Declaration

    Swift

    public typealias EntityType = E
  • Supported property value type this is describing.

    Declaration

    Swift

    public typealias ValueType = V
  • If this is a ToOne property, this is the type it refers to. Otherwise Void.

    Declaration

    Swift

    public typealias ReferencedType = R
  • Undocumented

    Declaration

    Swift

    public init(propertyId: UInt32, isPrimaryKey: Bool = false)
  • Indicates if the property is the entity’s primary key.

    Declaration

    Swift

    public var isPrimaryKey: Bool { get }
  • The internal ID of the property, in terms of the database schema.

    Declaration

    Swift

    public var propertyId: UInt32 { get }