nano-store 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/Gemfile.lock +3 -3
  2. data/Rakefile +1 -1
  3. data/lib/nano_store/finder.rb +12 -6
  4. data/lib/nano_store/version.rb +1 -1
  5. data/vendor/Podfile.lock +2 -2
  6. data/vendor/Pods/Headers/NanoStore/NSFNanoBag.h +8 -2
  7. data/vendor/Pods/Headers/NanoStore/NSFNanoSearch.h +2 -0
  8. data/vendor/Pods/Headers/NanoStore/NSFNanoStore_Private.h +1 -1
  9. data/vendor/Pods/NanoStore/Classes/Private/NSFNanoStore_Private.h +1 -1
  10. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoBag.h +8 -2
  11. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoBag.m +7 -4
  12. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoExpression.m +2 -6
  13. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSearch.h +2 -0
  14. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoSearch.m +9 -7
  15. data/vendor/Pods/NanoStore/Classes/Public/NSFNanoStore.m +14 -4
  16. data/vendor/Pods/Pods.bridgesupport +8 -1
  17. metadata +8 -43
  18. data/vendor/NanoStore/Classes/Advanced/NSFNanoEngine.h +0 -542
  19. data/vendor/NanoStore/Classes/Advanced/NSFNanoEngine.m +0 -1781
  20. data/vendor/NanoStore/Classes/Advanced/NSFNanoResult.h +0 -137
  21. data/vendor/NanoStore/Classes/Advanced/NSFNanoResult.m +0 -265
  22. data/vendor/NanoStore/Classes/Private/NSFNanoBag_Private.h +0 -37
  23. data/vendor/NanoStore/Classes/Private/NSFNanoEngine_Private.h +0 -69
  24. data/vendor/NanoStore/Classes/Private/NSFNanoExpression_Private.h +0 -35
  25. data/vendor/NanoStore/Classes/Private/NSFNanoGlobals_Private.h +0 -99
  26. data/vendor/NanoStore/Classes/Private/NSFNanoObject_Private.h +0 -35
  27. data/vendor/NanoStore/Classes/Private/NSFNanoPredicate_Private.h +0 -35
  28. data/vendor/NanoStore/Classes/Private/NSFNanoResult_Private.h +0 -43
  29. data/vendor/NanoStore/Classes/Private/NSFNanoSearch_Private.h +0 -48
  30. data/vendor/NanoStore/Classes/Private/NSFNanoStore_Private.h +0 -57
  31. data/vendor/NanoStore/Classes/Private/NanoStore_Private.h +0 -37
  32. data/vendor/NanoStore/Classes/Public/NSFNanoBag.h +0 -306
  33. data/vendor/NanoStore/Classes/Public/NSFNanoBag.m +0 -485
  34. data/vendor/NanoStore/Classes/Public/NSFNanoExpression.h +0 -125
  35. data/vendor/NanoStore/Classes/Public/NSFNanoExpression.m +0 -103
  36. data/vendor/NanoStore/Classes/Public/NSFNanoGlobals.h +0 -323
  37. data/vendor/NanoStore/Classes/Public/NSFNanoGlobals.m +0 -145
  38. data/vendor/NanoStore/Classes/Public/NSFNanoObject.h +0 -298
  39. data/vendor/NanoStore/Classes/Public/NSFNanoObject.m +0 -187
  40. data/vendor/NanoStore/Classes/Public/NSFNanoObjectProtocol.h +0 -119
  41. data/vendor/NanoStore/Classes/Public/NSFNanoPredicate.h +0 -123
  42. data/vendor/NanoStore/Classes/Public/NSFNanoPredicate.m +0 -130
  43. data/vendor/NanoStore/Classes/Public/NSFNanoSearch.h +0 -381
  44. data/vendor/NanoStore/Classes/Public/NSFNanoSearch.m +0 -835
  45. data/vendor/NanoStore/Classes/Public/NSFNanoSortDescriptor.h +0 -124
  46. data/vendor/NanoStore/Classes/Public/NSFNanoSortDescriptor.m +0 -79
  47. data/vendor/NanoStore/Classes/Public/NSFNanoStore.h +0 -475
  48. data/vendor/NanoStore/Classes/Public/NSFNanoStore.m +0 -1375
  49. data/vendor/NanoStore/Classes/Public/NanoStore.h +0 -463
  50. data/vendor/NanoStore/LICENSE +0 -25
  51. data/vendor/NanoStore/NanoStore.bridgesupport +0 -1215
  52. data/vendor/NanoStore/README.md +0 -411
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nano-store (0.3.5)
4
+ nano-store (0.3.9)
5
5
  bubble-wrap (>= 0.1.1)
6
- motion-cocoapods (>= 1.0.2)
6
+ motion-cocoapods (>= 1.0.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- bubble-wrap (0.1.1)
11
+ bubble-wrap (0.2.0)
12
12
  cocoapods (0.5.1)
13
13
  xcodeproj (~> 0.1.0)
14
14
  motion-cocoapods (1.0.2)
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ Motion::Project::App.setup do |app|
10
10
 
11
11
  app.files += Dir.glob(File.join(app.project_dir, 'lib/nano_store/*.rb'))
12
12
  app.pods do
13
- dependency 'NanoStore'
13
+ dependency 'NanoStore', '~> 2.1.1'
14
14
  end
15
15
  end
16
16
 
@@ -53,13 +53,14 @@ module NanoStore
53
53
 
54
54
  sort_descriptors = sort_descriptor_with_options(sort_options)
55
55
  search.sort = sort_descriptors
56
-
56
+ search.filterClass = self.object_class_name
57
+
57
58
  error_ptr = Pointer.new(:id)
58
59
  searchResults = search.searchObjectsWithReturnType(NSFReturnObjects, error:error_ptr)
59
60
  raise NanoStoreError, error_ptr[0].description if error_ptr[0]
60
-
61
- # workaround until we find way to only query specific class
62
- searchResults.select {|obj| obj.class == self }
61
+
62
+ # workaround to filter class until nanostore implement class filter
63
+ searchResults.select {|r| r.class.to_s == self.to_s }
63
64
  end
64
65
 
65
66
  # find model keys by criteria
@@ -101,6 +102,7 @@ module NanoStore
101
102
 
102
103
  sort_descriptors = sort_descriptor_with_options(sort_options)
103
104
  search.sort = sort_descriptors
105
+ search.filterClass = self.object_class_name
104
106
 
105
107
  error_ptr = Pointer.new(:id)
106
108
 
@@ -108,8 +110,12 @@ module NanoStore
108
110
  searchResults = search.searchObjectsWithReturnType(NSFReturnObjects, error:error_ptr)
109
111
  raise NanoStoreError, error_ptr[0].description if error_ptr[0]
110
112
 
111
- # workaround until we find way to only query specific class
112
- searchResults.select {|obj| obj.class == self }.collect(&:key)
113
+ # workaround to filter class until nanostore implement class filter
114
+ searchResults.select {|r| r.class.to_s == self.to_s }.collect(&:key)
115
+ end
116
+
117
+ def object_class_name
118
+ "k#{self.to_s.capitalize}"
113
119
  end
114
120
 
115
121
  private
@@ -1,3 +1,3 @@
1
1
  module NanoStore
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  end
data/vendor/Podfile.lock CHANGED
@@ -1,5 +1,5 @@
1
1
  PODS:
2
- - NanoStore (2.0.1)
2
+ - NanoStore (2.1.1)
3
3
 
4
4
  DEPENDENCIES:
5
- - NanoStore
5
+ - NanoStore (~> 2.1.1)
@@ -97,6 +97,8 @@
97
97
  /** * Creates and returns a bag adding to it the objects contained in the given array.
98
98
  * @param theObjects an array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
99
99
  * @return A bag only containing the objects with conform to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink upon success, nil otherwise.
100
+ * @throws NSFUnexpectedParameterException is thrown if theObjects is nil.
101
+ * @warning If theObjects is nil, an NSFUnexpectedParameterException will be thrown. Use + bag; instead.
100
102
  * @see \link initBagWithNanoObjects: - (NSFNanoBag*)initBagWithNanoObjects:(NSArray *)theObjects \endlink
101
103
  */
102
104
 
@@ -111,8 +113,10 @@
111
113
 
112
114
  /** * Creates and returns a bag with the specified name adding to it the objects contained in the given array.
113
115
  * @param theName the name of the bag. Can be nil.
114
- * @param theObjects an array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
116
+ * @param theObjects is a required array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
115
117
  * @return A bag only containing the objects with conform to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink upon success, nil otherwise.
118
+ * @throws NSFUnexpectedParameterException is thrown if theObjects is nil.
119
+ * @warning If theObjects is nil, an NSFUnexpectedParameterException will be thrown.
116
120
  * @see \link initBagWithNanoObjects: - (NSFNanoBag*)initBagWithNanoObjects:(NSArray *)theObjects \endlink
117
121
  */
118
122
 
@@ -120,8 +124,10 @@
120
124
 
121
125
  /** * Initializes a newly allocated bag with the specified name adding to it the objects contained in the given array.
122
126
  * @param theName the name of the bag. Can be nil.
123
- * @param theObjects an array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
127
+ * @param theObjects is a required array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
124
128
  * @return A bag only containing the objects with conform to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink upon success, nil otherwise.
129
+ * @throws NSFUnexpectedParameterException is thrown if theObjects is nil.
130
+ * @warning If theObjects is nil, an NSFUnexpectedParameterException will be thrown.
125
131
  * @see \link bagWithObjects: + (NSFNanoBag*)bagWithObjects:(NSArray *)theObjects \endlink
126
132
  */
127
133
 
@@ -174,6 +174,8 @@
174
174
  @property (nonatomic, copy, readonly) NSString *sql;
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
+ /** * The filterClass allows to filter the results based on a specific object class. */
178
+ @property (nonatomic, strong, readwrite) NSString *filterClass;
177
179
 
178
180
  /** @name Creating and Initializing a Search
179
181
  */
@@ -29,7 +29,7 @@
29
29
  /** \cond */
30
30
 
31
31
  @interface NSFNanoStore (Private)
32
- + (NSFNanoStore *)_debug;
32
+ + (NSFNanoStore *)_createAndOpenDebugDatabase;
33
33
  - (NSFNanoResult *)_executeSQL:(NSString *)theSQLStatement;
34
34
  - (NSString*)_nestedDescriptionWithPrefixedSpace:(NSString *)prefixedSpace;
35
35
  - (BOOL)_initializePreparedStatementsWithError:(out NSError **)outError;
@@ -29,7 +29,7 @@
29
29
  /** \cond */
30
30
 
31
31
  @interface NSFNanoStore (Private)
32
- + (NSFNanoStore *)_debug;
32
+ + (NSFNanoStore *)_createAndOpenDebugDatabase;
33
33
  - (NSFNanoResult *)_executeSQL:(NSString *)theSQLStatement;
34
34
  - (NSString*)_nestedDescriptionWithPrefixedSpace:(NSString *)prefixedSpace;
35
35
  - (BOOL)_initializePreparedStatementsWithError:(out NSError **)outError;
@@ -97,6 +97,8 @@
97
97
  /** * Creates and returns a bag adding to it the objects contained in the given array.
98
98
  * @param theObjects an array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
99
99
  * @return A bag only containing the objects with conform to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink upon success, nil otherwise.
100
+ * @throws NSFUnexpectedParameterException is thrown if theObjects is nil.
101
+ * @warning If theObjects is nil, an NSFUnexpectedParameterException will be thrown. Use + bag; instead.
100
102
  * @see \link initBagWithNanoObjects: - (NSFNanoBag*)initBagWithNanoObjects:(NSArray *)theObjects \endlink
101
103
  */
102
104
 
@@ -111,8 +113,10 @@
111
113
 
112
114
  /** * Creates and returns a bag with the specified name adding to it the objects contained in the given array.
113
115
  * @param theName the name of the bag. Can be nil.
114
- * @param theObjects an array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
116
+ * @param theObjects is a required array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
115
117
  * @return A bag only containing the objects with conform to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink upon success, nil otherwise.
118
+ * @throws NSFUnexpectedParameterException is thrown if theObjects is nil.
119
+ * @warning If theObjects is nil, an NSFUnexpectedParameterException will be thrown.
116
120
  * @see \link initBagWithNanoObjects: - (NSFNanoBag*)initBagWithNanoObjects:(NSArray *)theObjects \endlink
117
121
  */
118
122
 
@@ -120,8 +124,10 @@
120
124
 
121
125
  /** * Initializes a newly allocated bag with the specified name adding to it the objects contained in the given array.
122
126
  * @param theName the name of the bag. Can be nil.
123
- * @param theObjects an array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
127
+ * @param theObjects is a required array of objects conforming to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink.
124
128
  * @return A bag only containing the objects with conform to the \link NSFNanoObjectProtocol::initNanoObjectFromDictionaryRepresentation:forKey:store: NSFNanoObjectProtocol\endlink upon success, nil otherwise.
129
+ * @throws NSFUnexpectedParameterException is thrown if theObjects is nil.
130
+ * @warning If theObjects is nil, an NSFUnexpectedParameterException will be thrown.
125
131
  * @see \link bagWithObjects: + (NSFNanoBag*)bagWithObjects:(NSArray *)theObjects \endlink
126
132
  */
127
133
 
@@ -65,11 +65,14 @@
65
65
 
66
66
  - (id)initBagWithName:(NSString *)theName andObjects:(NSArray *)someObjects
67
67
  {
68
+ if (nil == someObjects) {
69
+ [[NSException exceptionWithName:NSFUnexpectedParameterException
70
+ reason:[NSString stringWithFormat:@"*** -[%@ %s]: 'someObjects' cannot be nil.", [self class], _cmd]
71
+ userInfo:nil]raise];
72
+ }
73
+
68
74
  if ((self = [self init])) {
69
- NSError *outError = nil;
70
- if (NO == [self addObjectsFromArray:someObjects error:&outError]) {
71
- NSLog(@"%@", [NSString stringWithFormat:@"*** -[%@ %s]: a problem occurred while initializing the NanoBag, leaving it in an inconsistent state. Reason: %@.", [self class], _cmd, [outError localizedDescription]]);
72
- }
75
+ [self addObjectsFromArray:someObjects error:nil];
73
76
 
74
77
  name = [theName copy];
75
78
  hasUnsavedChanges = YES;
@@ -39,20 +39,16 @@
39
39
 
40
40
  + (NSFNanoExpression*)expressionWithPredicate:(NSFNanoPredicate *)aPredicate
41
41
  {
42
- if (nil == aPredicate)
43
- [[NSException exceptionWithName:NSFUnexpectedParameterException
44
- reason:[NSString stringWithFormat:@"*** -[%@ %s]: the predicate is nil.", [self class], _cmd]
45
- userInfo:nil]raise];
46
-
47
42
  return [[self alloc]initWithPredicate:aPredicate];
48
43
  }
49
44
 
50
45
  - (id)initWithPredicate:(NSFNanoPredicate *)aPredicate
51
46
  {
52
- if (nil == aPredicate)
47
+ if (nil == aPredicate) {
53
48
  [[NSException exceptionWithName:NSFUnexpectedParameterException
54
49
  reason:[NSString stringWithFormat:@"*** -[%@ %s]: the predicate is nil.", [self class], _cmd]
55
50
  userInfo:nil]raise];
51
+ }
56
52
 
57
53
  if ((self = [super init])) {
58
54
  predicates = [NSMutableArray new];
@@ -174,6 +174,8 @@
174
174
  @property (nonatomic, copy, readonly) NSString *sql;
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
+ /** * The filterClass allows to filter the results based on a specific object class. */
178
+ @property (nonatomic, strong, readwrite) NSString *filterClass;
177
179
 
178
180
  /** @name Creating and Initializing a Search
179
181
  */
@@ -37,7 +37,7 @@
37
37
  }
38
38
 
39
39
 
40
- @synthesize nanoStore, attributesToBeReturned, key, attribute, value, match, expressions, groupValues, sql, sort;
40
+ @synthesize nanoStore, attributesToBeReturned, key, attribute, value, match, expressions, groupValues, sql, sort, filterClass;
41
41
 
42
42
  // ----------------------------------------------
43
43
  // Initialization / Cleanup
@@ -83,7 +83,7 @@
83
83
  return sql;
84
84
  }
85
85
 
86
- - (NSString*)description
86
+ - (NSString *)description
87
87
  {
88
88
  NSMutableString *description = [NSMutableString string];
89
89
 
@@ -96,9 +96,10 @@
96
96
  [description appendString:[NSString stringWithFormat:@"Value : %@\n", value]];
97
97
  [description appendString:[NSString stringWithFormat:@"Match : %@\n", NSFStringFromMatchType(match)]];
98
98
  [description appendString:[NSString stringWithFormat:@"Expressions : %@\n", expressions]];
99
- [description appendString:[NSString stringWithFormat:@"Group Values? : %@\n", (groupValues ? @"YES" : @"NO")]];
99
+ [description appendString:[NSString stringWithFormat:@"Group values? : %@\n", (groupValues ? @"YES" : @"NO")]];
100
100
  [description appendString:[NSString stringWithFormat:@"Sort : %@\n", sort]];
101
-
101
+ [description appendString:[NSString stringWithFormat:@"Filter class : %@\n", filterClass]];
102
+
102
103
  return description;
103
104
  }
104
105
 
@@ -576,10 +577,11 @@
576
577
  }
577
578
 
578
579
  if (NSFReturnObjects == returnType) {
579
- if (nil != attributes)
580
- theSQLStatement = [NSString stringWithFormat:@"SELECT DISTINCT (NSFKey),NSFPlist,NSFObjectClass FROM NSFKeys WHERE NSFKey IN (%@)", theSQLStatement];
581
- else
580
+ if (self.filterClass.length > 0) {
581
+ theSQLStatement = [NSString stringWithFormat:@"SELECT DISTINCT (NSFKey),NSFPlist,NSFObjectClass FROM NSFKeys WHERE (NSFObjectClass = '%@') AND NSFKey IN (%@)", self.filterClass, theSQLStatement];
582
+ } else {
582
583
  theSQLStatement = [NSString stringWithFormat:@"SELECT DISTINCT (NSFKey),NSFPlist,NSFObjectClass FROM NSFKeys WHERE NSFKey IN (%@)", theSQLStatement];
584
+ }
583
585
  }
584
586
 
585
587
  return theSQLStatement;
@@ -665,9 +665,18 @@
665
665
 
666
666
  /** \cond */
667
667
 
668
- + (NSFNanoStore *)_debug
668
+ + (NSFNanoStore *)_createAndOpenDebugDatabase
669
669
  {
670
- return [NSFNanoStore createStoreWithType:NSFPersistentStoreType path:[@"~/Desktop/NanoStoreDebug.db" stringByExpandingTildeInPath]];
670
+ NSFNanoStore *db = [NSFNanoStore createStoreWithType:NSFPersistentStoreType path:[@"~/Desktop/NanoStoreDebug.db" stringByExpandingTildeInPath]];
671
+ NSError *outError = nil;
672
+
673
+ if (NO == [db openWithError:&outError]) {
674
+ [[NSException exceptionWithName:NSFNanoStoreUnableToManipulateStoreException
675
+ reason:[NSString stringWithFormat:@"*** -[%@ %s]: could not open the database. Reason: %@", [self class], _cmd, [outError localizedDescription]]
676
+ userInfo:nil]raise];
677
+ }
678
+
679
+ return db;
671
680
  }
672
681
 
673
682
  - (NSFNanoResult *)_executeSQL:(NSString *)theSQLStatement
@@ -1144,9 +1153,10 @@
1144
1153
  unsavedObjectsCount = [addedObjects count];
1145
1154
 
1146
1155
  if (unsavedObjectsCount > 0) {
1147
- if (NO == [self removeObjectsWithKeysInArray:[keys allObjects] error:outError]) {
1156
+ NSError *localOutError = nil;
1157
+ if (NO == [self removeObjectsWithKeysInArray:[keys allObjects] error:&localOutError]) {
1148
1158
  [[NSException exceptionWithName:NSFNanoStoreUnableToManipulateStoreException
1149
- reason:[NSString stringWithFormat:@"*** -[%@ %s]: %@", [self class], _cmd, [*outError localizedDescription]]
1159
+ reason:[NSString stringWithFormat:@"*** -[%@ %s]: %@", [self class], _cmd, [localOutError localizedDescription]]
1150
1160
  userInfo:nil]raise];
1151
1161
  }
1152
1162
  }
@@ -806,6 +806,9 @@
806
806
  <method selector='expressions'>
807
807
  <retval declared_type='NSArray*' type='@'/>
808
808
  </method>
809
+ <method selector='filterClass'>
810
+ <retval declared_type='NSString*' type='@'/>
811
+ </method>
809
812
  <method selector='groupValues'>
810
813
  <retval declared_type='BOOL' type='B'/>
811
814
  </method>
@@ -853,6 +856,10 @@
853
856
  <arg name='expressions' declared_type='NSArray*' type='@' index='0'/>
854
857
  <retval declared_type='void' type='v'/>
855
858
  </method>
859
+ <method selector='setFilterClass:'>
860
+ <arg name='filterClass' declared_type='NSString*' type='@' index='0'/>
861
+ <retval declared_type='void' type='v'/>
862
+ </method>
856
863
  <method selector='setGroupValues:'>
857
864
  <arg name='groupValues' declared_type='BOOL' type='B' index='0'/>
858
865
  <retval declared_type='void' type='v'/>
@@ -954,7 +961,7 @@
954
961
  <arg name='outError' declared_type='NSError**' type='^@' index='0' type_modifier='o'/>
955
962
  <retval declared_type='BOOL' type='B'/>
956
963
  </method>
957
- <method selector='_debug' class_method='true'>
964
+ <method selector='_createAndOpenDebugDatabase' class_method='true'>
958
965
  <retval declared_type='NSFNanoStore*' type='@'/>
959
966
  </method>
960
967
  <method selector='_defaultTestData' class_method='true'>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nano-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-23 00:00:00.000000000 Z
12
+ date: 2012-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bubble-wrap
16
- requirement: &70162724225720 !ruby/object:Gem::Requirement
16
+ requirement: &70240847333780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70162724225720
24
+ version_requirements: *70240847333780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: motion-cocoapods
27
- requirement: &70162724225080 !ruby/object:Gem::Requirement
27
+ requirement: &70240847333180 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70162724225080
35
+ version_requirements: *70240847333180
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: motion-redgreen
38
- requirement: &70162724224600 !ruby/object:Gem::Requirement
38
+ requirement: &70240847332740 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70162724224600
46
+ version_requirements: *70240847332740
47
47
  description: Wrapper for NanoStore, a lightweight schema-less key-value document database
48
48
  based on sqlite, for RubyMotion.
49
49
  email:
@@ -76,41 +76,6 @@ files:
76
76
  - spec/model_spec.rb
77
77
  - spec/nano_store_spec.rb
78
78
  - spec/store_extension_spec.rb
79
- - vendor/NanoStore/Classes/Advanced/NSFNanoEngine.h
80
- - vendor/NanoStore/Classes/Advanced/NSFNanoEngine.m
81
- - vendor/NanoStore/Classes/Advanced/NSFNanoResult.h
82
- - vendor/NanoStore/Classes/Advanced/NSFNanoResult.m
83
- - vendor/NanoStore/Classes/Private/NSFNanoBag_Private.h
84
- - vendor/NanoStore/Classes/Private/NSFNanoEngine_Private.h
85
- - vendor/NanoStore/Classes/Private/NSFNanoExpression_Private.h
86
- - vendor/NanoStore/Classes/Private/NSFNanoGlobals_Private.h
87
- - vendor/NanoStore/Classes/Private/NSFNanoObject_Private.h
88
- - vendor/NanoStore/Classes/Private/NSFNanoPredicate_Private.h
89
- - vendor/NanoStore/Classes/Private/NSFNanoResult_Private.h
90
- - vendor/NanoStore/Classes/Private/NSFNanoSearch_Private.h
91
- - vendor/NanoStore/Classes/Private/NSFNanoStore_Private.h
92
- - vendor/NanoStore/Classes/Private/NanoStore_Private.h
93
- - vendor/NanoStore/Classes/Public/NSFNanoBag.h
94
- - vendor/NanoStore/Classes/Public/NSFNanoBag.m
95
- - vendor/NanoStore/Classes/Public/NSFNanoExpression.h
96
- - vendor/NanoStore/Classes/Public/NSFNanoExpression.m
97
- - vendor/NanoStore/Classes/Public/NSFNanoGlobals.h
98
- - vendor/NanoStore/Classes/Public/NSFNanoGlobals.m
99
- - vendor/NanoStore/Classes/Public/NSFNanoObject.h
100
- - vendor/NanoStore/Classes/Public/NSFNanoObject.m
101
- - vendor/NanoStore/Classes/Public/NSFNanoObjectProtocol.h
102
- - vendor/NanoStore/Classes/Public/NSFNanoPredicate.h
103
- - vendor/NanoStore/Classes/Public/NSFNanoPredicate.m
104
- - vendor/NanoStore/Classes/Public/NSFNanoSearch.h
105
- - vendor/NanoStore/Classes/Public/NSFNanoSearch.m
106
- - vendor/NanoStore/Classes/Public/NSFNanoSortDescriptor.h
107
- - vendor/NanoStore/Classes/Public/NSFNanoSortDescriptor.m
108
- - vendor/NanoStore/Classes/Public/NSFNanoStore.h
109
- - vendor/NanoStore/Classes/Public/NSFNanoStore.m
110
- - vendor/NanoStore/Classes/Public/NanoStore.h
111
- - vendor/NanoStore/LICENSE
112
- - vendor/NanoStore/NanoStore.bridgesupport
113
- - vendor/NanoStore/README.md
114
79
  - vendor/Podfile.lock
115
80
  - vendor/Pods/Headers/NanoStore/NSFNanoBag.h
116
81
  - vendor/Pods/Headers/NanoStore/NSFNanoBag_Private.h
@@ -1,542 +0,0 @@
1
- /*
2
- NSFNanoBag.h
3
- NanoStore
4
-
5
- Copyright (c) 2010 Webbo, L.L.C. All rights reserved.
6
-
7
- Redistribution and use in source and binary forms, with or without modification, are permitted
8
- provided that the following conditions are met:
9
-
10
- * Redistributions of source code must retain the above copyright notice, this list of conditions
11
- and the following disclaimer.
12
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions
13
- and the following disclaimer in the documentation and/or other materials provided with the distribution.
14
- * Neither the name of Webbo nor the names of its contributors may be used to endorse or promote
15
- products derived from this software without specific prior written permission.
16
-
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
18
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
19
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
20
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23
- OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
- SUCH DAMAGE.
25
- */
26
-
27
- /*! @file NSFNanoEngine.h
28
- @brief A wrapper around SQLite, it provides convenience methods as well as "raw" access to the database.
29
- */
30
-
31
- /** @class NSFNanoEngine
32
- * A wrapper around SQLite, it provides convenience methods as well as "raw" access to the database.
33
- */
34
-
35
- #import "sqlite3.h"
36
-
37
- #import "NSFNanoGlobals.h"
38
- #import "NSFNanoGlobals.h"
39
-
40
- @class NSFNanoResult;
41
-
42
- @interface NSFNanoEngine : NSObject
43
-
44
- /** * A reference to the SQLite database. */
45
- @property (nonatomic, assign, readonly) sqlite3 *sqlite;
46
- /** * The file path where the database is located. */
47
- @property (nonatomic, copy, readonly) NSString *path;
48
- /** * The cache mechanism being used. */
49
- @property (nonatomic, assign, readwrite) NSFCacheMethod cacheMethod;
50
-
51
- /** @name Creating and Initializing NanoEngine
52
- */
53
-
54
- //@{
55
-
56
- /** Creates and returns an engine object at a given file path.
57
- * @param thePath the file path where the document store will be created. Must not be nil.
58
- * @return An engine object upon success, nil otherwise.
59
- * @note To manipulate the document store, you must first open it.
60
- * @see - (id)initWithPath:(NSString *)thePath;
61
- * @see - (BOOL)openWithCacheMethod:(NSFCacheMethod)theCacheMethod useFastMode:(BOOL)useFastMode;
62
- */
63
-
64
- + (id)databaseWithPath:(NSString *)thePath;
65
-
66
- /** Initializes a newly allocated document store at a given file path.
67
- * @param thePath the file path where the document store will be created. Must not be nil.
68
- * @return An engine object upon success, nil otherwise.
69
- * @note To manipulate the document store, you must first open it.
70
- * @see + (id)databaseWithPath:(NSString *)thePath;
71
- * @see - (BOOL)openWithCacheMethod:(NSFCacheMethod)theCacheMethod useFastMode:(BOOL)useFastMode;
72
- */
73
-
74
- - (id)initWithPath:(NSString *)thePath;
75
-
76
- //@}
77
-
78
- /** @name Opening and Closing
79
- */
80
-
81
- //@{
82
-
83
- /** Opens the engine, making it ready for manipulation.
84
- * @param theCacheMethod allows to specify hwo the data will be read from the database:. This setting incurs a tradeoff between speed and memory usage.
85
- * @param useFastMode if set to YES, the document store is opened with all performance turned on (more risky in case of failure). Setting it to NO is slower, but safer. See the note below for more information.
86
- * @return YES upon success, NO otherwise.
87
- * @note
88
- * When FastMode is activated NanoStore continues without pausing as soon as it has handed data off to the operating system.
89
- * If the application running NanoStore crashes, the data will be safe, but the database might become corrupted if the operating system crashes
90
- * or the computer loses power before that data has been written to the disk surface.
91
- * On the other hand, some operations are as much as 50 or more times faster with FastMode activated.
92
- *
93
- * @par
94
- * If FastMode is deactivated, NanoStore will pause at critical moments to make sure that data has actually been written to the disk surface
95
- * before continuing. This ensures that if the operating system crashes or if there is a power failure, the database will be uncorrupted after rebooting.
96
- * Deactivating FastMode is very safe, but it is also slower.
97
- */
98
-
99
- - (BOOL)openWithCacheMethod:(NSFCacheMethod)theCacheMethod useFastMode:(BOOL)useFastMode;
100
-
101
- /** Closes the database.
102
- * @return YES upon success, NO otherwise.
103
- */
104
-
105
- - (BOOL)close;
106
-
107
- //@}
108
-
109
- /** @name Accessors
110
- */
111
-
112
- //@{
113
-
114
- /** Checks whether the document store is open or closed.
115
- * @see - (void)close;
116
- */
117
-
118
- - (BOOL)isDatabaseOpen;
119
-
120
- /** Checks whether a transaction is currently active.
121
- * @return YES if a transaction is currently active, NO otherwise.
122
- */
123
-
124
- - (BOOL)isTransactionActive;
125
-
126
- /** Sets the busy timeout.
127
- * @param theTimeout is number of milliseconds that SQLite will wait to retry a busy operation.
128
- * @note The acceptable range is between 100 and 5000 milliseconds. If the value is out of range, the 250 millisecond default timeout will be set instead.
129
- * @see - (unsigned int)busyTimeout;
130
- */
131
-
132
- - (void)setBusyTimeout:(unsigned int)theTimeout;
133
-
134
- /** Returns the current busy timeout.
135
- * @see - (void)setBusyTimeout:(unsigned int)theTimeout;
136
- */
137
-
138
- - (unsigned int)busyTimeout;
139
-
140
- /** Returns the recommended cache size based on the system resources available.
141
- * @return The recommended cache size in number of pages.
142
- */
143
-
144
- + (NSUInteger)recommendedCacheSize;
145
-
146
- /** Sets the cache size.
147
- * @param numberOfPages is the number of pages.
148
- * @return YES upon success, NO otherwise.
149
- * @see + (NSUInteger)recommendedCacheSize;
150
- * @see - (NSUInteger)cacheSize;
151
- */
152
-
153
- - (BOOL)setCacheSize:(NSUInteger)numberOfPages;
154
-
155
- /** Returns the cache size.
156
- * @return The current cache size.
157
- * @see + (NSUInteger)recommendedCacheSize;
158
- * @see - (BOOL)setCacheSize:(NSUInteger)numberOfPages;
159
- */
160
-
161
- - (NSUInteger)cacheSize;
162
-
163
- /** Returns the system's page size
164
- */
165
-
166
- + (NSInteger)systemPageSize;
167
-
168
- /** Sets the page size.
169
- * @param numberOfBytes is the size of the page.
170
- * @return YES upon success, NO otherwise.
171
- * @see + (NSInteger)systemPageSize;
172
- * @see - (NSUInteger)pageSize;
173
- */
174
-
175
- - (BOOL)setPageSize:(NSUInteger)numberOfBytes;
176
-
177
- /** Returns the page size.
178
- * @return The current page size.
179
- * @see + (NSInteger)systemPageSize;
180
- * @see - (BOOL)setPageSize:(NSUInteger)numberOfBytes;
181
- */
182
-
183
- - (NSUInteger)pageSize;
184
-
185
- /** Sets the text encoding type.
186
- * @param theEncodingType is the encoding type. Can be NSFEncodingUTF8 or NSFEncodingUTF16.
187
- * @return YES upon success, NO otherwise.
188
- * @see - (NSFEncodingType)encoding;
189
- */
190
-
191
- - (BOOL)setEncodingType:(NSFEncodingType)theEncodingType;
192
-
193
- /** Returns the encoding type.
194
- * @return The current encoding type.
195
- * @see - (BOOL)setEncodingType:(NSFEncodingType)theEncodingType;
196
- */
197
-
198
- - (NSFEncodingType)encoding;
199
-
200
- /** Returns the encoding type from its string equivalent.
201
- * @return The encoding type if successful, NSFEncodingUnknown otherwise.
202
- * @see + (NSString *)NSFEncodingTypeToNSString:(NSFEncodingType)value;
203
- */
204
-
205
- + (NSFEncodingType)NSStringToNSFEncodingType:(NSString *)value;
206
-
207
- /** Returns the string equivalent of an encoding type.
208
- * @return The string equivalent if successful, nil otherwise.
209
- * @see + (NSFEncodingType)NSStringToNSFEncodingType:(NSString *)value;
210
- */
211
-
212
- + (NSString *)NSFEncodingTypeToNSString:(NSFEncodingType)value;
213
-
214
- /** Sets the synchronous mode.
215
- * @param theSynchronousMode is the synchronous mode. Can be SynchronousModeOff, SynchronousModeNormal or SynchronousModeFull.
216
- * @see - (NSFSynchronousMode)synchronousMode;
217
- */
218
-
219
- - (void)setSynchronousMode:(NSFSynchronousMode)theSynchronousMode;
220
-
221
- /** Returns the synchronous mode.
222
- * @return The current synchronous mode.
223
- * @see - (void)setSynchronousMode:(NSFSynchronousMode)theSynchronousMode;
224
- */
225
-
226
- - (NSFSynchronousMode)synchronousMode;
227
-
228
- /** Sets the temporary storage mode.
229
- * @param theTempStoreMode is the temporary storage mode. Can be TempStoreModeDefault, TempStoreModeFile or TempStoreModeMemory.
230
- * @see - (NSFTempStoreMode)tempStoreMode;
231
- */
232
-
233
- - (void)setTempStoreMode:(NSFTempStoreMode)theTempStoreMode;
234
-
235
- /** Returns the temporary storage mode.
236
- * @return The current temporary storage mode.
237
- * @see - (void)setTempStoreMode:(NSFTempStoreMode)theTempStoreMode;
238
- */
239
-
240
- - (NSFTempStoreMode)tempStoreMode;
241
-
242
- /** * Journal mode.
243
- * These values represent the options used by SQLite to the the journal mode for databases associated with the current database connection.
244
-
245
- @par
246
- The <b>DELETE</b> journaling mode is the normal behavior. In the <b>DELETE</b> mode, the rollback journal is deleted at the conclusion
247
- of each transaction. Indeed, the delete operation is the action that causes the transaction to commit. (See the document titled
248
- Atomic Commit In SQLite for additional detail.)
249
-
250
- @par
251
- The <b>TRUNCATE</b> journaling mode commits transactions by truncating the rollback journal to zero-length instead of deleting it.
252
- On many systems, truncating a file is much faster than deleting the file since the containing directory does not need to be changed.
253
-
254
- @par
255
- The <b>PERSIST</b> journaling mode prevents the rollback journal from being deleted at the end of each transaction. Instead, the header
256
- of the journal is overwritten with zeros. This will prevent other database connections from rolling the journal back. The <b>PERSIST</b>
257
- journaling mode is useful as an optimization on platforms where deleting or truncating a file is much more expensive than overwriting
258
- the first block of a file with zeros.
259
-
260
- @par
261
- The <b>MEMORY</b> journaling mode stores the rollback journal in volatile RAM. This saves disk I/O but at the expense of database safety
262
- and integrity. If the application using SQLite crashes in the middle of a transaction when the <b>MEMORY</b> journaling mode is set, then
263
- the database file will very likely go corrupt.
264
-
265
- @par
266
- The <b>WAL</b> journaling mode uses a write-ahead log instead of a rollback journal to implement transactions. The <b>WAL</b> journaling mode is
267
- persistent; after being set it stays in effect across multiple database connections and after closing and reopening the database. A database
268
- in <b>WAL</b> journaling mode can only be accessed by SQLite version 3.7.0 or later.
269
-
270
- @par
271
- The <b>OFF</b> journaling mode disables the rollback journal completely. No rollback journal is ever created and hence there is never a
272
- rollback journal to delete. The <b>OFF</b> journaling mode disables the atomic commit and rollback capabilities of SQLite. The <b>ROLLBACK</b> command
273
- no longer works; it behaves in an undefined way. Applications must avoid using the <b>ROLLBACK</b> command when the journal mode is <b>OFF</b>.
274
- If the application crashes in the middle of a transaction when the <b>OFF</b> journaling mode is set, then the database file will very likely go corrupt.
275
-
276
- @note
277
- The journal_mode for an in-memory database is either <b>MEMORY</b> or <b>OFF</b> and can not be changed to a different value. An attempt to change
278
- the journal_mode of an in-memory database to any setting other than <b>MEMORY</b> or <b>OFF</b> is ignored. Note also that the journal_mode cannot be changed
279
- while a transaction is active.
280
-
281
- @see NSFNanoEngine
282
- */
283
-
284
- - (NSFJournalModeMode)journalModeAndReturnError:(out NSError **)outError;
285
-
286
- /** Returns the journal mode.
287
- * @return The current journal mode.
288
- * @see - (NSFJournalModeMode)journalModeAndReturnError:(out NSError **)outError;
289
- */
290
- - (BOOL)setJournalMode:(NSFJournalModeMode)theMode;
291
-
292
- /** Returns a new array containing the datatypes recognized by NanoStore.
293
- * @return A new array containing the datatypes recognized by NanoStore.
294
- */
295
-
296
- + (NSSet *)sharedNanoStoreEngineDatatypes;
297
-
298
- /** Returns the NanoStore engine version.
299
- * @return The NanoStore engine version.
300
- */
301
-
302
- + (NSString *)nanoStoreEngineVersion;
303
-
304
- /** Returns the SQLite version.
305
- * @return The SQLite version.
306
- */
307
-
308
- + (NSString *)sqliteVersion;
309
-
310
- //@}
311
-
312
- /** @name Transactions
313
- */
314
-
315
- //@{
316
-
317
- /** Starts a transaction.
318
- * @return YES upon success, NO otherwise.
319
- * @see - (BOOL)beginTransaction;
320
- * @see - (BOOL)beginDeferredTransaction;
321
- * @see - (BOOL)commitTransaction;
322
- * @see - (BOOL)rollbackTransaction;
323
- * @see - (BOOL)isTransactionActive;
324
- */
325
-
326
- - (BOOL)beginTransaction;
327
-
328
- /** Starts a deferred transaction.
329
- * @return YES upon success, NO otherwise.
330
- * @see - (BOOL)beginTransaction;
331
- * @see - (BOOL)commitTransaction;
332
- * @see - (BOOL)rollbackTransaction;
333
- * @see - (BOOL)isTransactionActive;
334
- */
335
-
336
- - (BOOL)beginDeferredTransaction;
337
-
338
- /** Commits a transaction.
339
- * @return YES upon success, NO otherwise.
340
- * @see - (BOOL)beginTransaction;
341
- * @see - (BOOL)beginDeferredTransaction;
342
- * @see - (BOOL)rollbackTransaction;
343
- * @see - (BOOL)isTransactionActive;
344
- */
345
-
346
- - (BOOL)commitTransaction;
347
-
348
- /** Rolls back a transaction.
349
- * @return YES upon success, NO otherwise.
350
- * @see - (BOOL)beginTransaction;
351
- * @see - (BOOL)beginDeferredTransaction;
352
- * @see - (BOOL)commitTransaction;
353
- * @see - (BOOL)isTransactionActive;
354
- */
355
-
356
- - (BOOL)rollbackTransaction;
357
-
358
- //@}
359
-
360
- /** @name Everything About Tables
361
- */
362
-
363
- //@{
364
-
365
- /** Creates a table.
366
- * @param theTable the name of the table. Must not be nil.
367
- * @param theColumns the names of the columns. Must not be nil.
368
- * @param theDatatypes the datatypes of the columns. Must not be nil.
369
- * @see - (BOOL)dropTable:(NSString *)theTable;
370
- * @return YES upon success, NO otherwise.
371
- * @note
372
- * Allowed datatypes: NSFNanoTypeRowUID, NSFNanoTypeString, NSFNanoTypeData, NSFNanoTypeDate and NSFNanoTypeNumber.
373
- * @throws NSFUnexpectedParameterException is thrown if any of the parameters are nil.
374
- * @throws NSFUnexpectedParameterException is thrown if the number of columns and datatypes are not equal.
375
- */
376
-
377
- - (BOOL)createTable:(NSString *)theTable withColumns:(NSArray *)theColumns datatypes:(NSArray *)theDatatypes;
378
-
379
- /** Returns a new array containing the tables found in the main document store.
380
- * @return A new array containing the tables in the main document store, or an empty array if none is found.
381
- * @see - (NSDictionary *)allTables;
382
- * @see - (NSArray *)temporaryTables;
383
- */
384
-
385
- - (NSArray *)tables;
386
-
387
- /** Returns a new array containing the tables found in the main and attached document stores.
388
- * @return A new array containing the tables in the main and attached document stores, or an empty array if none is found.
389
- * @note
390
- * The dictionary key is the document store name and its value, an array of the tables associated with that document store.
391
- * @see - (NSArray *)tables;
392
- * @see - (NSArray *)temporaryTables;
393
- */
394
-
395
- - (NSDictionary *)allTables;
396
-
397
- /** Returns a new array containing the columns for a given table.
398
- * @param theTable is the name of the table.
399
- * @return A new array containing the columns for a given table, or an empty array if none is found.
400
- */
401
-
402
- - (NSArray *)columnsForTable:(NSString *)theTable;
403
-
404
- /** Returns a new array containing the temporary tables found in the main document store.
405
- * @return A new array containing the temporary tables in the main document store, or an empty array if none is found.
406
- * @see - (NSArray *)tables;
407
- * @see - (NSDictionary *)allTables;
408
- */
409
-
410
- - (NSArray *)temporaryTables;
411
-
412
- /** Returns a new array containing the datatypes for a given table.
413
- * @param theTable is the name of the table.
414
- * @return A new array containing the datatypes for a given table, or an empty array if none is found.
415
- */
416
-
417
- - (NSArray *)datatypesForTable:(NSString *)theTable;
418
-
419
- /** Removes the table from the document store.
420
- * @param theTable is the name of the table.
421
- * @return YES upon success, NO otherwise.
422
- * @see - (BOOL)createTable:(NSString *)theTable withColumns:(NSArray *)theColumns datatypes:(NSArray *)theDatatypes;
423
- */
424
-
425
- - (BOOL)dropTable:(NSString *)theTable;
426
-
427
- //@}
428
-
429
- /** @name Everything about Indexes
430
- */
431
-
432
- //@{
433
-
434
- /** Creates an index.
435
- * @param theColumn is the name of the column.
436
- * @param theTable is the name of the table.
437
- * @param isUnique whether the index should be unique or allow duplicates.
438
- * @return YES upon success, NO otherwise.
439
- * @see - (void)dropIndex:(NSString *)indexName;
440
- */
441
-
442
- - (BOOL)createIndexForColumn:(NSString *)theColumn table:(NSString *)theTable isUnique:(BOOL)isUnique;
443
-
444
- /** Returns a new array containing the indexes found in the main document store.
445
- * @return A new array containing the indexes in the main document store, or an empty array if none is found.
446
- */
447
-
448
- - (NSArray *)indexes;
449
-
450
- /** Returns a new array containing the indexes found for a given table.
451
- * @return A new array containing the indexes for a given table, or an empty array if none is found.
452
- */
453
-
454
- - (NSArray *)indexedColumnsForTable:(NSString *)theTable;
455
-
456
- /** Removes an index.
457
- * @param theIndex is the name of the index to be removed.
458
- * @see - (BOOL)createIndexForColumn:(NSString *)theColumn table:(NSString *)theTable isUnique:(BOOL)isUnique;
459
- */
460
-
461
- - (void)dropIndex:(NSString *)theIndex;
462
-
463
- //@}
464
-
465
- /** @name Database Maintenance
466
- */
467
-
468
- //@{
469
-
470
- /** Compacts the database, attempting to reclaim unused space.
471
- * @return YES upon success, NO otherwise.
472
- * @note If a transaction is open, the operation will not proceed and NO will be returned instead.
473
- */
474
-
475
- - (BOOL)compact;
476
-
477
- /** Performs an integrity check on the database.
478
- * @return YES upon success, NO otherwise.
479
- * @note If a transaction is open, the operation will not proceed and NO will be returned instead.
480
- */
481
-
482
- - (BOOL)integrityCheck;
483
-
484
- //@}
485
-
486
- /** @name Searching and Retrieving
487
- */
488
-
489
- //@{
490
-
491
- /** Executes a SQL statement.
492
- * @param theSQLStatement is the SQL statement to be executed. Must not be nil or an empty string.
493
- * @return Returns a NSFNanoResult.
494
- * @throws NSFUnexpectedParameterException is thrown if the statement is nil or an empty string.
495
- * @attention Check NSFNanoResult's error property to find out if there was a problem executing the statement.
496
- * @note The result set will always contain string values. If you need to obtain NanoObjects instead, use the NSFNanoSearch class.
497
- * @see NSFNanoSearch
498
- */
499
-
500
- - (NSFNanoResult *)executeSQL:(NSString *)theSQLStatement;
501
-
502
- /** Returns the largest ROWUID for a given table.
503
- * @param theTable is the table from which to obtain the largest ROWUID. Must not be nil.
504
- * @return The largest ROWUID in use.
505
- * @throws NSFUnexpectedParameterException is thrown if the table is nil.
506
- */
507
-
508
- - (long long)maxRowUIDForTable:(NSString *)theTable;
509
-
510
- //@}
511
-
512
- /** @name Miscellaneous
513
- */
514
-
515
- //@{
516
-
517
- /** Returns a string containing the base 64 representation of a data element.
518
- * @return A string encoded in base 64 format.
519
- */
520
-
521
- + (NSString *)encodeDataToBase64:(NSData *)theData;
522
-
523
- /** Returns a data element containing from a base 64 formatted string.
524
- * @return A data element.
525
- */
526
-
527
- + (NSData *)decodeDataFromBase64:(NSString *)theEncodedData;
528
-
529
- /** Returns a UUID string
530
- * @return A string containing a representation of a UUID.
531
- */
532
-
533
- + (NSString *)stringWithUUID;
534
-
535
- /** Returns a string representation of the engine.
536
- */
537
-
538
- - (NSString *)description;
539
-
540
- //@}
541
-
542
- @end