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
tableName
table name
columns
columns
custom
custom column specification
Return Value
new user columns
-
Initialize
Declaration
Objective-C
- (instancetype)initWithUserColumns:(GPKGUserColumns *)userColumns;
Swift
init!(userColumns: GPKGUserColumns!)
Parameters
userColumns
user 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
index
index
previousIndex
previous index
column
column
-
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
expected
expected data type
column
column
-
Check for missing columns
Declaration
Objective-C
- (void)missingCheckWithIndex:(NSNumber *)index andColumn:(NSString *)column;
Swift
func missingCheck(withIndex index: NSNumber!, andColumn column: String!)
Parameters
index
index
column
column
-
Get the column index of the column name
Declaration
Objective-C
- (int)columnIndexWithColumnName:(NSString *)columnName;
Swift
func columnIndex(withColumnName columnName: String!) -> Int32
Parameters
columnName
column 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
columnName
column name
required
column 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
index
index
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
index
index
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
columnName
column name
Return Value
column
-
Check if the table has the column
Declaration
Objective-C
- (BOOL)hasColumnWithColumnName:(NSString *)columnName;
Swift
func hasColumn(withColumnName columnName: String!) -> Bool
Parameters
columnName
column name
Return Value
true if has the column
-
Get the column count
Declaration
Objective-C
- (int)columnCount;
Swift
func columnCount() -> Int32
Return Value
column count
-
Check if the row has an id column
Declaration
Objective-C
- (BOOL)hasIdColumn;
Swift
func hasIdColumn() -> Bool
Return Value
true if has an id column
-
Get the id column index
Declaration
Objective-C
- (int)idIndex;
Swift
func idIndex() -> Int32
Return 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() -> Bool
Return Value
true if has a primary key
-
Get the primary key column index
Declaration
Objective-C
- (int)pkIndex;
Swift
func pkIndex() -> Int32
Return 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
type
data type
Return Value
columns
-
Add a new column
Declaration
Objective-C
- (void)addColumn:(GPKGUserColumn *)column;
Swift
func addColumn(_ column: GPKGUserColumn!)
Parameters
column
new column
-
Rename a column
Declaration
Objective-C
- (void)renameColumn:(GPKGUserColumn *)column toColumn:(NSString *)newColumnName;
Swift
func renameColumn(_ column: GPKGUserColumn!, toColumn newColumnName: String!)
Parameters
column
column
newColumnName
new 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
columnName
column name
newColumnName
new 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
index
column index
newColumnName
new column name
-
Drop a column
Declaration
Objective-C
- (void)dropColumn:(GPKGUserColumn *)column;
Swift
func dropColumn(_ column: GPKGUserColumn!)
Parameters
column
column to drop
-
Drop a column
Declaration
Objective-C
- (void)dropColumnWithName:(NSString *)columnName;
Swift
func dropColumn(withName columnName: String!)
Parameters
columnName
column name
-
Drop a column
Declaration
Objective-C
- (void)dropColumnWithIndex:(int)index;
Swift
func dropColumn(with index: Int32)
Parameters
index
column index
-
Alter a column
Declaration
Objective-C
- (void)alterColumn:(GPKGUserColumn *)column;
Swift
func alterColumn(_ column: GPKGUserColumn!)
Parameters
column
altered column
-
Check if any columns have an in-memory data columns schema
Declaration
Objective-C
- (BOOL)hasSchema;
Swift
func hasSchema() -> Bool
Return Value
true if has a column schema