diff options
author | rowanbeentje <rowan@beent.je> | 2012-02-23 02:13:56 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-02-23 02:13:56 +0000 |
commit | 05f1612cbb7e33cf9135a346fc2505cc0e87e853 (patch) | |
tree | 785824be4e44a61389271343d958851fa4ff7dd0 /Source/SPDatabaseInfo.m | |
parent | a889340b9cb1eca0d3ff022e8e6e2c718480bf44 (diff) | |
download | sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.tar.gz sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.tar.bz2 sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.zip |
Warning: this branch commit is largely untested, and known to throw exceptions as database structure retrieval is currently missing!
Further work on SPMySQLFramework integration:
- Improve SPMySQL framework build settings including correct ppc builds and a Distribution configuration for the build distributions to match
- Add new convenience querying and result methods to the framework
- Amend Sequel Pro source to use the new SPMySQL.framework methods everywhere, replacing MCPKit methods where they differ and improving some functions
- Remove MCPKit from the source
- Fix a number of warnings on Release-style builds
Diffstat (limited to 'Source/SPDatabaseInfo.m')
-rw-r--r-- | Source/SPDatabaseInfo.m | 33 |
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 |