motion-yapper 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/.travis.yml +6 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +63 -0
- data/README.md +16 -0
- data/Rakefile +20 -0
- data/app/app_delegate.rb +5 -0
- data/lib/yapper.rb +30 -0
- data/lib/yapper/attachment.rb +48 -0
- data/lib/yapper/bson.rb +20 -0
- data/lib/yapper/config.rb +18 -0
- data/lib/yapper/db.rb +151 -0
- data/lib/yapper/document.rb +54 -0
- data/lib/yapper/document/attachment.rb +26 -0
- data/lib/yapper/document/callbacks.rb +86 -0
- data/lib/yapper/document/persistance.rb +171 -0
- data/lib/yapper/document/relation.rb +84 -0
- data/lib/yapper/document/selection.rb +100 -0
- data/lib/yapper/extensions.rb +80 -0
- data/lib/yapper/log.rb +5 -0
- data/lib/yapper/sync.rb +134 -0
- data/lib/yapper/sync/data.rb +12 -0
- data/lib/yapper/sync/event.rb +194 -0
- data/lib/yapper/sync/queue.rb +164 -0
- data/lib/yapper/timestamps.rb +16 -0
- data/lib/yapper/version.rb +3 -0
- data/lib/yapper/yapper.rb +2 -0
- data/spec/helpers/time_helper.rb +3 -0
- data/spec/integration/all_spec.rb +40 -0
- data/spec/integration/callback_spec.rb +87 -0
- data/spec/integration/db_spec.rb +40 -0
- data/spec/integration/find_spec.rb +51 -0
- data/spec/integration/persistance_spec.rb +118 -0
- data/spec/integration/relation_spec.rb +174 -0
- data/spec/integration/sync_spec.rb +42 -0
- data/spec/integration/timestamps_spec.rb +34 -0
- data/spec/integration/types_spec.rb +23 -0
- data/spec/integration/when_spec.rb +29 -0
- data/spec/integration/where_spec.rb +132 -0
- data/vendor/Podfile.lock +24 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +1396 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +327 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +321 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +150 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +157 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +143 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +848 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +167 -0
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +191 -0
- data/vendor/Pods/AFNetworking/LICENSE +19 -0
- data/vendor/Pods/AFNetworking/README.md +208 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +601 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/BuildHeaders/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +109 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +90 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +20 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +121 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +186 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +74 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +17 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +41 -0
- data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +15 -0
- data/vendor/Pods/CocoaLumberjack/LICENSE.txt +18 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +99 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +727 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1353 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +601 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +1083 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1479 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.m +191 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +251 -0
- data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +7 -0
- data/vendor/Pods/CocoaLumberjack/README.markdown +37 -0
- data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +641 -0
- data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +133 -0
- data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +113 -0
- data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +71 -0
- data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +75 -0
- data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +43 -0
- data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +68 -0
- data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +370 -0
- data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +89 -0
- data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +78 -0
- data/vendor/Pods/Headers/CocoaLumberjack/ContextFilterLogFormatter.h +65 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +41 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +102 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +334 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +601 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +167 -0
- data/vendor/Pods/Headers/CocoaLumberjack/DispatchQueueLogFormatter.h +116 -0
- data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/Headers/Reachability/Reachability.h +109 -0
- data/vendor/Pods/Headers/YapDatabase/YapCache.h +90 -0
- data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +20 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +121 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +186 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +74 -0
- data/vendor/Pods/Headers/YapDatabase/YapNull.h +17 -0
- data/vendor/Pods/Headers/YapDatabase/YapSet.h +41 -0
- data/vendor/Pods/Headers/YapDatabase/YapTouch.h +15 -0
- data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +17 -0
- data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +5 -0
- data/vendor/Pods/Headers/____Pods-environment.h +38 -0
- data/vendor/Pods/Manifest.lock +24 -0
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +18 -0
- data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +39 -0
- data/vendor/Pods/NSData+MD5Digest/README.md +11 -0
- data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-AFNetworking-dummy.m +5 -0
- data/vendor/Pods/Pods-AFNetworking-prefix.pch +17 -0
- data/vendor/Pods/Pods-AFNetworking.xcconfig +1 -0
- data/vendor/Pods/Pods-Acknowledgements.markdown +96 -0
- data/vendor/Pods/Pods-Acknowledgements.plist +142 -0
- data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +5 -0
- data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +5 -0
- data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
- data/vendor/Pods/Pods-Reachability-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-Reachability-dummy.m +5 -0
- data/vendor/Pods/Pods-Reachability-prefix.pch +5 -0
- data/vendor/Pods/Pods-Reachability.xcconfig +1 -0
- data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +5 -0
- data/vendor/Pods/Pods-YapDatabase-dummy.m +5 -0
- data/vendor/Pods/Pods-YapDatabase-prefix.pch +5 -0
- data/vendor/Pods/Pods-YapDatabase.xcconfig +1 -0
- data/vendor/Pods/Pods-dummy.m +5 -0
- data/vendor/Pods/Pods-environment.h +38 -0
- data/vendor/Pods/Pods-resources.sh +68 -0
- data/vendor/Pods/Pods.bridgesupport +5096 -0
- data/vendor/Pods/Pods.xcconfig +5 -0
- data/vendor/Pods/Pods.xcodeproj/project.pbxproj +5536 -0
- data/vendor/Pods/Reachability/LICENCE.txt +24 -0
- data/vendor/Pods/Reachability/README.md +65 -0
- data/vendor/Pods/Reachability/Reachability.h +109 -0
- data/vendor/Pods/Reachability/Reachability.m +527 -0
- data/vendor/Pods/YapDatabase/LICENSE.txt +18 -0
- data/vendor/Pods/YapDatabase/README.md +30 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +19 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +108 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +175 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +12 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +41 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +39 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +966 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +69 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +89 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +146 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +32 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +298 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +79 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +95 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +68 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +1352 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +440 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +15 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +58 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +11 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +46 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +11 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +180 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +73 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +100 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +149 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +33 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +330 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +33 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +184 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +58 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +1166 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +94 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +72 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +36 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +296 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +27 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +28 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +153 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +272 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +2494 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +825 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +1567 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +330 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +141 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +186 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +191 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +115 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +897 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +56 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +27 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +447 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +4505 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +90 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +453 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +29 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +48 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +37 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +83 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +158 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +73 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +56 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +424 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +13 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +26 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +121 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +74 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +603 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +17 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +31 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +15 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +31 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +20 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +194 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +42 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +96 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +41 -0
- data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +82 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +547 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +2022 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +447 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +3874 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +541 -0
- data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +5282 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +13 -0
- data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -0
- data/yapper.gemspec +24 -0
- metadata +458 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
#import "YapDatabaseManager.h"
|
2
|
+
#import <libkern/OSAtomic.h>
|
3
|
+
|
4
|
+
/**
|
5
|
+
* There should only be one YapDatabase or YapCollectionDatabase per file.
|
6
|
+
*
|
7
|
+
* The architecture design is to create a single parent database instance,
|
8
|
+
* and then spawn connections to the database as needed from the parent.
|
9
|
+
*
|
10
|
+
* The architecture is built around this restriction, and is dependent upon it for proper operation.
|
11
|
+
* This class simply helps maintain this requirement.
|
12
|
+
**/
|
13
|
+
@implementation YapDatabaseManager
|
14
|
+
|
15
|
+
static NSMutableSet *registeredPaths;
|
16
|
+
static OSSpinLock lock;
|
17
|
+
|
18
|
+
+ (void)initialize
|
19
|
+
{
|
20
|
+
static dispatch_once_t onceToken;
|
21
|
+
dispatch_once(&onceToken, ^{
|
22
|
+
|
23
|
+
registeredPaths = [[NSMutableSet alloc] init];
|
24
|
+
lock = OS_SPINLOCK_INIT;
|
25
|
+
});
|
26
|
+
}
|
27
|
+
|
28
|
+
+ (BOOL)registerDatabaseForPath:(NSString *)inPath
|
29
|
+
{
|
30
|
+
NSString *path = [inPath stringByStandardizingPath];
|
31
|
+
if (path == nil) return NO;
|
32
|
+
|
33
|
+
BOOL result = NO;
|
34
|
+
|
35
|
+
OSSpinLockLock(&lock);
|
36
|
+
if (![registeredPaths containsObject:path])
|
37
|
+
{
|
38
|
+
[registeredPaths addObject:path];
|
39
|
+
result = YES;
|
40
|
+
}
|
41
|
+
OSSpinLockUnlock(&lock);
|
42
|
+
|
43
|
+
return result;
|
44
|
+
}
|
45
|
+
|
46
|
+
+ (void)deregisterDatabaseForPath:(NSString *)inPath
|
47
|
+
{
|
48
|
+
NSString *path = [inPath stringByStandardizingPath];
|
49
|
+
if (path == nil) return;
|
50
|
+
|
51
|
+
OSSpinLockLock(&lock);
|
52
|
+
[registeredPaths removeObject:path];
|
53
|
+
OSSpinLockUnlock(&lock);
|
54
|
+
}
|
55
|
+
|
56
|
+
@end
|
@@ -0,0 +1,424 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
#import "YapDatabase.h"
|
4
|
+
#import "YapDatabaseDefaults.h"
|
5
|
+
#import "YapDatabaseConnection.h"
|
6
|
+
#import "YapDatabaseTransaction.h"
|
7
|
+
#import "YapDatabaseExtension.h"
|
8
|
+
|
9
|
+
#import "YapCache.h"
|
10
|
+
#import "YapMemoryTable.h"
|
11
|
+
|
12
|
+
#import "sqlite3.h"
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Helper method to conditionally invoke sqlite3_finalize on a statement, and then set the ivar to NULL.
|
16
|
+
**/
|
17
|
+
NS_INLINE void sqlite_finalize_null(sqlite3_stmt **stmtPtr)
|
18
|
+
{
|
19
|
+
if (*stmtPtr) {
|
20
|
+
sqlite3_finalize(*stmtPtr);
|
21
|
+
*stmtPtr = NULL;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
extern NSString *const YapDatabaseRegisteredExtensionsKey;
|
26
|
+
extern NSString *const YapDatabaseRegisteredTablesKey;
|
27
|
+
extern NSString *const YapDatabaseExtensionsOrderKey;
|
28
|
+
extern NSString *const YapDatabaseNotificationKey;
|
29
|
+
|
30
|
+
@interface YapDatabase () {
|
31
|
+
@private
|
32
|
+
|
33
|
+
NSMutableArray *changesets;
|
34
|
+
uint64_t snapshot;
|
35
|
+
|
36
|
+
dispatch_queue_t internalQueue;
|
37
|
+
dispatch_queue_t checkpointQueue;
|
38
|
+
|
39
|
+
YapDatabaseDefaults *defaults;
|
40
|
+
|
41
|
+
NSDictionary *registeredExtensions;
|
42
|
+
NSDictionary *registeredTables;
|
43
|
+
|
44
|
+
NSDictionary *extensionDependencies;
|
45
|
+
NSArray *extensionsOrder;
|
46
|
+
|
47
|
+
YapDatabaseConnection *registrationConnection;
|
48
|
+
|
49
|
+
NSUInteger maxConnectionPoolCount;
|
50
|
+
NSTimeInterval connectionPoolLifetime;
|
51
|
+
dispatch_source_t connectionPoolTimer;
|
52
|
+
NSMutableArray *connectionPoolValues;
|
53
|
+
NSMutableArray *connectionPoolDates;
|
54
|
+
|
55
|
+
sqlite3 *db; // Used for setup & checkpoints
|
56
|
+
|
57
|
+
@public
|
58
|
+
|
59
|
+
void *IsOnSnapshotQueueKey; // Only to be used by YapDatabaseConnection
|
60
|
+
void *IsOnWriteQueueKey; // Only to be used by YapDatabaseConnection
|
61
|
+
|
62
|
+
dispatch_queue_t snapshotQueue; // Only to be used by YapDatabaseConnection
|
63
|
+
dispatch_queue_t writeQueue; // Only to be used by YapDatabaseConnection
|
64
|
+
|
65
|
+
NSMutableArray *connectionStates; // Only to be used by YapDatabaseConnection
|
66
|
+
|
67
|
+
NSArray *previouslyRegisteredExtensionNames; // Only to be used by YapDatabaseConnection
|
68
|
+
|
69
|
+
YapDatabaseSerializer objectSerializer; // Read-only by transactions
|
70
|
+
YapDatabaseDeserializer objectDeserializer; // Read-only by transactions
|
71
|
+
|
72
|
+
YapDatabaseSerializer metadataSerializer; // Read-only by transactions
|
73
|
+
YapDatabaseDeserializer metadataDeserializer; // Read-only by transactions
|
74
|
+
|
75
|
+
YapDatabaseSanitizer objectSanitizer; // Read-only by transactions
|
76
|
+
YapDatabaseSanitizer metadataSanitizer; // Read-only by transactions
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* General utility methods.
|
81
|
+
**/
|
82
|
+
- (BOOL)tableExists:(NSString *)tableName using:(sqlite3 *)aDb;
|
83
|
+
- (NSArray *)columnNamesForTable:(NSString *)tableName using:(sqlite3 *)aDb;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* New connections inherit their default values from this structure.
|
87
|
+
**/
|
88
|
+
- (YapDatabaseDefaults *)defaults;
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Called from YapDatabaseConnection's dealloc method to remove connection's state from connectionStates array.
|
92
|
+
**/
|
93
|
+
- (void)removeConnection:(YapDatabaseConnection *)connection;
|
94
|
+
|
95
|
+
/**
|
96
|
+
* YapDatabaseConnection uses these methods to recycle sqlite3 instances using the connection pool.
|
97
|
+
**/
|
98
|
+
- (BOOL)connectionPoolEnqueue:(sqlite3 *)aDb;
|
99
|
+
- (sqlite3 *)connectionPoolDequeue;
|
100
|
+
|
101
|
+
/**
|
102
|
+
* These methods are only accessible from within the snapshotQueue.
|
103
|
+
* Used by [YapDatabaseConnection prepare].
|
104
|
+
**/
|
105
|
+
- (NSDictionary *)registeredTables;
|
106
|
+
- (NSArray *)extensionsOrder;
|
107
|
+
|
108
|
+
/**
|
109
|
+
* This method is only accessible from within the snapshotQueue.
|
110
|
+
*
|
111
|
+
* Prior to starting the sqlite commit, the connection must report its changeset to the database.
|
112
|
+
* The database will store the changeset, and provide it to other connections if needed (due to a race condition).
|
113
|
+
*
|
114
|
+
* The following MUST be in the dictionary:
|
115
|
+
*
|
116
|
+
* - snapshot : NSNumber with the changeset's snapshot
|
117
|
+
**/
|
118
|
+
- (void)notePendingChanges:(NSDictionary *)changeset fromConnection:(YapDatabaseConnection *)connection;
|
119
|
+
|
120
|
+
/**
|
121
|
+
* This method is only accessible from within the snapshotQueue.
|
122
|
+
*
|
123
|
+
* This method is used if a transaction finds itself in a race condition.
|
124
|
+
* That is, the transaction started before it was able to process changesets from sibling connections.
|
125
|
+
*
|
126
|
+
* It should fetch the changesets needed and then process them via [connection noteCommittedChanges:].
|
127
|
+
**/
|
128
|
+
- (NSArray *)pendingAndCommittedChangesSince:(uint64_t)connectionSnapshot until:(uint64_t)maxSnapshot;
|
129
|
+
|
130
|
+
/**
|
131
|
+
* This method is only accessible from within the snapshotQueue.
|
132
|
+
*
|
133
|
+
* Upon completion of a readwrite transaction, the connection must report its changeset to the database.
|
134
|
+
* The database will then forward the changeset to all other connections.
|
135
|
+
*
|
136
|
+
* The following MUST be in the dictionary:
|
137
|
+
*
|
138
|
+
* - snapshot : NSNumber with the changeset's snapshot
|
139
|
+
**/
|
140
|
+
- (void)noteCommittedChanges:(NSDictionary *)changeset fromConnection:(YapDatabaseConnection *)connection;
|
141
|
+
|
142
|
+
/**
|
143
|
+
* This method should be called whenever the maximum checkpointable snapshot is incremented.
|
144
|
+
* That is, the state of every connection is known to the system.
|
145
|
+
* And a snaphot cannot be checkpointed until every connection is at or past that snapshot.
|
146
|
+
* Thus, we can know the point at which a snapshot becomes checkpointable,
|
147
|
+
* and we can thus optimize the checkpoint invocations such that
|
148
|
+
* each invocation is able to checkpoint one or more commits.
|
149
|
+
**/
|
150
|
+
- (void)asyncCheckpoint:(uint64_t)maxCheckpointableSnapshot;
|
151
|
+
|
152
|
+
@end
|
153
|
+
|
154
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
155
|
+
#pragma mark -
|
156
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
157
|
+
|
158
|
+
@interface YapDatabaseConnection () {
|
159
|
+
@private
|
160
|
+
uint64_t snapshot;
|
161
|
+
|
162
|
+
id sharedKeySetForInternalChangeset;
|
163
|
+
id sharedKeySetForExternalChangeset;
|
164
|
+
|
165
|
+
YapDatabaseReadTransaction *longLivedReadTransaction;
|
166
|
+
BOOL throwExceptionsForImplicitlyEndingLongLivedReadTransaction;
|
167
|
+
NSMutableArray *pendingChangesets;
|
168
|
+
NSMutableArray *processedChangesets;
|
169
|
+
|
170
|
+
NSDictionary *registeredExtensions;
|
171
|
+
BOOL registeredExtensionsChanged;
|
172
|
+
|
173
|
+
NSDictionary *registeredTables;
|
174
|
+
BOOL registeredTablesChanged;
|
175
|
+
|
176
|
+
NSMutableDictionary *extensions;
|
177
|
+
BOOL extensionsReady;
|
178
|
+
id sharedKeySetForExtensions;
|
179
|
+
|
180
|
+
@public
|
181
|
+
__strong YapDatabase *database;
|
182
|
+
|
183
|
+
sqlite3 *db;
|
184
|
+
|
185
|
+
dispatch_queue_t connectionQueue; // Only for YapDatabaseExtensionConnection subclasses
|
186
|
+
void *IsOnConnectionQueueKey; // Only for YapDatabaseExtensionConnection subclasses
|
187
|
+
|
188
|
+
NSArray *extensionsOrder; // Read-only by YapDatabaseTransaction
|
189
|
+
|
190
|
+
BOOL hasDiskChanges;
|
191
|
+
|
192
|
+
YapCache *objectCache;
|
193
|
+
YapCache *metadataCache;
|
194
|
+
|
195
|
+
NSUInteger objectCacheLimit; // Read-only by transaction. Use as consideration of whether to add to cache.
|
196
|
+
NSUInteger metadataCacheLimit; // Read-only by transaction. Use as consideration of whether to add to cache.
|
197
|
+
|
198
|
+
YapDatabasePolicy objectPolicy; // Read-only by transaction. Use to determine what goes in objectChanges.
|
199
|
+
YapDatabasePolicy metadataPolicy; // Read-only by transaction. Use to determine what goes in metadataChanges.
|
200
|
+
|
201
|
+
BOOL needsMarkSqlLevelSharedReadLock; // Read-only by transaction. Use as consideration of whether to invoke method.
|
202
|
+
|
203
|
+
NSMutableDictionary *objectChanges;
|
204
|
+
NSMutableDictionary *metadataChanges;
|
205
|
+
NSMutableSet *removedKeys;
|
206
|
+
NSMutableSet *removedCollections;
|
207
|
+
BOOL allKeysRemoved;
|
208
|
+
}
|
209
|
+
|
210
|
+
- (id)initWithDatabase:(YapDatabase *)database;
|
211
|
+
|
212
|
+
- (sqlite3_stmt *)beginTransactionStatement;
|
213
|
+
- (sqlite3_stmt *)commitTransactionStatement;
|
214
|
+
- (sqlite3_stmt *)rollbackTransactionStatement;
|
215
|
+
|
216
|
+
- (sqlite3_stmt *)yapGetDataForKeyStatement; // Against "yap" database, for internal use
|
217
|
+
- (sqlite3_stmt *)yapSetDataForKeyStatement; // Against "yap" database, for internal use
|
218
|
+
- (sqlite3_stmt *)yapRemoveExtensionStatement; // Against "yap" database, for internal use
|
219
|
+
|
220
|
+
- (sqlite3_stmt *)getCollectionCountStatement;
|
221
|
+
- (sqlite3_stmt *)getKeyCountForCollectionStatement;
|
222
|
+
- (sqlite3_stmt *)getKeyCountForAllStatement;
|
223
|
+
- (sqlite3_stmt *)getCountForRowidStatement;
|
224
|
+
- (sqlite3_stmt *)getRowidForKeyStatement;
|
225
|
+
- (sqlite3_stmt *)getKeyForRowidStatement;
|
226
|
+
- (sqlite3_stmt *)getKeyDataForRowidStatement;
|
227
|
+
- (sqlite3_stmt *)getKeyMetadataForRowidStatement;
|
228
|
+
- (sqlite3_stmt *)getDataForRowidStatement;
|
229
|
+
- (sqlite3_stmt *)getAllForRowidStatement;
|
230
|
+
- (sqlite3_stmt *)getDataForKeyStatement;
|
231
|
+
- (sqlite3_stmt *)getMetadataForKeyStatement;
|
232
|
+
- (sqlite3_stmt *)getAllForKeyStatement;
|
233
|
+
- (sqlite3_stmt *)insertForRowidStatement;
|
234
|
+
- (sqlite3_stmt *)updateAllForRowidStatement;
|
235
|
+
- (sqlite3_stmt *)updateMetadataForRowidStatement;
|
236
|
+
- (sqlite3_stmt *)removeForRowidStatement;
|
237
|
+
- (sqlite3_stmt *)removeCollectionStatement;
|
238
|
+
- (sqlite3_stmt *)removeAllStatement;
|
239
|
+
- (sqlite3_stmt *)enumerateCollectionsStatement;
|
240
|
+
- (sqlite3_stmt *)enumerateCollectionsForKeyStatement;
|
241
|
+
- (sqlite3_stmt *)enumerateKeysInCollectionStatement;
|
242
|
+
- (sqlite3_stmt *)enumerateKeysInAllCollectionsStatement;
|
243
|
+
- (sqlite3_stmt *)enumerateKeysAndMetadataInCollectionStatement;
|
244
|
+
- (sqlite3_stmt *)enumerateKeysAndMetadataInAllCollectionsStatement;
|
245
|
+
- (sqlite3_stmt *)enumerateKeysAndObjectsInCollectionStatement;
|
246
|
+
- (sqlite3_stmt *)enumerateKeysAndObjectsInAllCollectionsStatement;
|
247
|
+
- (sqlite3_stmt *)enumerateRowsInCollectionStatement;
|
248
|
+
- (sqlite3_stmt *)enumerateRowsInAllCollectionsStatement;
|
249
|
+
|
250
|
+
- (void)prepare;
|
251
|
+
|
252
|
+
- (NSDictionary *)extensions;
|
253
|
+
|
254
|
+
- (BOOL)registerExtension:(YapDatabaseExtension *)extension withName:(NSString *)extensionName;
|
255
|
+
- (void)unregisterExtension:(NSString *)extensionName;
|
256
|
+
|
257
|
+
- (NSDictionary *)registeredTables;
|
258
|
+
|
259
|
+
- (BOOL)registerTable:(YapMemoryTable *)table withName:(NSString *)name;
|
260
|
+
- (void)unregisterTableWithName:(NSString *)name;
|
261
|
+
|
262
|
+
- (YapDatabaseReadTransaction *)newReadTransaction;
|
263
|
+
- (YapDatabaseReadWriteTransaction *)newReadWriteTransaction;
|
264
|
+
|
265
|
+
- (void)markSqlLevelSharedReadLockAcquired;
|
266
|
+
|
267
|
+
- (void)postRollbackCleanup;
|
268
|
+
|
269
|
+
- (NSArray *)internalChangesetKeys;
|
270
|
+
- (NSArray *)externalChangesetKeys;
|
271
|
+
- (void)getInternalChangeset:(NSMutableDictionary **)internalPtr externalChangeset:(NSMutableDictionary **)externalPtr;
|
272
|
+
- (void)processChangeset:(NSDictionary *)changeset;
|
273
|
+
|
274
|
+
- (void)noteCommittedChanges:(NSDictionary *)changeset;
|
275
|
+
|
276
|
+
- (void)maybeResetLongLivedReadTransaction;
|
277
|
+
|
278
|
+
@end
|
279
|
+
|
280
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
281
|
+
#pragma mark -
|
282
|
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
283
|
+
|
284
|
+
@interface YapDatabaseReadTransaction () {
|
285
|
+
@private
|
286
|
+
|
287
|
+
NSMutableDictionary *extensions;
|
288
|
+
NSMutableArray *orderedExtensions;
|
289
|
+
BOOL extensionsReady;
|
290
|
+
|
291
|
+
@protected
|
292
|
+
BOOL isMutated; // Used for "mutation during enumeration" protection
|
293
|
+
|
294
|
+
@public
|
295
|
+
__unsafe_unretained YapDatabaseConnection *connection;
|
296
|
+
|
297
|
+
BOOL isReadWriteTransaction;
|
298
|
+
BOOL rollback;
|
299
|
+
id customObjectForNotification;
|
300
|
+
}
|
301
|
+
|
302
|
+
- (id)initWithConnection:(YapDatabaseConnection *)connection isReadWriteTransaction:(BOOL)flag;
|
303
|
+
|
304
|
+
- (void)beginTransaction;
|
305
|
+
- (void)preCommitReadWriteTransaction;
|
306
|
+
- (void)commitTransaction;
|
307
|
+
- (void)rollbackTransaction;
|
308
|
+
|
309
|
+
- (NSDictionary *)extensions;
|
310
|
+
- (NSArray *)orderedExtensions;
|
311
|
+
|
312
|
+
- (YapMemoryTableTransaction *)memoryTableTransaction:(NSString *)tableName;
|
313
|
+
|
314
|
+
- (void)addRegisteredExtensionTransaction:(YapDatabaseExtensionTransaction *)extTransaction;
|
315
|
+
- (void)removeRegisteredExtensionTransaction:(NSString *)extName;
|
316
|
+
|
317
|
+
|
318
|
+
- (BOOL)getBoolValue:(BOOL *)valuePtr forKey:(NSString *)key extension:(NSString *)extensionName;
|
319
|
+
- (void)setBoolValue:(BOOL)value forKey:(NSString *)key extension:(NSString *)extensionName;
|
320
|
+
|
321
|
+
- (BOOL)getIntValue:(int *)valuePtr forKey:(NSString *)key extension:(NSString *)extensionName;
|
322
|
+
- (void)setIntValue:(int)value forKey:(NSString *)key extension:(NSString *)extensionName;
|
323
|
+
|
324
|
+
- (BOOL)getDoubleValue:(double *)valuePtr forKey:(NSString *)key extension:(NSString *)extensionName;
|
325
|
+
- (void)setDoubleValue:(double)value forKey:(NSString *)key extension:(NSString *)extensionName;
|
326
|
+
|
327
|
+
- (NSString *)stringValueForKey:(NSString *)key extension:(NSString *)extensionName;
|
328
|
+
- (void)setStringValue:(NSString *)value forKey:(NSString *)key extension:(NSString *)extensionName;
|
329
|
+
|
330
|
+
- (NSData *)dataValueForKey:(NSString *)key extension:(NSString *)extensionName;
|
331
|
+
- (void)setDataValue:(NSData *)value forKey:(NSString *)key extension:(NSString *)extensionName;
|
332
|
+
|
333
|
+
- (void)removeAllValuesForExtension:(NSString *)extensionName;
|
334
|
+
|
335
|
+
- (NSException *)mutationDuringEnumerationException;
|
336
|
+
|
337
|
+
- (BOOL)getRowid:(int64_t *)rowidPtr forKey:(NSString *)key inCollection:(NSString *)collection;
|
338
|
+
|
339
|
+
- (BOOL)getKey:(NSString **)keyPtr collection:(NSString **)collectionPtr forRowid:(int64_t)rowid;
|
340
|
+
|
341
|
+
- (BOOL)getKey:(NSString **)keyPtr
|
342
|
+
collection:(NSString **)collectionPtr
|
343
|
+
object:(id *)objectPtr
|
344
|
+
forRowid:(int64_t)rowid;
|
345
|
+
|
346
|
+
- (BOOL)getKey:(NSString **)keyPtr
|
347
|
+
collection:(NSString **)collectionPtr
|
348
|
+
metadata:(id *)metadataPtr
|
349
|
+
forRowid:(int64_t)rowid;
|
350
|
+
|
351
|
+
- (BOOL)getKey:(NSString **)keyPtr
|
352
|
+
collection:(NSString **)collectionPtr
|
353
|
+
object:(id *)objectPtr
|
354
|
+
metadata:(id *)metadataPtr
|
355
|
+
forRowid:(int64_t)rowid;
|
356
|
+
|
357
|
+
- (BOOL)hasRowForRowid:(int64_t)rowid;
|
358
|
+
|
359
|
+
- (id)objectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
|
360
|
+
|
361
|
+
- (void)_enumerateKeysInCollection:(NSString *)collection
|
362
|
+
usingBlock:(void (^)(int64_t rowid, NSString *key, BOOL *stop))block;
|
363
|
+
|
364
|
+
- (void)_enumerateKeysInCollections:(NSArray *)collections
|
365
|
+
usingBlock:(void (^)(int64_t rowid, NSString *collection, NSString *key, BOOL *stop))block;
|
366
|
+
|
367
|
+
- (void)_enumerateKeysInAllCollectionsUsingBlock:
|
368
|
+
(void (^)(int64_t rowid, NSString *collection, NSString *key, BOOL *stop))block;
|
369
|
+
|
370
|
+
- (void)_enumerateKeysAndMetadataInCollection:(NSString *)collection
|
371
|
+
usingBlock:(void (^)(int64_t rowid, NSString *key, id metadata, BOOL *stop))block;
|
372
|
+
- (void)_enumerateKeysAndMetadataInCollection:(NSString *)collection
|
373
|
+
usingBlock:(void (^)(int64_t rowid, NSString *key, id metadata, BOOL *stop))block
|
374
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *key))filter;
|
375
|
+
|
376
|
+
- (void)_enumerateKeysAndMetadataInCollections:(NSArray *)collections
|
377
|
+
usingBlock:(void (^)(int64_t rowid, NSString *collection, NSString *key, id metadata, BOOL *stop))block;
|
378
|
+
- (void)_enumerateKeysAndMetadataInCollections:(NSArray *)collections
|
379
|
+
usingBlock:(void (^)(int64_t rowid, NSString *collection, NSString *key, id metadata, BOOL *stop))block
|
380
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *collection, NSString *key))filter;
|
381
|
+
|
382
|
+
- (void)_enumerateKeysAndMetadataInAllCollectionsUsingBlock:
|
383
|
+
(void (^)(int64_t rowid, NSString *collection, NSString *key, id metadata, BOOL *stop))block;
|
384
|
+
- (void)_enumerateKeysAndMetadataInAllCollectionsUsingBlock:
|
385
|
+
(void (^)(int64_t rowid, NSString *collection, NSString *key, id metadata, BOOL *stop))block
|
386
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *collection, NSString *key))filter;
|
387
|
+
|
388
|
+
- (void)_enumerateKeysAndObjectsInCollection:(NSString *)collection
|
389
|
+
usingBlock:(void (^)(int64_t rowid, NSString *key, id object, BOOL *stop))block;
|
390
|
+
- (void)_enumerateKeysAndObjectsInCollection:(NSString *)collection
|
391
|
+
usingBlock:(void (^)(int64_t rowid, NSString *key, id object, BOOL *stop))block
|
392
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *key))filter;
|
393
|
+
|
394
|
+
- (void)_enumerateKeysAndObjectsInCollections:(NSArray *)collections
|
395
|
+
usingBlock:(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, BOOL *stop))block;
|
396
|
+
- (void)_enumerateKeysAndObjectsInCollections:(NSArray *)collections
|
397
|
+
usingBlock:(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, BOOL *stop))block
|
398
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *collection, NSString *key))filter;
|
399
|
+
|
400
|
+
- (void)_enumerateKeysAndObjectsInAllCollectionsUsingBlock:
|
401
|
+
(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, BOOL *stop))block;
|
402
|
+
- (void)_enumerateKeysAndObjectsInAllCollectionsUsingBlock:
|
403
|
+
(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, BOOL *stop))block
|
404
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *collection, NSString *key))filter;
|
405
|
+
|
406
|
+
- (void)_enumerateRowsInCollection:(NSString *)collection
|
407
|
+
usingBlock:(void (^)(int64_t rowid, NSString *key, id object, id metadata, BOOL *stop))block;
|
408
|
+
- (void)_enumerateRowsInCollection:(NSString *)collection
|
409
|
+
usingBlock:(void (^)(int64_t rowid, NSString *key, id object, id metadata, BOOL *stop))block
|
410
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *key))filter;
|
411
|
+
|
412
|
+
- (void)_enumerateRowsInCollections:(NSArray *)collections
|
413
|
+
usingBlock:(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, id metadata, BOOL *stop))block;
|
414
|
+
- (void)_enumerateRowsInCollections:(NSArray *)collections
|
415
|
+
usingBlock:(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, id metadata, BOOL *stop))block
|
416
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *collection, NSString *key))filter;
|
417
|
+
|
418
|
+
- (void)_enumerateRowsInAllCollectionsUsingBlock:
|
419
|
+
(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, id metadata, BOOL *stop))block;
|
420
|
+
- (void)_enumerateRowsInAllCollectionsUsingBlock:
|
421
|
+
(void (^)(int64_t rowid, NSString *collection, NSString *key, id object, id metadata, BOOL *stop))block
|
422
|
+
withFilter:(BOOL (^)(int64_t rowid, NSString *collection, NSString *key))filter;
|
423
|
+
|
424
|
+
@end
|