GPKGTableInfo

Objective-C

@interface GPKGTableInfo : NSObject

Swift

class GPKGTableInfo : NSObject

Table Info queries (table_info)

  • Get the table name

    Declaration

    Objective-C

    - (NSString *)tableName;

    Swift

    func tableName() -> String!

    Return Value

    table name

  • Number of columns

    Declaration

    Objective-C

    - (int)numColumns;

    Swift

    func numColumns() -> Int32

    Return Value

    column count

  • Get the columns

    Declaration

    Objective-C

    - (NSArray<GPKGTableColumn *> *)columns;

    Swift

    func columns() -> [GPKGTableColumn]!

    Return Value

    columns

  • Get the column at the index

    Declaration

    Objective-C

    - (GPKGTableColumn *)columnAtIndex:(int)index;

    Swift

    func column(at index: Int32) -> GPKGTableColumn!

    Parameters

    index

    column index

    Return Value

    column

  • Check if the table has the column

    Declaration

    Objective-C

    - (BOOL)hasColumn:(NSString *)name;

    Swift

    func hasColumn(_ name: String!) -> Bool

    Parameters

    name

    column name

    Return Value

    true if has column

  • Get the column with the name

    Declaration

    Objective-C

    - (GPKGTableColumn *)column:(NSString *)name;

    Swift

    func column(_ name: String!) -> GPKGTableColumn!

    Parameters

    name

    column name

    Return Value

    column or null if does not exist

  • Check if the table has one or more primary keys

    Declaration

    Objective-C

    - (BOOL)hasPrimaryKey;

    Swift

    func hasPrimaryKey() -> Bool

    Return Value

    true if has at least one primary key

  • Get the primary key columns

    Declaration

    Objective-C

    - (NSArray<GPKGTableColumn *> *)primaryKeys;

    Swift

    func primaryKeys() -> [GPKGTableColumn]!

    Return Value

    primary key columns

  • Get the single or first primary key if one exists

    Declaration

    Objective-C

    - (GPKGTableColumn *)primaryKey;

    Swift

    func primaryKey() -> GPKGTableColumn!

    Return Value

    single or first primary key, null if no primary key

  • Query for the table_info of the table name

    Declaration

    Objective-C

    + (GPKGTableInfo *)infoWithConnection:(GPKGConnection *)db
                                 andTable:(NSString *)tableName;

    Swift

    /*not inherited*/ init!(connection db: GPKGConnection!, andTable tableName: String!)

    Parameters

    db

    connection

    tableName

    table name

    Return Value

    table info or null if no table

  • Get the data type from the type value

    Declaration

    Objective-C

    + (enum GPKGDataType)dataType:(NSString *)type;

    Swift

    class func dataType(_ type: String!) -> GPKGDataType

    Parameters

    type

    type value

    Return Value

    data type or null

  • Get the default object value for the string default value and type

    Declaration

    Objective-C

    + (NSObject *)defaultValue:(NSString *)defaultValue withType:(NSString *)type;

    Swift

    class func defaultValue(_ defaultValue: String!, withType type: String!) -> NSObject!

    Parameters

    defaultValue

    default value

    type

    type

    Return Value

    default value

  • Get the default object value for the string default value with the data type

    Declaration

    Objective-C

    + (NSObject *)defaultValue:(NSString *)defaultValue
                  withDataType:(enum GPKGDataType)type;

    Swift

    class func defaultValue(_ defaultValue: String!, with type: GPKGDataType) -> NSObject!

    Parameters

    defaultValue

    default value

    type

    data type

    Return Value

    default value