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
index
index
name
column name
dataType
data type
max
max size
notNull
true if not null
defaultValue
default value
primaryKey
ture 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
index
index
name
column name
type
string type
dataType
data type
max
max size
notNull
true if not null
defaultValue
default value
primaryKey
ture if primary key
Return Value
new user column
-
Initialize
Declaration
Objective-C
- (instancetype)initWithTableColumn:(GPKGTableColumn *)tableColumn;
Swift
init!(tableColumn: GPKGTableColumn!)
Parameters
tableColumn
table 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
dataType
data type
name
column name
Return Value
type name
-
Check if the column has a valid index
Declaration
Objective-C
- (BOOL)hasIndex;
Swift
func hasIndex() -> Bool
Return 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!) -> Bool
Parameters
name
column 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() -> Bool
Return Value
true if has max value
-
Determine if the column has a default value
Declaration
Objective-C
- (BOOL)hasDefaultValue;
Swift
func hasDefaultValue() -> Bool
Return Value
true if has default value
-
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
-
Clear the constraints
Declaration
Objective-C
- (NSArray<GPKGConstraint *> *)clearConstraintsWithReset:(BOOL)reset;
Swift
func clearConstraints(withReset reset: Bool) -> [GPKGConstraint]!
Parameters
reset
true 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
type
constraint 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
constraint
constraint
-
Set the constraint order by constraint type
Declaration
Objective-C
- (void)setConstraintOrder:(GPKGConstraint *)constraint;
Swift
func setConstraintOrder(_ constraint: GPKGConstraint!)
Parameters
constraint
constraint
-
Add a constraint
Declaration
Objective-C
- (void)addConstraintSql:(NSString *)constraint;
Swift
func addConstraintSql(_ constraint: String!)
Parameters
constraint
constraint
-
Add a constraint
Declaration
Objective-C
- (void)addConstraintType:(enum GPKGConstraintType)type withSql:(NSString *)constraint;
Swift
func add(_ type: GPKGConstraintType, withSql constraint: String!)
Parameters
type
constraint type
constraint
constraint
-
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
type
constraint type
order
constraint order
constraint
constraint
-
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
type
constraint type
order
constraint order
constraint
constraint
-
Add constraints
Declaration
Objective-C
- (void)addConstraintsArray:(NSArray<GPKGConstraint *> *)constraints;
Swift
func add(_ constraints: [GPKGConstraint]!)
Parameters
constraints
constraints
-
Add constraints
Declaration
Objective-C
- (void)addColumnConstraints:(GPKGColumnConstraints *)constraints;
Swift
func addConstraints(_ constraints: GPKGColumnConstraints!)
Parameters
constraints
constraints
-
Add constraints
Declaration
Objective-C
- (void)addConstraints:(GPKGConstraints *)constraints;
Swift
func addConstraints(_ constraints: GPKGConstraints!)
Parameters
constraints
constraints
-
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
defaultValue
default 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
constraint
constraint
Return Value
SQL or null
-
Check if the column has an in-memory data columns schema
Declaration
Objective-C
- (BOOL)hasSchema;
Swift
func hasSchema() -> Bool
Return Value
true if has column schema