ADSQLForeignKeyExpression

public class ADSQLForeignKeyExpression: ADSQLExpression

Defines a foreign key expression used in a SQL statement.

  • Defines the modify action to take.

    See more

    Declaration

    Swift

    public enum OnModify: String
  • Defines the action to take on the foreign key.

    See more

    Declaration

    Swift

    public enum ModifyAction: String
  • The name of the foreign key table.

    Declaration

    Swift

    public var foreignTableName: String = ""
  • A list of columns that compose the key.

    Declaration

    Swift

    public var columnNames: [String] = []
  • If true, the foreign key is modified when the parent row is modified.

    Declaration

    Swift

    public var onModify = OnModify.ignore
  • The action to take when modifying a foreign key value.

    Declaration

    Swift

    public var modifyAction = ModifyAction.noAction
  • The name of the field to match in the foreign key table.

    Declaration

    Swift

    public var matchName: String = ""
  • If true, the action is defferable, else false.

    Declaration

    Swift

    public var deferrable = false
  • If true, the action is immediate, else false.

    Declaration

    Swift

    public var initiallyImmediate = true
  • Creates a new Foreign Key Expression instance.

    Declaration

    Swift

    public init()
  • Decodes the expression from an Instance Dictionary that has been read from a Swift Portable Object Notation (SPON) stream.

    Declaration

    Swift

    public required init(fromInstance dictionary: ADInstanceDictionary)

    Parameters

    dictionary

    A ADInstanceDictionary representing the values for the expression.

  • Evaluates the given expression and returns a result based on the data in the record passed in.

    Declaration

    Swift

    @discardableResult public func evaluate(forRecord row: ADRecord? = nil) throws -> Any?

    Parameters

    row

    A ADRecord containing values to be evaluated against the expression.

    Return Value

    The result of the evaluation.

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

    Declaration

    Swift

    public func encode() -> ADInstanceDictionary
  • Decodes the expression 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 expression.