motion-yapper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.travis.yml +2 -0
- data/Gemfile +1 -0
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/lib/motion-yapper.rb +1 -0
- data/lib/yapper.rb +3 -5
- data/lib/yapper/config.rb +2 -0
- data/lib/yapper/db.rb +105 -40
- data/lib/yapper/document.rb +7 -4
- data/lib/yapper/document/callbacks.rb +0 -7
- data/lib/yapper/document/{persistance.rb → persistence.rb} +27 -21
- data/lib/yapper/document/relation.rb +29 -22
- data/lib/yapper/document/selection.rb +122 -54
- data/lib/yapper/extensions.rb +12 -24
- data/lib/yapper/settings.rb +43 -0
- data/lib/yapper/timestamps.rb +2 -0
- data/lib/yapper/version.rb +1 -1
- data/{yapper.gemspec → motion-yapper.gemspec} +0 -0
- data/spec/integration/{where_spec.rb → criteria_spec.rb} +78 -10
- data/spec/integration/db_spec.rb +70 -0
- data/spec/integration/defaults_spec.rb +37 -0
- data/spec/integration/extensions_spec.rb +14 -0
- data/spec/integration/{persistance_spec.rb → persistence_spec.rb} +0 -0
- data/spec/integration/relation_spec.rb +4 -4
- data/vendor/Podfile.lock +9 -11
- 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 +4 -4
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/{CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h → BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +51 -50
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +546 -546
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1093 -907
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +98 -65
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +873 -748
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1284 -1243
- data/vendor/Pods/{BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h → CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{ContextFilterLogFormatter.m → DDContextFilterLogFormatter.m} +70 -70
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +253 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +30 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +127 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +1 -1
- data/vendor/Pods/CocoaLumberjack/README.markdown +52 -15
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +4 -4
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
- data/vendor/Pods/Headers/CocoaLumberjack/{ContextFilterLogFormatter.h → DDContextFilterLogFormatter.h} +6 -8
- data/vendor/Pods/Headers/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +67 -32
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +99 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +98 -65
- data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +30 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +39 -25
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +3 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +48 -107
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +2 -0
- data/vendor/Pods/Headers/____Pods-environment.h +15 -15
- data/vendor/Pods/Manifest.lock +9 -11
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +2 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +1 -1
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +1 -1
- data/vendor/Pods/{Pods-Acknowledgements.markdown → Pods-acknowledgements.markdown} +0 -37
- data/vendor/Pods/{Pods-Acknowledgements.plist → Pods-acknowledgements.plist} +0 -45
- data/vendor/Pods/Pods-environment.h +15 -15
- data/vendor/Pods/Pods.xcconfig +3 -3
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +2426 -3155
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +59 -0
- data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
- data/vendor/Pods/YapDatabase/README.md +3 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +8 -35
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +25 -41
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +17 -17
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +403 -134
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +32 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +8 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +113 -62
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +35 -31
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +25 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +25 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +79 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +125 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +35 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +129 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +802 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +163 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +408 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +59 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +384 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +5254 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +10 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +49 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +9 -8
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +62 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +148 -45
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +18 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +2 -2
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +15 -9
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +211 -64
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +48 -107
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +10 -7
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +13 -22
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +10 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +75 -24
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +725 -244
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +99 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +8 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +19 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +1 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +1 -1
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +3 -3
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +43 -21
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +4 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +3 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +5 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +4 -4
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +84 -93
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +21 -19
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +381 -209
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +131 -21
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +587 -267
- data/vendor/Pods/{Pods.bridgesupport → build-iPhoneSimulator/Pods.bridgesupport} +633 -2557
- data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +2 -1
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +4 -2
- metadata +80 -108
- data/Gemfile.lock +0 -63
- data/lib/yapper/attachment.rb +0 -48
- data/lib/yapper/document/attachment.rb +0 -26
- data/lib/yapper/sync.rb +0 -134
- data/lib/yapper/sync/data.rb +0 -12
- data/lib/yapper/sync/event.rb +0 -194
- data/lib/yapper/sync/queue.rb +0 -164
- data/spec/integration/all_spec.rb +0 -40
- data/spec/integration/sync_spec.rb +0 -42
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +0 -1396
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +0 -327
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +0 -321
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +0 -150
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +0 -157
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +0 -143
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +0 -848
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +0 -167
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +0 -191
- data/vendor/Pods/AFNetworking/LICENSE +0 -19
- data/vendor/Pods/AFNetworking/README.md +0 -208
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +0 -109
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +0 -251
- data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +0 -641
- data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +0 -133
- data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +0 -113
- data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +0 -71
- data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
- data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +0 -43
- data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +0 -68
- data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +0 -370
- data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +0 -89
- data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +0 -78
- data/vendor/Pods/Headers/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Headers/YapDatabase/YapCache.h +0 -90
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +0 -29
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +0 -37
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +0 -440
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -19
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -69
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +0 -158
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +0 -424
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -73
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +0 -13
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +0 -121
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +0 -36
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +0 -153
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +0 -74
- data/vendor/Pods/Headers/YapDatabase/YapNull.h +0 -17
- data/vendor/Pods/Headers/YapDatabase/YapTouch.h +0 -15
- data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +0 -17
- data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +0 -5
- data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-AFNetworking-dummy.m +0 -5
- data/vendor/Pods/Pods-AFNetworking-prefix.pch +0 -17
- data/vendor/Pods/Pods-AFNetworking.xcconfig +0 -1
- data/vendor/Pods/Pods-Reachability-Private.xcconfig +0 -5
- data/vendor/Pods/Pods-Reachability-dummy.m +0 -5
- data/vendor/Pods/Pods-Reachability-prefix.pch +0 -5
- data/vendor/Pods/Pods-Reachability.xcconfig +0 -1
- data/vendor/Pods/Reachability/LICENCE.txt +0 -24
- data/vendor/Pods/Reachability/README.md +0 -65
- data/vendor/Pods/Reachability/Reachability.h +0 -109
- data/vendor/Pods/Reachability/Reachability.m +0 -527
@@ -7,10 +7,20 @@
|
|
7
7
|
#import "YapDatabaseSecondaryIndexTransaction.h"
|
8
8
|
|
9
9
|
#import "YapDatabaseSecondaryIndexSetup.h"
|
10
|
+
#import "YapDatabaseSecondaryIndexSetupPrivate.h"
|
11
|
+
|
10
12
|
#import "YapCache.h"
|
11
13
|
|
12
14
|
#import "sqlite3.h"
|
13
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
|
+
|
14
24
|
@interface YapDatabaseSecondaryIndex () {
|
15
25
|
@public
|
16
26
|
|
@@ -0,0 +1,18 @@
|
|
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
CHANGED
@@ -97,4 +97,53 @@ typedef enum {
|
|
97
97
|
block:(YapDatabaseSecondaryIndexBlock)block
|
98
98
|
blockType:(YapDatabaseSecondaryIndexBlockType)blockType;
|
99
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
|
+
|
100
149
|
@end
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m
CHANGED
@@ -53,6 +53,8 @@
|
|
53
53
|
#pragma mark Instance
|
54
54
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
55
55
|
|
56
|
+
@synthesize version = version;
|
57
|
+
|
56
58
|
- (id)init
|
57
59
|
{
|
58
60
|
NSAssert(NO, @"Must use designated initializer");
|
@@ -62,6 +64,14 @@
|
|
62
64
|
- (id)initWithSetup:(YapDatabaseSecondaryIndexSetup *)inSetup
|
63
65
|
block:(YapDatabaseSecondaryIndexBlock)inBlock
|
64
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
|
65
75
|
{
|
66
76
|
// Sanity checks
|
67
77
|
|
@@ -110,6 +120,8 @@
|
|
110
120
|
blockType = inBlockType;
|
111
121
|
|
112
122
|
columnNamesSharedKeySet = [NSDictionary sharedKeySetForKeys:[setup columnNames]];
|
123
|
+
|
124
|
+
version = inVersion;
|
113
125
|
}
|
114
126
|
return self;
|
115
127
|
}
|
@@ -47,7 +47,11 @@ static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
|
|
47
47
|
- (void)dealloc
|
48
48
|
{
|
49
49
|
[queryCache removeAllObjects];
|
50
|
-
|
50
|
+
[self _flushStatements];
|
51
|
+
}
|
52
|
+
|
53
|
+
- (void)_flushStatements
|
54
|
+
{
|
51
55
|
sqlite_finalize_null(&insertStatement);
|
52
56
|
sqlite_finalize_null(&updateStatement);
|
53
57
|
sqlite_finalize_null(&removeStatement);
|
@@ -57,19 +61,16 @@ static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
|
|
57
61
|
/**
|
58
62
|
* Required override method from YapDatabaseExtensionConnection
|
59
63
|
**/
|
60
|
-
- (void)
|
64
|
+
- (void)_flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags
|
61
65
|
{
|
62
|
-
if (
|
66
|
+
if (flags & YapDatabaseConnectionFlushMemoryFlags_Caches)
|
63
67
|
{
|
64
68
|
[queryCache removeAllObjects];
|
65
69
|
}
|
66
70
|
|
67
|
-
if (
|
71
|
+
if (flags & YapDatabaseConnectionFlushMemoryFlags_Statements)
|
68
72
|
{
|
69
|
-
|
70
|
-
sqlite_finalize_null(&updateStatement);
|
71
|
-
sqlite_finalize_null(&removeStatement);
|
72
|
-
sqlite_finalize_null(&removeAllStatement);
|
73
|
+
[self _flushStatements];
|
73
74
|
}
|
74
75
|
}
|
75
76
|
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m
CHANGED
@@ -130,7 +130,10 @@
|
|
130
130
|
|
131
131
|
- (YapDatabaseSecondaryIndexColumn *)columnAtIndex:(NSUInteger)index
|
132
132
|
{
|
133
|
-
|
133
|
+
if (index < [setup count])
|
134
|
+
return [setup objectAtIndex:index];
|
135
|
+
else
|
136
|
+
return nil;
|
134
137
|
}
|
135
138
|
|
136
139
|
- (NSArray *)columnNames
|
@@ -160,6 +163,49 @@
|
|
160
163
|
return [setup countByEnumeratingWithState:state objects:buffer count:length];
|
161
164
|
}
|
162
165
|
|
166
|
+
/**
|
167
|
+
* The columns parameter comes from:
|
168
|
+
* [YapDatabase columnNamesAndAffinityForTable:using:]
|
169
|
+
**/
|
170
|
+
- (BOOL)matchesExistingColumnNamesAndAffinity:(NSDictionary *)columns
|
171
|
+
{
|
172
|
+
// The columns parameter will include the 'rowid' column, which we need to ignore.
|
173
|
+
|
174
|
+
if (([setup count] + 1) != [columns count])
|
175
|
+
{
|
176
|
+
return NO;
|
177
|
+
}
|
178
|
+
|
179
|
+
for (YapDatabaseSecondaryIndexColumn *setupColumn in setup)
|
180
|
+
{
|
181
|
+
NSString *existingAffinity = [columns objectForKey:setupColumn.name];
|
182
|
+
if (existingAffinity == nil)
|
183
|
+
{
|
184
|
+
return NO;
|
185
|
+
}
|
186
|
+
else
|
187
|
+
{
|
188
|
+
if (setupColumn.type == YapDatabaseSecondaryIndexTypeInteger)
|
189
|
+
{
|
190
|
+
if ([existingAffinity caseInsensitiveCompare:@"INTEGER"] != NSOrderedSame)
|
191
|
+
return NO;
|
192
|
+
}
|
193
|
+
else if (setupColumn.type == YapDatabaseSecondaryIndexTypeReal)
|
194
|
+
{
|
195
|
+
if ([existingAffinity caseInsensitiveCompare:@"REAL"] != NSOrderedSame)
|
196
|
+
return NO;
|
197
|
+
}
|
198
|
+
else if (setupColumn.type == YapDatabaseSecondaryIndexTypeText)
|
199
|
+
{
|
200
|
+
if ([existingAffinity caseInsensitiveCompare:@"TEXT"] != NSOrderedSame)
|
201
|
+
return NO;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
return YES;
|
207
|
+
}
|
208
|
+
|
163
209
|
@end
|
164
210
|
|
165
211
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
@@ -181,4 +227,19 @@
|
|
181
227
|
return self;
|
182
228
|
}
|
183
229
|
|
230
|
+
- (NSString *)description
|
231
|
+
{
|
232
|
+
NSString *typeStr;
|
233
|
+
if (type == YapDatabaseSecondaryIndexTypeInteger)
|
234
|
+
typeStr = @"Integer";
|
235
|
+
else if (type == YapDatabaseSecondaryIndexTypeReal)
|
236
|
+
typeStr = @"Real";
|
237
|
+
else if (type == YapDatabaseSecondaryIndexTypeText)
|
238
|
+
typeStr = @"Text";
|
239
|
+
else
|
240
|
+
typeStr = @"Unknown";
|
241
|
+
|
242
|
+
return [NSString stringWithFormat:@"<YapDatabaseSecondaryIndexColumn: name(%@), type(%@)>", name, typeStr];
|
243
|
+
}
|
244
|
+
|
184
245
|
@end
|
@@ -22,11 +22,11 @@
|
|
22
22
|
#endif
|
23
23
|
|
24
24
|
/**
|
25
|
-
*
|
26
|
-
*
|
27
|
-
* and the class can automatically rebuild the tables as needed.
|
25
|
+
* Declare that this class implements YapDatabaseExtensionTransaction_Hooks protocol.
|
26
|
+
* This is done privately, as the protocol is internal.
|
28
27
|
**/
|
29
|
-
|
28
|
+
@interface YapDatabaseSecondaryIndexTransaction () <YapDatabaseExtensionTransaction_Hooks>
|
29
|
+
@end
|
30
30
|
|
31
31
|
|
32
32
|
@implementation YapDatabaseSecondaryIndexTransaction
|
@@ -54,14 +54,17 @@
|
|
54
54
|
**/
|
55
55
|
- (BOOL)createIfNeeded
|
56
56
|
{
|
57
|
-
int oldClassVersion =
|
57
|
+
int oldClassVersion = 0;
|
58
|
+
BOOL hasOldClassVersion = [self getIntValue:&oldClassVersion forExtensionKey:@"classVersion"];
|
58
59
|
int classVersion = YAP_DATABASE_SECONDARY_INDEX_CLASS_VERSION;
|
59
60
|
|
60
61
|
if (oldClassVersion != classVersion)
|
61
62
|
{
|
62
|
-
// First time registration
|
63
|
+
// First time registration (or at least for this version)
|
63
64
|
|
64
|
-
|
65
|
+
if (hasOldClassVersion) {
|
66
|
+
if (![self dropTable]) return NO;
|
67
|
+
}
|
65
68
|
|
66
69
|
if (![self createTable]) return NO;
|
67
70
|
if (![self populate]) return NO;
|
@@ -87,6 +90,53 @@
|
|
87
90
|
|
88
91
|
[self setIntValue:newVersion forExtensionKey:@"version"];
|
89
92
|
}
|
93
|
+
|
94
|
+
// The following code is designed to assist developers in understanding extension changes.
|
95
|
+
// The rules are straight-forward and easy to remember:
|
96
|
+
//
|
97
|
+
// - If you make ANY changes to the configuration of the extension then you MUST change the version.
|
98
|
+
//
|
99
|
+
// For this extension, that means you MUST change the version if ANY of the following are true:
|
100
|
+
//
|
101
|
+
// - you changed the setup
|
102
|
+
// - you changed the block in any meaningful way (which would result in different values for any existing row)
|
103
|
+
//
|
104
|
+
// Note: The code below detects only changes to the setup.
|
105
|
+
// It could theoretically handle such changes, and automatically force a repopulation.
|
106
|
+
// This is a bad idea for two reasons:
|
107
|
+
//
|
108
|
+
// - First, it complicates the rules. The rules, as stated above, are simple. They follow the KISS principle.
|
109
|
+
// Changing these rules would pose a complication that increases cognitive overhead.
|
110
|
+
// It may be easy to remember now, but 6 months from now the nuance has become hazy.
|
111
|
+
// Additionally, the rest of the database system follows the same set of rules.
|
112
|
+
// So adding a complication for just a particular extension is even more confusing.
|
113
|
+
//
|
114
|
+
// - Second, it adds overhead to the registration process.
|
115
|
+
// This sanity check doesn't come for free.
|
116
|
+
// And the overhead is only helpful during the development lifecycle.
|
117
|
+
// It's certainly not something you want in a shipped version.
|
118
|
+
//
|
119
|
+
#if DEBUG
|
120
|
+
else
|
121
|
+
{
|
122
|
+
__unsafe_unretained YapDatabase *database = databaseTransaction->connection->database;
|
123
|
+
sqlite3 *db = databaseTransaction->connection->db;
|
124
|
+
|
125
|
+
NSDictionary *columns = [database columnNamesAndAffinityForTable:[self tableName] using:db];
|
126
|
+
|
127
|
+
YapDatabaseSecondaryIndexSetup *setup = secondaryIndexConnection->secondaryIndex->setup;
|
128
|
+
|
129
|
+
if (![setup matchesExistingColumnNamesAndAffinity:columns])
|
130
|
+
{
|
131
|
+
YDBLogError(@"Error creating secondary index extension (%@):"
|
132
|
+
@" The given setup doesn't match the previously registered setup."
|
133
|
+
@" If you change the setup, or you change the block in any meaningful way,"
|
134
|
+
@" then you MUST change the version as well.",
|
135
|
+
THIS_METHOD);
|
136
|
+
return NO;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
#endif
|
90
140
|
}
|
91
141
|
|
92
142
|
return YES;
|
@@ -108,16 +158,6 @@
|
|
108
158
|
return YES;
|
109
159
|
}
|
110
160
|
|
111
|
-
/**
|
112
|
-
* Internal method.
|
113
|
-
*
|
114
|
-
* This method is used to handle the upgrade process from earlier architectures of this class.
|
115
|
-
**/
|
116
|
-
- (void)upgradeFromForOldClassVersion:(int)oldClassVersion
|
117
|
-
{
|
118
|
-
// Reserved for future use...
|
119
|
-
}
|
120
|
-
|
121
161
|
/**
|
122
162
|
* Internal method.
|
123
163
|
*
|
@@ -591,8 +631,7 @@
|
|
591
631
|
* This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
|
592
632
|
**/
|
593
633
|
- (void)handleInsertObject:(id)object
|
594
|
-
|
595
|
-
inCollection:(NSString *)collection
|
634
|
+
forCollectionKey:(YapCollectionKey *)collectionKey
|
596
635
|
withMetadata:(id)metadata
|
597
636
|
rowid:(int64_t)rowid
|
598
637
|
{
|
@@ -600,6 +639,9 @@
|
|
600
639
|
|
601
640
|
__unsafe_unretained YapDatabaseSecondaryIndex *secondaryIndex = secondaryIndexConnection->secondaryIndex;
|
602
641
|
|
642
|
+
__unsafe_unretained NSString *collection = collectionKey.collection;
|
643
|
+
__unsafe_unretained NSString *key = collectionKey.key;
|
644
|
+
|
603
645
|
// Invoke the block to find out if the object should be included in the index.
|
604
646
|
|
605
647
|
if (secondaryIndex->blockType == YapDatabaseSecondaryIndexBlockTypeWithKey)
|
@@ -650,8 +692,7 @@
|
|
650
692
|
* This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
|
651
693
|
**/
|
652
694
|
- (void)handleUpdateObject:(id)object
|
653
|
-
|
654
|
-
inCollection:(NSString *)collection
|
695
|
+
forCollectionKey:(YapCollectionKey *)collectionKey
|
655
696
|
withMetadata:(id)metadata
|
656
697
|
rowid:(int64_t)rowid
|
657
698
|
{
|
@@ -659,6 +700,9 @@
|
|
659
700
|
|
660
701
|
__unsafe_unretained YapDatabaseSecondaryIndex *secondaryIndex = secondaryIndexConnection->secondaryIndex;
|
661
702
|
|
703
|
+
__unsafe_unretained NSString *collection = collectionKey.collection;
|
704
|
+
__unsafe_unretained NSString *key = collectionKey.key;
|
705
|
+
|
662
706
|
// Invoke the block to find out if the object should be included in the index.
|
663
707
|
|
664
708
|
if (secondaryIndex->blockType == YapDatabaseSecondaryIndexBlockTypeWithKey)
|
@@ -711,15 +755,79 @@
|
|
711
755
|
* YapDatabase extension hook.
|
712
756
|
* This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
|
713
757
|
**/
|
714
|
-
- (void)
|
715
|
-
forKey:(NSString *)key
|
716
|
-
inCollection:(NSString *)collection
|
717
|
-
withRowid:(int64_t)rowid
|
758
|
+
- (void)handleReplaceObject:(id)object forCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
|
718
759
|
{
|
719
760
|
YDBLogAutoTrace();
|
720
761
|
|
721
762
|
__unsafe_unretained YapDatabaseSecondaryIndex *secondaryIndex = secondaryIndexConnection->secondaryIndex;
|
722
763
|
|
764
|
+
__unsafe_unretained NSString *collection = collectionKey.collection;
|
765
|
+
__unsafe_unretained NSString *key = collectionKey.key;
|
766
|
+
|
767
|
+
// Invoke the block to find out if the object should be included in the index.
|
768
|
+
|
769
|
+
id metadata = nil;
|
770
|
+
|
771
|
+
if (secondaryIndex->blockType == YapDatabaseSecondaryIndexBlockTypeWithKey ||
|
772
|
+
secondaryIndex->blockType == YapDatabaseSecondaryIndexBlockTypeWithMetadata)
|
773
|
+
{
|
774
|
+
// Index values are based on the key or object.
|
775
|
+
// Neither have changed, and thus the values haven't changed.
|
776
|
+
|
777
|
+
return;
|
778
|
+
}
|
779
|
+
else
|
780
|
+
{
|
781
|
+
// Index values are based on object or row (object+metadata).
|
782
|
+
// Invoke block to see what the new values are.
|
783
|
+
|
784
|
+
if (secondaryIndex->blockType == YapDatabaseSecondaryIndexBlockTypeWithObject)
|
785
|
+
{
|
786
|
+
__unsafe_unretained YapDatabaseSecondaryIndexWithObjectBlock block =
|
787
|
+
(YapDatabaseSecondaryIndexWithObjectBlock)secondaryIndex->block;
|
788
|
+
|
789
|
+
block(secondaryIndexConnection->blockDict, collection, key, object);
|
790
|
+
}
|
791
|
+
else
|
792
|
+
{
|
793
|
+
__unsafe_unretained YapDatabaseSecondaryIndexWithRowBlock block =
|
794
|
+
(YapDatabaseSecondaryIndexWithRowBlock)secondaryIndex->block;
|
795
|
+
|
796
|
+
metadata = [databaseTransaction objectForCollectionKey:collectionKey withRowid:rowid];
|
797
|
+
block(secondaryIndexConnection->blockDict, collection, key, object, metadata);
|
798
|
+
}
|
799
|
+
|
800
|
+
if ([secondaryIndexConnection->blockDict count] == 0)
|
801
|
+
{
|
802
|
+
// Remove associated values from index (if needed).
|
803
|
+
// This was an update operation, so the rowid may have previously had values in the index.
|
804
|
+
|
805
|
+
[self removeRowid:rowid];
|
806
|
+
}
|
807
|
+
else
|
808
|
+
{
|
809
|
+
// Add values to index (or update them).
|
810
|
+
// This was an update operation, so we need to insert or update.
|
811
|
+
|
812
|
+
[self addRowid:rowid isNew:NO];
|
813
|
+
[secondaryIndexConnection->blockDict removeAllObjects];
|
814
|
+
}
|
815
|
+
}
|
816
|
+
}
|
817
|
+
|
818
|
+
/**
|
819
|
+
* YapDatabase extension hook.
|
820
|
+
* This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
|
821
|
+
**/
|
822
|
+
- (void)handleReplaceMetadata:(id)metadata forCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
|
823
|
+
{
|
824
|
+
YDBLogAutoTrace();
|
825
|
+
|
826
|
+
__unsafe_unretained YapDatabaseSecondaryIndex *secondaryIndex = secondaryIndexConnection->secondaryIndex;
|
827
|
+
|
828
|
+
__unsafe_unretained NSString *collection = collectionKey.collection;
|
829
|
+
__unsafe_unretained NSString *key = collectionKey.key;
|
830
|
+
|
723
831
|
// Invoke the block to find out if the object should be included in the index.
|
724
832
|
|
725
833
|
id object = nil;
|
@@ -749,7 +857,7 @@
|
|
749
857
|
__unsafe_unretained YapDatabaseSecondaryIndexWithRowBlock block =
|
750
858
|
(YapDatabaseSecondaryIndexWithRowBlock)secondaryIndex->block;
|
751
859
|
|
752
|
-
object = [databaseTransaction
|
860
|
+
object = [databaseTransaction objectForCollectionKey:collectionKey withRowid:rowid];
|
753
861
|
block(secondaryIndexConnection->blockDict, collection, key, object, metadata);
|
754
862
|
}
|
755
863
|
|
@@ -775,7 +883,7 @@
|
|
775
883
|
* YapDatabase extension hook.
|
776
884
|
* This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
|
777
885
|
**/
|
778
|
-
- (void)
|
886
|
+
- (void)handleTouchObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
|
779
887
|
{
|
780
888
|
// Nothing to do for this extension
|
781
889
|
}
|
@@ -784,7 +892,7 @@
|
|
784
892
|
* YapDatabase extension hook.
|
785
893
|
* This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
|
786
894
|
**/
|
787
|
-
- (void)
|
895
|
+
- (void)handleTouchMetadataForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
|
788
896
|
{
|
789
897
|
// Nothing to do for this extension
|
790
898
|
}
|
@@ -793,7 +901,7 @@
|
|
793
901
|
* YapDatabase extension hook.
|
794
902
|
* This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
|
795
903
|
**/
|
796
|
-
- (void)
|
904
|
+
- (void)handleRemoveObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
|
797
905
|
{
|
798
906
|
YDBLogAutoTrace();
|
799
907
|
|
@@ -958,11 +1066,9 @@
|
|
958
1066
|
|
959
1067
|
BOOL result = [self _enumerateRowidsMatchingQuery:query usingBlock:^(int64_t rowid, BOOL *stop) {
|
960
1068
|
|
961
|
-
|
962
|
-
NSString *collection = nil;
|
963
|
-
[databaseTransaction getKey:&key collection:&collection forRowid:rowid];
|
1069
|
+
YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
|
964
1070
|
|
965
|
-
block(collection, key, stop);
|
1071
|
+
block(ck.collection, ck.key, stop);
|
966
1072
|
}];
|
967
1073
|
|
968
1074
|
return result;
|
@@ -977,12 +1083,11 @@
|
|
977
1083
|
|
978
1084
|
BOOL result = [self _enumerateRowidsMatchingQuery:query usingBlock:^(int64_t rowid, BOOL *stop) {
|
979
1085
|
|
980
|
-
|
981
|
-
NSString *collection = nil;
|
1086
|
+
YapCollectionKey *ck = nil;
|
982
1087
|
id metadata = nil;
|
983
|
-
[databaseTransaction
|
1088
|
+
[databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
|
984
1089
|
|
985
|
-
block(collection, key, metadata, stop);
|
1090
|
+
block(ck.collection, ck.key, metadata, stop);
|
986
1091
|
}];
|
987
1092
|
|
988
1093
|
return result;
|
@@ -997,12 +1102,11 @@
|
|
997
1102
|
|
998
1103
|
BOOL result = [self _enumerateRowidsMatchingQuery:query usingBlock:^(int64_t rowid, BOOL *stop) {
|
999
1104
|
|
1000
|
-
|
1001
|
-
NSString *collection = nil;
|
1105
|
+
YapCollectionKey *ck = nil;
|
1002
1106
|
id object = nil;
|
1003
|
-
[databaseTransaction
|
1107
|
+
[databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
|
1004
1108
|
|
1005
|
-
block(collection, key, object, stop);
|
1109
|
+
block(ck.collection, ck.key, object, stop);
|
1006
1110
|
}];
|
1007
1111
|
|
1008
1112
|
return result;
|
@@ -1017,13 +1121,12 @@
|
|
1017
1121
|
|
1018
1122
|
BOOL result = [self _enumerateRowidsMatchingQuery:query usingBlock:^(int64_t rowid, BOOL *stop) {
|
1019
1123
|
|
1020
|
-
|
1021
|
-
NSString *collection = nil;
|
1124
|
+
YapCollectionKey *ck = nil;
|
1022
1125
|
id object = nil;
|
1023
1126
|
id metadata = nil;
|
1024
|
-
[databaseTransaction
|
1127
|
+
[databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
|
1025
1128
|
|
1026
|
-
block(collection, key, object, metadata, stop);
|
1129
|
+
block(ck.collection, ck.key, object, metadata, stop);
|
1027
1130
|
}];
|
1028
1131
|
|
1029
1132
|
return result;
|