ADColumnSchema

open class ADColumnSchema

Holds all of the schema information about a table schema’s columns as read from a backing data store.

  • id

    The column’s unique id.

    Declaration

    Swift

    public var id = 0
  • The column’s name.

    Declaration

    Swift

    public var name = ""
  • The type of the columns sych as TEXT, BOOLEAN, DATE, etc.

    Declaration

    Swift

    public var type = ADSQLColumnType.noneType
  • true if the value of this column can be null, else false.

    Declaration

    Swift

    public var allowsNull = true
  • The default value for this column if no value is provided during an INSERT or UPDATE operation.

    Declaration

    Swift

    public var defaultValue: Any?
  • true if this column is the table’s primary key.

    Declaration

    Swift

    public var isPrimaryKey = false
  • true if the key value must be unique, else false.

    Declaration

    Swift

    public var isKeyUnique = true
  • If the column is a PRIMARY KEY of the INTEGER type, is it automatically incremented when a new row is created in the table.

    Declaration

    Swift

    public var autoIncrement: Bool = false
  • Holds the expression for a Check constraint.

    Declaration

    Swift

    public var checkExpression: ADSQLExpression?
  • Initializes a new ADColumnSchema and sets its initial properties.

    Declaration

    Swift

    public init(fromInstance dictionary: ADInstanceDictionary)

    Parameters

    dictionary

    A ADInstanceDictionary that defines the column.

  • Initializes a new ADColumnSchema and sets its initial properties.

    Declaration

    Swift

    public init(id: Int, name: String, type: ADSQLColumnType)

    Parameters

    id

    The numeric id of the column.

    name

    The name of the column.

    type

    The type of data stored in the column.

  • Initializes a new ADColumnSchema and sets its initial properties.

    Declaration

    Swift

    public init(id: Any?, name: Any?, type: Any?, allowsNull: Any? = true, isPrimaryKey: Any? = false, defaultValue: Any? = nil, isKeyUnique: Bool = true)

    Parameters

    id

    The unique id of the column.

    name

    The column name.

    allowsNull

    true if the column value can be nil, else false.

    isPrimaryKey

    true if this column is the primary key, else false.

    defaultValue

    The default value for the column.

    isKeyUnique

    true if the key value must be unique, else false.

  • Encodes the column schema into an Instance Dictionary for storage in a Swift Portable Object Notation (SPON) format. -Returns: The column schema represented as an Instance Dictionary.

    Declaration

    Swift

    public func encode() -> ADInstanceDictionary
  • Decodes the column schema from an Instance Dictionary that has been read from a Swift Portable Object Notation (SPON) stream.

    Declaration

    Swift

    public func decode(fromInstance dictionary: ADInstanceDictionary)

    Parameters

    dictionary

    A ADInstanceDictionary representing the values for the column Schema.