aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/PostgresKit/Source
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2013-05-21 19:54:00 +0000
committerstuconnolly <stuart02@gmail.com>2013-05-21 19:54:00 +0000
commit209b7db55ffd4b096b5d55402cd0ce989000c45b (patch)
tree72b5061b02a1d5c5a33790b8398506cba5e72786 /Frameworks/PostgresKit/Source
parentcae86c6943496128a61056b88a2c1c9420ce15ee (diff)
downloadsequelpro-209b7db55ffd4b096b5d55402cd0ce989000c45b.tar.gz
sequelpro-209b7db55ffd4b096b5d55402cd0ce989000c45b.tar.bz2
sequelpro-209b7db55ffd4b096b5d55402cd0ce989000c45b.zip
PostgresKit: Implement -description on PGPostgresResult and add an associated test.
Diffstat (limited to 'Frameworks/PostgresKit/Source')
-rw-r--r--Frameworks/PostgresKit/Source/PGPostgresResult.m23
1 files changed, 23 insertions, 0 deletions
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
@@ -290,6 +290,29 @@
}
#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
{