motion-yapper 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -1
- data/lib/yapper.rb +3 -3
- data/lib/yapper/db.rb +61 -4
- data/lib/yapper/document/persistence.rb +4 -0
- data/lib/yapper/document/selection.rb +13 -0
- data/lib/yapper/version.rb +1 -1
- data/motion-yapper.gemspec +1 -1
- data/spec/integration/search_spec.rb +111 -0
- data/vendor/Podfile.lock +11 -7
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -2
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +10 -7
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -2
- metadata +19 -297
- data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
- data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
- data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
- data/vendor/Pods/.build/libPods.a +0 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h +0 -63
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDDispatchQueueLogFormatter.h +0 -128
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +0 -369
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +0 -99
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +0 -634
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +0 -30
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +0 -181
- data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
- data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +0 -8
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +0 -91
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +0 -23
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +0 -547
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +0 -449
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +0 -15
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +0 -11
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +0 -444
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +0 -11
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +0 -81
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +0 -12
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +0 -39
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +0 -32
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +0 -89
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +0 -32
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -77
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +0 -68
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +0 -446
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +0 -42
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +0 -35
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +0 -29
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +0 -163
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +0 -79
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +0 -99
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +0 -59
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +0 -125
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +0 -384
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +0 -149
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +0 -33
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -83
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +0 -33
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +0 -18
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +0 -58
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +0 -121
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +0 -651
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +0 -127
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +0 -272
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +0 -116
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +0 -842
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +0 -63
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +0 -170
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +0 -330
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +0 -498
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +0 -99
- data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +0 -74
- data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +0 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +0 -41
- data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +0 -15
- data/vendor/Pods/CocoaLumberjack/LICENSE.txt +0 -18
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +0 -100
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +0 -727
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +0 -369
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +0 -1539
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +0 -99
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +0 -634
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +0 -1208
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +0 -181
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +0 -1520
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h +0 -63
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.m +0 -191
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.h +0 -128
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +0 -253
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +0 -30
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +0 -127
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +0 -7
- data/vendor/Pods/CocoaLumberjack/README.markdown +0 -74
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +0 -41
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +0 -102
- data/vendor/Pods/Headers/CocoaLumberjack/DDContextFilterLogFormatter.h +0 -63
- data/vendor/Pods/Headers/CocoaLumberjack/DDDispatchQueueLogFormatter.h +0 -128
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +0 -369
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +0 -99
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +0 -634
- data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +0 -30
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +0 -181
- data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +0 -23
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +0 -547
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +0 -449
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +0 -15
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +0 -11
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +0 -11
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +0 -81
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +0 -12
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +0 -39
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +0 -32
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +0 -89
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +0 -32
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +0 -68
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +0 -42
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +0 -35
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +0 -29
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +0 -163
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +0 -99
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +0 -59
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +0 -384
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +0 -149
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +0 -33
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +0 -33
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +0 -58
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +0 -651
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +0 -127
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +0 -272
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +0 -116
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +0 -842
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +0 -63
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +0 -330
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +0 -498
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +0 -99
- data/vendor/Pods/Headers/YapDatabase/YapSet.h +0 -41
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +0 -7
- data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +0 -5
- data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +0 -5
- data/vendor/Pods/Headers/____Pods-environment.h +0 -38
- data/vendor/Pods/Manifest.lock +0 -22
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +0 -39
- data/vendor/Pods/NSData+MD5Digest/README.md +0 -11
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +0 -5
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +0 -7
- data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +0 -5
- data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +0 -5
- data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-YapDatabase-dummy.m +0 -5
- data/vendor/Pods/Pods-YapDatabase-prefix.pch +0 -5
- data/vendor/Pods/Pods-YapDatabase.xcconfig +0 -1
- data/vendor/Pods/Pods-acknowledgements.markdown +0 -59
- data/vendor/Pods/Pods-acknowledgements.plist +0 -97
- data/vendor/Pods/Pods-dummy.m +0 -5
- data/vendor/Pods/Pods-environment.h +0 -38
- data/vendor/Pods/Pods-resources.sh +0 -68
- data/vendor/Pods/Pods.xcconfig +0 -5
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +0 -4807
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +0 -59
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +0 -31
- data/vendor/Pods/YapDatabase/LICENSE.txt +0 -18
- data/vendor/Pods/YapDatabase/README.md +0 -32
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +0 -81
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +0 -159
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +0 -12
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +0 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +0 -39
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +0 -1235
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +0 -32
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +0 -77
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +0 -89
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +0 -146
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +0 -32
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +0 -298
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +0 -95
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +0 -68
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +0 -1403
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +0 -444
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +0 -15
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +0 -83
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +0 -11
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +0 -46
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +0 -11
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +0 -204
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +0 -79
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +0 -125
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +0 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +0 -129
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +0 -29
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +0 -802
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +0 -163
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +0 -408
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +0 -99
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +0 -59
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +0 -29
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +0 -384
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +0 -5254
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +0 -83
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +0 -18
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +0 -149
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +0 -161
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +0 -33
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +0 -331
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +0 -33
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +0 -245
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +0 -58
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +0 -1269
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +0 -296
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +0 -28
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +0 -170
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +0 -272
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +0 -2500
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +0 -842
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +0 -1714
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +0 -330
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +0 -141
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +0 -127
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +0 -194
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +0 -116
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +0 -888
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +0 -63
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +0 -27
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +0 -498
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +0 -4986
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +0 -99
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +0 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +0 -19
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +0 -91
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +0 -465
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +0 -48
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +0 -83
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +0 -73
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +0 -56
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +0 -446
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +0 -26
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +0 -121
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +0 -74
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +0 -603
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +0 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +0 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +0 -15
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +0 -31
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +0 -23
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +0 -199
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +0 -42
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +0 -96
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +0 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +0 -82
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +0 -547
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +0 -2013
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +0 -449
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +0 -4046
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +0 -651
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +0 -5602
- data/vendor/Pods/build-iPhoneSimulator/Pods.bridgesupport +0 -3172
- data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
#import "YapDatabase.h"
|
|
2
|
-
#import "YapDatabaseConnection.h"
|
|
3
|
-
#import "YapDatabaseTransaction.h"
|
|
4
|
-
|
|
5
|
-
#import "YapDatabaseSecondaryIndex.h"
|
|
6
|
-
#import "YapDatabaseSecondaryIndexConnection.h"
|
|
7
|
-
#import "YapDatabaseSecondaryIndexTransaction.h"
|
|
8
|
-
|
|
9
|
-
#import "YapDatabaseSecondaryIndexSetup.h"
|
|
10
|
-
#import "YapDatabaseSecondaryIndexSetupPrivate.h"
|
|
11
|
-
|
|
12
|
-
#import "YapCache.h"
|
|
13
|
-
|
|
14
|
-
#import "sqlite3.h"
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This version number is stored in the yap2 table.
|
|
18
|
-
* If there is a major re-write to this class, then the version number will be incremented,
|
|
19
|
-
* and the class can automatically rebuild the table as needed.
|
|
20
|
-
**/
|
|
21
|
-
#define YAP_DATABASE_SECONDARY_INDEX_CLASS_VERSION 1
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@interface YapDatabaseSecondaryIndex () {
|
|
25
|
-
@public
|
|
26
|
-
|
|
27
|
-
YapDatabaseSecondaryIndexSetup *setup;
|
|
28
|
-
|
|
29
|
-
YapDatabaseSecondaryIndexBlock block;
|
|
30
|
-
YapDatabaseSecondaryIndexBlockType blockType;
|
|
31
|
-
|
|
32
|
-
int version;
|
|
33
|
-
|
|
34
|
-
id columnNamesSharedKeySet;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
- (NSString *)tableName;
|
|
38
|
-
|
|
39
|
-
@end
|
|
40
|
-
|
|
41
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
42
|
-
#pragma mark -
|
|
43
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
44
|
-
|
|
45
|
-
@interface YapDatabaseSecondaryIndexConnection () {
|
|
46
|
-
@public
|
|
47
|
-
|
|
48
|
-
__strong YapDatabaseSecondaryIndex *secondaryIndex;
|
|
49
|
-
__unsafe_unretained YapDatabaseConnection *databaseConnection;
|
|
50
|
-
|
|
51
|
-
NSMutableDictionary *blockDict;
|
|
52
|
-
|
|
53
|
-
YapCache *queryCache;
|
|
54
|
-
NSUInteger queryCacheLimit;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
- (id)initWithSecondaryIndex:(YapDatabaseSecondaryIndex *)secondaryIndex
|
|
58
|
-
databaseConnection:(YapDatabaseConnection *)databaseConnection;
|
|
59
|
-
|
|
60
|
-
- (sqlite3_stmt *)insertStatement;
|
|
61
|
-
- (sqlite3_stmt *)updateStatement;
|
|
62
|
-
- (sqlite3_stmt *)removeStatement;
|
|
63
|
-
- (sqlite3_stmt *)removeAllStatement;
|
|
64
|
-
|
|
65
|
-
@end
|
|
66
|
-
|
|
67
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
68
|
-
#pragma mark -
|
|
69
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
70
|
-
|
|
71
|
-
@interface YapDatabaseSecondaryIndexTransaction () {
|
|
72
|
-
@private
|
|
73
|
-
|
|
74
|
-
__unsafe_unretained YapDatabaseSecondaryIndexConnection *secondaryIndexConnection;
|
|
75
|
-
__unsafe_unretained YapDatabaseReadTransaction *databaseTransaction;
|
|
76
|
-
|
|
77
|
-
BOOL isMutated;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
- (id)initWithSecondaryIndexConnection:(YapDatabaseSecondaryIndexConnection *)secondaryIndexConnection
|
|
81
|
-
databaseTransaction:(YapDatabaseReadTransaction *)databaseTransaction;
|
|
82
|
-
|
|
83
|
-
@end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import "YapDatabaseSecondaryIndexSetup.h"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@interface YapDatabaseSecondaryIndexSetup ()
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This method compares its setup to a current table structure.
|
|
9
|
-
*
|
|
10
|
-
* @param columns
|
|
11
|
-
*
|
|
12
|
-
* Dictionary of column names and affinity.
|
|
13
|
-
*
|
|
14
|
-
* @see YapDatabase columnNamesAndAffinityForTable:using:
|
|
15
|
-
**/
|
|
16
|
-
- (BOOL)matchesExistingColumnNamesAndAffinity:(NSDictionary *)columns;
|
|
17
|
-
|
|
18
|
-
@end
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
#import "YapDatabaseExtension.h"
|
|
4
|
-
#import "YapDatabaseSecondaryIndexSetup.h"
|
|
5
|
-
#import "YapDatabaseSecondaryIndexConnection.h"
|
|
6
|
-
#import "YapDatabaseSecondaryIndexTransaction.h"
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Welcome to YapDatabase!
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/yaptv/YapDatabase
|
|
12
|
-
*
|
|
13
|
-
* The project wiki has a wealth of documentation if you have any questions.
|
|
14
|
-
* https://github.com/yaptv/YapDatabase/wiki
|
|
15
|
-
*
|
|
16
|
-
* YapDatabaseSecondaryIndex is an extension which allows you to add additional indexes.
|
|
17
|
-
* That is, it allows you to create index(es) within sqlite for particular properties of your objects.
|
|
18
|
-
* You can then issue queries to find or enumerate objects using the indexes. (e.g. age >= 62)
|
|
19
|
-
* This allows for increased flexibility above the traditional key-value model.
|
|
20
|
-
**/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* The block handles extracting the column values for the secondary indexes.
|
|
24
|
-
*
|
|
25
|
-
* When you add or update rows in the databse the block is invoked.
|
|
26
|
-
* Your block can inspect the row and determine if it contains any values that should be added to the secondary indexes.
|
|
27
|
-
* If not, the block can simply return.
|
|
28
|
-
* Otherwise the block should extract any values and add them to the given dictionary.
|
|
29
|
-
*
|
|
30
|
-
* After the block returns, the dictionary parameter will be inspected,
|
|
31
|
-
* and any set values will be automatically inserted/updated within the sqlite indexes.
|
|
32
|
-
*
|
|
33
|
-
* You should choose a block type that takes the minimum number of required parameters.
|
|
34
|
-
* The extension can make various optimizations based on required parameters of the block.
|
|
35
|
-
* For example, if metadata isn't required, then the extension can ignore metadata-only updates.
|
|
36
|
-
**/
|
|
37
|
-
typedef id YapDatabaseSecondaryIndexBlock; // One of the YapDatabaseSecondaryIndexWith_X_Block types below.
|
|
38
|
-
|
|
39
|
-
typedef void (^YapDatabaseSecondaryIndexWithKeyBlock) \
|
|
40
|
-
(NSMutableDictionary *dict, NSString *collection, NSString *key);
|
|
41
|
-
typedef void (^YapDatabaseSecondaryIndexWithObjectBlock) \
|
|
42
|
-
(NSMutableDictionary *dict, NSString *collection, NSString *key, id object);
|
|
43
|
-
typedef void (^YapDatabaseSecondaryIndexWithMetadataBlock) \
|
|
44
|
-
(NSMutableDictionary *dict, NSString *collection, NSString *key, id metadata);
|
|
45
|
-
typedef void (^YapDatabaseSecondaryIndexWithRowBlock) \
|
|
46
|
-
(NSMutableDictionary *dict, NSString *collection, NSString *key, id object, id metadata);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Use this enum to specify what kind of block you're passing.
|
|
50
|
-
**/
|
|
51
|
-
typedef enum {
|
|
52
|
-
YapDatabaseSecondaryIndexBlockTypeWithKey = 1031,
|
|
53
|
-
YapDatabaseSecondaryIndexBlockTypeWithObject = 1032,
|
|
54
|
-
YapDatabaseSecondaryIndexBlockTypeWithMetadata = 1033,
|
|
55
|
-
YapDatabaseSecondaryIndexBlockTypeWithRow = 1034
|
|
56
|
-
} YapDatabaseSecondaryIndexBlockType;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@interface YapDatabaseSecondaryIndex : YapDatabaseExtension
|
|
60
|
-
|
|
61
|
-
/* Inherited from YapDatabaseExtension
|
|
62
|
-
|
|
63
|
-
@property (nonatomic, strong, readonly) NSString *registeredName;
|
|
64
|
-
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Creates a new secondary index extension.
|
|
69
|
-
* After creation, you'll need to register the extension with the database system.
|
|
70
|
-
*
|
|
71
|
-
* @param setup
|
|
72
|
-
*
|
|
73
|
-
* A YapDatabaseSecondaryIndexSetup instance allows you to specify the column names and type.
|
|
74
|
-
* The column names can be whatever you want, with a few exceptions for reserved names such as "rowid".
|
|
75
|
-
* The types can reflect numbers or text.
|
|
76
|
-
*
|
|
77
|
-
* @param block
|
|
78
|
-
*
|
|
79
|
-
* Pass a block that is one of the following types:
|
|
80
|
-
* - YapDatabaseSecondaryIndexWithKeyBlock
|
|
81
|
-
* - YapDatabaseSecondaryIndexWithObjectBlock
|
|
82
|
-
* - YapDatabaseSecondaryIndexWithMetadataBlock
|
|
83
|
-
* - YapDatabaseSecondaryIndexWithRowBlock
|
|
84
|
-
*
|
|
85
|
-
* @param blockType
|
|
86
|
-
*
|
|
87
|
-
* Pass the blockType enum that matches the passed block:
|
|
88
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithKey
|
|
89
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithObject
|
|
90
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithMetadata
|
|
91
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithRow
|
|
92
|
-
*
|
|
93
|
-
* @see YapDatabaseSecondaryIndexSetup
|
|
94
|
-
* @see YapDatabase registerExtension:withName:
|
|
95
|
-
**/
|
|
96
|
-
- (id)initWithSetup:(YapDatabaseSecondaryIndexSetup *)setup
|
|
97
|
-
block:(YapDatabaseSecondaryIndexBlock)block
|
|
98
|
-
blockType:(YapDatabaseSecondaryIndexBlockType)blockType;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Creates a new secondary index extension.
|
|
102
|
-
* After creation, you'll need to register the extension with the database system.
|
|
103
|
-
*
|
|
104
|
-
* @param setup
|
|
105
|
-
*
|
|
106
|
-
* A YapDatabaseSecondaryIndexSetup instance allows you to specify the column names and type.
|
|
107
|
-
* The column names can be whatever you want, with a few exceptions for reserved names such as "rowid".
|
|
108
|
-
* The types can reflect numbers or text.
|
|
109
|
-
*
|
|
110
|
-
* @param block
|
|
111
|
-
*
|
|
112
|
-
* Pass a block that is one of the following types:
|
|
113
|
-
* - YapDatabaseSecondaryIndexWithKeyBlock
|
|
114
|
-
* - YapDatabaseSecondaryIndexWithObjectBlock
|
|
115
|
-
* - YapDatabaseSecondaryIndexWithMetadataBlock
|
|
116
|
-
* - YapDatabaseSecondaryIndexWithRowBlock
|
|
117
|
-
*
|
|
118
|
-
* @param blockType
|
|
119
|
-
*
|
|
120
|
-
* Pass the blockType enum that matches the passed block:
|
|
121
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithKey
|
|
122
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithObject
|
|
123
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithMetadata
|
|
124
|
-
* - YapDatabaseSecondaryIndexBlockTypeWithRow
|
|
125
|
-
*
|
|
126
|
-
* @param version
|
|
127
|
-
*
|
|
128
|
-
* If, after creating the secondary index(es), you need to change the setup or block,
|
|
129
|
-
* then simply increment the version parameter. If you pass a version that is different from the last
|
|
130
|
-
* initialization of the extension, then it will automatically re-create itself.
|
|
131
|
-
*
|
|
132
|
-
* @see YapDatabaseSecondaryIndexSetup
|
|
133
|
-
* @see YapDatabase registerExtension:withName:
|
|
134
|
-
**/
|
|
135
|
-
- (id)initWithSetup:(YapDatabaseSecondaryIndexSetup *)setup
|
|
136
|
-
block:(YapDatabaseSecondaryIndexBlock)block
|
|
137
|
-
blockType:(YapDatabaseSecondaryIndexBlockType)blockType
|
|
138
|
-
version:(int)version;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* The version assists in making changes to the extension.
|
|
142
|
-
*
|
|
143
|
-
* If you need to change the columnNames and/or block,
|
|
144
|
-
* then simply pass an incremented version during the init method,
|
|
145
|
-
* and the FTS extension will automatically update itself.
|
|
146
|
-
**/
|
|
147
|
-
@property (nonatomic, assign, readonly) int version;
|
|
148
|
-
|
|
149
|
-
@end
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
#import "YapDatabaseSecondaryIndex.h"
|
|
2
|
-
#import "YapDatabaseSecondaryIndexPrivate.h"
|
|
3
|
-
|
|
4
|
-
#import "YapDatabasePrivate.h"
|
|
5
|
-
#import "YapDatabaseExtensionPrivate.h"
|
|
6
|
-
|
|
7
|
-
#import "YapDatabaseLogging.h"
|
|
8
|
-
|
|
9
|
-
#if ! __has_feature(objc_arc)
|
|
10
|
-
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
|
11
|
-
#endif
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Define log level for this file: OFF, ERROR, WARN, INFO, VERBOSE
|
|
15
|
-
* See YapDatabaseLogging.h for more information.
|
|
16
|
-
**/
|
|
17
|
-
#if DEBUG
|
|
18
|
-
static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
|
|
19
|
-
#else
|
|
20
|
-
static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
|
|
21
|
-
#endif
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@implementation YapDatabaseSecondaryIndex
|
|
25
|
-
|
|
26
|
-
+ (void)dropTablesForRegisteredName:(NSString *)registeredName
|
|
27
|
-
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
|
|
28
|
-
{
|
|
29
|
-
sqlite3 *db = transaction->connection->db;
|
|
30
|
-
NSString *tableName = [self tableNameForRegisteredName:registeredName];
|
|
31
|
-
|
|
32
|
-
NSString *dropTable = [NSString stringWithFormat:@"DROP TABLE IF EXISTS \"%@\";", tableName];
|
|
33
|
-
|
|
34
|
-
int status = sqlite3_exec(db, [dropTable UTF8String], NULL, NULL, NULL);
|
|
35
|
-
if (status != SQLITE_OK)
|
|
36
|
-
{
|
|
37
|
-
YDBLogError(@"%@ - Failed dropping table (%@): %d %s",
|
|
38
|
-
THIS_METHOD, tableName, status, sqlite3_errmsg(db));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
+ (NSArray *)previousClassNames
|
|
43
|
-
{
|
|
44
|
-
return @[ @"YapCollectionsDatabaseSecondaryIndex" ];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
+ (NSString *)tableNameForRegisteredName:(NSString *)registeredName
|
|
48
|
-
{
|
|
49
|
-
return [NSString stringWithFormat:@"secondaryIndex_%@", registeredName];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
53
|
-
#pragma mark Instance
|
|
54
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
55
|
-
|
|
56
|
-
@synthesize version = version;
|
|
57
|
-
|
|
58
|
-
- (id)init
|
|
59
|
-
{
|
|
60
|
-
NSAssert(NO, @"Must use designated initializer");
|
|
61
|
-
return nil;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
- (id)initWithSetup:(YapDatabaseSecondaryIndexSetup *)inSetup
|
|
65
|
-
block:(YapDatabaseSecondaryIndexBlock)inBlock
|
|
66
|
-
blockType:(YapDatabaseSecondaryIndexBlockType)inBlockType
|
|
67
|
-
{
|
|
68
|
-
return [self initWithSetup:inSetup block:inBlock blockType:inBlockType version:0];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
- (id)initWithSetup:(YapDatabaseSecondaryIndexSetup *)inSetup
|
|
72
|
-
block:(YapDatabaseSecondaryIndexBlock)inBlock
|
|
73
|
-
blockType:(YapDatabaseSecondaryIndexBlockType)inBlockType
|
|
74
|
-
version:(int)inVersion
|
|
75
|
-
{
|
|
76
|
-
// Sanity checks
|
|
77
|
-
|
|
78
|
-
if (inSetup == nil)
|
|
79
|
-
{
|
|
80
|
-
NSAssert(NO, @"Invalid setup: nil");
|
|
81
|
-
|
|
82
|
-
YDBLogError(@"%@: Invalid setup: nil", THIS_METHOD);
|
|
83
|
-
return nil;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if ([inSetup count] == 0)
|
|
87
|
-
{
|
|
88
|
-
NSAssert(NO, @"Invalid setup: empty");
|
|
89
|
-
|
|
90
|
-
YDBLogError(@"%@: Invalid setup: empty", THIS_METHOD);
|
|
91
|
-
return nil;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (inBlock == NULL)
|
|
95
|
-
{
|
|
96
|
-
NSAssert(NO, @"Invalid block: NULL");
|
|
97
|
-
|
|
98
|
-
YDBLogError(@"%@: Invalid block: NULL", THIS_METHOD);
|
|
99
|
-
return nil;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (inBlockType != YapDatabaseSecondaryIndexBlockTypeWithKey &&
|
|
103
|
-
inBlockType != YapDatabaseSecondaryIndexBlockTypeWithObject &&
|
|
104
|
-
inBlockType != YapDatabaseSecondaryIndexBlockTypeWithMetadata &&
|
|
105
|
-
inBlockType != YapDatabaseSecondaryIndexBlockTypeWithRow )
|
|
106
|
-
{
|
|
107
|
-
NSAssert(NO, @"Invalid blockType");
|
|
108
|
-
|
|
109
|
-
YDBLogError(@"%@: Invalid blockType", THIS_METHOD);
|
|
110
|
-
return nil;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Looks sane, proceed with normal init
|
|
114
|
-
|
|
115
|
-
if ((self = [super init]))
|
|
116
|
-
{
|
|
117
|
-
setup = [inSetup copy];
|
|
118
|
-
|
|
119
|
-
block = inBlock;
|
|
120
|
-
blockType = inBlockType;
|
|
121
|
-
|
|
122
|
-
columnNamesSharedKeySet = [NSDictionary sharedKeySetForKeys:[setup columnNames]];
|
|
123
|
-
|
|
124
|
-
version = inVersion;
|
|
125
|
-
}
|
|
126
|
-
return self;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Subclasses must implement this method.
|
|
131
|
-
* This method is called during the view registration process to enusre the extension supports the database type.
|
|
132
|
-
*
|
|
133
|
-
* Return YES if the class/instance supports the particular type of database (YapDatabase vs YapDatabase).
|
|
134
|
-
**/
|
|
135
|
-
- (BOOL)supportsDatabase:(YapDatabase *)database withRegisteredExtensions:(NSDictionary *)registeredExtensions;
|
|
136
|
-
{
|
|
137
|
-
if ([database isKindOfClass:[YapDatabase class]])
|
|
138
|
-
{
|
|
139
|
-
return YES;
|
|
140
|
-
}
|
|
141
|
-
else
|
|
142
|
-
{
|
|
143
|
-
YDBLogError(@"YapDatabaseSecondaryIndex only supports YapDatabase, not YapDatabase."
|
|
144
|
-
@"You want YapDatabaseSecondaryIndex.");
|
|
145
|
-
return NO;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
- (YapDatabaseExtensionConnection *)newConnection:(YapDatabaseConnection *)databaseConnection
|
|
150
|
-
{
|
|
151
|
-
return [[YapDatabaseSecondaryIndexConnection alloc]
|
|
152
|
-
initWithSecondaryIndex:self
|
|
153
|
-
databaseConnection:databaseConnection];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
- (NSString *)tableName
|
|
157
|
-
{
|
|
158
|
-
return [[self class] tableNameForRegisteredName:self.registeredName];
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
@end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
#import "YapDatabaseExtensionConnection.h"
|
|
3
|
-
|
|
4
|
-
@class YapDatabaseSecondaryIndex;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@interface YapDatabaseSecondaryIndexConnection : YapDatabaseExtensionConnection
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Returns the parent instance.
|
|
11
|
-
**/
|
|
12
|
-
@property (nonatomic, strong, readonly) YapDatabaseSecondaryIndex *secondaryIndex;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* The queryCache speeds up the transaction methods. (enumerateXMatchingQuery:usingBlock:)
|
|
16
|
-
*
|
|
17
|
-
* In order for a query to be executed, it first has to be compiled by SQLite into an executable routine.
|
|
18
|
-
* The queryCache stores these compiled reusable routines, so that repeated queries can be executed faster.
|
|
19
|
-
*
|
|
20
|
-
* Please note that, in terms of caching, only the queryString matters. The queryParameters do not.
|
|
21
|
-
* That is, if you use the same queryString over and over, but with different parameters,
|
|
22
|
-
* you will get a nice benefit from caching as it will be able to recyle the compiled routine,
|
|
23
|
-
* and simply bind the different parameters each time.
|
|
24
|
-
*
|
|
25
|
-
* By default the queryCache is enabled and has a limit of 10.
|
|
26
|
-
*
|
|
27
|
-
* To disable the cache entirely, set queryCacheEnabled to NO.
|
|
28
|
-
* To use an inifinite cache size, set the queryCacheLimit to ZERO.
|
|
29
|
-
**/
|
|
30
|
-
@property (atomic, assign, readwrite) BOOL queryCacheEnabled;
|
|
31
|
-
@property (atomic, assign, readwrite) NSUInteger queryCacheLimit;
|
|
32
|
-
|
|
33
|
-
@end
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
#import "YapDatabaseSecondaryIndexConnection.h"
|
|
2
|
-
#import "YapDatabaseSecondaryIndexPrivate.h"
|
|
3
|
-
|
|
4
|
-
#import "YapDatabasePrivate.h"
|
|
5
|
-
#import "YapDatabaseExtensionPrivate.h"
|
|
6
|
-
|
|
7
|
-
#import "YapDatabaseLogging.h"
|
|
8
|
-
|
|
9
|
-
#if ! __has_feature(objc_arc)
|
|
10
|
-
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
|
11
|
-
#endif
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Define log level for this file: OFF, ERROR, WARN, INFO, VERBOSE
|
|
15
|
-
* See YapDatabaseLogging.h for more information.
|
|
16
|
-
**/
|
|
17
|
-
#if DEBUG
|
|
18
|
-
static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
|
|
19
|
-
#else
|
|
20
|
-
static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
|
|
21
|
-
#endif
|
|
22
|
-
|
|
23
|
-
@implementation YapDatabaseSecondaryIndexConnection
|
|
24
|
-
{
|
|
25
|
-
sqlite3_stmt *insertStatement;
|
|
26
|
-
sqlite3_stmt *updateStatement;
|
|
27
|
-
sqlite3_stmt *removeStatement;
|
|
28
|
-
sqlite3_stmt *removeAllStatement;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@synthesize secondaryIndex = secondaryIndex;
|
|
32
|
-
|
|
33
|
-
- (id)initWithSecondaryIndex:(YapDatabaseSecondaryIndex *)inSecondaryIndex
|
|
34
|
-
databaseConnection:(YapDatabaseConnection *)inDatabaseConnection
|
|
35
|
-
{
|
|
36
|
-
if ((self = [super init]))
|
|
37
|
-
{
|
|
38
|
-
secondaryIndex = inSecondaryIndex;
|
|
39
|
-
databaseConnection = inDatabaseConnection;
|
|
40
|
-
|
|
41
|
-
queryCacheLimit = 10;
|
|
42
|
-
queryCache = [[YapCache alloc] initWithKeyClass:[NSString class] countLimit:queryCacheLimit];
|
|
43
|
-
}
|
|
44
|
-
return self;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
- (void)dealloc
|
|
48
|
-
{
|
|
49
|
-
[queryCache removeAllObjects];
|
|
50
|
-
[self _flushStatements];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
- (void)_flushStatements
|
|
54
|
-
{
|
|
55
|
-
sqlite_finalize_null(&insertStatement);
|
|
56
|
-
sqlite_finalize_null(&updateStatement);
|
|
57
|
-
sqlite_finalize_null(&removeStatement);
|
|
58
|
-
sqlite_finalize_null(&removeAllStatement);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Required override method from YapDatabaseExtensionConnection
|
|
63
|
-
**/
|
|
64
|
-
- (void)_flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags
|
|
65
|
-
{
|
|
66
|
-
if (flags & YapDatabaseConnectionFlushMemoryFlags_Caches)
|
|
67
|
-
{
|
|
68
|
-
[queryCache removeAllObjects];
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (flags & YapDatabaseConnectionFlushMemoryFlags_Statements)
|
|
72
|
-
{
|
|
73
|
-
[self _flushStatements];
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
78
|
-
#pragma mark Accessors
|
|
79
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Required override method from YapDatabaseExtensionConnection.
|
|
83
|
-
**/
|
|
84
|
-
- (YapDatabaseExtension *)extension
|
|
85
|
-
{
|
|
86
|
-
return secondaryIndex;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
90
|
-
#pragma mark Configuration
|
|
91
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
92
|
-
|
|
93
|
-
- (BOOL)queryCacheEnabled
|
|
94
|
-
{
|
|
95
|
-
__block BOOL result = NO;
|
|
96
|
-
|
|
97
|
-
dispatch_block_t block = ^{
|
|
98
|
-
|
|
99
|
-
result = (queryCache == nil) ? NO : YES;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))
|
|
103
|
-
block();
|
|
104
|
-
else
|
|
105
|
-
dispatch_sync(databaseConnection->connectionQueue, block);
|
|
106
|
-
|
|
107
|
-
return result;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
- (void)setQueryCacheEnabled:(BOOL)queryCacheEnabled
|
|
111
|
-
{
|
|
112
|
-
dispatch_block_t block = ^{
|
|
113
|
-
|
|
114
|
-
if (queryCacheEnabled)
|
|
115
|
-
{
|
|
116
|
-
if (queryCache == nil)
|
|
117
|
-
queryCache = [[YapCache alloc] initWithKeyClass:[NSString class] countLimit:queryCacheLimit];
|
|
118
|
-
}
|
|
119
|
-
else
|
|
120
|
-
{
|
|
121
|
-
queryCache = nil;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))
|
|
126
|
-
block();
|
|
127
|
-
else
|
|
128
|
-
dispatch_async(databaseConnection->connectionQueue, block);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
- (NSUInteger)queryCacheLimit
|
|
132
|
-
{
|
|
133
|
-
__block NSUInteger result = 0;
|
|
134
|
-
|
|
135
|
-
dispatch_block_t block = ^{
|
|
136
|
-
|
|
137
|
-
result = queryCacheLimit;
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))
|
|
141
|
-
block();
|
|
142
|
-
else
|
|
143
|
-
dispatch_sync(databaseConnection->connectionQueue, block);
|
|
144
|
-
|
|
145
|
-
return result;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
- (void)setQueryCacheLimit:(NSUInteger)newQueryCacheLimit
|
|
149
|
-
{
|
|
150
|
-
dispatch_block_t block = ^{
|
|
151
|
-
|
|
152
|
-
queryCacheLimit = newQueryCacheLimit;
|
|
153
|
-
queryCache.countLimit = queryCacheLimit;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
if (dispatch_get_specific(databaseConnection->IsOnConnectionQueueKey))
|
|
157
|
-
block();
|
|
158
|
-
else
|
|
159
|
-
dispatch_async(databaseConnection->connectionQueue, block);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
163
|
-
#pragma mark Transactions
|
|
164
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Required override method from YapDatabaseExtensionConnection.
|
|
168
|
-
**/
|
|
169
|
-
- (id)newReadTransaction:(YapDatabaseReadTransaction *)databaseTransaction
|
|
170
|
-
{
|
|
171
|
-
YapDatabaseSecondaryIndexTransaction *transaction =
|
|
172
|
-
[[YapDatabaseSecondaryIndexTransaction alloc]
|
|
173
|
-
initWithSecondaryIndexConnection:self
|
|
174
|
-
databaseTransaction:databaseTransaction];
|
|
175
|
-
|
|
176
|
-
return transaction;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Required override method from YapDatabaseExtensionConnection.
|
|
181
|
-
**/
|
|
182
|
-
- (id)newReadWriteTransaction:(YapDatabaseReadWriteTransaction *)databaseTransaction
|
|
183
|
-
{
|
|
184
|
-
YapDatabaseSecondaryIndexTransaction *transaction =
|
|
185
|
-
[[YapDatabaseSecondaryIndexTransaction alloc]
|
|
186
|
-
initWithSecondaryIndexConnection:self
|
|
187
|
-
databaseTransaction:databaseTransaction];
|
|
188
|
-
|
|
189
|
-
if (blockDict == nil)
|
|
190
|
-
blockDict = [NSMutableDictionary dictionaryWithSharedKeySet:secondaryIndex->columnNamesSharedKeySet];
|
|
191
|
-
|
|
192
|
-
return transaction;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
196
|
-
#pragma mark Changeset
|
|
197
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* Required override method from YapDatabaseExtension
|
|
201
|
-
**/
|
|
202
|
-
- (void)getInternalChangeset:(NSMutableDictionary **)internalChangesetPtr
|
|
203
|
-
externalChangeset:(NSMutableDictionary **)externalChangesetPtr
|
|
204
|
-
hasDiskChanges:(BOOL *)hasDiskChangesPtr
|
|
205
|
-
{
|
|
206
|
-
// Nothing to do for this particular extension.
|
|
207
|
-
//
|
|
208
|
-
// YapDatabaseExtension throws a "not implemented" exception
|
|
209
|
-
// to ensure extensions have implementations of all required methods.
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Required override method from YapDatabaseExtension
|
|
214
|
-
**/
|
|
215
|
-
- (void)processChangeset:(NSDictionary *)changeset
|
|
216
|
-
{
|
|
217
|
-
// Nothing to do for this particular extension.
|
|
218
|
-
//
|
|
219
|
-
// YapDatabaseExtension throws a "not implemented" exception
|
|
220
|
-
// to ensure extensions have implementations of all required methods.
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
224
|
-
#pragma mark Statements
|
|
225
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
226
|
-
|
|
227
|
-
- (sqlite3_stmt *)insertStatement
|
|
228
|
-
{
|
|
229
|
-
if (insertStatement == NULL)
|
|
230
|
-
{
|
|
231
|
-
NSMutableString *string = [NSMutableString stringWithCapacity:100];
|
|
232
|
-
[string appendFormat:@"INSERT INTO \"%@\" (\"rowid\"", [secondaryIndex tableName]];
|
|
233
|
-
|
|
234
|
-
for (YapDatabaseSecondaryIndexColumn *column in secondaryIndex->setup)
|
|
235
|
-
{
|
|
236
|
-
[string appendFormat:@", \"%@\"", column.name];
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
[string appendString:@") VALUES (?"];
|
|
240
|
-
|
|
241
|
-
NSUInteger count = [secondaryIndex->setup count];
|
|
242
|
-
NSUInteger i;
|
|
243
|
-
for (i = 0; i < count; i++)
|
|
244
|
-
{
|
|
245
|
-
[string appendString:@", ?"];
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
[string appendString:@");"];
|
|
249
|
-
|
|
250
|
-
sqlite3 *db = databaseConnection->db;
|
|
251
|
-
|
|
252
|
-
int status = sqlite3_prepare_v2(db, [string UTF8String], -1, &insertStatement, NULL);
|
|
253
|
-
if (status != SQLITE_OK)
|
|
254
|
-
{
|
|
255
|
-
YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
return insertStatement;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
- (sqlite3_stmt *)updateStatement
|
|
263
|
-
{
|
|
264
|
-
if (updateStatement == NULL)
|
|
265
|
-
{
|
|
266
|
-
NSMutableString *string = [NSMutableString stringWithCapacity:100];
|
|
267
|
-
[string appendFormat:@"UPDATE \"%@\" SET ", [secondaryIndex tableName]];
|
|
268
|
-
|
|
269
|
-
NSUInteger i = 0;
|
|
270
|
-
for (YapDatabaseSecondaryIndexColumn *column in secondaryIndex->setup)
|
|
271
|
-
{
|
|
272
|
-
if (i == 0)
|
|
273
|
-
[string appendFormat:@"\"%@\" = ?", column.name];
|
|
274
|
-
else
|
|
275
|
-
[string appendFormat:@", \"%@\" = ?", column.name];
|
|
276
|
-
|
|
277
|
-
i++;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
[string appendString:@" WHERE rowid = ?;"];
|
|
281
|
-
|
|
282
|
-
sqlite3 *db = databaseConnection->db;
|
|
283
|
-
|
|
284
|
-
int status = sqlite3_prepare_v2(db, [string UTF8String], -1, &updateStatement, NULL);
|
|
285
|
-
if (status != SQLITE_OK)
|
|
286
|
-
{
|
|
287
|
-
YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return updateStatement;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
- (sqlite3_stmt *)removeStatement
|
|
295
|
-
{
|
|
296
|
-
if (removeStatement == NULL)
|
|
297
|
-
{
|
|
298
|
-
NSString *string =
|
|
299
|
-
[NSString stringWithFormat:@"DELETE FROM \"%@\" WHERE \"rowid\" = ?;", [secondaryIndex tableName]];
|
|
300
|
-
|
|
301
|
-
sqlite3 *db = databaseConnection->db;
|
|
302
|
-
|
|
303
|
-
int status = sqlite3_prepare_v2(db, [string UTF8String], -1, &removeStatement, NULL);
|
|
304
|
-
if (status != SQLITE_OK)
|
|
305
|
-
{
|
|
306
|
-
YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
return removeStatement;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
- (sqlite3_stmt *)removeAllStatement
|
|
314
|
-
{
|
|
315
|
-
if (removeAllStatement == NULL)
|
|
316
|
-
{
|
|
317
|
-
NSString *string = [NSString stringWithFormat:@"DELETE FROM \"%@\";", [secondaryIndex tableName]];
|
|
318
|
-
|
|
319
|
-
sqlite3 *db = databaseConnection->db;
|
|
320
|
-
|
|
321
|
-
int status = sqlite3_prepare_v2(db, [string UTF8String], -1, &removeAllStatement, NULL);
|
|
322
|
-
if (status != SQLITE_OK)
|
|
323
|
-
{
|
|
324
|
-
YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
return removeAllStatement;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
@end
|