aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseInfo.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-03-18 20:05:36 +0000
committerstuconnolly <stuart02@gmail.com>2012-03-18 20:05:36 +0000
commit524e8c356b4074f5be5933b0551374a130a8f6d1 (patch)
tree0dab40735f2d9484930050cd08376cbf15e4ea55 /Source/SPDatabaseInfo.m
parentbe3263f8158cb6f3dfa1005f49beefa7e494b852 (diff)
downloadsequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.tar.gz
sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.tar.bz2
sequelpro-524e8c356b4074f5be5933b0551374a130a8f6d1.zip
Bring outline view branch up to date with trunk (r3471:r3517).
Diffstat (limited to 'Source/SPDatabaseInfo.m')
-rw-r--r--Source/SPDatabaseInfo.m33
1 files changed, 3 insertions, 30 deletions
diff --git a/Source/SPDatabaseInfo.m b/Source/SPDatabaseInfo.m
index 3c70aec9..fc487718 100644
--- a/Source/SPDatabaseInfo.m
+++ b/Source/SPDatabaseInfo.m
@@ -24,6 +24,7 @@
#import "SPDBActionCommons.h"
#import "SPDatabaseInfo.h"
+#import "SPMySQL.h"
@implementation SPDatabaseInfo
@@ -36,40 +37,12 @@
- (NSArray *)listDBs
{
- return [self listDBsLike:nil];
+ return [connection databases];
}
- (NSArray *)listDBsLike:(NSString *)dbsName
{
- NSString *listDBStatement = nil;
-
- if ((dbsName == nil) || ([dbsName isEqualToString:@""])) {
- listDBStatement = [NSString stringWithFormat:@"SHOW DATABASES"];
- }
- else {
- listDBStatement = [NSString stringWithFormat:@"SHOW DATABASES LIKE %@", [dbsName backtickQuotedString]];
- }
-
- MCPResult *theResult = [connection queryString:listDBStatement];
-
- if ([connection queryErrored]) return NO;
-
- NSMutableArray *names = [NSMutableArray array];
- NSMutableString *name;
-
- if ([theResult numOfRows] > 1) {
-
- NSUInteger i;
-
- for (i = 0 ; i < [theResult numOfRows]; i++)
- {
- name = [[theResult fetchRowAsArray] objectAtIndex:0];
-
- [names addObject:name];
- }
- }
-
- return names;
+ return [connection databasesLike:dbsName];
}
@end