GPKGUserTable
Objective-C
@interface GPKGUserTable : NSObject <NSMutableCopying>
Swift
class GPKGUserTable : NSObject, NSMutableCopying
Abstract user table
-
Foreign key to Contents
Declaration
Objective-C
@property (nonatomic, strong) GPKGContents *contents;
Swift
var contents: GPKGContents! { get set }
-
Initialize
Declaration
Objective-C
- (instancetype)initWithColumns:(GPKGUserColumns *)columns;
Swift
init!(columns: GPKGUserColumns!)
Parameters
columns
user columns
Return Value
new user table
-
Initialize
Declaration
Objective-C
- (instancetype)initWithUserTable:(GPKGUserTable *)userTable;
Swift
init!(userTable: GPKGUserTable!)
Parameters
userTable
user table
Return Value
new user table
-
Get the contents data type
Declaration
Objective-C
- (NSString *)dataType;
Swift
func dataType() -> String!
Return Value
data type
-
Get the contents data type from the contents or use the default
Declaration
Objective-C
- (NSString *)dataTypeWithDefault:(NSString *)defaultType;
Swift
func dataType(withDefault defaultType: String!) -> String!
Parameters
defaultType
default data type
Return Value
contents or default data type
-
Create user columns for a subset of table columns
Declaration
Objective-C
- (GPKGUserColumns *)createUserColumnsWithColumns: (NSArray<GPKGUserColumn *> *)columns;
Swift
func createUserColumns(with columns: [GPKGUserColumn]!) -> GPKGUserColumns!
Parameters
columns
columns
Return Value
user columns
-
Create user columns for a subset of table columns
Declaration
Objective-C
- (GPKGUserColumns *)createUserColumnsWithNames: (NSArray<NSString *> *)columnNames;
Swift
func createUserColumns(withNames columnNames: [String]!) -> GPKGUserColumns!
Parameters
columnNames
column names
Return Value
user columns
-
Get the user columns
Declaration
Objective-C
- (GPKGUserColumns *)userColumns;
Swift
func userColumns() -> GPKGUserColumns!
Return Value
user columns
-
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 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 columns
Declaration
Objective-C
- (NSArray<GPKGUserColumn *> *)columns;
Swift
func columns() -> [GPKGUserColumn]!
Return Value
columns
-
Get the columns from the column names
- - parameter: columnNames column names
Declaration
Objective-C
- (NSArray<GPKGUserColumn *> *)columnsWithNames: (NSArray<NSString *> *)columnNames;
Swift
func columns(withNames columnNames: [String]!) -> [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
-
Get the table name
Declaration
Objective-C
- (NSString *)tableName;
Swift
func tableName() -> String!
Return Value
table name
-
Set the table name
Declaration
Objective-C
- (void)setTableName:(NSString *)tableName;
Swift
func setTableName(_ tableName: String!)
Parameters
tableName
table name
-
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
Return Value
pk column
-
Get the primary key column name
Declaration
Objective-C
- (NSString *)pkColumnName;
Swift
func pkColumnName() -> String!
Return Value
primary key column name
-
Add constraint
Declaration
Objective-C
- (void)addConstraint:(GPKGConstraint *)constraint;
Swift
func addConstraint(_ constraint: GPKGConstraint!)
Parameters
constraint
constraint
-
Add constraints
Declaration
Objective-C
- (void)addConstraintArray:(NSArray<GPKGConstraint *> *)constraints;
Swift
func addConstraintArray(_ constraints: [GPKGConstraint]!)
Parameters
constraints
constraints
-
Add constraints
Declaration
Objective-C
- (void)addConstraints:(GPKGConstraints *)constraints;
Swift
func addConstraints(_ constraints: GPKGConstraints!)
Parameters
constraints
constraints
-
Check if has constraints
Declaration
Objective-C
- (BOOL)hasConstraints;
Swift
func hasConstraints() -> Bool
Return Value
true if has constraints
-
Check if has constraints of the provided type
Declaration
Objective-C
- (BOOL)hasConstraintsOfType:(enum GPKGConstraintType)type;
Swift
func hasConstraints(of type: GPKGConstraintType) -> Bool
Parameters
type
constraint type
Return Value
true if has constraints
-
Get the constraints
Declaration
Objective-C
- (GPKGConstraints *)constraints;
Swift
func constraints() -> GPKGConstraints!
Return Value
constraints
-
Get the constraints of the provided type
Declaration
Objective-C
- (NSArray<GPKGConstraint *> *)constraintsOfType:(enum GPKGConstraintType)type;
Swift
func constraints(of type: GPKGConstraintType) -> [GPKGConstraint]!
Parameters
type
constraint type
Return Value
constraints
-
Clear the constraints
Declaration
Objective-C
- (NSArray<GPKGConstraint *> *)clearConstraints;
Swift
func clearConstraints() -> [GPKGConstraint]!
Return Value
cleared constraints
-
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
-
Is the primary key modifiable
Declaration
Objective-C
- (BOOL)isPkModifiable;
Swift
func isPkModifiable() -> Bool
Return Value
true if the primary key is modifiable
-
Set if the primary key can be modified
Declaration
Objective-C
- (void)setPkModifiable:(BOOL)pkModifiable;
Swift
func setPkModifiable(_ pkModifiable: Bool)
Parameters
pkModifiable
primary key modifiable flag
-
Is value validation against column types enabled
Declaration
Objective-C
- (BOOL)isValueValidation;
Swift
func isValueValidation() -> Bool
Return Value
true if values are validated against column types
-
Set if values should validated against column types
Declaration
Objective-C
- (void)setValueValidation:(BOOL)valueValidation;
Swift
func setValueValidation(_ valueValidation: Bool)
Parameters
valueValidation
value validation flag
-
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