Structures

The following structures are available globally.

  • Holds information about a constraint being applied to table from a CREATE TABLE SQL instruction.

    See more

    Declaration

    Swift

    public struct ADSQLTableConstraint
  • Holds information about a constraint applied to a Column Definition that has been parsed from a SQL CREATE TABLE instruction.

    See more

    Declaration

    Swift

    public struct ADSQLColumnConstraint
  • Holds information about a column definition read from a CREATE TABLE instruction when parsing a SQL statement.

    See more

    Declaration

    Swift

    public struct ADSQLColumnDefinition
  • Holds information about a value that is being written into a table’s column from a SQL UPDATE statement.

    See more

    Declaration

    Swift

    public struct ADSQLSetClause
  • Holds a result column definition for a SELECT SQL statement.

    See more

    Declaration

    Swift

    public struct ADSQLResultColumn
  • Creates and maintains a one-to-many or many-to-many cross reference relationship between two ADDataTable instances that can be stored in or read from a ADDataProvider.

    Example:

    The following creates a relationship between the Group and Person tables (both conforming to ADDataTable) on the Group.people property:

    import Foundation
    import ActionData
    
    class Group: ADDataTable {
    
        static var tableName = "Groups"
        static var primaryKey = "id"
        static var primaryKeyType: ADDataTableKeyType = .computedInt
    
        var id = ADSQLiteProvider.shared.makeID(Group.self) as! Int
        var name = ""
        var people = ADCrossReference<Person>(name: "PeopleInGroup", leftKeyName: "groupID", rightKeyName: "personID")
    
        required init() {
    
        }
    }
    

    Instance of the Person table stored in people will be cross referenced in the PeopleInGroup table where groupID is the Group instance’s id and personID is the Person instances id.

    Warning

    ADCrossReference was meant to work with a small number of relationships only, because all cross referenced items are always read into memory when the parent object is loaded. Care should be taken to keep from overflowing memory.
    See more

    Declaration

    Swift

    public struct ADCrossReference<T: ADDataTable>: ADDataCrossReference
  • Holds information about a result ordering statement from a SQL SELECT statement.

    See more

    Declaration

    Swift

    public struct ADSQLOrderByClause