GPKGConstraintParser

Objective-C

@interface GPKGConstraintParser : NSObject

Swift

class GPKGConstraintParser : NSObject

SQL constraint parser from create table statements

  • Get the constraints for the table SQL

    Declaration

    Objective-C

    + (GPKGTableConstraints *)tableConstraintsForSQL:(NSString *)tableSql;

    Swift

    class func tableConstraints(forSQL tableSql: String!) -> GPKGTableConstraints!

    Parameters

    tableSql

    table SQL

    Return Value

    constraints

  • Attempt to get column constraints by parsing the SQL statement

    Declaration

    Objective-C

    + (GPKGColumnConstraints *)columnConstraintsForSQL:(NSString *)constraintSql;

    Swift

    class func columnConstraints(forSQL constraintSql: String!) -> GPKGColumnConstraints!

    Parameters

    constraintSql

    constraint SQL statement

    Return Value

    constraints

  • Attempt to get a table constraint by parsing the SQL statement

    Declaration

    Objective-C

    + (GPKGConstraint *)tableConstraintForSQL:(NSString *)constraintSql;

    Swift

    class func tableConstraint(forSQL constraintSql: String!) -> GPKGConstraint!

    Parameters

    constraintSql

    constraint SQL statement

    Return Value

    constraint or null

  • Check if the SQL is a table type constraint

    Declaration

    Objective-C

    + (BOOL)isTableConstraint:(NSString *)constraintSql;

    Swift

    class func isTableConstraint(_ constraintSql: String!) -> Bool

    Parameters

    constraintSql

    constraint SQL statement

    Return Value

    true if a table constraint

  • Get the table constraint type of the constraint SQL

    Declaration

    Objective-C

    + (enum GPKGConstraintType)tableTypeForSQL:(NSString *)constraintSql;

    Swift

    class func tableType(forSQL constraintSql: String!) -> GPKGConstraintType

    Parameters

    constraintSql

    constraint SQL

    Return Value

    constraint type or null

  • Determine if the table constraint SQL is the constraint type

    Declaration

    Objective-C

    + (BOOL)isTableSQL:(NSString *)constraintSql type:(enum GPKGConstraintType)type;

    Swift

    class func isTableSQL(_ constraintSql: String!, type: GPKGConstraintType) -> Bool

    Parameters

    constraintSql

    constraint SQL

    type

    constraint type

    Return Value

    true if the constraint type

  • Attempt to get a column constraint by parsing the SQL statement

    Declaration

    Objective-C

    + (GPKGConstraint *)columnConstraintForSQL:(NSString *)constraintSql;

    Swift

    class func columnConstraint(forSQL constraintSql: String!) -> GPKGConstraint!

    Parameters

    constraintSql

    constraint SQL statement

    Return Value

    constraint or null

  • Check if the SQL is a column type constraint

    Declaration

    Objective-C

    + (BOOL)isColumnConstraint:(NSString *)constraintSql;

    Swift

    class func isColumnConstraint(_ constraintSql: String!) -> Bool

    Parameters

    constraintSql

    constraint SQL statement

    Return Value

    true if a column constraint

  • Get the column constraint type of the constraint SQL

    Declaration

    Objective-C

    + (enum GPKGConstraintType)columnTypeForSQL:(NSString *)constraintSql;

    Swift

    class func columnType(forSQL constraintSql: String!) -> GPKGConstraintType

    Parameters

    constraintSql

    constraint SQL

    Return Value

    constraint type or null

  • Determine if the column constraint SQL is the constraint type

    Declaration

    Objective-C

    + (BOOL)isColumnSQL:(NSString *)constraintSql
                   type:(enum GPKGConstraintType)type;

    Swift

    class func isColumnSQL(_ constraintSql: String!, type: GPKGConstraintType) -> Bool

    Parameters

    constraintSql

    constraint SQL

    type

    constraint type

    Return Value

    true if the constraint type

  • Attempt to get a constraint by parsing the SQL statement

    Declaration

    Objective-C

    + (GPKGConstraint *)constraintForSQL:(NSString *)constraintSql;

    Swift

    class func constraint(forSQL constraintSql: String!) -> GPKGConstraint!

    Parameters

    constraintSql

    constraint SQL statement

    Return Value

    constraint or null

  • Check if the SQL is a constraint

    Declaration

    Objective-C

    + (BOOL)isConstraint:(NSString *)constraintSql;

    Swift

    class func isConstraint(_ constraintSql: String!) -> Bool

    Parameters

    constraintSql

    constraint SQL statement

    Return Value

    true if a constraint

  • Get the constraint type of the constraint SQL

    Declaration

    Objective-C

    + (enum GPKGConstraintType)typeForSQL:(NSString *)constraintSql;

    Swift

    class func type(forSQL constraintSql: String!) -> GPKGConstraintType

    Parameters

    constraintSql

    constraint SQL

    Return Value

    constraint type or null

  • Determine if the constraint SQL is the constraint type

    Declaration

    Objective-C

    + (BOOL)isSQL:(NSString *)constraintSql type:(enum GPKGConstraintType)type;

    Swift

    class func isSQL(_ constraintSql: String!, type: GPKGConstraintType) -> Bool

    Parameters

    type

    constraint type

    constraintSql

    constraint SQL

    Return Value

    true if the constraint type

  • Get the constraint name if it has one

    Declaration

    Objective-C

    + (NSString *)nameForSQL:(NSString *)constraintSql;

    Swift

    class func name(forSQL constraintSql: String!) -> String!

    Parameters

    constraintSql

    constraint SQL

    Return Value

    constraint name or null

  • Get the constraint name and remaining definition

    Declaration

    Objective-C

    + (NSArray<NSString *> *)nameAndDefinitionForSQL:(NSString *)constraintSql;

    Swift

    class func nameAndDefinition(forSQL constraintSql: String!) -> [String]!

    Parameters

    constraintSql

    constraint SQL

    Return Value

    array with name or null at index 0, definition at index 1