From 209b7db55ffd4b096b5d55402cd0ce989000c45b Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 21 May 2013 19:54:00 +0000 Subject: PostgresKit: Implement -description on PGPostgresResult and add an associated test. --- Frameworks/PostgresKit/Source/PGPostgresResult.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Frameworks/PostgresKit/Source/PGPostgresResult.m') diff --git a/Frameworks/PostgresKit/Source/PGPostgresResult.m b/Frameworks/PostgresKit/Source/PGPostgresResult.m index 1bf1db06..cd62f17e 100644 --- a/Frameworks/PostgresKit/Source/PGPostgresResult.m +++ b/Frameworks/PostgresKit/Source/PGPostgresResult.m @@ -289,6 +289,29 @@ return handler; } +#pragma mark - +#pragma mark Other + +- (NSString *)description +{ + NSMutableString *description = [[[NSMutableString alloc] init] autorelease]; + + if (![self numberOfRows]) return @""; + + PGPostgresResultRowType rowType = _defaultRowType; + + [self setDefaultRowType:PGPostgresResultRowAsDictionary]; + + for (NSDictionary *row in self) + { + [description appendString:[row description]]; + } + + [self setDefaultRowType:rowType]; + + return description; +} + #pragma mark - -(void)dealloc -- cgit v1.2.3