aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit/Source/QKQueryParameter.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-07-09 09:27:48 +0000
committerstuconnolly <stuart02@gmail.com>2012-07-09 09:27:48 +0000
commitc1bab7abd666d809aa01c330a66c53e1b6abe6c4 (patch)
tree075fcdeb4b371e0fd1a21e74fa14ebf705860e2e /Frameworks/QueryKit/Source/QKQueryParameter.m
parenta434272a852db341a6ea4421e388ef924b6a99d7 (diff)
downloadsequelpro-c1bab7abd666d809aa01c330a66c53e1b6abe6c4.tar.gz
sequelpro-c1bab7abd666d809aa01c330a66c53e1b6abe6c4.tar.bz2
sequelpro-c1bab7abd666d809aa01c330a66c53e1b6abe6c4.zip
Improve QueryKit's handling of quotes by making it on by default. Also, add a bunch more tests.
Diffstat (limited to 'Frameworks/QueryKit/Source/QKQueryParameter.m')
-rw-r--r--Frameworks/QueryKit/Source/QKQueryParameter.m17
1 files changed, 3 insertions, 14 deletions
diff --git a/Frameworks/QueryKit/Source/QKQueryParameter.m b/Frameworks/QueryKit/Source/QKQueryParameter.m
index c95bf585..c4f9cc29 100644
--- a/Frameworks/QueryKit/Source/QKQueryParameter.m
+++ b/Frameworks/QueryKit/Source/QKQueryParameter.m
@@ -30,12 +30,11 @@
#import "QKQueryParameter.h"
#import "QKQueryUtilities.h"
+#import "QKQueryConstants.h"
@implementation QKQueryParameter
-@synthesize _field;
@synthesize _operator;
-@synthesize _value;
#pragma mark -
#pragma mark Initialisation
@@ -64,21 +63,11 @@
NSString *field = [_field stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
- [string appendString:field];
+ [string appendFormat:@"%@%@%@", [self useQuotes] ? QUERY_QUOTE : EMPTY_STRING, field, [self useQuotes] ? QUERY_QUOTE : EMPTY_STRING];
[string appendFormat:@" %@ ", [QKQueryUtilities operatorRepresentationForType:_operator]];
- [string appendFormat:(![_value isKindOfClass:[NSNumber class]]) ? @"'%@'" : @"%@", [_value description]];
+ [string appendFormat:![_value isKindOfClass:[NSNumber class]] ? @"'%@'" : @"%@", [_value description]];
return string;
}
-#pragma mark -
-
-- (void)dealloc
-{
- if (_field) [_field release], _field = nil;
- if (_value) [_value release], _value = nil;
-
- [super dealloc];
-}
-
@end