motion-yapper 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +3 -1
  4. data/lib/yapper.rb +3 -3
  5. data/lib/yapper/db.rb +61 -4
  6. data/lib/yapper/document/persistence.rb +4 -0
  7. data/lib/yapper/document/selection.rb +13 -0
  8. data/lib/yapper/version.rb +1 -1
  9. data/motion-yapper.gemspec +1 -1
  10. data/spec/integration/search_spec.rb +111 -0
  11. data/vendor/Podfile.lock +11 -7
  12. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.bridgesupport +16 -2
  13. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.h +10 -7
  14. data/vendor/YapDatabaseRubyMotion/YapDatabaseRubyMotion.m +20 -2
  15. metadata +19 -297
  16. data/vendor/Pods/.build/libPods-CocoaLumberjack.a +0 -0
  17. data/vendor/Pods/.build/libPods-NSData+MD5Digest.a +0 -0
  18. data/vendor/Pods/.build/libPods-YapDatabase.a +0 -0
  19. data/vendor/Pods/.build/libPods.a +0 -0
  20. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDASLLogger.h +0 -41
  21. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDAbstractDatabaseLogger.h +0 -102
  22. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDContextFilterLogFormatter.h +0 -63
  23. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDDispatchQueueLogFormatter.h +0 -128
  24. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDFileLogger.h +0 -369
  25. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog+LOGV.h +0 -99
  26. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDLog.h +0 -634
  27. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDMultiFormatter.h +0 -30
  28. data/vendor/Pods/BuildHeaders/CocoaLumberjack/DDTTYLogger.h +0 -181
  29. data/vendor/Pods/BuildHeaders/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
  30. data/vendor/Pods/BuildHeaders/YapDatabase/NSDictionary+YapDatabase.h +0 -8
  31. data/vendor/Pods/BuildHeaders/YapDatabase/YapCache.h +0 -91
  32. data/vendor/Pods/BuildHeaders/YapDatabase/YapCollectionKey.h +0 -23
  33. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabase.h +0 -547
  34. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnection.h +0 -449
  35. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseConnectionState.h +0 -29
  36. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseDefaults.h +0 -37
  37. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtension.h +0 -15
  38. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionConnection.h +0 -11
  39. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionPrivate.h +0 -444
  40. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseExtensionTransaction.h +0 -11
  41. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredView.h +0 -81
  42. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewConnection.h +0 -12
  43. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewPrivate.h +0 -17
  44. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTransaction.h +0 -39
  45. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFilteredViewTypes.h +0 -32
  46. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearch.h +0 -89
  47. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchConnection.h +0 -32
  48. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchPrivate.h +0 -77
  49. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
  50. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseFullTextSearchTransaction.h +0 -68
  51. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseLogging.h +0 -158
  52. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseManager.h +0 -17
  53. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabasePrivate.h +0 -446
  54. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseQuery.h +0 -42
  55. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationship.h +0 -35
  56. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipConnection.h +0 -29
  57. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdge.h +0 -163
  58. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipEdgePrivate.h +0 -79
  59. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipNode.h +0 -99
  60. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipOptions.h +0 -59
  61. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipPrivate.h +0 -125
  62. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseRelationshipTransaction.h +0 -384
  63. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndex.h +0 -149
  64. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexConnection.h +0 -33
  65. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexPrivate.h +0 -83
  66. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetup.h +0 -33
  67. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexSetupPrivate.h +0 -18
  68. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +0 -58
  69. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseStatement.h +0 -13
  70. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseString.h +0 -121
  71. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseTransaction.h +0 -651
  72. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseView.h +0 -127
  73. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChange.h +0 -272
  74. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewChangePrivate.h +0 -94
  75. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewConnection.h +0 -116
  76. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappings.h +0 -842
  77. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewMappingsPrivate.h +0 -72
  78. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewOptions.h +0 -63
  79. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPage.h +0 -36
  80. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPageMetadata.h +0 -27
  81. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewPrivate.h +0 -170
  82. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptions.h +0 -330
  83. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewRangeOptionsPrivate.h +0 -17
  84. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTransaction.h +0 -498
  85. data/vendor/Pods/BuildHeaders/YapDatabase/YapDatabaseViewTypes.h +0 -99
  86. data/vendor/Pods/BuildHeaders/YapDatabase/YapMemoryTable.h +0 -74
  87. data/vendor/Pods/BuildHeaders/YapDatabase/YapNull.h +0 -17
  88. data/vendor/Pods/BuildHeaders/YapDatabase/YapSet.h +0 -41
  89. data/vendor/Pods/BuildHeaders/YapDatabase/YapTouch.h +0 -15
  90. data/vendor/Pods/CocoaLumberjack/LICENSE.txt +0 -18
  91. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.h +0 -41
  92. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDASLLogger.m +0 -100
  93. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.h +0 -102
  94. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDAbstractDatabaseLogger.m +0 -727
  95. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.h +0 -369
  96. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDFileLogger.m +0 -1539
  97. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog+LOGV.h +0 -99
  98. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.h +0 -634
  99. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDLog.m +0 -1208
  100. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.h +0 -181
  101. data/vendor/Pods/CocoaLumberjack/Lumberjack/DDTTYLogger.m +0 -1520
  102. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.h +0 -63
  103. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDContextFilterLogFormatter.m +0 -191
  104. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.h +0 -128
  105. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDDispatchQueueLogFormatter.m +0 -253
  106. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.h +0 -30
  107. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/DDMultiFormatter.m +0 -127
  108. data/vendor/Pods/CocoaLumberjack/Lumberjack/Extensions/README.txt +0 -7
  109. data/vendor/Pods/CocoaLumberjack/README.markdown +0 -74
  110. data/vendor/Pods/Headers/CocoaLumberjack/DDASLLogger.h +0 -41
  111. data/vendor/Pods/Headers/CocoaLumberjack/DDAbstractDatabaseLogger.h +0 -102
  112. data/vendor/Pods/Headers/CocoaLumberjack/DDContextFilterLogFormatter.h +0 -63
  113. data/vendor/Pods/Headers/CocoaLumberjack/DDDispatchQueueLogFormatter.h +0 -128
  114. data/vendor/Pods/Headers/CocoaLumberjack/DDFileLogger.h +0 -369
  115. data/vendor/Pods/Headers/CocoaLumberjack/DDLog+LOGV.h +0 -99
  116. data/vendor/Pods/Headers/CocoaLumberjack/DDLog.h +0 -634
  117. data/vendor/Pods/Headers/CocoaLumberjack/DDMultiFormatter.h +0 -30
  118. data/vendor/Pods/Headers/CocoaLumberjack/DDTTYLogger.h +0 -181
  119. data/vendor/Pods/Headers/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
  120. data/vendor/Pods/Headers/YapDatabase/YapCollectionKey.h +0 -23
  121. data/vendor/Pods/Headers/YapDatabase/YapDatabase.h +0 -547
  122. data/vendor/Pods/Headers/YapDatabase/YapDatabaseConnection.h +0 -449
  123. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtension.h +0 -15
  124. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionConnection.h +0 -11
  125. data/vendor/Pods/Headers/YapDatabase/YapDatabaseExtensionTransaction.h +0 -11
  126. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredView.h +0 -81
  127. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewConnection.h +0 -12
  128. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTransaction.h +0 -39
  129. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFilteredViewTypes.h +0 -32
  130. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearch.h +0 -89
  131. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchConnection.h +0 -32
  132. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
  133. data/vendor/Pods/Headers/YapDatabase/YapDatabaseFullTextSearchTransaction.h +0 -68
  134. data/vendor/Pods/Headers/YapDatabase/YapDatabaseQuery.h +0 -42
  135. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationship.h +0 -35
  136. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipConnection.h +0 -29
  137. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipEdge.h +0 -163
  138. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipNode.h +0 -99
  139. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipOptions.h +0 -59
  140. data/vendor/Pods/Headers/YapDatabase/YapDatabaseRelationshipTransaction.h +0 -384
  141. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndex.h +0 -149
  142. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexConnection.h +0 -33
  143. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexSetup.h +0 -33
  144. data/vendor/Pods/Headers/YapDatabase/YapDatabaseSecondaryIndexTransaction.h +0 -58
  145. data/vendor/Pods/Headers/YapDatabase/YapDatabaseTransaction.h +0 -651
  146. data/vendor/Pods/Headers/YapDatabase/YapDatabaseView.h +0 -127
  147. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewChange.h +0 -272
  148. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewConnection.h +0 -116
  149. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewMappings.h +0 -842
  150. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewOptions.h +0 -63
  151. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewRangeOptions.h +0 -330
  152. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTransaction.h +0 -498
  153. data/vendor/Pods/Headers/YapDatabase/YapDatabaseViewTypes.h +0 -99
  154. data/vendor/Pods/Headers/YapDatabase/YapSet.h +0 -41
  155. data/vendor/Pods/Headers/____Pods-CocoaLumberjack-prefix.h +0 -7
  156. data/vendor/Pods/Headers/____Pods-NSData+MD5Digest-prefix.h +0 -5
  157. data/vendor/Pods/Headers/____Pods-YapDatabase-prefix.h +0 -5
  158. data/vendor/Pods/Headers/____Pods-environment.h +0 -38
  159. data/vendor/Pods/Manifest.lock +0 -22
  160. data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.h +0 -18
  161. data/vendor/Pods/NSData+MD5Digest/NSData+MD5Digest/NSData+MD5Digest.m +0 -39
  162. data/vendor/Pods/NSData+MD5Digest/README.md +0 -11
  163. data/vendor/Pods/Pods-CocoaLumberjack-Private.xcconfig +0 -5
  164. data/vendor/Pods/Pods-CocoaLumberjack-dummy.m +0 -5
  165. data/vendor/Pods/Pods-CocoaLumberjack-prefix.pch +0 -7
  166. data/vendor/Pods/Pods-CocoaLumberjack.xcconfig +0 -0
  167. data/vendor/Pods/Pods-NSData+MD5Digest-Private.xcconfig +0 -5
  168. data/vendor/Pods/Pods-NSData+MD5Digest-dummy.m +0 -5
  169. data/vendor/Pods/Pods-NSData+MD5Digest-prefix.pch +0 -5
  170. data/vendor/Pods/Pods-NSData+MD5Digest.xcconfig +0 -0
  171. data/vendor/Pods/Pods-YapDatabase-Private.xcconfig +0 -5
  172. data/vendor/Pods/Pods-YapDatabase-dummy.m +0 -5
  173. data/vendor/Pods/Pods-YapDatabase-prefix.pch +0 -5
  174. data/vendor/Pods/Pods-YapDatabase.xcconfig +0 -1
  175. data/vendor/Pods/Pods-acknowledgements.markdown +0 -59
  176. data/vendor/Pods/Pods-acknowledgements.plist +0 -97
  177. data/vendor/Pods/Pods-dummy.m +0 -5
  178. data/vendor/Pods/Pods-environment.h +0 -38
  179. data/vendor/Pods/Pods-resources.sh +0 -68
  180. data/vendor/Pods/Pods.xcconfig +0 -5
  181. data/vendor/Pods/Pods.xcodeproj/project.pbxproj +0 -4807
  182. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-CocoaLumberjack.xcscheme +0 -59
  183. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-NSData+MD5Digest.xcscheme +0 -59
  184. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods-YapDatabase.xcscheme +0 -59
  185. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/Pods.xcscheme +0 -59
  186. data/vendor/Pods/Pods.xcodeproj/xcuserdata/kareemk.xcuserdatad/xcschemes/xcschememanagement.plist +0 -31
  187. data/vendor/Pods/YapDatabase/LICENSE.txt +0 -18
  188. data/vendor/Pods/YapDatabase/README.md +0 -32
  189. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/Internal/YapDatabaseFilteredViewPrivate.h +0 -17
  190. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.h +0 -81
  191. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredView.m +0 -159
  192. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.h +0 -12
  193. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewConnection.m +0 -41
  194. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.h +0 -39
  195. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTransaction.m +0 -1235
  196. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FilteredViews/YapDatabaseFilteredViewTypes.h +0 -32
  197. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/Internal/YapDatabaseFullTextSearchPrivate.h +0 -77
  198. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.h +0 -89
  199. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearch.m +0 -146
  200. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.h +0 -32
  201. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchConnection.m +0 -298
  202. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.h +0 -79
  203. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchSnippetOptions.m +0 -95
  204. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.h +0 -68
  205. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/FullTextSearch/YapDatabaseFullTextSearchTransaction.m +0 -1403
  206. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/Internal/YapDatabaseExtensionPrivate.h +0 -444
  207. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.h +0 -15
  208. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtension.m +0 -83
  209. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.h +0 -11
  210. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionConnection.m +0 -46
  211. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.h +0 -11
  212. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Protocol/YapDatabaseExtensionTransaction.m +0 -204
  213. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipEdgePrivate.h +0 -79
  214. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/Internal/YapDatabaseRelationshipPrivate.h +0 -125
  215. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.h +0 -35
  216. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationship.m +0 -129
  217. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.h +0 -29
  218. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipConnection.m +0 -802
  219. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.h +0 -163
  220. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipEdge.m +0 -408
  221. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipNode.h +0 -99
  222. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.h +0 -59
  223. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipOptions.m +0 -29
  224. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.h +0 -384
  225. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Relationships/YapDatabaseRelationshipTransaction.m +0 -5254
  226. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexPrivate.h +0 -83
  227. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/Internal/YapDatabaseSecondaryIndexSetupPrivate.h +0 -18
  228. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.h +0 -149
  229. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndex.m +0 -161
  230. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.h +0 -33
  231. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexConnection.m +0 -331
  232. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.h +0 -33
  233. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexSetup.m +0 -245
  234. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.h +0 -58
  235. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/SecondaryIndex/YapDatabaseSecondaryIndexTransaction.m +0 -1269
  236. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewChangePrivate.h +0 -94
  237. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewMappingsPrivate.h +0 -72
  238. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.h +0 -36
  239. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPage.mm +0 -296
  240. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.h +0 -27
  241. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPageMetadata.m +0 -28
  242. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewPrivate.h +0 -170
  243. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Internal/YapDatabaseViewRangeOptionsPrivate.h +0 -17
  244. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.h +0 -272
  245. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewChange.m +0 -2500
  246. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.h +0 -842
  247. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewMappings.m +0 -1714
  248. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.h +0 -330
  249. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/Utilities/YapDatabaseViewRangeOptions.m +0 -141
  250. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.h +0 -127
  251. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseView.m +0 -194
  252. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.h +0 -116
  253. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewConnection.m +0 -888
  254. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.h +0 -63
  255. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewOptions.m +0 -27
  256. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.h +0 -498
  257. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTransaction.m +0 -4986
  258. data/vendor/Pods/YapDatabase/YapDatabase/Extensions/Views/YapDatabaseViewTypes.h +0 -99
  259. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.h +0 -8
  260. data/vendor/Pods/YapDatabase/YapDatabase/Internal/NSDictionary+YapDatabase.m +0 -19
  261. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.h +0 -91
  262. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapCache.m +0 -465
  263. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.h +0 -29
  264. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseConnectionState.m +0 -48
  265. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.h +0 -37
  266. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseDefaults.m +0 -83
  267. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.h +0 -158
  268. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseLogging.m +0 -73
  269. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.h +0 -17
  270. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseManager.m +0 -56
  271. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabasePrivate.h +0 -446
  272. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.h +0 -13
  273. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseStatement.m +0 -26
  274. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapDatabaseString.h +0 -121
  275. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.h +0 -74
  276. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapMemoryTable.m +0 -603
  277. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.h +0 -17
  278. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapNull.m +0 -35
  279. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.h +0 -15
  280. data/vendor/Pods/YapDatabase/YapDatabase/Internal/YapTouch.m +0 -31
  281. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.h +0 -23
  282. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapCollectionKey.m +0 -199
  283. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.h +0 -42
  284. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapDatabaseQuery.m +0 -96
  285. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.h +0 -41
  286. data/vendor/Pods/YapDatabase/YapDatabase/Utilities/YapSet.m +0 -82
  287. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.h +0 -547
  288. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabase.m +0 -2013
  289. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.h +0 -449
  290. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseConnection.m +0 -4046
  291. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.h +0 -651
  292. data/vendor/Pods/YapDatabase/YapDatabase/YapDatabaseTransaction.m +0 -5602
  293. data/vendor/Pods/build-iPhoneSimulator/Pods.bridgesupport +0 -3172
  294. data/vendor/Pods/build-iPhoneSimulator/libPods.a +0 -0
@@ -1,35 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
-
3
- #import "YapDatabaseExtension.h"
4
-
5
- #import "YapDatabaseRelationshipNode.h"
6
- #import "YapDatabaseRelationshipEdge.h"
7
- #import "YapDatabaseRelationshipOptions.h"
8
- #import "YapDatabaseRelationshipConnection.h"
9
- #import "YapDatabaseRelationshipTransaction.h"
10
-
11
- /**
12
- * Welcome to YapDatabase!
13
- *
14
- * The project page has a wealth of documentation if you have any questions.
15
- * https://github.com/yaptv/YapDatabase
16
- *
17
- * If you're new to the project you may want to visit the wiki.
18
- * https://github.com/yaptv/YapDatabase/wiki
19
- *
20
- * The YapDatabaseRelationship extension allow you to create relationships between objects,
21
- * and configure automatic deletion rules.
22
- *
23
- * For tons of information about this extension, see the wiki article:
24
- * https://github.com/yaptv/YapDatabase/wiki/Relationships
25
- **/
26
-
27
- @interface YapDatabaseRelationship : YapDatabaseExtension
28
-
29
- - (id)init;
30
-
31
- - (id)initWithVersion:(int)version;
32
-
33
- - (id)initWithVersion:(int)version options:(YapDatabaseRelationshipOptions *)options;
34
-
35
- @end
@@ -1,129 +0,0 @@
1
- #import "YapDatabaseRelationship.h"
2
- #import "YapDatabaseRelationshipPrivate.h"
3
-
4
- #import "YapDatabasePrivate.h"
5
- #import "YapDatabaseExtensionPrivate.h"
6
-
7
- #import "YapDatabaseLogging.h"
8
-
9
- #if ! __has_feature(objc_arc)
10
- #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
11
- #endif
12
-
13
- /**
14
- * Define log level for this file: OFF, ERROR, WARN, INFO, VERBOSE
15
- * See YapDatabaseLogging.h for more information.
16
- **/
17
- #if DEBUG
18
- static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
19
- #else
20
- static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
21
- #endif
22
-
23
-
24
- @implementation YapDatabaseRelationship
25
- {
26
- dispatch_queue_t fileManagerQueue;
27
- }
28
-
29
- /**
30
- * Subclasses MUST implement this method.
31
- *
32
- * This method is used when unregistering an extension in order to drop the related tables.
33
- **/
34
- + (void)dropTablesForRegisteredName:(NSString *)registeredName
35
- withTransaction:(YapDatabaseReadWriteTransaction *)transaction
36
- {
37
- sqlite3 *db = transaction->connection->db;
38
-
39
- NSString *tableName = [self tableNameForRegisteredName:registeredName];
40
- NSString *dropTable = [NSString stringWithFormat:@"DROP TABLE IF EXISTS \"%@\";", tableName];
41
-
42
- int status = sqlite3_exec(db, [dropTable UTF8String], NULL, NULL, NULL);
43
- if (status != SQLITE_OK)
44
- {
45
- YDBLogError(@"%@ - Failed dropping table (%@): %d %s",
46
- THIS_METHOD, tableName, status, sqlite3_errmsg(db));
47
- }
48
- }
49
-
50
- + (NSString *)tableNameForRegisteredName:(NSString *)registeredName
51
- {
52
- return [NSString stringWithFormat:@"relationship_%@", registeredName];
53
- }
54
-
55
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
56
- #pragma mark Instance
57
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
58
-
59
- - (id)init
60
- {
61
- return [self initWithVersion:0 options:nil];
62
-
63
- }
64
-
65
- - (id)initWithVersion:(int)inVersion
66
- {
67
- return [self initWithVersion:inVersion options:nil];
68
- }
69
-
70
- - (id)initWithVersion:(int)inVersion options:(YapDatabaseRelationshipOptions *)inOptions
71
- {
72
- if ((self = [super init]))
73
- {
74
- version = inVersion;
75
- options = inOptions ? [inOptions copy] : [[YapDatabaseRelationshipOptions alloc] init];
76
- }
77
- return self;
78
- }
79
-
80
- /**
81
- * Subclasses must implement this method.
82
- * This method is called during the view registration process to enusre the extension supports
83
- * the database configuration.
84
- **/
85
- - (BOOL)supportsDatabase:(YapDatabase *)database withRegisteredExtensions:(NSDictionary *)registeredExtensions
86
- {
87
- // Only 1 relationship extension is supported at a time.
88
-
89
- __block BOOL supported = YES;
90
-
91
- [registeredExtensions enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
92
-
93
- if ([obj isKindOfClass:[YapDatabaseRelationship class]])
94
- {
95
- YDBLogWarn(@"Only 1 YapDatabaseRelationship instance is supported at a time");
96
-
97
- supported = NO;
98
- *stop = YES;
99
- }
100
- }];
101
-
102
- return supported;
103
- }
104
-
105
- - (YapDatabaseExtensionConnection *)newConnection:(YapDatabaseConnection *)databaseConnection
106
- {
107
- return [[YapDatabaseRelationshipConnection alloc] initWithRelationship:self databaseConnection:databaseConnection];
108
- }
109
-
110
- - (NSString *)tableName
111
- {
112
- return [[self class] tableNameForRegisteredName:self.registeredName];
113
- }
114
-
115
- /**
116
- * The dispatch queue for performing file deletion operations.
117
- * Note: This method is not thread-safe, as it expects to only be invoked from within a read-write transaction.
118
- **/
119
- - (dispatch_queue_t)fileManagerQueue
120
- {
121
- if (fileManagerQueue == NULL)
122
- {
123
- fileManagerQueue = dispatch_queue_create("YapDatabaseRelationship.fileManager", DISPATCH_QUEUE_SERIAL);
124
- }
125
-
126
- return fileManagerQueue;
127
- }
128
-
129
- @end
@@ -1,29 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "YapDatabaseExtensionConnection.h"
3
-
4
- @class YapDatabaseRelationship;
5
-
6
- /**
7
- * Welcome to YapDatabase!
8
- *
9
- * The project page has a wealth of documentation if you have any questions.
10
- * https://github.com/yaptv/YapDatabase
11
- *
12
- * If you're new to the project you may want to visit the wiki.
13
- * https://github.com/yaptv/YapDatabase/wiki
14
- *
15
- * The YapDatabaseRelationship extension allow you to create relationships between objects,
16
- * and configure automatic deletion rules.
17
- *
18
- * For tons of information about this extension, see the wiki article:
19
- * https://github.com/yaptv/YapDatabase/wiki/Relationships
20
- **/
21
-
22
- @interface YapDatabaseRelationshipConnection : YapDatabaseExtensionConnection
23
-
24
- /**
25
- * Returns the parent view instance.
26
- **/
27
- @property (nonatomic, strong, readonly) YapDatabaseRelationship *relationship;
28
-
29
- @end
@@ -1,802 +0,0 @@
1
- #import "YapDatabaseRelationshipConnection.h"
2
- #import "YapDatabaseRelationshipPrivate.h"
3
- #import "YapDatabaseExtensionPrivate.h"
4
- #import "YapDatabasePrivate.h"
5
- #import "YapCollectionKey.h"
6
- #import "YapDatabaseString.h"
7
- #import "YapDatabaseLogging.h"
8
-
9
- #if ! __has_feature(objc_arc)
10
- #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
11
- #endif
12
-
13
- /**
14
- * Define log level for this file: OFF, ERROR, WARN, INFO, VERBOSE
15
- * See YapDatabaseLogging.h for more information.
16
- **/
17
- #if DEBUG
18
- static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
19
- #else
20
- static const int ydbLogLevel = YDB_LOG_LEVEL_WARN;
21
- #endif
22
-
23
-
24
- @implementation YapDatabaseRelationshipConnection
25
- {
26
- sqlite3_stmt *findManualEdgeStatement;
27
- sqlite3_stmt *insertEdgeStatement;
28
- sqlite3_stmt *updateEdgeStatement;
29
- sqlite3_stmt *deleteEdgeStatement;
30
- sqlite3_stmt *deleteEdgesWithNodeStatement;
31
- sqlite3_stmt *enumerateAllDstFilePathStatement;
32
- sqlite3_stmt *enumerateForSrcStatement;
33
- sqlite3_stmt *enumerateForDstStatement;
34
- sqlite3_stmt *enumerateForSrcNameStatement;
35
- sqlite3_stmt *enumerateForDstNameStatement;
36
- sqlite3_stmt *enumerateForNameStatement;
37
- sqlite3_stmt *enumerateForSrcDstStatement;
38
- sqlite3_stmt *enumerateForSrcDstNameStatement;
39
- sqlite3_stmt *countForSrcNameExcludingDstStatement;
40
- sqlite3_stmt *countForDstNameExcludingSrcStatement;
41
- sqlite3_stmt *countForNameStatement;
42
- sqlite3_stmt *countForSrcStatement;
43
- sqlite3_stmt *countForSrcNameStatement;
44
- sqlite3_stmt *countForDstStatement;
45
- sqlite3_stmt *countForDstNameStatement;
46
- sqlite3_stmt *countForSrcDstStatement;
47
- sqlite3_stmt *countForSrcDstNameStatement;
48
- sqlite3_stmt *removeAllStatement;
49
- sqlite3_stmt *removeAllProtocolStatement;
50
- }
51
-
52
- @synthesize relationship = relationship;
53
-
54
- - (id)initWithRelationship:(YapDatabaseRelationship *)inRelationship databaseConnection:(YapDatabaseConnection *)inDbC
55
- {
56
- if ((self = [super init]))
57
- {
58
- relationship = inRelationship;
59
- databaseConnection = inDbC;
60
- }
61
- return self;
62
- }
63
-
64
- - (void)dealloc
65
- {
66
- [self _flushStatements];
67
- }
68
-
69
- - (void)_flushStatements
70
- {
71
- sqlite_finalize_null(&findManualEdgeStatement);
72
- sqlite_finalize_null(&insertEdgeStatement);
73
- sqlite_finalize_null(&updateEdgeStatement);
74
- sqlite_finalize_null(&deleteEdgeStatement);
75
- sqlite_finalize_null(&deleteEdgesWithNodeStatement);
76
- sqlite_finalize_null(&enumerateAllDstFilePathStatement);
77
- sqlite_finalize_null(&enumerateForSrcStatement);
78
- sqlite_finalize_null(&enumerateForDstStatement);
79
- sqlite_finalize_null(&enumerateForSrcNameStatement);
80
- sqlite_finalize_null(&enumerateForDstNameStatement);
81
- sqlite_finalize_null(&enumerateForNameStatement);
82
- sqlite_finalize_null(&enumerateForSrcDstStatement);
83
- sqlite_finalize_null(&enumerateForSrcDstNameStatement);
84
- sqlite_finalize_null(&countForSrcNameExcludingDstStatement);
85
- sqlite_finalize_null(&countForDstNameExcludingSrcStatement);
86
- sqlite_finalize_null(&countForNameStatement);
87
- sqlite_finalize_null(&countForSrcStatement);
88
- sqlite_finalize_null(&countForSrcNameStatement);
89
- sqlite_finalize_null(&countForDstStatement);
90
- sqlite_finalize_null(&countForDstNameStatement);
91
- sqlite_finalize_null(&countForSrcDstStatement);
92
- sqlite_finalize_null(&countForSrcDstNameStatement);
93
- sqlite_finalize_null(&removeAllStatement);
94
- sqlite_finalize_null(&removeAllProtocolStatement);
95
- }
96
-
97
- /**
98
- * Required override method from YapDatabaseExtensionConnection
99
- **/
100
- - (void)_flushMemoryWithFlags:(YapDatabaseConnectionFlushMemoryFlags)flags
101
- {
102
- if (flags & YapDatabaseConnectionFlushMemoryFlags_Statements)
103
- {
104
- [self _flushStatements];
105
- }
106
- }
107
-
108
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
109
- #pragma mark Accessors
110
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
111
-
112
- /**
113
- * Required override method from YapDatabaseExtensionConnection.
114
- **/
115
- - (YapDatabaseExtension *)extension
116
- {
117
- return relationship;
118
- }
119
-
120
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
121
- #pragma mark Transactions
122
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
123
-
124
- /**
125
- * Required override method from YapDatabaseExtensionConnection.
126
- **/
127
- - (id)newReadTransaction:(YapDatabaseReadTransaction *)databaseTransaction
128
- {
129
- YapDatabaseRelationshipTransaction *transaction =
130
- [[YapDatabaseRelationshipTransaction alloc] initWithRelationshipConnection:self
131
- databaseTransaction:databaseTransaction];
132
-
133
- return transaction;
134
- }
135
-
136
- /**
137
- * Required override method from YapDatabaseExtensionConnection.
138
- **/
139
- - (id)newReadWriteTransaction:(YapDatabaseReadWriteTransaction *)databaseTransaction
140
- {
141
- YapDatabaseRelationshipTransaction *transaction =
142
- [[YapDatabaseRelationshipTransaction alloc] initWithRelationshipConnection:self
143
- databaseTransaction:databaseTransaction];
144
-
145
- [self prepareForReadWriteTransaction];
146
- return transaction;
147
- }
148
-
149
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
150
- #pragma mark Changeset
151
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
152
-
153
- /**
154
- * Initializes any ivars that a read-write transaction may need.
155
- **/
156
- - (void)prepareForReadWriteTransaction
157
- {
158
- if (protocolChanges == nil)
159
- protocolChanges = [[NSMutableDictionary alloc] init];
160
- if (manualChanges == nil)
161
- manualChanges = [[NSMutableDictionary alloc] init];
162
- if (inserted == nil)
163
- inserted = [[NSMutableSet alloc] init];
164
- if (deletedOrder == nil)
165
- deletedOrder = [[NSMutableArray alloc] init];
166
- if (deletedInfo == nil)
167
- deletedInfo = [[NSMutableDictionary alloc] init];
168
- if (filesToDelete == nil)
169
- filesToDelete = [[NSMutableSet alloc] init];
170
- }
171
-
172
- /**
173
- * Invoked by our YapDatabaseViewTransaction at the completion of the commitTransaction method.
174
- **/
175
- - (void)postCommitCleanup
176
- {
177
- YDBLogAutoTrace();
178
-
179
- [protocolChanges removeAllObjects];
180
- [manualChanges removeAllObjects];
181
- [inserted removeAllObjects];
182
- [deletedOrder removeAllObjects];
183
- [deletedInfo removeAllObjects];
184
-
185
- // By nil'ing this out (instead of removing all objects)
186
- // we can avoid a copy of this object.
187
- if ([filesToDelete count] > 0)
188
- filesToDelete = nil;
189
- }
190
-
191
- /**
192
- * Invoked by our YapDatabaseViewTransaction at the completion of the rollbackTransaction method.
193
- **/
194
- - (void)postRollbackCleanup
195
- {
196
- YDBLogAutoTrace();
197
-
198
- [protocolChanges removeAllObjects];
199
- [manualChanges removeAllObjects];
200
- [inserted removeAllObjects];
201
- [deletedOrder removeAllObjects];
202
- [deletedInfo removeAllObjects];
203
- [filesToDelete removeAllObjects];
204
- }
205
-
206
- - (void)getInternalChangeset:(NSMutableDictionary **)internalChangesetPtr
207
- externalChangeset:(NSMutableDictionary **)externalChangesetPtr
208
- hasDiskChanges:(BOOL *)hasDiskChangesPtr
209
- {
210
- YDBLogAutoTrace();
211
-
212
- NSMutableDictionary *internalChangeset = nil;
213
- NSMutableDictionary *externalChangeset = nil;
214
- BOOL hasDiskChanges = NO;
215
-
216
- // In the future we may want to store a changeset that specifies which edges were added & removed.
217
-
218
- *internalChangesetPtr = internalChangeset;
219
- *externalChangesetPtr = externalChangeset;
220
- *hasDiskChangesPtr = hasDiskChanges;
221
- }
222
-
223
- - (void)processChangeset:(NSDictionary *)changeset
224
- {
225
- // Nothing to do here.
226
- // This method is required to be overriden by YapDatabaseExtensionConnection.
227
- }
228
-
229
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
230
- #pragma mark Statements
231
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
232
-
233
- - (sqlite3_stmt *)findManualEdgeStatement
234
- {
235
- if (findManualEdgeStatement == NULL)
236
- {
237
- NSString *tableName = [relationship tableName];
238
-
239
- NSString *string = [NSString stringWithFormat:
240
- @"SELECT \"rowid\", \"rules\" FROM \"%@\" "
241
- @" WHERE \"src\" = ? AND \"dst\" = ? AND \"name\" = ? AND \"manual\" = 1 LIMIT 1;",
242
- tableName];
243
-
244
- sqlite3 *db = databaseConnection->db;
245
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
246
-
247
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &findManualEdgeStatement, NULL);
248
- if (status != SQLITE_OK)
249
- {
250
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
251
- }
252
-
253
- FreeYapDatabaseString(&stmt);
254
- }
255
-
256
- return findManualEdgeStatement;
257
- }
258
-
259
- - (sqlite3_stmt *)insertEdgeStatement
260
- {
261
- if (insertEdgeStatement == NULL)
262
- {
263
- NSString *string = [NSString stringWithFormat:
264
- @"INSERT INTO \"%@\" (\"name\", \"src\", \"dst\", \"rules\", \"manual\") VALUES (?, ?, ?, ?, ?);",
265
- [relationship tableName]];
266
-
267
- sqlite3 *db = databaseConnection->db;
268
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
269
-
270
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &insertEdgeStatement, NULL);
271
- if (status != SQLITE_OK)
272
- {
273
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
274
- }
275
-
276
- FreeYapDatabaseString(&stmt);
277
- }
278
-
279
- return insertEdgeStatement;
280
- }
281
-
282
- - (sqlite3_stmt *)updateEdgeStatement
283
- {
284
- if (updateEdgeStatement == NULL)
285
- {
286
- NSString *string = [NSString stringWithFormat:
287
- @"UPDATE \"%@\" SET \"rules\" = ? WHERE \"rowid\" = ?;", [relationship tableName]];
288
-
289
- sqlite3 *db = databaseConnection->db;
290
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
291
-
292
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &updateEdgeStatement, NULL);
293
- if (status != SQLITE_OK)
294
- {
295
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
296
- }
297
-
298
- FreeYapDatabaseString(&stmt);
299
- }
300
-
301
- return updateEdgeStatement;
302
- }
303
-
304
- - (sqlite3_stmt *)deleteEdgeStatement
305
- {
306
- if (deleteEdgeStatement == NULL)
307
- {
308
- NSString *string = [NSString stringWithFormat:
309
- @"DELETE FROM \"%@\" WHERE \"rowid\" = ?;", [relationship tableName]];
310
-
311
- sqlite3 *db = databaseConnection->db;
312
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
313
-
314
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &deleteEdgeStatement, NULL);
315
- if (status != SQLITE_OK)
316
- {
317
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
318
- }
319
-
320
- FreeYapDatabaseString(&stmt);
321
- }
322
-
323
- return deleteEdgeStatement;
324
- }
325
-
326
- - (sqlite3_stmt *)deleteEdgesWithNodeStatement
327
- {
328
- if (deleteEdgesWithNodeStatement == NULL)
329
- {
330
- NSString *string = [NSString stringWithFormat:
331
- @"DELETE FROM \"%@\" WHERE \"src\" = ? OR \"dst\" = ?;", [relationship tableName]];
332
-
333
- sqlite3 *db = databaseConnection->db;
334
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
335
-
336
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &deleteEdgesWithNodeStatement, NULL);
337
- if (status != SQLITE_OK)
338
- {
339
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
340
- }
341
-
342
- FreeYapDatabaseString(&stmt);
343
- }
344
-
345
- return deleteEdgesWithNodeStatement;
346
- }
347
-
348
- - (sqlite3_stmt *)enumerateAllDstFilePathStatement
349
- {
350
- if (enumerateAllDstFilePathStatement == NULL)
351
- {
352
- // The 'dst' column stores both integers and text.
353
- // If the edge has a destination key & column, then the 'dst' affinity of row is integer (rowid of dst).
354
- // If the edge has a destinationFilePath, the the 'dst' affinity of row is text.
355
- //
356
- // We've set the affinity of the 'dst' column to be none.
357
- // Which means that we can easily find all 'dst' rows with text affinity by searching for those rows
358
- // where: 'dst' > INT64_MAX
359
- //
360
- // This is because TEXT is always greater than INTEGER
361
- //
362
- // For more information, see the documentation: http://www.sqlite.org/datatype3.html
363
-
364
- NSString *string = [NSString stringWithFormat:
365
- @"SELECT \"dst\" FROM \"%@\" WHERE \"dst\" > ?;",
366
- [relationship tableName]];
367
-
368
- sqlite3 *db = databaseConnection->db;
369
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
370
-
371
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateAllDstFilePathStatement, NULL);
372
- if (status != SQLITE_OK)
373
- {
374
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
375
- }
376
-
377
- FreeYapDatabaseString(&stmt);
378
- }
379
-
380
- if (enumerateAllDstFilePathStatement)
381
- {
382
- // We do this outside of the if statement above
383
- // just in case we accidentally call sqlite3_clear_bindings.
384
-
385
- sqlite3_bind_int64(enumerateAllDstFilePathStatement, 1, INT64_MAX);
386
- }
387
-
388
- return enumerateAllDstFilePathStatement;
389
- }
390
-
391
- - (sqlite3_stmt *)enumerateForSrcStatement
392
- {
393
- if (enumerateForSrcStatement == NULL)
394
- {
395
- NSString *string = [NSString stringWithFormat:
396
- @"SELECT \"rowid\", \"name\", \"dst\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ?;",
397
- [relationship tableName]];
398
-
399
- sqlite3 *db = databaseConnection->db;
400
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
401
-
402
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateForSrcStatement, NULL);
403
- if (status != SQLITE_OK)
404
- {
405
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
406
- }
407
-
408
- FreeYapDatabaseString(&stmt);
409
- }
410
-
411
- return enumerateForSrcStatement;
412
- }
413
-
414
- - (sqlite3_stmt *)enumerateForDstStatement
415
- {
416
- if (enumerateForDstStatement == NULL)
417
- {
418
- NSString *string = [NSString stringWithFormat:
419
- @"SELECT \"rowid\", \"name\", \"src\", \"rules\", \"manual\" FROM \"%@\" WHERE \"dst\" = ?;",
420
- [relationship tableName]];
421
-
422
- sqlite3 *db = databaseConnection->db;
423
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
424
-
425
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateForDstStatement, NULL);
426
- if (status != SQLITE_OK)
427
- {
428
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
429
- }
430
-
431
- FreeYapDatabaseString(&stmt);
432
- }
433
-
434
- return enumerateForDstStatement;
435
- }
436
-
437
- - (sqlite3_stmt *)enumerateForSrcNameStatement
438
- {
439
- if (enumerateForSrcNameStatement == NULL)
440
- {
441
- NSString *string = [NSString stringWithFormat:
442
- @"SELECT \"rowid\", \"dst\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ? AND \"name\" = ?;",
443
- [relationship tableName]];
444
-
445
- sqlite3 *db = databaseConnection->db;
446
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
447
-
448
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateForSrcNameStatement, NULL);
449
- if (status != SQLITE_OK)
450
- {
451
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
452
- }
453
-
454
- FreeYapDatabaseString(&stmt);
455
- }
456
-
457
- return enumerateForSrcNameStatement;
458
- }
459
-
460
- - (sqlite3_stmt *)enumerateForDstNameStatement
461
- {
462
- if (enumerateForDstNameStatement == NULL)
463
- {
464
- NSString *string = [NSString stringWithFormat:
465
- @"SELECT \"rowid\", \"src\", \"rules\", \"manual\" FROM \"%@\" WHERE \"dst\" = ? AND \"name\" = ?;",
466
- [relationship tableName]];
467
-
468
- sqlite3 *db = databaseConnection->db;
469
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
470
-
471
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateForDstNameStatement, NULL);
472
- if (status != SQLITE_OK)
473
- {
474
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
475
- }
476
-
477
- FreeYapDatabaseString(&stmt);
478
- }
479
-
480
- return enumerateForDstNameStatement;
481
- }
482
-
483
- - (sqlite3_stmt *)enumerateForNameStatement
484
- {
485
- if (enumerateForNameStatement == NULL)
486
- {
487
- NSString *string = [NSString stringWithFormat:
488
- @"SELECT \"rowid\", \"src\", \"dst\", \"rules\", \"manual\" FROM \"%@\" WHERE \"name\" = ?;",
489
- [relationship tableName]];
490
-
491
- sqlite3 *db = databaseConnection->db;
492
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
493
-
494
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateForNameStatement, NULL);
495
- if (status != SQLITE_OK)
496
- {
497
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
498
- }
499
-
500
- FreeYapDatabaseString(&stmt);
501
- }
502
-
503
- return enumerateForNameStatement;
504
- }
505
-
506
- - (sqlite3_stmt *)enumerateForSrcDstStatement
507
- {
508
- if (enumerateForSrcDstStatement == NULL)
509
- {
510
- NSString *string = [NSString stringWithFormat:
511
- @"SELECT \"rowid\", \"name\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ? AND \"dst\" = ?;",
512
- [relationship tableName]];
513
-
514
- sqlite3 *db = databaseConnection->db;
515
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
516
-
517
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateForSrcDstStatement, NULL);
518
- if (status != SQLITE_OK)
519
- {
520
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
521
- }
522
-
523
- FreeYapDatabaseString(&stmt);
524
- }
525
-
526
- return enumerateForSrcDstStatement;
527
- }
528
-
529
- - (sqlite3_stmt *)enumerateForSrcDstNameStatement
530
- {
531
- if (enumerateForSrcDstNameStatement == NULL)
532
- {
533
- NSString *string = [NSString stringWithFormat:
534
- @"SELECT \"rowid\", \"rules\", \"manual\" FROM \"%@\" WHERE \"src\" = ? AND \"dst\" = ? AND \"name\" = ?;",
535
- [relationship tableName]];
536
-
537
- sqlite3 *db = databaseConnection->db;
538
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
539
-
540
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &enumerateForSrcDstNameStatement, NULL);
541
- if (status != SQLITE_OK)
542
- {
543
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
544
- }
545
-
546
- FreeYapDatabaseString(&stmt);
547
- }
548
-
549
- return enumerateForSrcDstNameStatement;
550
- }
551
-
552
- - (sqlite3_stmt *)countForSrcNameExcludingDstStatement
553
- {
554
- if (countForSrcNameExcludingDstStatement == NULL)
555
- {
556
- NSString *string = [NSString stringWithFormat:
557
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"src\" = ? AND \"dst\" != ? AND \"name\" = ?;",
558
- [relationship tableName]];
559
-
560
- sqlite3 *db = databaseConnection->db;
561
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
562
-
563
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForSrcNameExcludingDstStatement, NULL);
564
- if (status != SQLITE_OK)
565
- {
566
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
567
- }
568
-
569
- FreeYapDatabaseString(&stmt);
570
- }
571
-
572
- return countForSrcNameExcludingDstStatement;
573
- }
574
-
575
- - (sqlite3_stmt *)countForDstNameExcludingSrcStatement
576
- {
577
- if (countForDstNameExcludingSrcStatement == NULL)
578
- {
579
- NSString *string = [NSString stringWithFormat:
580
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"dst\" = ? AND \"src\" != ? AND \"name\" = ?;",
581
- [relationship tableName]];
582
-
583
- sqlite3 *db = databaseConnection->db;
584
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
585
-
586
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForDstNameExcludingSrcStatement, NULL);
587
- if (status != SQLITE_OK)
588
- {
589
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
590
- }
591
-
592
- FreeYapDatabaseString(&stmt);
593
- }
594
-
595
- return countForDstNameExcludingSrcStatement;
596
- }
597
-
598
- - (sqlite3_stmt *)countForNameStatement
599
- {
600
- if (countForNameStatement == NULL)
601
- {
602
- NSString *string = [NSString stringWithFormat:
603
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"name\" = ?;",
604
- [relationship tableName]];
605
-
606
- sqlite3 *db = databaseConnection->db;
607
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
608
-
609
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForNameStatement, NULL);
610
- if (status != SQLITE_OK)
611
- {
612
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
613
- }
614
-
615
- FreeYapDatabaseString(&stmt);
616
- }
617
-
618
- return countForNameStatement;
619
- }
620
-
621
- - (sqlite3_stmt *)countForSrcStatement
622
- {
623
- if (countForSrcStatement == NULL)
624
- {
625
- NSString *string = [NSString stringWithFormat:
626
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"src\" = ?;",
627
- [relationship tableName]];
628
-
629
- sqlite3 *db = databaseConnection->db;
630
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
631
-
632
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForSrcStatement, NULL);
633
- if (status != SQLITE_OK)
634
- {
635
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
636
- }
637
-
638
- FreeYapDatabaseString(&stmt);
639
- }
640
-
641
- return countForSrcStatement;
642
- }
643
-
644
- - (sqlite3_stmt *)countForSrcNameStatement
645
- {
646
- if (countForSrcNameStatement == NULL)
647
- {
648
- NSString *string = [NSString stringWithFormat:
649
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"src\" = ? AND \"name\" = ?;",
650
- [relationship tableName]];
651
-
652
- sqlite3 *db = databaseConnection->db;
653
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
654
-
655
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForSrcNameStatement, NULL);
656
- if (status != SQLITE_OK)
657
- {
658
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
659
- }
660
-
661
- FreeYapDatabaseString(&stmt);
662
- }
663
-
664
- return countForSrcNameStatement;
665
- }
666
-
667
- - (sqlite3_stmt *)countForDstStatement
668
- {
669
- if (countForDstStatement == NULL)
670
- {
671
- NSString *string = [NSString stringWithFormat:
672
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"dst\" = ?;",
673
- [relationship tableName]];
674
-
675
- sqlite3 *db = databaseConnection->db;
676
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
677
-
678
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForDstStatement, NULL);
679
- if (status != SQLITE_OK)
680
- {
681
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
682
- }
683
-
684
- FreeYapDatabaseString(&stmt);
685
- }
686
-
687
- return countForDstStatement;
688
- }
689
-
690
- - (sqlite3_stmt *)countForDstNameStatement
691
- {
692
- if (countForDstNameStatement == NULL)
693
- {
694
- NSString *string = [NSString stringWithFormat:
695
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"dst\" = ? AND \"name\" = ?;",
696
- [relationship tableName]];
697
-
698
- sqlite3 *db = databaseConnection->db;
699
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
700
-
701
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForDstNameStatement, NULL);
702
- if (status != SQLITE_OK)
703
- {
704
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
705
- }
706
-
707
- FreeYapDatabaseString(&stmt);
708
- }
709
-
710
- return countForDstNameStatement;
711
- }
712
-
713
- - (sqlite3_stmt *)countForSrcDstStatement
714
- {
715
- if (countForSrcDstStatement == NULL)
716
- {
717
- NSString *string = [NSString stringWithFormat:
718
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"src\" = ? AND \"dst\" = ?;",
719
- [relationship tableName]];
720
-
721
- sqlite3 *db = databaseConnection->db;
722
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
723
-
724
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForSrcDstStatement, NULL);
725
- if (status != SQLITE_OK)
726
- {
727
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
728
- }
729
-
730
- FreeYapDatabaseString(&stmt);
731
- }
732
-
733
- return countForSrcDstStatement;
734
- }
735
-
736
- - (sqlite3_stmt *)countForSrcDstNameStatement
737
- {
738
- if (countForSrcDstNameStatement == NULL)
739
- {
740
- NSString *string = [NSString stringWithFormat:
741
- @"SELECT COUNT(*) AS NumberOfRows FROM \"%@\" WHERE \"src\" = ? AND \"dst\" = ? AND \"name\" = ?;",
742
- [relationship tableName]];
743
-
744
- sqlite3 *db = databaseConnection->db;
745
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
746
-
747
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &countForSrcDstNameStatement, NULL);
748
- if (status != SQLITE_OK)
749
- {
750
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
751
- }
752
-
753
- FreeYapDatabaseString(&stmt);
754
- }
755
-
756
- return countForSrcDstNameStatement;
757
- }
758
-
759
- - (sqlite3_stmt *)removeAllStatement
760
- {
761
- if (removeAllStatement == NULL)
762
- {
763
- NSString *string = [NSString stringWithFormat:@"DELETE FROM \"%@\";", [relationship tableName]];
764
-
765
- sqlite3 *db = databaseConnection->db;
766
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
767
-
768
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &removeAllStatement, NULL);
769
- if (status != SQLITE_OK)
770
- {
771
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
772
- }
773
-
774
- FreeYapDatabaseString(&stmt);
775
- }
776
-
777
- return removeAllStatement;
778
- }
779
-
780
- - (sqlite3_stmt *)removeAllProtocolStatement
781
- {
782
- if (removeAllProtocolStatement == NULL)
783
- {
784
- NSString *string = [NSString stringWithFormat:
785
- @"DELETE FROM \"%@\" WHERE \"manual\" = 0;", [relationship tableName]];
786
-
787
- sqlite3 *db = databaseConnection->db;
788
- YapDatabaseString stmt; MakeYapDatabaseString(&stmt, string);
789
-
790
- int status = sqlite3_prepare_v2(db, stmt.str, stmt.length+1, &removeAllProtocolStatement, NULL);
791
- if (status != SQLITE_OK)
792
- {
793
- YDBLogError(@"%@: Error creating prepared statement: %d %s", THIS_METHOD, status, sqlite3_errmsg(db));
794
- }
795
-
796
- FreeYapDatabaseString(&stmt);
797
- }
798
-
799
- return removeAllProtocolStatement;
800
- }
801
-
802
- @end