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
@@ -10,11 +10,36 @@
|
|
10
10
|
NSAssert(NO, @"Missing required method(%@) in class(%@)", NSStringFromSelector(_cmd), [self class]);
|
11
11
|
}
|
12
12
|
|
13
|
+
/**
|
14
|
+
* Subclasses may OPTIONALLY implement this method.
|
15
|
+
*
|
16
|
+
* If an extension class is renamed this method should be used to properly transition.
|
17
|
+
* The extension architecture will verify that a re-registered extension is using the same
|
18
|
+
* extension class that it was previously using. If the class names differ, then the extension architecture
|
19
|
+
* will automatically try to unregister the previous extension using the previous extension class.
|
20
|
+
*
|
21
|
+
* That is, it will attempt to invoke [PreviousExtensionClass dropTablesForRegisteredName: withTransaction:].
|
22
|
+
* Of course this won't work because the PreviousExtensionClass no longer exists.
|
23
|
+
* So the end result is that you will likely see the database spit out a warning like this:
|
24
|
+
*
|
25
|
+
* - Dropping tables for previously registered extension with name(order),
|
26
|
+
* class(YapDatabaseQuack) for new class(YapDatabaseDuck)
|
27
|
+
* - Unable to drop tables for previously registered extension with name(order),
|
28
|
+
* unknown class(YapDatabaseQuack)
|
29
|
+
*
|
30
|
+
* This method helps the extension architecture to understand what's happening, and it won't spit out any warnings.
|
31
|
+
*
|
32
|
+
* The default implementation returns nil.
|
33
|
+
**/
|
13
34
|
+ (NSArray *)previousClassNames
|
14
35
|
{
|
15
36
|
return nil;
|
16
37
|
}
|
17
38
|
|
39
|
+
/**
|
40
|
+
* Read-only property.
|
41
|
+
* Automatically set by YapDatabase instance during the registration process.
|
42
|
+
**/
|
18
43
|
@synthesize registeredName;
|
19
44
|
|
20
45
|
/**
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
return nil;
|
23
23
|
}
|
24
24
|
|
25
|
-
- (void)
|
25
|
+
- (void)_flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags
|
26
26
|
{
|
27
27
|
NSAssert(NO, @"Missing required override method(%@) in class(%@)", NSStringFromSelector(_cmd), [self class]);
|
28
28
|
}
|
data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m
CHANGED
@@ -39,11 +39,29 @@
|
|
39
39
|
return NO;
|
40
40
|
}
|
41
41
|
|
42
|
+
/**
|
43
|
+
* Subclasses may OPTIONALLY implement this method.
|
44
|
+
* This method is only called if within a readwrite transaction.
|
45
|
+
*
|
46
|
+
* Subclasses should ONLY implement this method if they need to make changes to the 'database' table.
|
47
|
+
* That is, the main collection/key/value table that directly stores the user's objects.
|
48
|
+
*
|
49
|
+
* Return NO if the extension does not directly modify the main database table.
|
50
|
+
* Return YES if the extension does modify the main database table,
|
51
|
+
* regardless of whether it made changes during this invocation.
|
52
|
+
*
|
53
|
+
* This method may be invoked several times in a row.
|
54
|
+
**/
|
55
|
+
- (BOOL)flushPendingChangesToMainDatabaseTable
|
56
|
+
{
|
57
|
+
return NO;
|
58
|
+
}
|
59
|
+
|
42
60
|
/**
|
43
61
|
* This method is called if within a readwrite transaction.
|
44
62
|
* This method is optional.
|
45
63
|
**/
|
46
|
-
- (void)
|
64
|
+
- (void)prepareChangeset
|
47
65
|
{
|
48
66
|
// Subclasses may optionally override this method to perform any "cleanup" before the changesets are requested.
|
49
67
|
// Remember, the changesets are requested before the commitTransaction method is invoked.
|
@@ -177,4 +195,10 @@
|
|
177
195
|
[[self databaseTransaction] setDataValue:value forKey:key extension:registeredName];
|
178
196
|
}
|
179
197
|
|
198
|
+
- (void)removeValueForExtensionKey:(NSString *)key
|
199
|
+
{
|
200
|
+
NSString *registeredName = [[[self extensionConnection] extension] registeredName];
|
201
|
+
[[self databaseTransaction] removeValueForKey:key extension:registeredName];
|
202
|
+
}
|
203
|
+
|
180
204
|
@end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#import "YapDatabaseRelationshipEdge.h"
|
2
|
+
|
3
|
+
enum {
|
4
|
+
YDB_EdgeActionNone = 0,
|
5
|
+
YDB_EdgeActionInsert = 1,
|
6
|
+
YDB_EdgeActionUpdate = 2,
|
7
|
+
YDB_EdgeActionDelete = 3
|
8
|
+
};
|
9
|
+
|
10
|
+
enum {
|
11
|
+
YDB_FlagsNone = 0,
|
12
|
+
YDB_FlagsSourceDeleted = 1 << 0,
|
13
|
+
YDB_FlagsDestinationDeleted = 1 << 1,
|
14
|
+
YDB_FlagsBadSource = 1 << 2,
|
15
|
+
YDB_FlagsBadDestination = 1 << 3,
|
16
|
+
YDB_FlagsHasSourceRowid = 1 << 4, // If set, sourceRowid lookup not needed
|
17
|
+
YDB_FlagsHasDestinationRowid = 1 << 5, // If set, destinationRowid lookup not needed
|
18
|
+
YDB_FlagsHasEdgeRowid = 1 << 6,
|
19
|
+
YDB_FlagsNotInDatabase = 1 << 7,
|
20
|
+
};
|
21
|
+
|
22
|
+
|
23
|
+
@interface YapDatabaseRelationshipEdge () {
|
24
|
+
@public
|
25
|
+
|
26
|
+
// Public properties.
|
27
|
+
// Internal code should access these directly.
|
28
|
+
|
29
|
+
NSString *name;
|
30
|
+
|
31
|
+
NSString *sourceKey;
|
32
|
+
NSString *sourceCollection;
|
33
|
+
|
34
|
+
NSString *destinationKey;
|
35
|
+
NSString *destinationCollection;
|
36
|
+
|
37
|
+
NSString *destinationFilePath;
|
38
|
+
|
39
|
+
YDB_NodeDeleteRules nodeDeleteRules;
|
40
|
+
|
41
|
+
BOOL isManualEdge;
|
42
|
+
|
43
|
+
// Internal properties.
|
44
|
+
// Internal code must access these directly.
|
45
|
+
|
46
|
+
int64_t edgeRowid;
|
47
|
+
int64_t sourceRowid;
|
48
|
+
int64_t destinationRowid;
|
49
|
+
|
50
|
+
int edgeAction;
|
51
|
+
int flags;
|
52
|
+
}
|
53
|
+
|
54
|
+
// Init directly from database row
|
55
|
+
- (id)initWithRowid:(int64_t)rowid
|
56
|
+
name:(NSString *)name
|
57
|
+
src:(int64_t)src
|
58
|
+
dst:(int64_t)dst
|
59
|
+
dstFilePath:(NSString *)dstFilePath
|
60
|
+
rules:(int)rules
|
61
|
+
manual:(BOOL)isManual;
|
62
|
+
|
63
|
+
// Copy for YapDatabaseRelationshipNode protocol
|
64
|
+
- (id)copyWithSourceKey:(NSString *)newSrcKey collection:(NSString *)newSrcCollection rowid:(int64_t)newSrcRowid;
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Compares two manual edges to see if they represent the same relationship.
|
68
|
+
* That is, if both edges are manual edges, and the following are equal:
|
69
|
+
*
|
70
|
+
* - name
|
71
|
+
* - sourceKey / sourceCollection
|
72
|
+
* - destinationKey / destinationCollection
|
73
|
+
* - destinationFilePath
|
74
|
+
*
|
75
|
+
* The nodeDeleteRules do NOT need to match.
|
76
|
+
**/
|
77
|
+
- (BOOL)matchesManualEdge:(YapDatabaseRelationshipEdge *)edge;
|
78
|
+
|
79
|
+
@end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#import "YapDatabase.h"
|
4
|
+
#import "YapDatabaseConnection.h"
|
5
|
+
#import "YapDatabaseTransaction.h"
|
6
|
+
|
7
|
+
#import "YapDatabaseRelationship.h"
|
8
|
+
#import "YapDatabaseRelationshipOptions.h"
|
9
|
+
#import "YapDatabaseRelationshipConnection.h"
|
10
|
+
#import "YapDatabaseRelationshipTransaction.h"
|
11
|
+
|
12
|
+
#import "YapDatabasePrivate.h"
|
13
|
+
#import "YapDatabaseExtensionPrivate.h"
|
14
|
+
|
15
|
+
/**
|
16
|
+
* This version number is stored in the yap2 table.
|
17
|
+
* If there is a major re-write to this class, then the version number will be incremented,
|
18
|
+
* and the class can automatically rebuild the table as needed.
|
19
|
+
**/
|
20
|
+
#define YAP_DATABASE_RELATIONSHIP_CLASS_VERSION 3
|
21
|
+
|
22
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
23
|
+
#pragma mark -
|
24
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
25
|
+
|
26
|
+
@interface YapDatabaseRelationship () {
|
27
|
+
@public
|
28
|
+
|
29
|
+
int version;
|
30
|
+
YapDatabaseRelationshipOptions *options;
|
31
|
+
}
|
32
|
+
|
33
|
+
- (NSString *)tableName;
|
34
|
+
|
35
|
+
/**
|
36
|
+
* The dispatch queue for performing file deletion operations.
|
37
|
+
* Note: This method is not thread-safe, as it expects to only be invoked from within a read-write transaction.
|
38
|
+
**/
|
39
|
+
- (dispatch_queue_t)fileManagerQueue;
|
40
|
+
|
41
|
+
@end
|
42
|
+
|
43
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
44
|
+
#pragma mark -
|
45
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
46
|
+
|
47
|
+
@interface YapDatabaseRelationshipOptions () {
|
48
|
+
@public
|
49
|
+
|
50
|
+
BOOL disableYapDatabaseRelationshipNodeProtocol;
|
51
|
+
NSSet *allowedCollections;
|
52
|
+
}
|
53
|
+
|
54
|
+
@end
|
55
|
+
|
56
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
57
|
+
#pragma mark -
|
58
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
59
|
+
|
60
|
+
@interface YapDatabaseRelationshipConnection () {
|
61
|
+
@public
|
62
|
+
|
63
|
+
__strong YapDatabaseRelationship *relationship;
|
64
|
+
__unsafe_unretained YapDatabaseConnection *databaseConnection;
|
65
|
+
|
66
|
+
NSMutableDictionary *protocolChanges; // key:(NSNumber *)srcRowidNumber, value:(NSMutableArray *)edges
|
67
|
+
NSMutableDictionary *manualChanges; // key:(NSString *)edgeName, value:(NSMutableArray *)edges
|
68
|
+
|
69
|
+
NSMutableSet *inserted; // contains:(NSNumber *)rowidNumber
|
70
|
+
|
71
|
+
NSMutableArray *deletedOrder; // contains:(NSNumber *)rowidNumber
|
72
|
+
NSMutableDictionary *deletedInfo; // key:(NSNumber *)rowidNumber, value:(YapCollectionKey *)collectionKey
|
73
|
+
|
74
|
+
NSMutableSet *filesToDelete;
|
75
|
+
|
76
|
+
// NSMutableSet *mutatedSomething;
|
77
|
+
}
|
78
|
+
|
79
|
+
- (id)initWithRelationship:(YapDatabaseRelationship *)relationship databaseConnection:(YapDatabaseConnection *)dbc;
|
80
|
+
|
81
|
+
- (void)postRollbackCleanup;
|
82
|
+
- (void)postCommitCleanup;
|
83
|
+
|
84
|
+
- (sqlite3_stmt *)findManualEdgeStatement;
|
85
|
+
- (sqlite3_stmt *)insertEdgeStatement;
|
86
|
+
- (sqlite3_stmt *)updateEdgeStatement;
|
87
|
+
- (sqlite3_stmt *)deleteEdgeStatement;
|
88
|
+
- (sqlite3_stmt *)deleteEdgesWithNodeStatement;
|
89
|
+
- (sqlite3_stmt *)enumerateAllDstFilePathStatement;
|
90
|
+
- (sqlite3_stmt *)enumerateForSrcStatement;
|
91
|
+
- (sqlite3_stmt *)enumerateForDstStatement;
|
92
|
+
- (sqlite3_stmt *)enumerateForSrcNameStatement;
|
93
|
+
- (sqlite3_stmt *)enumerateForDstNameStatement;
|
94
|
+
- (sqlite3_stmt *)enumerateForNameStatement;
|
95
|
+
- (sqlite3_stmt *)enumerateForSrcDstStatement;
|
96
|
+
- (sqlite3_stmt *)enumerateForSrcDstNameStatement;
|
97
|
+
- (sqlite3_stmt *)countForSrcNameExcludingDstStatement;
|
98
|
+
- (sqlite3_stmt *)countForDstNameExcludingSrcStatement;
|
99
|
+
- (sqlite3_stmt *)countForNameStatement;
|
100
|
+
- (sqlite3_stmt *)countForSrcStatement;
|
101
|
+
- (sqlite3_stmt *)countForSrcNameStatement;
|
102
|
+
- (sqlite3_stmt *)countForDstStatement;
|
103
|
+
- (sqlite3_stmt *)countForDstNameStatement;
|
104
|
+
- (sqlite3_stmt *)countForSrcDstStatement;
|
105
|
+
- (sqlite3_stmt *)countForSrcDstNameStatement;
|
106
|
+
- (sqlite3_stmt *)removeAllStatement;
|
107
|
+
- (sqlite3_stmt *)removeAllProtocolStatement;
|
108
|
+
|
109
|
+
@end
|
110
|
+
|
111
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
112
|
+
#pragma mark -
|
113
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
114
|
+
|
115
|
+
@interface YapDatabaseRelationshipTransaction () {
|
116
|
+
@protected
|
117
|
+
|
118
|
+
__unsafe_unretained YapDatabaseRelationshipConnection *relationshipConnection;
|
119
|
+
__unsafe_unretained YapDatabaseReadTransaction *databaseTransaction;
|
120
|
+
}
|
121
|
+
|
122
|
+
- (id)initWithRelationshipConnection:(YapDatabaseRelationshipConnection *)relationshipConnection
|
123
|
+
databaseTransaction:(YapDatabaseReadTransaction *)databaseTransaction;
|
124
|
+
|
125
|
+
@end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#import "YapDatabaseExtension.h"
|
4
|
+
|
5
|
+
#import "YapDatabaseRelationshipNode.h"
|
6
|
+
#import "YapDatabaseRelationshipEdge.h"
|
7
|
+
#import "YapDatabaseRelationshipOptions.h"
|
8
|
+
#import "YapDatabaseRelationshipConnection.h"
|
9
|
+
#import "YapDatabaseRelationshipTransaction.h"
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Welcome to YapDatabase!
|
13
|
+
*
|
14
|
+
* The project page has a wealth of documentation if you have any questions.
|
15
|
+
* https://github.com/yaptv/YapDatabase
|
16
|
+
*
|
17
|
+
* If you're new to the project you may want to visit the wiki.
|
18
|
+
* https://github.com/yaptv/YapDatabase/wiki
|
19
|
+
*
|
20
|
+
* The YapDatabaseRelationship extension allow you to create relationships between objects,
|
21
|
+
* and configure automatic deletion rules.
|
22
|
+
*
|
23
|
+
* For tons of information about this extension, see the wiki article:
|
24
|
+
* https://github.com/yaptv/YapDatabase/wiki/Relationships
|
25
|
+
**/
|
26
|
+
|
27
|
+
@interface YapDatabaseRelationship : YapDatabaseExtension
|
28
|
+
|
29
|
+
- (id)init;
|
30
|
+
|
31
|
+
- (id)initWithVersion:(int)version;
|
32
|
+
|
33
|
+
- (id)initWithVersion:(int)version options:(YapDatabaseRelationshipOptions *)options;
|
34
|
+
|
35
|
+
@end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
#import "YapDatabaseRelationship.h"
|
2
|
+
#import "YapDatabaseRelationshipPrivate.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 YapDatabaseRelationship
|
25
|
+
{
|
26
|
+
dispatch_queue_t fileManagerQueue;
|
27
|
+
}
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Subclasses MUST implement this method.
|
31
|
+
*
|
32
|
+
* This method is used when unregistering an extension in order to drop the related tables.
|
33
|
+
**/
|
34
|
+
+ (void)dropTablesForRegisteredName:(NSString *)registeredName
|
35
|
+
withTransaction:(YapDatabaseReadWriteTransaction *)transaction
|
36
|
+
{
|
37
|
+
sqlite3 *db = transaction->connection->db;
|
38
|
+
|
39
|
+
NSString *tableName = [self tableNameForRegisteredName:registeredName];
|
40
|
+
NSString *dropTable = [NSString stringWithFormat:@"DROP TABLE IF EXISTS \"%@\";", tableName];
|
41
|
+
|
42
|
+
int status = sqlite3_exec(db, [dropTable UTF8String], NULL, NULL, NULL);
|
43
|
+
if (status != SQLITE_OK)
|
44
|
+
{
|
45
|
+
YDBLogError(@"%@ - Failed dropping table (%@): %d %s",
|
46
|
+
THIS_METHOD, tableName, status, sqlite3_errmsg(db));
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
+ (NSString *)tableNameForRegisteredName:(NSString *)registeredName
|
51
|
+
{
|
52
|
+
return [NSString stringWithFormat:@"relationship_%@", registeredName];
|
53
|
+
}
|
54
|
+
|
55
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
56
|
+
#pragma mark Instance
|
57
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
58
|
+
|
59
|
+
- (id)init
|
60
|
+
{
|
61
|
+
return [self initWithVersion:0 options:nil];
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
- (id)initWithVersion:(int)inVersion
|
66
|
+
{
|
67
|
+
return [self initWithVersion:inVersion options:nil];
|
68
|
+
}
|
69
|
+
|
70
|
+
- (id)initWithVersion:(int)inVersion options:(YapDatabaseRelationshipOptions *)inOptions
|
71
|
+
{
|
72
|
+
if ((self = [super init]))
|
73
|
+
{
|
74
|
+
version = inVersion;
|
75
|
+
options = inOptions ? [inOptions copy] : [[YapDatabaseRelationshipOptions alloc] init];
|
76
|
+
}
|
77
|
+
return self;
|
78
|
+
}
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Subclasses must implement this method.
|
82
|
+
* This method is called during the view registration process to enusre the extension supports
|
83
|
+
* the database configuration.
|
84
|
+
**/
|
85
|
+
- (BOOL)supportsDatabase:(YapDatabase *)database withRegisteredExtensions:(NSDictionary *)registeredExtensions
|
86
|
+
{
|
87
|
+
// Only 1 relationship extension is supported at a time.
|
88
|
+
|
89
|
+
__block BOOL supported = YES;
|
90
|
+
|
91
|
+
[registeredExtensions enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
|
92
|
+
|
93
|
+
if ([obj isKindOfClass:[YapDatabaseRelationship class]])
|
94
|
+
{
|
95
|
+
YDBLogWarn(@"Only 1 YapDatabaseRelationship instance is supported at a time");
|
96
|
+
|
97
|
+
supported = NO;
|
98
|
+
*stop = YES;
|
99
|
+
}
|
100
|
+
}];
|
101
|
+
|
102
|
+
return supported;
|
103
|
+
}
|
104
|
+
|
105
|
+
- (YapDatabaseExtensionConnection *)newConnection:(YapDatabaseConnection *)databaseConnection
|
106
|
+
{
|
107
|
+
return [[YapDatabaseRelationshipConnection alloc] initWithRelationship:self databaseConnection:databaseConnection];
|
108
|
+
}
|
109
|
+
|
110
|
+
- (NSString *)tableName
|
111
|
+
{
|
112
|
+
return [[self class] tableNameForRegisteredName:self.registeredName];
|
113
|
+
}
|
114
|
+
|
115
|
+
/**
|
116
|
+
* The dispatch queue for performing file deletion operations.
|
117
|
+
* Note: This method is not thread-safe, as it expects to only be invoked from within a read-write transaction.
|
118
|
+
**/
|
119
|
+
- (dispatch_queue_t)fileManagerQueue
|
120
|
+
{
|
121
|
+
if (fileManagerQueue == NULL)
|
122
|
+
{
|
123
|
+
fileManagerQueue = dispatch_queue_create("YapDatabaseRelationship.fileManager", DISPATCH_QUEUE_SERIAL);
|
124
|
+
}
|
125
|
+
|
126
|
+
return fileManagerQueue;
|
127
|
+
}
|
128
|
+
|
129
|
+
@end
|