GPKGUserColumns
Objective-C
@interface GPKGUserColumns : NSObject <NSMutableCopying>
Swift
class GPKGUserColumns : NSObject, NSMutableCopying
Abstract collection of columns from a user table, representing a full set of table columns or a subset from a query
-
Table name, null when a pre-ordered subset of columns for a query
Declaration
Objective-C
@property (nonatomic, strong) NSString *tableName;Swift
var tableName: String! { get set } -
Custom column specification flag (subset of table columns or different ordering)
Declaration
Objective-C
@property (nonatomic) BOOL custom;Swift
var custom: Bool { get set } -
Indicates if the primary key is modifiable
Declaration
Objective-C
@property (nonatomic) BOOL pkModifiable;Swift
var pkModifiable: Bool { get set } -
Indicates if values are validated against column types
Declaration
Objective-C
@property (nonatomic) BOOL valueValidation;Swift
var valueValidation: Bool { get set } -
Initialize
Declaration
Objective-C
- (instancetype)initWithTable:(NSString *)tableName andColumns:(NSArray *)columns andCustom:(BOOL)custom;Swift
init!(table tableName: String!, andColumns columns: [Any]!, andCustom custom: Bool)Parameters
tableNametable name
columnscolumns
customcustom column specification
Return Value
new user columns
-
Initialize
Declaration
Objective-C
- (instancetype)initWithUserColumns:(GPKGUserColumns *)userColumns;Swift
init!(userColumns: GPKGUserColumns!)Parameters
userColumnsuser columns
Return Value
new user columns
-
Update the table columns
Declaration
Objective-C
- (void)updateColumns;Swift
func updateColumns() -
Check for duplicate column names
Declaration
Objective-C
- (void)duplicateCheckWithIndex:(int)index andPreviousIndex:(NSNumber *)previousIndex andColumn:(NSString *)column;Swift
func duplicateCheck(with index: Int32, andPreviousIndex previousIndex: NSNumber!, andColumn column: String!)Parameters
indexindex
previousIndexprevious index
columncolumn
-
Check for the expected data type
Declaration
Objective-C
- (void)typeCheckWithExpected:(enum GPKGDataType)expected andColumn:(GPKGUserColumn *)column;Swift
func typeCheck(withExpected expected: GPKGDataType, andColumn column: GPKGUserColumn!)Parameters
expectedexpected data type
columncolumn
-
Check for missing columns
Declaration
Objective-C
- (void)missingCheckWithIndex:(NSNumber *)index andColumn:(NSString *)column;Swift
func missingCheck(withIndex index: NSNumber!, andColumn column: String!)Parameters
indexindex
columncolumn
-
Get the column index of the column name
Declaration
Objective-C
- (int)columnIndexWithColumnName:(NSString *)columnName;Swift
func columnIndex(withColumnName columnName: String!) -> Int32Parameters
columnNamecolumn name
Return Value
index
-
Get the column index of the column name
Declaration
Objective-C
- (NSNumber *)columnIndexWithColumnName:(NSString *)columnName andRequired:(BOOL)required;Swift
func columnIndex(withColumnName columnName: String!, andRequired required: Bool) -> NSNumber!Parameters
columnNamecolumn name
requiredcolumn existence is required
Return Value
index
-
Get the array of column names
Declaration
Objective-C
- (NSArray<NSString *> *)columnNames;Swift
func columnNames() -> [String]!Return Value
column names
-
Get the column name at the index
Declaration
Objective-C
- (NSString *)columnNameWithIndex:(int)index;Swift
func columnName(with index: Int32) -> String!Parameters
indexindex
Return Value
column name
-
Get the list of columns
Declaration
Objective-C
- (NSArray<GPKGUserColumn *> *)columns;Swift
func columns() -> [GPKGUserColumn]!Return Value
columns
-
Get the column at the index
Declaration
Objective-C
- (GPKGUserColumn *)columnWithIndex:(int)index;Swift
func column(with index: Int32) -> GPKGUserColumn!Parameters
indexindex
Return Value
column
-
Get the column of the column name
Declaration
Objective-C
- (GPKGUserColumn *)columnWithColumnName:(NSString *)columnName;Swift
func column(withColumnName columnName: String!) -> GPKGUserColumn!Parameters
columnNamecolumn name
Return Value
column
-
Check if the table has the column
Declaration
Objective-C
- (BOOL)hasColumnWithColumnName:(NSString *)columnName;Swift
func hasColumn(withColumnName columnName: String!) -> BoolParameters
columnNamecolumn name
Return Value
true if has the column
-
Get the column count
Declaration
Objective-C
- (int)columnCount;Swift
func columnCount() -> Int32Return Value
column count
-
Check if the row has an id column
Declaration
Objective-C
- (BOOL)hasIdColumn;Swift
func hasIdColumn() -> BoolReturn Value
true if has an id column
-
Get the id column index
Declaration
Objective-C
- (int)idIndex;Swift
func idIndex() -> Int32Return Value
id column index
-
Get the id column
Return Value
id column
-
Get the id column name
Declaration
Objective-C
- (NSString *)idColumnName;Swift
func idColumnName() -> String!Return Value
id column name
-
Check if the table has a primary key column
Declaration
Objective-C
- (BOOL)hasPkColumn;Swift
func hasPkColumn() -> BoolReturn Value
true if has a primary key
-
Get the primary key column index
Declaration
Objective-C
- (int)pkIndex;Swift
func pkIndex() -> Int32Return Value
primary key column index
-
Get the primary key column index
Return Value
pk index
-
Get the primary key column name
Declaration
Objective-C
- (NSString *)pkColumnName;Swift
func pkColumnName() -> String!Return Value
primary key column name
-
Get the columns with the provided data type
Declaration
Objective-C
- (NSArray *)columnsOfType:(enum GPKGDataType)type;Swift
func columns(of type: GPKGDataType) -> [Any]!Parameters
typedata type
Return Value
columns
-
Add a new column
Declaration
Objective-C
- (void)addColumn:(GPKGUserColumn *)column;Swift
func addColumn(_ column: GPKGUserColumn!)Parameters
columnnew column
-
Rename a column
Declaration
Objective-C
- (void)renameColumn:(GPKGUserColumn *)column toColumn:(NSString *)newColumnName;Swift
func renameColumn(_ column: GPKGUserColumn!, toColumn newColumnName: String!)Parameters
columncolumn
newColumnNamenew column name
-
Rename a column
Declaration
Objective-C
- (void)renameColumnWithName:(NSString *)columnName toColumn:(NSString *)newColumnName;Swift
func renameColumn(withName columnName: String!, toColumn newColumnName: String!)Parameters
columnNamecolumn name
newColumnNamenew column name
-
Rename a column
Declaration
Objective-C
- (void)renameColumnWithIndex:(int)index toColumn:(NSString *)newColumnName;Swift
func renameColumn(with index: Int32, toColumn newColumnName: String!)Parameters
indexcolumn index
newColumnNamenew column name
-
Drop a column
Declaration
Objective-C
- (void)dropColumn:(GPKGUserColumn *)column;Swift
func dropColumn(_ column: GPKGUserColumn!)Parameters
columncolumn to drop
-
Drop a column
Declaration
Objective-C
- (void)dropColumnWithName:(NSString *)columnName;Swift
func dropColumn(withName columnName: String!)Parameters
columnNamecolumn name
-
Drop a column
Declaration
Objective-C
- (void)dropColumnWithIndex:(int)index;Swift
func dropColumn(with index: Int32)Parameters
indexcolumn index
-
Alter a column
Declaration
Objective-C
- (void)alterColumn:(GPKGUserColumn *)column;Swift
func alterColumn(_ column: GPKGUserColumn!)Parameters
columnaltered column
-
Check if any columns have an in-memory data columns schema
Declaration
Objective-C
- (BOOL)hasSchema;Swift
func hasSchema() -> BoolReturn Value
true if has a column schema
View on GitHub
GPKGUserColumns Class Reference