Index

RBSQLiteResultSet.h

Classes


RBSQLiteResultSet

Properties

Indicates that there is returned data.
public hasResults Bool { get }

The number of rows in this set.
public rowCount Bool { get }

The number of columns in this set.
public columnCount Bool { get }

An array of NSString objects detailing column names.
public columnNames [String] { get }

An array of NSNumber objects that hold RBSQLiteFieldType values for columns.
public columnTypes [NSNumber] { get }

An array of values containing data as retreived from SQLite. This is a single flat array and is used in conjection with row and column counts to structure and retreive data in a tabulated format correctly.
public fields NSArray { get }

The scalar value for an SQL scalar query. Convenience property that returns the data from the first row and first column of the result set.
public scalarValue Any? { get }

Functions

Initializes a new RBSQLiteResultSet object populating it with an existing RBSQLiteResultSet.
@param resultSet : The RBSQLiteResultSet from which to populate.
@returns A newly initialized and populated RBSQLiteResultSet object.
- (nonnull instancetype)initWithResultSet:(nonnull RBSQLiteResultSet *)resultSet;

Initializes a new RBSQLiteResultSet object populating it with data.
@param columnNames : An array of NSString objects detailing column names.
@param columnTypes : An array of NSNumber objects holding RBSQLiteFieldType values for columns.
@param fieldValues : An array containing the data values for this result set.
@returns A newly initialized and populated RBSQLiteResultSet object.
- (nonnull instancetype)initWithColumnNames:(nonnull NSArray<NSString *> *)columnNames columnTypes:(nonnull NSArray<NSNumber *> *)columnTypes fieldValues:(nonnull NSArray *)fieldValues;

Retreives the column index for the given column name.
@param name : The column name.
@returns The column index.
- (NSUInteger)columnIndexForName:(nonnull NSString *)name;

Retrieves the column name for the given index.
@param index : The column index.
@returns The column name.
- (nonnull NSString *)columnNameAtIndex:(NSUInteger)index;

Retrives the RBSQLiteFieldType column type for the given column index.
@param index : The column index.
@returns The RBSQLiteFieldType column type.
- (RBSQLiteFieldType)columnTypeAtIndex:(NSUInteger)index;

Retrieves the value for the given column and row index.
@param index : The column index.
@param row : The row index.
@returns The value.
- (nonnull id)valueAtIndex:(NSUInteger)index forRow:(NSUInteger)row;

Retreives the value for the given column name and row index.
@param columnName : The column name.
@param row : The row index.
@returns The value.
- (nonnull id)valueForColumnName:(nonnull NSString *)columnName forRow:(NSUInteger)row;

Retreives the values for a given row index.
@param row : The row index.
@returns An array of values representing the data for that SQLite row.
- (nonnull NSArray *)valuesAtRow:(NSUInteger)row;


RBSQLiteMutableResultSet

Mutable version of RBSQLiteResultSet that can be used to setup a tabular structure (rows and columns) to which data can be added to later.

Functions

Adds a new column to the result set structure.
@param name : The column name.
@param type : The column type as an SQLITE type (SQLITEINTEGER, SQLITEFLOAT, SQLITETEXT, SQLITEBLOB, SQLITE_NULL).
@returns Returns YES if successful.
- (BOOL)addColumn:(nonnull NSString *)name SQLiteType:(int)type;

Adds a new value to the data array.
@param value : The value.
@returns Returns YES if successful.
- (BOOL)pushFieldValue:(nonnull id)value;