GPKGUserColumn
Objective-C
@interface GPKGUserColumn : NSObject <NSMutableCopying>
Swift
class GPKGUserColumn : NSObject, NSMutableCopying
Metadata about a single column from a user table
-
Column index
Declaration
Objective-C
@property (nonatomic) int index;Swift
var index: Int32 { get set } -
Column name
Declaration
Objective-C
@property (nonatomic, strong) NSString *name;Swift
var name: String! { get set } -
Max size
Declaration
Objective-C
@property (nonatomic, strong) NSNumber *max;Swift
var max: NSNumber! { get set } -
True if a not null column
Declaration
Objective-C
@property (nonatomic) BOOL notNull;Swift
var notNull: Bool { get set } -
Default column value
Declaration
Objective-C
@property (nonatomic, strong) NSObject *defaultValue;Swift
var defaultValue: NSObject! { get set } -
True if a primary key column
Declaration
Objective-C
@property (nonatomic) BOOL primaryKey;Swift
var primaryKey: Bool { get set } -
True if primary key is autoincrement
Declaration
Objective-C
@property (nonatomic) BOOL autoincrement;Swift
var autoincrement: Bool { get set } -
True if unique column
Declaration
Objective-C
@property (nonatomic) BOOL unique;Swift
var unique: Bool { get set } -
Type
Declaration
Objective-C
@property (nonatomic, strong) NSString *type;Swift
var type: String! { get set } -
Data type
Declaration
Objective-C
@property (nonatomic) enum GPKGDataType dataType;Swift
var dataType: GPKGDataType { get set } -
Column in-memory schema, not saved as part of the column, saved using GPKGDataColumnsDao
Declaration
Objective-C
@property (nonatomic, strong) GPKGDataColumns *schema;Swift
var schema: GPKGDataColumns! { get set } -
-initWithIndex:andName: andDataType: andMax: andNotNull: andDefaultValue: andPrimaryKey: andAutoincrement: Initialize
Declaration
Objective-C
- (instancetype)initWithIndex:(int)index andName:(NSString *)name andDataType:(enum GPKGDataType)dataType andMax:(NSNumber *)max andNotNull:(BOOL)notNull andDefaultValue:(NSObject *)defaultValue andPrimaryKey:(BOOL)primaryKey andAutoincrement:(BOOL)autoincrement;Swift
init!(index: Int32, andName name: String!, andDataType dataType: GPKGDataType, andMax max: NSNumber!, andNotNull notNull: Bool, andDefaultValue defaultValue: NSObject!, andPrimaryKey primaryKey: Bool, andAutoincrement autoincrement: Bool)Parameters
indexindex
namecolumn name
dataTypedata type
maxmax size
notNulltrue if not null
defaultValuedefault value
primaryKeyture if primary key
Return Value
new user column
-
-initWithIndex:andName: andType: andDataType: andMax: andNotNull: andDefaultValue: andPrimaryKey: andAutoincrement: Initialize
Declaration
Objective-C
- (instancetype)initWithIndex:(int)index andName:(NSString *)name andType:(NSString *)type andDataType:(enum GPKGDataType)dataType andMax:(NSNumber *)max andNotNull:(BOOL)notNull andDefaultValue:(NSObject *)defaultValue andPrimaryKey:(BOOL)primaryKey andAutoincrement:(BOOL)autoincrement;Swift
init!(index: Int32, andName name: String!, andType type: String!, andDataType dataType: GPKGDataType, andMax max: NSNumber!, andNotNull notNull: Bool, andDefaultValue defaultValue: NSObject!, andPrimaryKey primaryKey: Bool, andAutoincrement autoincrement: Bool)Parameters
indexindex
namecolumn name
typestring type
dataTypedata type
maxmax size
notNulltrue if not null
defaultValuedefault value
primaryKeyture if primary key
Return Value
new user column
-
Initialize
Declaration
Objective-C
- (instancetype)initWithTableColumn:(GPKGTableColumn *)tableColumn;Swift
init!(tableColumn: GPKGTableColumn!)Parameters
tableColumntable column
-
Get the type name from the data type
Declaration
Objective-C
+ (NSString *)nameOfDataType:(enum GPKGDataType)dataType forColumn:(NSString *)name;Swift
class func name(of dataType: GPKGDataType, forColumn name: String!) -> String!Parameters
dataTypedata type
namecolumn name
Return Value
type name
-
Check if the column has a valid index
Declaration
Objective-C
- (BOOL)hasIndex;Swift
func hasIndex() -> BoolReturn Value
true if has a valid index
-
Reset the column index
Declaration
Objective-C
- (void)resetIndex;Swift
func resetIndex() -
Determine if this column is named the provided name
Declaration
Objective-C
- (BOOL)isNamed:(NSString *)name;Swift
func isNamed(_ name: String!) -> BoolParameters
namecolumn name
Return Value
true if named the provided name
-
Determine if the column has a max value
Declaration
Objective-C
- (BOOL)hasMax;Swift
func hasMax() -> BoolReturn Value
true if has max value
-
Determine if the column has a default value
Declaration
Objective-C
- (BOOL)hasDefaultValue;Swift
func hasDefaultValue() -> BoolReturn Value
true if has default value
-
Check if has constraints
Declaration
Objective-C
- (BOOL)hasConstraints;Swift
func hasConstraints() -> BoolReturn 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) -> BoolParameters
typeconstraint 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
typeconstraint type
Return Value
constraints
-
Clear the constraints
Declaration
Objective-C
- (NSArray<GPKGConstraint *> *)clearConstraints;Swift
func clearConstraints() -> [GPKGConstraint]!Return Value
cleared constraints
-
Clear the constraints
Declaration
Objective-C
- (NSArray<GPKGConstraint *> *)clearConstraintsWithReset:(BOOL)reset;Swift
func clearConstraints(withReset reset: Bool) -> [GPKGConstraint]!Parameters
resettrue to reset constraint settings
Return Value
cleared constraints
-
Clear the constraints of the provided type
Declaration
Objective-C
- (NSArray<GPKGConstraint *> *)clearConstraintsOfType: (enum GPKGConstraintType)type;Swift
func clearConstraints(of type: GPKGConstraintType) -> [GPKGConstraint]!Parameters
typeconstraint type
Return Value
cleared constraints
-
Add the default constraints that are enabled (not null, default value, primary key) from the column properties
Declaration
Objective-C
- (void)addDefaultConstraints;Swift
func addDefaultConstraints() -
Add a constraint
Declaration
Objective-C
- (void)addConstraint:(GPKGConstraint *)constraint;Swift
func addConstraint(_ constraint: GPKGConstraint!)Parameters
constraintconstraint
-
Set the constraint order by constraint type
Declaration
Objective-C
- (void)setConstraintOrder:(GPKGConstraint *)constraint;Swift
func setConstraintOrder(_ constraint: GPKGConstraint!)Parameters
constraintconstraint
-
Add a constraint
Declaration
Objective-C
- (void)addConstraintSql:(NSString *)constraint;Swift
func addConstraintSql(_ constraint: String!)Parameters
constraintconstraint
-
Add a constraint
Declaration
Objective-C
- (void)addConstraintType:(enum GPKGConstraintType)type withSql:(NSString *)constraint;Swift
func add(_ type: GPKGConstraintType, withSql constraint: String!)Parameters
typeconstraint type
constraintconstraint
-
Add a constraint
Declaration
Objective-C
- (void)addConstraintType:(enum GPKGConstraintType)type withOrder:(NSNumber *)order andSql:(NSString *)constraint;Swift
func add(_ type: GPKGConstraintType, withOrder order: NSNumber!, andSql constraint: String!)Parameters
typeconstraint type
orderconstraint order
constraintconstraint
-
Add a constraint
Declaration
Objective-C
- (void)addConstraintType:(enum GPKGConstraintType)type withOrderInt:(int)order andSql:(NSString *)constraint;Swift
func add(_ type: GPKGConstraintType, withOrder order: Int32, andSql constraint: String!)Parameters
typeconstraint type
orderconstraint order
constraintconstraint
-
Add constraints
Declaration
Objective-C
- (void)addConstraintsArray:(NSArray<GPKGConstraint *> *)constraints;Swift
func add(_ constraints: [GPKGConstraint]!)Parameters
constraintsconstraints
-
Add constraints
Declaration
Objective-C
- (void)addColumnConstraints:(GPKGColumnConstraints *)constraints;Swift
func addConstraints(_ constraints: GPKGColumnConstraints!)Parameters
constraintsconstraints
-
Add constraints
Declaration
Objective-C
- (void)addConstraints:(GPKGConstraints *)constraints;Swift
func addConstraints(_ constraints: GPKGConstraints!)Parameters
constraintsconstraints
-
Add a not null constraint
Declaration
Objective-C
- (void)addNotNullConstraint;Swift
func addNotNullConstraint() -
Remove a not null constraint
Declaration
Objective-C
- (void)removeNotNullConstraint;Swift
func removeNotNullConstraint() -
Add a default value constraint
Declaration
Objective-C
- (void)addDefaultValueConstraint:(NSObject *)defaultValue;Swift
func addDefaultValueConstraint(_ defaultValue: NSObject!)Parameters
defaultValuedefault value
-
Remove a default value constraint
Declaration
Objective-C
- (void)removeDefaultValueConstraint;Swift
func removeDefaultValueConstraint() -
Add a primary key constraint
Declaration
Objective-C
- (void)addPrimaryKeyConstraint;Swift
func addPrimaryKeyConstraint() -
Remove a primary key constraint
Declaration
Objective-C
- (void)removePrimaryKeyConstraint;Swift
func removePrimaryKeyConstraint() -
Add an autoincrement constraint
Declaration
Objective-C
- (void)addAutoincrementConstraint;Swift
func addAutoincrementConstraint() -
Remove an autoincrement constraint
Declaration
Objective-C
- (void)removeAutoincrementConstraint;Swift
func removeAutoincrementConstraint() -
Add a unique constraint
Declaration
Objective-C
- (void)addUniqueConstraint;Swift
func addUniqueConstraint() -
Remove a unique constraint
Declaration
Objective-C
- (void)removeUniqueConstraint;Swift
func removeUniqueConstraint() -
Build the SQL for the constraint
Declaration
Objective-C
- (NSString *)buildConstraintSql:(GPKGConstraint *)constraint;Swift
func buildConstraintSql(_ constraint: GPKGConstraint!) -> String!Parameters
constraintconstraint
Return Value
SQL or null
-
Check if the column has an in-memory data columns schema
Declaration
Objective-C
- (BOOL)hasSchema;Swift
func hasSchema() -> BoolReturn Value
true if has column schema
View on GitHub
GPKGUserColumn Class Reference