nano-store 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. data/README.md +8 -4
  2. data/Rakefile +1 -1
  3. data/lib/nano_store.rb +2 -4
  4. data/lib/nano_store/version.rb +1 -1
  5. data/spec/model_spec.rb +14 -0
  6. data/spec/spec_helper.rb +4 -0
  7. data/vendor/Podfile.lock +4 -4
  8. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoGlobals.h +3 -1
  9. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoPredicate.h +5 -5
  10. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoSearch.h +5 -3
  11. data/vendor/Pods/BuildHeaders/NanoStore/NSFNanoSortDescriptor.h +1 -1
  12. data/vendor/Pods/BuildHeaders/NanoStore/NanoStore.h +36 -0
  13. data/vendor/Pods/Documentation/NanoStore/docset-installed.txt +2 -2
  14. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Info.plist +3 -3
  15. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoBag.html +2 -2
  16. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoEngine.html +2 -2
  17. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoExpression.html +2 -2
  18. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoObject.html +2 -2
  19. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoPredicate.html +7 -7
  20. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoResult.html +2 -2
  21. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoSearch.html +66 -5
  22. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoSortDescriptor.html +3 -3
  23. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFNanoStore.html +2 -2
  24. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Classes/NSFOrderedDictionary.html +2 -2
  25. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/Protocols/NSFNanoObjectProtocol.html +2 -2
  26. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/css/styles.css +0 -0
  27. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/hierarchy.html +5 -5
  28. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Documents/index.html +5 -5
  29. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Nodes.xml +1 -1
  30. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Tokens5.xml +6 -6
  31. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Tokens7.xml +24 -2
  32. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/Tokens8.xml +2 -2
  33. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/docSet.dsidx +0 -0
  34. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/docSet.skidx +0 -0
  35. data/vendor/Pods/Documentation/NanoStore/docset/Contents/Resources/docSet.toc +0 -0
  36. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoBag.html +2 -2
  37. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoEngine.html +2 -2
  38. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoExpression.html +2 -2
  39. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoObject.html +2 -2
  40. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoPredicate.html +7 -7
  41. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoResult.html +2 -2
  42. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoSearch.html +66 -5
  43. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoSortDescriptor.html +3 -3
  44. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFNanoStore.html +2 -2
  45. data/vendor/Pods/Documentation/NanoStore/html/Classes/NSFOrderedDictionary.html +2 -2
  46. data/vendor/Pods/Documentation/NanoStore/html/Protocols/NSFNanoObjectProtocol.html +2 -2
  47. data/vendor/Pods/Documentation/NanoStore/html/css/styles.css +0 -0
  48. data/vendor/Pods/Documentation/NanoStore/html/hierarchy.html +5 -5
  49. data/vendor/Pods/Documentation/NanoStore/html/index.html +5 -5
  50. data/vendor/Pods/Headers/NanoStore/NSFNanoGlobals.h +3 -1
  51. data/vendor/Pods/Headers/NanoStore/NSFNanoPredicate.h +5 -5
  52. data/vendor/Pods/Headers/NanoStore/NSFNanoSearch.h +5 -3
  53. data/vendor/Pods/Headers/NanoStore/NSFNanoSortDescriptor.h +1 -1
  54. data/vendor/Pods/Headers/NanoStore/NanoStore.h +36 -0
  55. data/vendor/Pods/NanoStore/Classes/Advanced/NSFNanoEngine.m +40 -49
  56. data/vendor/Pods/NanoStore/Classes/Advanced/NSFNanoResult.m +42 -53
  57. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoBag.m +80 -89
  58. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoExpression.m +11 -13
  59. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoGlobals.h +3 -1
  60. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoGlobals.m +1 -0
  61. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoObject.m +34 -29
  62. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoPredicate.h +5 -5
  63. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoPredicate.m +43 -34
  64. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSearch.h +5 -3
  65. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSearch.m +171 -97
  66. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSortDescriptor.h +1 -1
  67. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSortDescriptor.m +13 -12
  68. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoStore.m +92 -86
  69. data/vendor/Pods/NanoStore/Classes/Public/NanoStore.h +36 -0
  70. data/vendor/Pods/Pods-resources.sh +8 -4
  71. data/vendor/Pods/Pods.bridgesupport +109 -101
  72. metadata +5 -5
@@ -12,7 +12,7 @@
12
12
  <body>
13
13
  <header id="top_header">
14
14
  <div id="library" class="hideInXcode">
15
- <h1><a id="libraryTitle" href="../index.html">NanoStore 2.5.2 </a></h1>
15
+ <h1><a id="libraryTitle" href="../index.html">NanoStore 2.6.4 </a></h1>
16
16
  <a id="developerHome" href="../index.html">Tito Ciuro</a>
17
17
  </div>
18
18
 
@@ -44,6 +44,8 @@
44
44
 
45
45
  <option value="//api/name/attributesToBeReturned">&nbsp;&nbsp;&nbsp;&nbsp;attributesToBeReturned</option>
46
46
 
47
+ <option value="//api/name/bag">&nbsp;&nbsp;&nbsp;&nbsp;bag</option>
48
+
47
49
  <option value="//api/name/expressions">&nbsp;&nbsp;&nbsp;&nbsp;expressions</option>
48
50
 
49
51
  <option value="//api/name/filterClass">&nbsp;&nbsp;&nbsp;&nbsp;filterClass</option>
@@ -162,6 +164,8 @@
162
164
 
163
165
  <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/attributesToBeReturned">attributesToBeReturned</a></span></li>
164
166
 
167
+ <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/bag">bag</a></span></li>
168
+
165
169
  <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/expressions">expressions</a></span></li>
166
170
 
167
171
  <li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/filterClass">filterClass</a></span></li>
@@ -552,6 +556,16 @@ NSDictionary *searchResults = [search searchObjectsWithReturnType:NSFReturnObjec
552
556
  </span>
553
557
  <span class="task-item-suffix">property</span>
554
558
 
559
+ </li><li>
560
+ <span class="tooltip">
561
+ <code><a href="#//api/name/bag">&nbsp;&nbsp;bag</a></code>
562
+ <span class="tooltip"><ul>
563
+ <li><a href="#//api/name/limit">limit</a> a Search to a particular bag.</li>
564
+ </ul>
565
+ </span>
566
+ </span>
567
+ <span class="task-item-suffix">property</span>
568
+
555
569
  </li>
556
570
  </ul>
557
571
 
@@ -886,6 +900,53 @@ NSDictionary *searchResults = [search searchObjectsWithReturnType:NSFReturnObjec
886
900
 
887
901
 
888
902
 
903
+ <div class="method-subsection declared-in-section">
904
+ <h4 class="method-subtitle">Declared In</h4>
905
+ <code class="declared-in-ref">NSFNanoSearch.h</code><br />
906
+ </div>
907
+
908
+
909
+ </div>
910
+
911
+ <div class="section-method">
912
+ <a name="//api/name/bag" title="bag"></a>
913
+ <h3 class="subsubtitle method-title">bag</h3>
914
+
915
+
916
+
917
+ <div class="method-subsection brief-description">
918
+ <ul>
919
+ <li><a href="#//api/name/limit">limit</a> a Search to a particular bag.</li>
920
+ </ul>
921
+
922
+ </div>
923
+
924
+
925
+
926
+ <div class="method-subsection method-declaration"><code>@property (nonatomic, assign, readwrite) NSFNanoBag *bag</code></div>
927
+
928
+
929
+
930
+
931
+
932
+
933
+
934
+
935
+
936
+ <div class="method-subsection discussion-section">
937
+ <h4 class="method-subtitle">Discussion</h4>
938
+ <ul>
939
+ <li><a href="#//api/name/limit">limit</a> a Search to a particular bag.</li>
940
+ </ul>
941
+
942
+ </div>
943
+
944
+
945
+
946
+
947
+
948
+
949
+
889
950
  <div class="method-subsection declared-in-section">
890
951
  <h4 class="method-subtitle">Declared In</h4>
891
952
  <code class="declared-in-ref">NSFNanoSearch.h</code><br />
@@ -956,7 +1017,7 @@ NSDictionary *searchResults = [search searchObjectsWithReturnType:NSFReturnObjec
956
1017
 
957
1018
 
958
1019
 
959
- <div class="method-subsection method-declaration"><code>@property (nonatomic, strong, readwrite) NSString *filterClass</code></div>
1020
+ <div class="method-subsection method-declaration"><code>@property (nonatomic, copy, readwrite) NSString *filterClass</code></div>
960
1021
 
961
1022
 
962
1023
 
@@ -2271,7 +2332,7 @@ When invoked, it sets the values of search to its initial state. Resetting and p
2271
2332
 
2272
2333
  <div class="method-subsection discussion-section">
2273
2334
  <h4 class="method-subtitle">Discussion</h4>
2274
- <p>Performs a search using the values of the properties before, on or after a given date.</p><div class="note"><p><strong>Note:</strong> The <a href="#//api/name/sort">sort</a> descriptor will be ignored when returning requesting NSFReturnKeys.</p></div>
2335
+ <p>Performs a search using the values of the properties before, on or after a given date.</p><div class="note"><p><strong>Note:</strong> The <a href="#//api/name/sort">sort</a> descriptor will be ignored when the return type is NSFReturnKeys.</p></div>
2275
2336
  </div>
2276
2337
 
2277
2338
 
@@ -2341,7 +2402,7 @@ When invoked, it sets the values of search to its initial state. Resetting and p
2341
2402
 
2342
2403
  <div class="method-subsection discussion-section">
2343
2404
  <h4 class="method-subtitle">Discussion</h4>
2344
- <p>Performs a search using the values of the properties.</p><div class="note"><p><strong>Note:</strong> The <a href="#//api/name/sort">sort</a> descriptor will be ignored when returning requesting NSFReturnKeys.</p></div>
2405
+ <p>Performs a search using the values of the properties.</p><div class="note"><p><strong>Note:</strong> The <a href="#//api/name/sort">sort</a> descriptor will be ignored when the return type is NSFReturnKeys.</p></div>
2345
2406
  </div>
2346
2407
 
2347
2408
 
@@ -2380,7 +2441,7 @@ When invoked, it sets the values of search to its initial state. Resetting and p
2380
2441
  <div id="footer">
2381
2442
  <hr />
2382
2443
  <div class="footer-copyright">
2383
- <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-01-22)</span><br />
2444
+ <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-03-08)</span><br />
2384
2445
 
2385
2446
  <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
2386
2447
 
@@ -12,7 +12,7 @@
12
12
  <body>
13
13
  <header id="top_header">
14
14
  <div id="library" class="hideInXcode">
15
- <h1><a id="libraryTitle" href="../index.html">NanoStore 2.5.2 </a></h1>
15
+ <h1><a id="libraryTitle" href="../index.html">NanoStore 2.6.4 </a></h1>
16
16
  <a id="developerHome" href="../index.html">Tito Ciuro</a>
17
17
  </div>
18
18
 
@@ -296,7 +296,7 @@ NSLog(@&ldquo;%@&rdquo;, [[object info]objectForKey:@&ldquo;City&rdquo;]);
296
296
 
297
297
 
298
298
 
299
- <div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) NSString *attribute</code></div>
299
+ <div class="method-subsection method-declaration"><code>@property (nonatomic, copy, readonly) NSString *attribute</code></div>
300
300
 
301
301
 
302
302
 
@@ -610,7 +610,7 @@ NSLog(@&ldquo;%@&rdquo;, [[object info]objectForKey:@&ldquo;City&rdquo;]);
610
610
  <div id="footer">
611
611
  <hr />
612
612
  <div class="footer-copyright">
613
- <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-01-22)</span><br />
613
+ <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-03-08)</span><br />
614
614
 
615
615
  <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
616
616
 
@@ -12,7 +12,7 @@
12
12
  <body>
13
13
  <header id="top_header">
14
14
  <div id="library" class="hideInXcode">
15
- <h1><a id="libraryTitle" href="../index.html">NanoStore 2.5.2 </a></h1>
15
+ <h1><a id="libraryTitle" href="../index.html">NanoStore 2.6.4 </a></h1>
16
16
  <a id="developerHome" href="../index.html">Tito Ciuro</a>
17
17
  </div>
18
18
 
@@ -3620,7 +3620,7 @@ Therefore, it&rsquo;s always a good idea to call \link saveStoreAndReturnError:
3620
3620
  <div id="footer">
3621
3621
  <hr />
3622
3622
  <div class="footer-copyright">
3623
- <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-01-22)</span><br />
3623
+ <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-03-08)</span><br />
3624
3624
 
3625
3625
  <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
3626
3626
 
@@ -12,7 +12,7 @@
12
12
  <body>
13
13
  <header id="top_header">
14
14
  <div id="library" class="hideInXcode">
15
- <h1><a id="libraryTitle" href="../index.html">NanoStore 2.5.2 </a></h1>
15
+ <h1><a id="libraryTitle" href="../index.html">NanoStore 2.6.4 </a></h1>
16
16
  <a id="developerHome" href="../index.html">Tito Ciuro</a>
17
17
  </div>
18
18
 
@@ -209,7 +209,7 @@
209
209
  <div id="footer">
210
210
  <hr />
211
211
  <div class="footer-copyright">
212
- <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-01-22)</span><br />
212
+ <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-03-08)</span><br />
213
213
 
214
214
  <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
215
215
 
@@ -12,7 +12,7 @@
12
12
  <body>
13
13
  <header id="top_header">
14
14
  <div id="library" class="hideInXcode">
15
- <h1><a id="libraryTitle" href="../index.html">NanoStore 2.5.2 </a></h1>
15
+ <h1><a id="libraryTitle" href="../index.html">NanoStore 2.6.4 </a></h1>
16
16
  <a id="developerHome" href="../index.html">Tito Ciuro</a>
17
17
  </div>
18
18
 
@@ -548,7 +548,7 @@ NSFNanoSortDescriptor *sortedCities = [[NSFNanoSortDescriptor alloc]initWithAttr
548
548
  <div id="footer">
549
549
  <hr />
550
550
  <div class="footer-copyright">
551
- <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-01-22)</span><br />
551
+ <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-03-08)</span><br />
552
552
 
553
553
  <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
554
554
 
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <title>NanoStore 2.5.2 Hierarchy</title>
5
+ <title>NanoStore 2.6.4 Hierarchy</title>
6
6
  <link rel="stylesheet" type="text/css" href="css/styles.css" media="all" />
7
7
  <link rel="stylesheet" type="text/css" media="print" href="css/stylesPrint.css" />
8
8
  <meta name="generator" content="appledoc 2.0.5 (build 789)" />
@@ -10,12 +10,12 @@
10
10
  <body>
11
11
  <header id="top_header">
12
12
  <div id="library" class="hideInXcode">
13
- <h1><a id="libraryTitle" href="index.html">NanoStore 2.5.2 </a></h1>
13
+ <h1><a id="libraryTitle" href="index.html">NanoStore 2.6.4 </a></h1>
14
14
  <a id="developerHome" href="index.html">Tito Ciuro</a>
15
15
  </div>
16
16
 
17
17
  <div id="title" role="banner">
18
- <h1 class="hideInXcode">NanoStore 2.5.2 Hierarchy</h1>
18
+ <h1 class="hideInXcode">NanoStore 2.6.4 Hierarchy</h1>
19
19
  </div>
20
20
  <ul id="headerButtons" role="toolbar"></ul>
21
21
  </header>
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  <div id="header">
28
28
  <div class="section-header">
29
- <h1 class="title title-header">NanoStore 2.5.2 Hierarchy</h1>
29
+ <h1 class="title title-header">NanoStore 2.6.4 Hierarchy</h1>
30
30
  </div>
31
31
  </div>
32
32
  <div id="container">
@@ -93,7 +93,7 @@
93
93
  <div id="footer">
94
94
  <hr />
95
95
  <div class="footer-copyright">
96
- <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-01-22)</span><br />
96
+ <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-03-08)</span><br />
97
97
 
98
98
  <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
99
99
 
@@ -2,7 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <title>NanoStore 2.5.2 Reference</title>
5
+ <title>NanoStore 2.6.4 Reference</title>
6
6
  <link rel="stylesheet" type="text/css" href="css/styles.css" media="all" />
7
7
  <link rel="stylesheet" type="text/css" media="print" href="css/stylesPrint.css" />
8
8
  <meta name="generator" content="appledoc 2.0.5 (build 789)" />
@@ -10,12 +10,12 @@
10
10
  <body>
11
11
  <header id="top_header">
12
12
  <div id="library" class="hideInXcode">
13
- <h1><a id="libraryTitle" href="index.html">NanoStore 2.5.2 </a></h1>
13
+ <h1><a id="libraryTitle" href="index.html">NanoStore 2.6.4 </a></h1>
14
14
  <a id="developerHome" href="index.html">Tito Ciuro</a>
15
15
  </div>
16
16
 
17
17
  <div id="title" role="banner">
18
- <h1 class="hideInXcode">NanoStore 2.5.2 Reference</h1>
18
+ <h1 class="hideInXcode">NanoStore 2.6.4 Reference</h1>
19
19
  </div>
20
20
  <ul id="headerButtons" role="toolbar"></ul>
21
21
  </header>
@@ -26,7 +26,7 @@
26
26
  </div>
27
27
  <div id="header">
28
28
  <div class="section-header">
29
- <h1 class="title title-header">NanoStore 2.5.2 Reference</h1>
29
+ <h1 class="title title-header">NanoStore 2.6.4 Reference</h1>
30
30
  </div>
31
31
  </div>
32
32
  <div id="container">
@@ -641,7 +641,7 @@ time reading the journal file and writing the changes to the store.
641
641
  <div id="footer">
642
642
  <hr />
643
643
  <div class="footer-copyright">
644
- <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-01-22)</span><br />
644
+ <p><span class="copyright">&copy; 2013 Tito Ciuro. All rights reserved. (Last updated: 2013-03-08)</span><br />
645
645
 
646
646
  <span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.0.5 (build 789)</a>.</span></p>
647
647
 
@@ -144,7 +144,9 @@ typedef enum {
144
144
  /** * Greater Ththanan */
145
145
  NSFGreaterThan,
146
146
  /** * Less than */
147
- NSFLessThan
147
+ NSFLessThan,
148
+ /** * Not Equal to from */
149
+ NSFNotEqualTo
148
150
  } NSFMatchType;
149
151
 
150
152
  /** * Column types for the Attributes table.
@@ -77,7 +77,7 @@
77
77
  /** * The comparison operator to be used. */
78
78
  @property (nonatomic, assign, readonly) NSFMatchType match;
79
79
  /** * The value to be used for comparison. */
80
- @property (nonatomic, copy, readonly) NSString *value;
80
+ @property (nonatomic, readonly) id value;
81
81
 
82
82
  /** @name Creating and Initializing a Predicate
83
83
  */
@@ -87,22 +87,22 @@
87
87
  /** * Creates and returns a predicate.
88
88
  * @param theType is the column type. Can be \link Globals::NSFKeyColumn NSFKeyColumn \endlink, \link Globals::NSFAttributeColumn NSFAttributeColumn \endlink or \link Globals::NSFValueColumn NSFValueColumn \endlink.
89
89
  * @param theMatch is the match operator.
90
- * @param theValue is the value.
90
+ * @param theValue can be an NSString or [NSNull null]
91
91
  * @return A predicate which can be used in an NSFNanoExpression.
92
92
  * @see \link initWithColumn:matching:value: - (id)initWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(NSString *)theValue \endlink
93
93
  */
94
94
 
95
- + (NSFNanoPredicate*)predicateWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(NSString *)theValue;
95
+ + (NSFNanoPredicate*)predicateWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(id)theValue;
96
96
 
97
97
  /** * Initializes a newly allocated predicate.
98
98
  * @param theType is the column type. Can be \link Globals::NSFKeyColumn NSFKeyColumn \endlink, \link Globals::NSFAttributeColumn NSFAttributeColumn \endlink or \link Globals::NSFValueColumn NSFValueColumn \endlink.
99
99
  * @param theMatch is the match operator.
100
- * @param theValue is the value.
100
+ * @param theValue can be an NSString or [NSNull null]
101
101
  * @return A predicate which can be used in an NSFNanoExpression.
102
102
  * @see \link predicateWithColumn:matching:value: + (NSFNanoPredicate*)predicateWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(NSString *)theValue \endlink
103
103
  */
104
104
 
105
- - (id)initWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(NSString *)theValue;
105
+ - (id)initWithColumn:(NSFTableColumnType)theType matching:(NSFMatchType)theMatch value:(id)theValue;
106
106
 
107
107
  //@}
108
108
 
@@ -175,11 +175,13 @@
175
175
  /** * The sort holds an array of one or more sort descriptors of type \link NSFNanoSortDescriptor NSFNanoSortDescriptor \endlink. */
176
176
  @property (nonatomic, strong, readwrite) NSArray *sort;
177
177
  /** * The filterClass allows to filter the results based on a specific object class. */
178
- @property (nonatomic, strong, readwrite) NSString *filterClass;
178
+ @property (nonatomic, copy, readwrite) NSString *filterClass;
179
179
  /** * If an expression has an offset clause, then the first M rows are omitted from the result set returned by the search operation and the next N rows are returned, where M and N are the values that the offset and limit clauses evaluate to, respectively. Or, if the search would return less than M+N rows if it did not have a limit clause, then the first M rows are skipped and the remaining rows (if any) are returned. */
180
180
  @property (nonatomic, assign, readwrite) NSUInteger offset;
181
181
  /** * The limit clause is used to place an upper bound on the number of rows returned by a Search operation. */
182
182
  @property (nonatomic, assign, readwrite) NSUInteger limit;
183
+ /** * limit a Search to a particular bag. */
184
+ @property (nonatomic, assign, readwrite) NSFNanoBag *bag;
183
185
 
184
186
  /** @name Creating and Initializing a Search
185
187
  */
@@ -213,7 +215,7 @@
213
215
  * @param theReturnType the type of object to be returned. Can be \link Globals::NSFReturnObjects NSFReturnObjects \endlink or \link Globals::NSFReturnKeys NSFReturnKeys \endlink.
214
216
  * @param outError is used if an error occurs. May be NULL.
215
217
  * @return An array is returned if: 1) the sort has been specified or 2) the return type is \link Globals::NSFReturnKeys NSFReturnKeys \endlink. Otherwise, a dictionary is returned.
216
- * @note The sort descriptor will be ignored when returning requesting NSFReturnKeys.
218
+ * @note The sort descriptor will be ignored when the return type is NSFReturnKeys.
217
219
  * @see \link searchObjectsAdded:date:returnType:error: - (id)searchObjectsAdded:(NSFDateMatchType)theDateMatch date:(NSDate *)theDate returnType:(NSFReturnType)theReturnType error:(out NSError **)outError \endlink
218
220
  */
219
221
 
@@ -225,7 +227,7 @@
225
227
  * @param theReturnType the type of object to be returned. Can be \link Globals::NSFReturnObjects NSFReturnObjects \endlink or \link Globals::NSFReturnKeys NSFReturnKeys \endlink.
226
228
  * @param outError is used if an error occurs. May be NULL.
227
229
  * @return If theReturnType is \link Globals::NSFReturnObjects NSFReturnObjects \endlink, a dictionary is returned. Otherwise, an array is returned.
228
- * @note The sort descriptor will be ignored when returning requesting NSFReturnKeys.
230
+ * @note The sort descriptor will be ignored when the return type is NSFReturnKeys.
229
231
  * @see \link searchObjectsWithReturnType:error: - (id)searchObjectsWithReturnType:(NSFReturnType)theReturnType error:(out NSError **)outError \endlink
230
232
  */
231
233
 
@@ -75,7 +75,7 @@
75
75
  @interface NSFNanoSortDescriptor : NSObject
76
76
 
77
77
  /** * The property key to use when performing a comparison */
78
- @property (nonatomic, readonly) NSString *attribute;
78
+ @property (nonatomic, copy, readonly) NSString *attribute;
79
79
  /** * The property to indicate whether the comparison should be performed in ascending mode */
80
80
  @property (nonatomic, readonly) BOOL isAscending;
81
81
 
@@ -64,6 +64,13 @@
64
64
  - iOS library runs on the device and simulator
65
65
  - ARC compliant
66
66
 
67
+ @section latest_changes Latest changes
68
+ v2.5 - January 1, 2013
69
+
70
+ Starting with v2.5, the plist mechanism has been replaced with NSKeyedArchiver. There are several reasons for it: it's more compact, faster and uses less memory. Perhaps the most important reason is that it opens the possibility to store other data types.
71
+
72
+ NSNull is now supported. Big thanks to Wanny (https://github.com/mrwanny) for taking the time to improve this section of NanoStore.
73
+
67
74
  @section installation_sec Installation
68
75
 
69
76
  Building NanoStore is very easy. Just follow these steps:
@@ -423,6 +430,35 @@
423
430
  [sortByLastName release];
424
431
  @endcode
425
432
 
433
+ @section paging_limit_sec Paging using Limit and Offset
434
+ SQLite provides a really cool feature called OFFSET that is usually used with a LIMIT clause.
435
+
436
+ The LIMIT clause is used to limit the number of results returned in a SQL statement. So if you have 1000 rows in table, but only want to return the first 10, you would do something like this:
437
+ @code
438
+ SELECT column FROM table LIMIT 10
439
+ @endcode
440
+ Now suppose you wanted to show results 11-20. With the OFFSET keyword it's just as easy. The following query will do:
441
+ @code
442
+ SELECT column FROM table LIMIT 10 OFFSET 10
443
+ @endcode
444
+ Using pagination is also quite easy with NanoStore. This example based on one of the unit tests provided with the NanoStore distro:
445
+ @code
446
+ NSFNanoStore *nanoStore = [NSFNanoStore createAndOpenStoreWithType:NSFMemoryStoreType path:nil error:nil];
447
+
448
+ // Assume we have added objects to the store
449
+
450
+ NSFNanoSearch *search = [NSFNanoSearch searchWithStore:nanoStore];
451
+ search.value = @"Barcelona";
452
+ search.match = NSFEqualTo;
453
+ search.limit = 5;
454
+ search.offset = 3;
455
+
456
+ NSDictionary *searchResults = [search searchObjectsWithReturnType:NSFReturnObjects error:nil];
457
+
458
+ // Assuming the query matches some results, NanoStore should have retrieved
459
+ // the first 5 records right after the 3rd one from the result set.
460
+ @endcode
461
+
426
462
  @section performancetips_sec Performance Tips
427
463
 
428
464
  NanoStore by defaults saves every object to disk one by one. To speed up inserts and edited objects, increase NSFNanoStore's \link NSFNanoStore::saveInterval saveInterval \endlink property.
@@ -45,23 +45,19 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
45
45
 
46
46
  #pragma mark -
47
47
 
48
- @implementation NSFNanoEngine
49
- {
50
- @protected
51
- sqlite3 *sqlite;
52
- NSString *path;
53
- NSFCacheMethod cacheMethod;
54
-
55
- /** \cond */
56
- NSMutableDictionary *schema;
57
- BOOL willCommitChangeSchema;
58
- unsigned int busyTimeout;
59
- /** \endcond */
60
- }
48
+ @interface NSFNanoEngine ()
49
+
50
+ /** \cond */
51
+ @property (nonatomic, assign, readwrite) sqlite3 *sqlite;
52
+ @property (nonatomic, copy, readwrite) NSString *path;
53
+ @property (nonatomic) NSMutableDictionary *schema;
54
+ @property (nonatomic) BOOL willCommitChangeSchema;
55
+ @property (nonatomic) unsigned int busyTimeout;
56
+ /** \endcond */
57
+
58
+ @end
61
59
 
62
- @synthesize sqlite;
63
- @synthesize path;
64
- @synthesize cacheMethod;
60
+ @implementation NSFNanoEngine
65
61
 
66
62
  #pragma mark -
67
63
 
@@ -87,7 +83,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
87
83
  userInfo:nil]raise];
88
84
 
89
85
  if ((self = [self init])) {
90
- path = [thePath copy];
86
+ _path = thePath;
91
87
  }
92
88
 
93
89
  return self;
@@ -103,8 +99,8 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
103
99
  - (id)init
104
100
  {
105
101
  if ((self = [super init])) {
106
- path = nil;
107
- schema = nil;
102
+ _path = nil;
103
+ _schema = nil;
108
104
  }
109
105
  return self;
110
106
  }
@@ -126,7 +122,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
126
122
  NSFOrderedDictionary *values = [NSFOrderedDictionary new];
127
123
 
128
124
  values[@"SQLite address"] = [NSString stringWithFormat:@"%p", self.sqlite];
129
- values[@"Database path"] = path;
125
+ values[@"Database path"] = _path;
130
126
  values[@"Cache method"] = [self NSFP_cacheMethodToString];
131
127
 
132
128
  return values;
@@ -148,7 +144,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
148
144
 
149
145
  - (BOOL)openWithCacheMethod:(NSFCacheMethod)theCacheMethod useFastMode:(BOOL)useFastMode
150
146
  {
151
- int status = sqlite3_open_v2( [path UTF8String], &sqlite,
147
+ int status = sqlite3_open_v2( [_path UTF8String], &_sqlite,
152
148
  SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_AUTOPROXY | SQLITE_OPEN_FULLMUTEX, NULL);
153
149
 
154
150
  // Set NanoStoreEngine's page size to match the system current page size
@@ -166,7 +162,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
166
162
  if ((SQLITE_OK != status) || (sqlite3_extended_result_codes(self.sqlite, 1) != SQLITE_OK))
167
163
  return NO;
168
164
 
169
- if ([[path lowercaseString]isEqualToString:NSFMemoryDatabase] == YES) {
165
+ if ([[_path lowercaseString]isEqualToString:NSFMemoryDatabase] == YES) {
170
166
 
171
167
  sqlite3_exec(self.sqlite, "PRAGMA fullfsync = OFF;", NULL, NULL, NULL);
172
168
  sqlite3_exec(self.sqlite, "PRAGMA temp_store = MEMORY", NULL, NULL, NULL);
@@ -192,7 +188,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
192
188
  }
193
189
 
194
190
  // Save whether we want data to be fetched lazily
195
- cacheMethod = theCacheMethod;
191
+ _cacheMethod = theCacheMethod;
196
192
 
197
193
  [self setBusyTimeout:250];
198
194
 
@@ -229,7 +225,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
229
225
  }
230
226
 
231
227
  int status = sqlite3_close(self.sqlite);
232
- sqlite = NULL;
228
+ _sqlite = NULL;
233
229
 
234
230
  // Since we're operating with extended result code support, extract the bits
235
231
  // and obtain the regular result code
@@ -252,7 +248,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
252
248
  if (YES == [self isTransactionActive])
253
249
  return NO;
254
250
 
255
- willCommitChangeSchema = NO;
251
+ _willCommitChangeSchema = NO;
256
252
 
257
253
  return [self beginDeferredTransaction];
258
254
  }
@@ -262,7 +258,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
262
258
  if (YES == [self isTransactionActive])
263
259
  return NO;
264
260
 
265
- willCommitChangeSchema = NO;
261
+ _willCommitChangeSchema = NO;
266
262
 
267
263
  return [self NSFP_beginTransactionMode:@"BEGIN DEFERRED TRANSACTION;"];
268
264
  }
@@ -270,19 +266,19 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
270
266
  - (BOOL)commitTransaction
271
267
  {
272
268
  if (NO == [self isTransactionActive]) {
273
- willCommitChangeSchema = NO;
269
+ _willCommitChangeSchema = NO;
274
270
  return NO;
275
271
  }
276
272
 
277
- if (NO == willCommitChangeSchema)
273
+ if (NO == _willCommitChangeSchema)
278
274
  [self NSFP_uninstallCommitCallback];
279
275
 
280
276
  BOOL success = (nil == [[self executeSQL:@"COMMIT TRANSACTION;"]error]);
281
277
 
282
- if (NO == willCommitChangeSchema)
278
+ if (NO == _willCommitChangeSchema)
283
279
  [self NSFP_installCommitCallback];
284
280
 
285
- willCommitChangeSchema = NO;
281
+ _willCommitChangeSchema = NO;
286
282
 
287
283
  return success;
288
284
  }
@@ -290,13 +286,13 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
290
286
  - (BOOL)rollbackTransaction
291
287
  {
292
288
  if ([self isTransactionActive] == NO) {
293
- willCommitChangeSchema = NO;
289
+ _willCommitChangeSchema = NO;
294
290
  return NO;
295
291
  }
296
292
 
297
293
  BOOL success = (nil == [[self executeSQL:@"ROLLBACK TRANSACTION;"]error]);
298
294
 
299
- willCommitChangeSchema = NO;
295
+ _willCommitChangeSchema = NO;
300
296
 
301
297
  return success;
302
298
  }
@@ -717,14 +713,9 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
717
713
  theTimeout = 250;
718
714
  }
719
715
 
720
- busyTimeout = theTimeout;
716
+ _busyTimeout = theTimeout;
721
717
 
722
- sqlite3_busy_timeout(self.sqlite, busyTimeout);
723
- }
724
-
725
- - (unsigned int)busyTimeout
726
- {
727
- return busyTimeout;
718
+ sqlite3_busy_timeout(self.sqlite, _busyTimeout);
728
719
  }
729
720
 
730
721
  + (NSInteger)systemPageSize
@@ -1078,7 +1069,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
1078
1069
 
1079
1070
  - (NSString *)NSFP_cacheMethodToString
1080
1071
  {
1081
- switch (cacheMethod) {
1072
+ switch (_cacheMethod) {
1082
1073
  case CacheAllData:
1083
1074
  return @"Cache all data";
1084
1075
  break;
@@ -1190,8 +1181,8 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
1190
1181
  NSString *datatype = nil;
1191
1182
 
1192
1183
  // Check to see if the schema has been cached; take advantage of it if possible...
1193
- if (nil != schema) {
1194
- datatype = [[schema objectForKey:table]objectForKey:column];
1184
+ if (nil != _schema) {
1185
+ datatype = [[_schema objectForKey:table]objectForKey:column];
1195
1186
  if (nil == datatype) datatype = NSFStringFromNanoDataType(NSFNanoTypeUnknown);
1196
1187
  } else {
1197
1188
  NSString *theSQLStatement = [NSString stringWithFormat:@"SELECT %@ from %@ WHERE %@ = '%@' AND %@ = '%@';", NSFP_DatatypeIdentifier, NSFP_SchemaTable, NSFP_TableIdentifier, table, NSFP_ColumnIdentifier, column];
@@ -1202,14 +1193,14 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
1202
1193
 
1203
1194
  if (nil == datatype) datatype = NSFStringFromNanoDataType(NSFNanoTypeUnknown);
1204
1195
 
1205
- NSMutableDictionary *tempSchema = [schema objectForKey:table];
1196
+ NSMutableDictionary *tempSchema = [_schema objectForKey:table];
1206
1197
  if (nil != tempSchema)
1207
1198
  tempSchema = [[NSMutableDictionary alloc]init];
1208
1199
  else
1209
1200
  ;
1210
1201
 
1211
1202
  [tempSchema setObject:datatype forKey:column];
1212
- [schema setObject:tempSchema forKey:table];
1203
+ [_schema setObject:tempSchema forKey:table];
1213
1204
 
1214
1205
  tempSchema = nil;
1215
1206
  }
@@ -1513,8 +1504,8 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
1513
1504
  - (void)NSFP_rebuildDatatypeCache
1514
1505
  {
1515
1506
  // Cleanup
1516
- schema = nil;
1517
- schema = [[NSMutableDictionary alloc]init];
1507
+ _schema = nil;
1508
+ _schema = [[NSMutableDictionary alloc]init];
1518
1509
 
1519
1510
  NSArray *tables = [self NSFP_flattenAllTables];
1520
1511
  if ([tables count] == 0)
@@ -1535,7 +1526,7 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
1535
1526
  [tableDictionary setObject:[datatypes objectAtIndex:j] forKey:[columns objectAtIndex:j]];
1536
1527
  }
1537
1528
 
1538
- [schema setObject:tableDictionary forKey:table];
1529
+ [_schema setObject:tableDictionary forKey:table];
1539
1530
  }
1540
1531
  }
1541
1532
 
@@ -1738,8 +1729,8 @@ static NSSet *__NSFPSharedNanoStoreEngineDatatypes = nil;
1738
1729
 
1739
1730
  NSString *rowUIDDatatype = NSFStringFromNanoDataType(NSFNanoTypeRowUID);
1740
1731
 
1741
- if (nil != schema)
1742
- return [[[schema objectForKey:table]objectForKey:column]isEqualToString:rowUIDDatatype];
1732
+ if (nil != _schema)
1733
+ return [[[_schema objectForKey:table]objectForKey:column]isEqualToString:rowUIDDatatype];
1743
1734
 
1744
1735
  NSString *theSQLStatement = [NSString stringWithFormat:@"SELECT %@ FROM %@ WHERE %@ = '%@' AND %@ = '%@';", NSFP_DatatypeIdentifier, NSFP_SchemaTable, NSFP_TableIdentifier, table, NSFP_ColumnIdentifier, column];
1745
1736
  NSFNanoResult* result = [self executeSQL:theSQLStatement];