diff options
author | stuconnolly <stuart02@gmail.com> | 2012-07-14 10:26:44 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-07-14 10:26:44 +0000 |
commit | 6c1a1acdb2e030b08ccd08dc6eea70b3657ebb4c (patch) | |
tree | a2b9c82ab3db6f149ee6a67affd94ecda30a5b9b /Frameworks/QueryKit/Source/QKQueryUtilities.m | |
parent | a2d65d3fa1e58d91d47260cdbbbeae7c99aa04f8 (diff) | |
download | sequelpro-6c1a1acdb2e030b08ccd08dc6eea70b3657ebb4c.tar.gz sequelpro-6c1a1acdb2e030b08ccd08dc6eea70b3657ebb4c.tar.bz2 sequelpro-6c1a1acdb2e030b08ccd08dc6eea70b3657ebb4c.zip |
Bunch of improvements including uderlying database system support.
Diffstat (limited to 'Frameworks/QueryKit/Source/QKQueryUtilities.m')
-rw-r--r-- | Frameworks/QueryKit/Source/QKQueryUtilities.m | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/Frameworks/QueryKit/Source/QKQueryUtilities.m b/Frameworks/QueryKit/Source/QKQueryUtilities.m index 8519eb20..06396ddc 100644 --- a/Frameworks/QueryKit/Source/QKQueryUtilities.m +++ b/Frameworks/QueryKit/Source/QKQueryUtilities.m @@ -35,13 +35,34 @@ static NSString *QKUnrecognisedQueryOperatorException = @"QKUnrecognisedQueryOpe @implementation QKQueryUtilities /** - * Returns a string representation of the supplied operator type. + * Returns the identifier quote character for the supplied database. + * + * @param database The database to return the character for + * + * @return The character as a string. + */ ++ (NSString *)identifierQuoteCharacterForDatabase:(QKQueryDatabase)database +{ + NSString *character = EMPTY_STRING; + + if (database == QKDatabaseMySQL) { + character = @"`"; + } + else if (database == QKDatabasePostgreSQL) { + character = @""""; + } + + return character; +} + +/** + * Returns a string representation of the supplied operator. * * @param operator The operator * * @return A string represenation of the operator. */ -+ (NSString *)operatorRepresentationForType:(QKQueryOperator)operator ++ (NSString *)stringRepresentationOfQueryOperator:(QKQueryOperator)operator { NSString *opString = nil; |