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.
Files changed (296) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -2
  3. data/.travis.yml +2 -0
  4. data/Gemfile +1 -0
  5. data/README.md +1 -1
  6. data/Rakefile +1 -1
  7. data/lib/motion-yapper.rb +1 -0
  8. data/lib/yapper.rb +3 -5
  9. data/lib/yapper/config.rb +2 -0
  10. data/lib/yapper/db.rb +105 -40
  11. data/lib/yapper/document.rb +7 -4
  12. data/lib/yapper/document/callbacks.rb +0 -7
  13. data/lib/yapper/document/{persistance.rb → persistence.rb} +27 -21
  14. data/lib/yapper/document/relation.rb +29 -22
  15. data/lib/yapper/document/selection.rb +122 -54
  16. data/lib/yapper/extensions.rb +12 -24
  17. data/lib/yapper/settings.rb +43 -0
  18. data/lib/yapper/timestamps.rb +2 -0
  19. data/lib/yapper/version.rb +1 -1
  20. data/{yapper.gemspec → motion-yapper.gemspec} +0 -0
  21. data/spec/integration/{where_spec.rb → criteria_spec.rb} +78 -10
  22. data/spec/integration/db_spec.rb +70 -0
  23. data/spec/integration/defaults_spec.rb +37 -0
  24. data/spec/integration/extensions_spec.rb +14 -0
  25. data/spec/integration/{persistance_spec.rb → persistence_spec.rb} +0 -0
  26. data/spec/integration/relation_spec.rb +4 -4
  27. data/vendor/Podfile.lock +9 -11
  28. data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
  29. data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
  30. data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
  31. data/vendor/Pods/.build/libPods.a +0 -0
  32. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +4 -4
  33. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
  34. data/vendor/Pods/{CocoaLumberjack/Lumberjack/Extensions/ContextFilterLogFormatter.h → BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h} +6 -8
  35. data/vendor/Pods/BuildHeaders/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  36. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +67 -32
  37. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +99 -0
  38. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +98 -65
  39. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +30 -0
  40. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +39 -25
  41. data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +8 -0
  42. data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +1 -0
  43. data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +3 -0
  44. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +4 -4
  45. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +21 -19
  46. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +1 -1
  47. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +35 -31
  48. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +8 -35
  49. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -2
  50. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
  51. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
  52. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +8 -0
  53. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +43 -21
  54. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +35 -0
  55. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
  56. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
  57. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +79 -0
  58. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
  59. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
  60. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +125 -0
  61. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
  62. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
  63. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +10 -0
  64. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
  65. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +131 -21
  66. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +48 -107
  67. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +2 -2
  68. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +1 -0
  69. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +17 -0
  70. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +10 -3
  71. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +18 -1
  72. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +75 -24
  73. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +99 -0
  74. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +4 -4
  75. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +51 -50
  76. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +14 -14
  77. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +546 -546
  78. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +67 -32
  79. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +1093 -907
  80. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +99 -0
  81. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +98 -65
  82. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +873 -748
  83. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +39 -25
  84. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +1284 -1243
  85. data/vendor/Pods/{BuildHeaders/CocoaLumberjack/ContextFilterLogFormatter.h → CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h} +6 -8
  86. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{ContextFilterLogFormatter.m → DDContextFilterLogFormatter.m} +70 -70
  87. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  88. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +253 -0
  89. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +30 -0
  90. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +127 -0
  91. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +1 -1
  92. data/vendor/Pods/CocoaLumberjack/README.markdown +52 -15
  93. data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +4 -4
  94. data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +14 -14
  95. data/vendor/Pods/Headers/CocoaLumberjack/{ContextFilterLogFormatter.h → DDContextFilterLogFormatter.h} +6 -8
  96. data/vendor/Pods/Headers/CocoaLumberjack/{DispatchQueueLogFormatter.h → DDDispatchQueueLogFormatter.h} +18 -6
  97. data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +67 -32
  98. data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +99 -0
  99. data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +98 -65
  100. data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +30 -0
  101. data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +39 -25
  102. data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +3 -0
  103. data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +4 -4
  104. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +21 -19
  105. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +8 -35
  106. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +17 -17
  107. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +32 -0
  108. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +35 -0
  109. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +29 -0
  110. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +163 -0
  111. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +99 -0
  112. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +59 -0
  113. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +384 -0
  114. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +49 -0
  115. data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +131 -21
  116. data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +48 -107
  117. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +2 -2
  118. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +1 -0
  119. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +17 -0
  120. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +10 -3
  121. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +75 -24
  122. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +99 -0
  123. data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +2 -0
  124. data/vendor/Pods/Headers/____Pods-environment.h +15 -15
  125. data/vendor/Pods/Manifest.lock +9 -11
  126. data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +1 -1
  127. data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +2 -0
  128. data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +1 -1
  129. data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +1 -1
  130. data/vendor/Pods/{Pods-Acknowledgements.markdown → Pods-acknowledgements.markdown} +0 -37
  131. data/vendor/Pods/{Pods-Acknowledgements.plist → Pods-acknowledgements.plist} +0 -45
  132. data/vendor/Pods/Pods-environment.h +15 -15
  133. data/vendor/Pods/Pods.xcconfig +3 -3
  134. data/vendor/Pods/Pods.xcodeproj/project.pbxproj +2426 -3155
  135. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +59 -0
  136. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +59 -0
  137. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +59 -0
  138. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +59 -0
  139. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +31 -0
  140. data/vendor/Pods/YapDatabase/README.md +3 -1
  141. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -2
  142. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +8 -35
  143. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +25 -41
  144. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +17 -17
  145. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +403 -134
  146. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +32 -0
  147. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +8 -0
  148. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +8 -8
  149. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +113 -62
  150. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +35 -31
  151. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +25 -0
  152. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +1 -1
  153. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +25 -1
  154. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +79 -0
  155. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +125 -0
  156. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +35 -0
  157. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +129 -0
  158. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +29 -0
  159. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +802 -0
  160. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +163 -0
  161. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +408 -0
  162. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +99 -0
  163. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +59 -0
  164. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +29 -0
  165. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +384 -0
  166. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +5254 -0
  167. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +10 -0
  168. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +18 -0
  169. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +49 -0
  170. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +12 -0
  171. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +9 -8
  172. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +62 -1
  173. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +148 -45
  174. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +18 -1
  175. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +2 -2
  176. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +15 -9
  177. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +17 -0
  178. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +211 -64
  179. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +48 -107
  180. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +10 -7
  181. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +1 -0
  182. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +13 -22
  183. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +10 -3
  184. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +75 -24
  185. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +725 -244
  186. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +99 -0
  187. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +8 -0
  188. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +19 -0
  189. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +1 -0
  190. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +12 -0
  191. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +1 -1
  192. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +3 -3
  193. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +43 -21
  194. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +4 -0
  195. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +3 -0
  196. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +5 -0
  197. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +4 -4
  198. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +84 -93
  199. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +21 -19
  200. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +381 -209
  201. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +131 -21
  202. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +587 -267
  203. data/vendor/Pods/{Pods.bridgesupport → build-iPhoneSimulator/Pods.bridgesupport} +633 -2557
  204. data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
  205. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +2 -1
  206. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +2 -1
  207. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +4 -2
  208. metadata +80 -108
  209. data/Gemfile.lock +0 -63
  210. data/lib/yapper/attachment.rb +0 -48
  211. data/lib/yapper/document/attachment.rb +0 -26
  212. data/lib/yapper/sync.rb +0 -134
  213. data/lib/yapper/sync/data.rb +0 -12
  214. data/lib/yapper/sync/event.rb +0 -194
  215. data/lib/yapper/sync/queue.rb +0 -164
  216. data/spec/integration/all_spec.rb +0 -40
  217. data/spec/integration/sync_spec.rb +0 -42
  218. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.h +0 -641
  219. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPClient.m +0 -1396
  220. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h +0 -133
  221. data/vendor/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m +0 -327
  222. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.h +0 -113
  223. data/vendor/Pods/AFNetworking/AFNetworking/AFImageRequestOperation.m +0 -321
  224. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.h +0 -71
  225. data/vendor/Pods/AFNetworking/AFNetworking/AFJSONRequestOperation.m +0 -150
  226. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  227. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworkActivityIndicatorManager.m +0 -157
  228. data/vendor/Pods/AFNetworking/AFNetworking/AFNetworking.h +0 -43
  229. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  230. data/vendor/Pods/AFNetworking/AFNetworking/AFPropertyListRequestOperation.m +0 -143
  231. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.h +0 -370
  232. data/vendor/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m +0 -848
  233. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.h +0 -89
  234. data/vendor/Pods/AFNetworking/AFNetworking/AFXMLRequestOperation.m +0 -167
  235. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.h +0 -78
  236. data/vendor/Pods/AFNetworking/AFNetworking/UIImageView+AFNetworking.m +0 -191
  237. data/vendor/Pods/AFNetworking/LICENSE +0 -19
  238. data/vendor/Pods/AFNetworking/README.md +0 -208
  239. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPClient.h +0 -641
  240. data/vendor/Pods/BuildHeaders/AFNetworking/AFHTTPRequestOperation.h +0 -133
  241. data/vendor/Pods/BuildHeaders/AFNetworking/AFImageRequestOperation.h +0 -113
  242. data/vendor/Pods/BuildHeaders/AFNetworking/AFJSONRequestOperation.h +0 -71
  243. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  244. data/vendor/Pods/BuildHeaders/AFNetworking/AFNetworking.h +0 -43
  245. data/vendor/Pods/BuildHeaders/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  246. data/vendor/Pods/BuildHeaders/AFNetworking/AFURLConnectionOperation.h +0 -370
  247. data/vendor/Pods/BuildHeaders/AFNetworking/AFXMLRequestOperation.h +0 -89
  248. data/vendor/Pods/BuildHeaders/AFNetworking/UIImageView+AFNetworking.h +0 -78
  249. data/vendor/Pods/BuildHeaders/Reachability/Reachability.h +0 -109
  250. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DispatchQueueLogFormatter.m +0 -251
  251. data/vendor/Pods/Headers/AFNetworking/AFHTTPClient.h +0 -641
  252. data/vendor/Pods/Headers/AFNetworking/AFHTTPRequestOperation.h +0 -133
  253. data/vendor/Pods/Headers/AFNetworking/AFImageRequestOperation.h +0 -113
  254. data/vendor/Pods/Headers/AFNetworking/AFJSONRequestOperation.h +0 -71
  255. data/vendor/Pods/Headers/AFNetworking/AFNetworkActivityIndicatorManager.h +0 -75
  256. data/vendor/Pods/Headers/AFNetworking/AFNetworking.h +0 -43
  257. data/vendor/Pods/Headers/AFNetworking/AFPropertyListRequestOperation.h +0 -68
  258. data/vendor/Pods/Headers/AFNetworking/AFURLConnectionOperation.h +0 -370
  259. data/vendor/Pods/Headers/AFNetworking/AFXMLRequestOperation.h +0 -89
  260. data/vendor/Pods/Headers/AFNetworking/UIImageView+AFNetworking.h +0 -78
  261. data/vendor/Pods/Headers/Reachability/Reachability.h +0 -109
  262. data/vendor/Pods/Headers/YapDatabase/YapCache.h +0 -90
  263. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnectionState.h +0 -29
  264. data/vendor/Pods/Headers/YapDatabase/YapDatabaseDefaults.h +0 -37
  265. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionPrivate.h +0 -440
  266. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -19
  267. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -69
  268. data/vendor/Pods/Headers/YapDatabase/YapDatabaseLogging.h +0 -158
  269. data/vendor/Pods/Headers/YapDatabase/YapDatabaseManager.h +0 -17
  270. data/vendor/Pods/Headers/YapDatabase/YapDatabasePrivate.h +0 -424
  271. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -73
  272. data/vendor/Pods/Headers/YapDatabase/YapDatabaseStatement.h +0 -13
  273. data/vendor/Pods/Headers/YapDatabase/YapDatabaseString.h +0 -121
  274. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
  275. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
  276. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPage.h +0 -36
  277. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
  278. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewPrivate.h +0 -153
  279. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
  280. data/vendor/Pods/Headers/YapDatabase/YapMemoryTable.h +0 -74
  281. data/vendor/Pods/Headers/YapDatabase/YapNull.h +0 -17
  282. data/vendor/Pods/Headers/YapDatabase/YapTouch.h +0 -15
  283. data/vendor/Pods/Headers/____Pods-AFNetworking-prefix.h +0 -17
  284. data/vendor/Pods/Headers/____Pods-Reachability-prefix.h +0 -5
  285. data/vendor/Pods/Pods-AFNetworking-Private.xcconfig +0 -5
  286. data/vendor/Pods/Pods-AFNetworking-dummy.m +0 -5
  287. data/vendor/Pods/Pods-AFNetworking-prefix.pch +0 -17
  288. data/vendor/Pods/Pods-AFNetworking.xcconfig +0 -1
  289. data/vendor/Pods/Pods-Reachability-Private.xcconfig +0 -5
  290. data/vendor/Pods/Pods-Reachability-dummy.m +0 -5
  291. data/vendor/Pods/Pods-Reachability-prefix.pch +0 -5
  292. data/vendor/Pods/Pods-Reachability.xcconfig +0 -1
  293. data/vendor/Pods/Reachability/LICENCE.txt +0 -24
  294. data/vendor/Pods/Reachability/README.md +0 -65
  295. data/vendor/Pods/Reachability/Reachability.h +0 -109
  296. data/vendor/Pods/Reachability/Reachability.m +0 -527
@@ -0,0 +1,32 @@
1
+ #import <Foundation/Foundation.h>
2
+
3
+
4
+ /**
5
+ * The filtering block removes items from this view that are in the parent view.
6
+ *
7
+ * A YapDatabaseFilteredView will have the same groups and same sort order as the parent,
8
+ * with the exception of those groups/rows that the filter block returned NO for.
9
+ *
10
+ * Here's how it works:
11
+ * When you initialize a YapDatabaseFilteredView instance, it will enumerate the parentView
12
+ * and invoke the filter block for every row in every group. So it can quickly copy a parentView as it
13
+ * doesn't have to perform any sorting.
14
+ *
15
+ * After its initialization, the filterView will automatically run for inserted / updated rows
16
+ * after the parentView has processed them. It then gets the group from parentView,
17
+ * and invokes the filterBlock again (if needed).
18
+ *
19
+ * You should choose a block type that takes the minimum number of required parameters.
20
+ * The filterView can make various optimizations based on required parameters of the block.
21
+ **/
22
+ typedef id YapDatabaseViewFilteringBlock; // One of the YapDatabaseViewGroupingX types below.
23
+
24
+ typedef BOOL (^YapDatabaseViewFilteringWithKeyBlock) \
25
+ (NSString *group, NSString *collection, NSString *key);
26
+ typedef BOOL (^YapDatabaseViewFilteringWithObjectBlock) \
27
+ (NSString *group, NSString *collection, NSString *key, id object);
28
+ typedef BOOL (^YapDatabaseViewFilteringWithMetadataBlock)\
29
+ (NSString *group, NSString *collection, NSString *key, id metadata);
30
+ typedef BOOL (^YapDatabaseViewFilteringWithRowBlock) \
31
+ (NSString *group, NSString *collection, NSString *key, id object, id metadata);
32
+
@@ -8,6 +8,14 @@
8
8
 
9
9
  #import "sqlite3.h"
10
10
 
11
+ /**
12
+ * This version number is stored in the yap2 table.
13
+ * If there is a major re-write to this class, then the version number will be incremented,
14
+ * and the class can automatically rebuild the tables as needed.
15
+ **/
16
+ #define YAP_DATABASE_FTS_CLASS_VERSION 1
17
+
18
+
11
19
  @interface YapDatabaseFullTextSearch () {
12
20
  @public
13
21
 
@@ -47,6 +47,11 @@
47
47
  }
48
48
 
49
49
  - (void)dealloc
50
+ {
51
+ [self _flushStatements];
52
+ }
53
+
54
+ - (void)_flushStatements
50
55
  {
51
56
  sqlite_finalize_null(&insertRowidStatement);
52
57
  sqlite_finalize_null(&setRowidStatement);
@@ -59,16 +64,11 @@
59
64
  /**
60
65
  * Required override method from YapDatabaseExtensionConnection
61
66
  **/
62
- - (void)_flushMemoryWithLevel:(int)level
67
+ - (void)_flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags
63
68
  {
64
- if (level >= YapDatabaseConnectionFlushMemoryLevelModerate)
69
+ if (flags & YapDatabaseConnectionFlushMemoryFlags_Statements)
65
70
  {
66
- sqlite_finalize_null(&insertRowidStatement);
67
- sqlite_finalize_null(&setRowidStatement);
68
- sqlite_finalize_null(&removeRowidStatement);
69
- sqlite_finalize_null(&removeAllStatement);
70
- sqlite_finalize_null(&queryStatement);
71
- sqlite_finalize_null(&querySnippetStatement);
71
+ [self _flushStatements];
72
72
  }
73
73
  }
74
74
 
@@ -20,11 +20,11 @@
20
20
  #endif
21
21
 
22
22
  /**
23
- * This version number is stored in the yap2 table.
24
- * If there is a major re-write to this class, then the version number will be incremented,
25
- * and the class can automatically rebuild the tables as needed.
23
+ * Declare that this class implements YapDatabaseExtensionTransaction_Hooks protocol.
24
+ * This is done privately, as the protocol is internal.
26
25
  **/
27
- #define YAP_DATABASE_FTS_CLASS_VERSION 1
26
+ @interface YapDatabaseFullTextSearchTransaction () <YapDatabaseExtensionTransaction_Hooks>
27
+ @end
28
28
 
29
29
 
30
30
  @implementation YapDatabaseFullTextSearchTransaction
@@ -52,14 +52,17 @@
52
52
  **/
53
53
  - (BOOL)createIfNeeded
54
54
  {
55
- int oldClassVersion = [self intValueForExtensionKey:@"classVersion"];
55
+ int oldClassVersion = 0;
56
+ BOOL hasOldClassVersion = [self getIntValue:&oldClassVersion forExtensionKey:@"classVersion"];
56
57
  int classVersion = YAP_DATABASE_FTS_CLASS_VERSION;
57
58
 
58
59
  if (oldClassVersion != classVersion)
59
60
  {
60
- // First time registration
61
+ // First time registration (or at least for this version)
61
62
 
62
- [self upgradeFromForOldClassVersion:oldClassVersion];
63
+ if (hasOldClassVersion) {
64
+ if (![self dropTable]) return NO;
65
+ }
63
66
 
64
67
  if (![self createTable]) return NO;
65
68
  if (![self populate]) return NO;
@@ -106,16 +109,6 @@
106
109
  return YES;
107
110
  }
108
111
 
109
- /**
110
- * Internal method.
111
- *
112
- * This method is used to handle the upgrade process from earlier architectures of this class.
113
- **/
114
- - (void)upgradeFromForOldClassVersion:(int)oldClassVersion
115
- {
116
- // Reserved for future use...
117
- }
118
-
119
112
  /**
120
113
  * Internal method.
121
114
  *
@@ -526,8 +519,7 @@
526
519
  * This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
527
520
  **/
528
521
  - (void)handleInsertObject:(id)object
529
- forKey:(NSString *)key
530
- inCollection:(NSString *)collection
522
+ forCollectionKey:(YapCollectionKey *)collectionKey
531
523
  withMetadata:(id)metadata
532
524
  rowid:(int64_t)rowid
533
525
  {
@@ -535,6 +527,9 @@
535
527
 
536
528
  __unsafe_unretained YapDatabaseFullTextSearch *fts = ftsConnection->fts;
537
529
 
530
+ __unsafe_unretained NSString *collection = collectionKey.collection;
531
+ __unsafe_unretained NSString *key = collectionKey.key;
532
+
538
533
  // Invoke the block to find out if the object should be included in the index.
539
534
 
540
535
  if (fts->blockType == YapDatabaseFullTextSearchBlockTypeWithKey)
@@ -585,8 +580,7 @@
585
580
  * This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
586
581
  **/
587
582
  - (void)handleUpdateObject:(id)object
588
- forKey:(NSString *)key
589
- inCollection:(NSString *)collection
583
+ forCollectionKey:(YapCollectionKey *)collectionKey
590
584
  withMetadata:(id)metadata
591
585
  rowid:(int64_t)rowid
592
586
  {
@@ -594,6 +588,9 @@
594
588
 
595
589
  __unsafe_unretained YapDatabaseFullTextSearch *fts = ftsConnection->fts;
596
590
 
591
+ __unsafe_unretained NSString *collection = collectionKey.collection;
592
+ __unsafe_unretained NSString *key = collectionKey.key;
593
+
597
594
  // Invoke the block to find out if the object should be included in the index.
598
595
 
599
596
  if (fts->blockType == YapDatabaseFullTextSearchBlockTypeWithKey)
@@ -646,15 +643,79 @@
646
643
  * YapDatabase extension hook.
647
644
  * This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
648
645
  **/
649
- - (void)handleUpdateMetadata:(id)metadata
650
- forKey:(NSString *)key
651
- inCollection:(NSString *)collection
652
- withRowid:(int64_t)rowid
646
+ - (void)handleReplaceObject:(id)object forCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
647
+ {
648
+ YDBLogAutoTrace();
649
+
650
+ __unsafe_unretained YapDatabaseFullTextSearch *fts = ftsConnection->fts;
651
+
652
+ __unsafe_unretained NSString *collection = collectionKey.collection;
653
+ __unsafe_unretained NSString *key = collectionKey.key;
654
+
655
+ // Invoke the block to find out if the object should be included in the index.
656
+
657
+ id metadata = nil;
658
+
659
+ if (fts->blockType == YapDatabaseFullTextSearchBlockTypeWithKey ||
660
+ fts->blockType == YapDatabaseFullTextSearchBlockTypeWithMetadata)
661
+ {
662
+ // Index values are based on the key or metadata.
663
+ // Neither have changed, and thus the values haven't changed.
664
+
665
+ return;
666
+ }
667
+ else
668
+ {
669
+ // Index values are based on object or row (object+metadata).
670
+ // Invoke block to see what the new values are.
671
+
672
+ if (fts->blockType == YapDatabaseFullTextSearchBlockTypeWithObject)
673
+ {
674
+ __unsafe_unretained YapDatabaseFullTextSearchWithObjectBlock block =
675
+ (YapDatabaseFullTextSearchWithObjectBlock)fts->block;
676
+
677
+ block(ftsConnection->blockDict, collection, key, object);
678
+ }
679
+ else
680
+ {
681
+ __unsafe_unretained YapDatabaseFullTextSearchWithRowBlock block =
682
+ (YapDatabaseFullTextSearchWithRowBlock)fts->block;
683
+
684
+ metadata = [databaseTransaction metadataForCollectionKey:collectionKey withRowid:rowid];
685
+ block(ftsConnection->blockDict, collection, key, object, metadata);
686
+ }
687
+
688
+ if ([ftsConnection->blockDict count] == 0)
689
+ {
690
+ // Remove associated values from index (if needed).
691
+ // This was an update operation, so the rowid may have previously had values in the index.
692
+
693
+ [self removeRowid:rowid];
694
+ }
695
+ else
696
+ {
697
+ // Add values to index (or update them).
698
+ // This was an update operation, so we need to insert or update.
699
+
700
+ [self addRowid:rowid isNew:NO];
701
+ [ftsConnection->blockDict removeAllObjects];
702
+ }
703
+ }
704
+ }
705
+
706
+ /**
707
+ * YapDatabase extension hook.
708
+ * This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
709
+ **/
710
+ - (void)handleReplaceMetadata:(id)metadata forCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
653
711
  {
654
712
  YDBLogAutoTrace();
655
713
 
656
714
  __unsafe_unretained YapDatabaseFullTextSearch *fts = ftsConnection->fts;
657
715
 
716
+ __unsafe_unretained NSString *collection = collectionKey.collection;
717
+ __unsafe_unretained NSString *key = collectionKey.key;
718
+
658
719
  // Invoke the block to find out if the object should be included in the index.
659
720
 
660
721
  id object = nil;
@@ -669,7 +730,7 @@
669
730
  }
670
731
  else
671
732
  {
672
- // Index values are based on metadata or objectAndMetadata.
733
+ // Index values are based on metadata or row (object+metadata).
673
734
  // Invoke block to see what the new values are.
674
735
 
675
736
  if (fts->blockType == YapDatabaseFullTextSearchBlockTypeWithMetadata)
@@ -684,7 +745,7 @@
684
745
  __unsafe_unretained YapDatabaseFullTextSearchWithRowBlock block =
685
746
  (YapDatabaseFullTextSearchWithRowBlock)fts->block;
686
747
 
687
- object = [databaseTransaction objectForKey:key inCollection:collection];
748
+ object = [databaseTransaction objectForCollectionKey:collectionKey withRowid:rowid];
688
749
  block(ftsConnection->blockDict, collection, key, object, metadata);
689
750
  }
690
751
 
@@ -710,7 +771,7 @@
710
771
  * YapDatabase extension hook.
711
772
  * This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
712
773
  **/
713
- - (void)handleTouchObjectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid
774
+ - (void)handleTouchObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
714
775
  {
715
776
  // Nothing to do for this extension
716
777
  }
@@ -719,7 +780,7 @@
719
780
  * YapDatabase extension hook.
720
781
  * This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
721
782
  **/
722
- - (void)handleTouchMetadataForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid
783
+ - (void)handleTouchMetadataForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
723
784
  {
724
785
  // Nothing to do for this extension
725
786
  }
@@ -728,7 +789,7 @@
728
789
  * YapDatabase extension hook.
729
790
  * This method is invoked by a YapDatabaseReadWriteTransaction as a post-operation-hook.
730
791
  **/
731
- - (void)handleRemoveObjectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid
792
+ - (void)handleRemoveObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid
732
793
  {
733
794
  YDBLogAutoTrace();
734
795
 
@@ -785,11 +846,9 @@
785
846
  {
786
847
  int64_t rowid = sqlite3_column_int64(statement, 0);
787
848
 
788
- NSString *key = nil;
789
- NSString *collection = nil;
790
- [databaseTransaction getKey:&key collection:&collection forRowid:rowid];
849
+ YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
791
850
 
792
- block(collection, key, &stop);
851
+ block(ck.collection, ck.key, &stop);
793
852
 
794
853
  if (stop || isMutated) break;
795
854
 
@@ -836,12 +895,11 @@
836
895
  {
837
896
  int64_t rowid = sqlite3_column_int64(statement, 0);
838
897
 
839
- NSString *key = nil;
840
- NSString *collection = nil;
898
+ YapCollectionKey *ck = nil;
841
899
  id metadata = nil;
842
- [databaseTransaction getKey:&key collection:&collection metadata:&metadata forRowid:rowid];
900
+ [databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
843
901
 
844
- block(collection, key, metadata, &stop);
902
+ block(ck.collection, ck.key, metadata, &stop);
845
903
 
846
904
  if (stop || isMutated) break;
847
905
 
@@ -888,12 +946,11 @@
888
946
  {
889
947
  int64_t rowid = sqlite3_column_int64(statement, 0);
890
948
 
891
- NSString *key = nil;
892
- NSString *collection = nil;
949
+ YapCollectionKey *ck = nil;
893
950
  id object = nil;
894
- [databaseTransaction getKey:&key collection:&collection object:&object forRowid:rowid];
951
+ [databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
895
952
 
896
- block(collection, key, object, &stop);
953
+ block(ck.collection, ck.key, object, &stop);
897
954
 
898
955
  if (stop || isMutated) break;
899
956
 
@@ -940,13 +997,12 @@
940
997
  {
941
998
  int64_t rowid = sqlite3_column_int64(statement, 0);
942
999
 
943
- NSString *key = nil;
944
- NSString *collection = nil;
1000
+ YapCollectionKey *ck = nil;
945
1001
  id object = nil;
946
1002
  id metadata = nil;
947
- [databaseTransaction getKey:&key collection:&collection object:&object metadata:&metadata forRowid:rowid];
1003
+ [databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
948
1004
 
949
- block(collection, key, object, metadata, &stop);
1005
+ block(ck.collection, ck.key, object, metadata, &stop);
950
1006
 
951
1007
  if (stop || isMutated) break;
952
1008
 
@@ -1035,11 +1091,9 @@
1035
1091
 
1036
1092
  NSString *snippet = [[NSString alloc] initWithBytes:text length:textSize encoding:NSUTF8StringEncoding];
1037
1093
 
1038
- NSString *key = nil;
1039
- NSString *collection = nil;
1040
- [databaseTransaction getKey:&key collection:&collection forRowid:rowid];
1094
+ YapCollectionKey *ck = [databaseTransaction collectionKeyForRowid:rowid];
1041
1095
 
1042
- block(snippet, collection, key, &stop);
1096
+ block(snippet, ck.collection, ck.key, &stop);
1043
1097
 
1044
1098
  if (stop || isMutated) break;
1045
1099
 
@@ -1128,12 +1182,11 @@
1128
1182
 
1129
1183
  NSString *snippet = [[NSString alloc] initWithBytes:text length:textSize encoding:NSUTF8StringEncoding];
1130
1184
 
1131
- NSString *key = nil;
1132
- NSString *collection = nil;
1185
+ YapCollectionKey *ck = nil;
1133
1186
  id metadata = nil;
1134
- [databaseTransaction getKey:&key collection:&collection metadata:&metadata forRowid:rowid];
1187
+ [databaseTransaction getCollectionKey:&ck metadata:&metadata forRowid:rowid];
1135
1188
 
1136
- block(snippet, collection, key, metadata, &stop);
1189
+ block(snippet, ck.collection, ck.key, metadata, &stop);
1137
1190
 
1138
1191
  if (stop || isMutated) break;
1139
1192
 
@@ -1222,12 +1275,11 @@
1222
1275
 
1223
1276
  NSString *snippet = [[NSString alloc] initWithBytes:text length:textSize encoding:NSUTF8StringEncoding];
1224
1277
 
1225
- NSString *key = nil;
1226
- NSString *collection = nil;
1278
+ YapCollectionKey *ck = nil;
1227
1279
  id object = nil;
1228
- [databaseTransaction getKey:&key collection:&collection object:&object forRowid:rowid];
1280
+ [databaseTransaction getCollectionKey:&ck object:&object forRowid:rowid];
1229
1281
 
1230
- block(snippet, collection, key, object, &stop);
1282
+ block(snippet, ck.collection, ck.key, object, &stop);
1231
1283
 
1232
1284
  if (stop || isMutated) break;
1233
1285
 
@@ -1316,13 +1368,12 @@
1316
1368
 
1317
1369
  NSString *snippet = [[NSString alloc] initWithBytes:text length:textSize encoding:NSUTF8StringEncoding];
1318
1370
 
1319
- NSString *key = nil;
1320
- NSString *collection = nil;
1371
+ YapCollectionKey *ck = nil;
1321
1372
  id object = nil;
1322
1373
  id metadata = nil;
1323
- [databaseTransaction getKey:&key collection:&collection object:&object metadata:&metadata forRowid:rowid];
1374
+ [databaseTransaction getCollectionKey:&ck object:&object metadata:&metadata forRowid:rowid];
1324
1375
 
1325
- block(snippet, collection, key, object, metadata, &stop);
1376
+ block(snippet, ck.collection, ck.key, object, metadata, &stop);
1326
1377
 
1327
1378
  if (stop || isMutated) break;
1328
1379
 
@@ -7,6 +7,7 @@
7
7
  #import "YapDatabase.h"
8
8
  #import "YapDatabaseConnection.h"
9
9
  #import "YapDatabaseTransaction.h"
10
+ #import "YapCollectionKey.h"
10
11
 
11
12
  #import "sqlite3.h"
12
13
 
@@ -136,34 +137,19 @@
136
137
  * This method will be invoked in order to flush memory.
137
138
  * Subclasses are encouraged to do something similar to the following:
138
139
  *
139
- * if (level >= YapDatabaseConnectionFlushMemoryLevelMild)
140
+ * if (flags & YapDatabaseConnectionFlushMemoryFlags_Caches)
140
141
  * {
141
142
  * // Dump all caches
142
143
  * }
143
144
  *
144
- * if (level >= YapDatabaseConnectionFlushMemoryLevelModerate)
145
+ * if (flags & YapDatabaseConnectionFlushMemoryFlags_Statements)
145
146
  * {
146
- * // Release any prepared statements that aren't constantly used.
147
- * //
148
- * // For example, any statements that make modifications to the database,
149
- * // and any other statements that are likely to be used infrequently.
147
+ * // Dump all pre-compiled statements
150
148
  *
151
149
  * sqlite_finalize_null(&myStatement);
152
150
  * }
153
- *
154
- * if (level >= YapDatabaseConnectionFlushMemoryLevelFull)
155
- * {
156
- * // Release all other prepared statements
157
- *
158
- * sqlite_finalize_null(&myOtherStatement);
159
- *
160
- * // And flush any state that may have been prepared via
161
- * // the extTransaction's prepareIfNeeded method.
162
- *
163
- * viewGroups = nil;
164
- * }
165
151
  **/
166
- - (void)_flushMemoryWithLevel:(int)level;
152
+ - (void)_flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags;
167
153
 
168
154
  /**
169
155
  * Subclasses MUST implement this method.
@@ -325,6 +311,21 @@
325
311
  **/
326
312
  - (BOOL)prepareIfNeeded;
327
313
 
314
+ /**
315
+ * Subclasses may OPTIONALLY implement this method.
316
+ * This method is only called if within a readwrite transaction.
317
+ *
318
+ * Subclasses should ONLY implement this method if they need to make changes to the 'database' table.
319
+ * That is, the main collection/key/value table that directly stores the user's objects.
320
+ *
321
+ * Return NO if the extension does not directly modify the main database table.
322
+ * Return YES if the extension does modify the main database table,
323
+ * regardless of whether it made changes during this invocation.
324
+ *
325
+ * This method may be invoked several times in a row.
326
+ **/
327
+ - (BOOL)flushPendingChangesToMainDatabaseTable;
328
+
328
329
  /**
329
330
  * Subclasses may OPTIONALLY implement this method.
330
331
  * This method is only called if within a readwrite transaction.
@@ -332,7 +333,7 @@
332
333
  * Subclasses may implement it to perform any "cleanup" before the changeset is requested.
333
334
  * Remember, the changeset is requested before the commitTransaction method is invoked.
334
335
  **/
335
- - (void)preCommitReadWriteTransaction;
336
+ - (void)prepareChangeset;
336
337
 
337
338
  /**
338
339
  * Subclasses MUST implement this method.
@@ -400,6 +401,8 @@
400
401
  - (NSData *)dataValueForExtensionKey:(NSString *)key;
401
402
  - (void)setDataValue:(NSData *)value forExtensionKey:(NSString *)key;
402
403
 
404
+ - (void)removeValueForExtensionKey:(NSString *)key;
405
+
403
406
  @end
404
407
 
405
408
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -413,26 +416,27 @@
413
416
  @required
414
417
 
415
418
  - (void)handleInsertObject:(id)object
416
- forKey:(NSString *)key
417
- inCollection:(NSString *)collection
419
+ forCollectionKey:(YapCollectionKey *)collectionKey
418
420
  withMetadata:(id)metadata
419
421
  rowid:(int64_t)rowid;
420
422
 
421
423
  - (void)handleUpdateObject:(id)object
422
- forKey:(NSString *)key
423
- inCollection:(NSString *)collection
424
+ forCollectionKey:(YapCollectionKey *)collectionKey
424
425
  withMetadata:(id)metadata
425
426
  rowid:(int64_t)rowid;
426
427
 
427
- - (void)handleUpdateMetadata:(id)metadata
428
- forKey:(NSString *)key
429
- inCollection:(NSString *)collection
430
- withRowid:(int64_t)rowid;
428
+ - (void)handleReplaceObject:(id)object
429
+ forCollectionKey:(YapCollectionKey *)collectionKey
430
+ withRowid:(int64_t)rowid;
431
+
432
+ - (void)handleReplaceMetadata:(id)metadata
433
+ forCollectionKey:(YapCollectionKey *)collectionKey
434
+ withRowid:(int64_t)rowid;
431
435
 
432
- - (void)handleTouchObjectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
433
- - (void)handleTouchMetadataForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
436
+ - (void)handleTouchObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid;
437
+ - (void)handleTouchMetadataForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid;
434
438
 
435
- - (void)handleRemoveObjectForKey:(NSString *)key inCollection:(NSString *)collection withRowid:(int64_t)rowid;
439
+ - (void)handleRemoveObjectForCollectionKey:(YapCollectionKey *)collectionKey withRowid:(int64_t)rowid;
436
440
  - (void)handleRemoveObjectsForKeys:(NSArray *)keys inCollection:(NSString *)collection withRowids:(NSArray *)rowids;
437
441
 
438
442
  - (void)handleRemoveAllObjectsInAllCollections;