GPKGResultSet
Objective-C
@interface GPKGResultSet : NSObject <NSFastEnumeration>
Swift
class GPKGResultSet : NSObject, NSFastEnumeration
Result set from a database query
-
SQL statement
Declaration
Objective-C
@property (nonatomic) sqlite3_stmt *statement;Swift
var statement: OpaquePointer! { get set } -
SQL string statement
Declaration
Objective-C
@property (nonatomic, strong) NSString *sql;Swift
var sql: String! { get set } -
SQL arguments
Declaration
Objective-C
@property (nonatomic, strong) NSArray *args;Swift
var args: [Any]! { get set } -
Result count
Declaration
Objective-C
@property (nonatomic) int count;Swift
var count: Int32 { get set } -
SQL Connection
Declaration
Objective-C
@property (nonatomic, strong) GPKGDbConnection *connection;Swift
var connection: GPKGDbConnection! { get set } -
Column Names
Declaration
Objective-C
@property (nonatomic, strong) NSArray<NSString *> *columnNames;Swift
var columnNames: [String]! { get set } -
Column name to index mapping
Declaration
Objective-C
@property (nonatomic, strong) NSDictionary<NSString *, NSNumber *> *columnIndex;Swift
var columnIndex: [String : NSNumber]! { get set } -
User columns
Declaration
Objective-C
@property (nonatomic, strong) GPKGUserColumns *columns;Swift
var columns: GPKGUserColumns! { get set } -
Initialize
Declaration
Objective-C
- (instancetype)initWithStatement:(sqlite3_stmt *)statement andSql:(NSString *)sql andArgs:(NSArray *)args andCount:(int)count andConnection:(GPKGDbConnection *)connection;Swift
init!(statement: OpaquePointer!, andSql sql: String!, andArgs args: [Any]!, andCount count: Int32, andConnection connection: GPKGDbConnection!)Parameters
statementstatement
sqlSQL statement
argsSQL arguments
countresult count
connectiondb connection
Return Value
new result set
-
Initialize reusing existing result set statement and connection
Declaration
Objective-C
- (instancetype)initWithResultSet:(GPKGResultSet *)resultSet;Swift
init!(resultSet: GPKGResultSet!)Parameters
resultSetresult set
Return Value
new result set
-
Move to the next result if one exists
Declaration
Objective-C
- (BOOL)moveToNext;Swift
func moveToNext() -> BoolReturn Value
true if a result found, false if no more results
-
Move to the first result
Declaration
Objective-C
- (BOOL)moveToFirst;Swift
func moveToFirst() -> BoolReturn Value
reset code
-
Move result to index position
Declaration
Objective-C
- (BOOL)moveToPosition:(int)position;Swift
func move(toPosition position: Int32) -> BoolParameters
positionindex position
Return Value
true if result at position found
-
Close the result set
Declaration
Objective-C
- (void)close;Swift
func close() -
Close the result set statement, but leave the connection open
Declaration
Objective-C
- (void)closeStatement;Swift
func closeStatement() -
Get the column count
Declaration
Objective-C
- (int)columnCount;Swift
func columnCount() -> Int32Return Value
count
-
Get the row value
Return Value
row value
-
Get the row values
Declaration
Objective-C
- (NSArray<NSObject *> *)rowValues;Swift
func rowValues() -> [NSObject]!Return Value
row value array
-
Get a row and populate with values
Declaration
Objective-C
- (void)rowPopulateValues:(NSMutableArray *)values;Swift
func rowPopulateValues(_ values: NSMutableArray!)Parameters
valuesvalues
-
Get value with column index
Declaration
Objective-C
- (NSObject *)valueWithIndex:(int)index;Swift
func value(with index: Int32) -> NSObject!Parameters
indexcolumn index
Return Value
value
-
Get the value for the column name
Declaration
Objective-C
- (NSObject *)valueWithColumnName:(NSString *)columnName;Swift
func value(withColumnName columnName: String!) -> NSObject!Parameters
columnNamecolumn name
Return Value
value
-
Get column index for column name
Declaration
Objective-C
- (int)columnIndexWithName:(NSString *)columnName;Swift
func columnIndex(withName columnName: String!) -> Int32Parameters
columnNamecolumn name
Return Value
index
-
Get the column type of the column index
Declaration
Objective-C
- (int)type:(int)columnIndex;Swift
func type(_ columnIndex: Int32) -> Int32Parameters
columnIndexindex
Return Value
column type
-
Get the string value at the column index
Declaration
Objective-C
- (NSString *)stringWithIndex:(int)columnIndex;Swift
func string(with columnIndex: Int32) -> String!Parameters
columnIndexcolumn index
Return Value
string value
-
Get the int value at the column index
Declaration
Objective-C
- (NSNumber *)intWithIndex:(int)columnIndex;Swift
func int(with columnIndex: Int32) -> NSNumber!Parameters
columnIndexcolumn index
Return Value
int number
-
Get the blob value at the column index
Declaration
Objective-C
- (NSData *)blobWithIndex:(int)columnIndex;Swift
func blob(with columnIndex: Int32) -> Data!Parameters
columnIndexcolumn index
Return Value
blob data
-
Get the long value at the column index
Declaration
Objective-C
- (NSNumber *)longWithIndex:(int)columnIndex;Swift
func long(with columnIndex: Int32) -> NSNumber!Parameters
columnIndexcolumn index
Return Value
long number
-
Get the double value at the column index
Declaration
Objective-C
- (NSNumber *)doubleWithIndex:(int)columnIndex;Swift
func double(with columnIndex: Int32) -> NSNumber!Parameters
columnIndexcolumn index
Return Value
double number
-
Get the result count and close the result set
Declaration
Objective-C
- (int)countAndClose;Swift
func countAndClose() -> Int32Return Value
result count
-
Set the columns from the user table
Declaration
Objective-C
- (void)setColumnsFromTable:(GPKGUserTable *)table;Swift
func setColumnsFrom(_ table: GPKGUserTable!)Parameters
tableuser table
-
Get the id value
Declaration
Objective-C
- (NSNumber *)id;Swift
func id() -> NSNumber!Return Value
id value
-
Get the id value
Declaration
Objective-C
- (int)idValue;Swift
func idValue() -> Int32Return Value
id value, or -1 if none
View on GitHub
GPKGResultSet Class Reference