YapDatabaseSecondaryIndexHandler
@interface YapDatabaseSecondaryIndexHandler : NSObject
The handler block handles extracting the column values for the secondary indexes.
When you add or update rows in the databse the block is invoked. Your block can inspect the row and determine if it contains any values that should be added to the secondary indexes. If not, the block can simply return. Otherwise the block should extract any values and add them to the given dictionary.
After the block returns, the dictionary parameter will be inspected, and any set values will be automatically inserted/updated within the sqlite indexes.
You should choose a block type that takes the minimum number of required parameters. The extension can make various optimizations based on required parameters of the block. For example, if metadata isn’t required, then the extension can ignore metadata-only updates.
-
Undocumented
Declaration
Objective-C
+ (instancetype)withKeyBlock:(YapDatabaseSecondaryIndexWithKeyBlock)block;
Swift
class func withKeyBlock(_ block: @escaping YapDatabaseSecondaryIndexWithKeyBlock) -> Self
-
Undocumented
Declaration
Objective-C
+ (instancetype)withObjectBlock:(YapDatabaseSecondaryIndexWithObjectBlock)block;
Swift
class func withObjectBlock(_ block: @escaping YapDatabaseSecondaryIndexWithObjectBlock) -> Self
-
Undocumented
Declaration
Objective-C
+ (instancetype)withMetadataBlock:(YapDatabaseSecondaryIndexWithMetadataBlock)block;
Swift
class func withMetadataBlock(_ block: @escaping YapDatabaseSecondaryIndexWithMetadataBlock) -> Self
-
Undocumented
Declaration
Objective-C
+ (instancetype)withRowBlock:(YapDatabaseSecondaryIndexWithRowBlock)block;
Swift
class func withRowBlock(_ block: @escaping YapDatabaseSecondaryIndexWithRowBlock) -> Self
-
Undocumented
Declaration
Objective-C
+ (instancetype)withOptions:(YapDatabaseBlockInvoke)ops keyBlock:(YapDatabaseSecondaryIndexWithKeyBlock)block;
Swift
class func withOptions(_ ops: YapDatabaseBlockInvoke, keyBlock block: @escaping YapDatabaseSecondaryIndexWithKeyBlock) -> Self
-
Undocumented
Declaration
Objective-C
+ (instancetype)withOptions:(YapDatabaseBlockInvoke)ops objectBlock:(YapDatabaseSecondaryIndexWithObjectBlock)block;
Swift
class func withOptions(_ ops: YapDatabaseBlockInvoke, objectBlock block: @escaping YapDatabaseSecondaryIndexWithObjectBlock) -> Self
-
Undocumented
Declaration
Objective-C
+ (instancetype)withOptions:(YapDatabaseBlockInvoke)ops metadataBlock:(YapDatabaseSecondaryIndexWithMetadataBlock)block;
Swift
class func withOptions(_ ops: YapDatabaseBlockInvoke, metadataBlock block: @escaping YapDatabaseSecondaryIndexWithMetadataBlock) -> Self
-
Undocumented
Declaration
Objective-C
+ (instancetype)withOptions:(YapDatabaseBlockInvoke)ops rowBlock:(YapDatabaseSecondaryIndexWithRowBlock)block;
Swift
class func withOptions(_ ops: YapDatabaseBlockInvoke, rowBlock block: @escaping YapDatabaseSecondaryIndexWithRowBlock) -> Self
-
Undocumented
Declaration
Objective-C
@property (nonatomic, strong, readonly) YapDatabaseSecondaryIndexBlock block
Swift
var block: Any { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, assign, readonly) YapDatabaseBlockType blockType
Swift
var blockType: YapDatabaseBlockType { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, assign, readonly) YapDatabaseBlockInvoke blockInvokeOptions
Swift
var blockInvokeOptions: YapDatabaseBlockInvoke { get }