diff options
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; |