aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDump.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-07-21 16:47:11 +0000
committerstuconnolly <stuart02@gmail.com>2009-07-21 16:47:11 +0000
commit8b8f3e6cea540b17262aadf6d97a8ad28fe41c03 (patch)
treead6bb7f53b03924aa24d0cf5822a27b3bd453592 /Source/TableDump.m
parent383863f98dfc488db0181e01d39da1bb025d421b (diff)
downloadsequelpro-8b8f3e6cea540b17262aadf6d97a8ad28fe41c03.tar.gz
sequelpro-8b8f3e6cea540b17262aadf6d97a8ad28fe41c03.tar.bz2
sequelpro-8b8f3e6cea540b17262aadf6d97a8ad28fe41c03.zip
Merge framework integration branch back to trunk. Summary of changes:
- Includes all custom code from subclasses CMMCPConnection and CMMCPResult, meaning they have subsequently been removed from the project. - All previous Sequel Pro specific code in the above subclasses has been removed in favour of the delegate (currently set to TableDocumet) informing the framework of such information. - All references to CMMCPConnection and CMMCPResult have subsequently been changed to MCPConnection and MCPResult. - Framework includes MySQL 5.1.36 client libraries and source headers. - Framework is now built as a 4-way (32/64 bit, i386/PPC arch) binary. - All import references to <MCPKit_bundled/MCPKit_bundled.h> have been changed to <MCPKit/MCPKit.h>. - New script 'build-mysql-client.sh' can be used to build the MySQL client libraries from the MySQL source. See the script's header for a list of available options or run it with no arguments to display it's usage. Note that there are still a few changes to be made to the framework with regard to removing Sequel Pro specific calls to the delegate. These however can be made later on as they have no effect on functionality and are merely design changes. Also, note that any future development done on the framework should be made to be as 'generic' as possible, with no Sequel Pro specific references. This should allow the framework to be integrated into another project without the need for SP specific code.
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r--Source/TableDump.m28
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 94aa7a0a..7f65196d 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -43,12 +43,12 @@
get the tables in db
*/
{
- CMMCPResult *queryResult;
+ MCPResult *queryResult;
int i;
//get tables
[tables removeAllObjects];
- queryResult = (CMMCPResult *)[mySQLConnection listTables];
+ queryResult = (MCPResult *)[mySQLConnection listTables];
if ([queryResult numOfRows]) [queryResult dataSeek:0];
for ( i = 0 ; i < [queryResult numOfRows] ; i++ ) {
@@ -423,7 +423,7 @@
if (!importSQLAsUTF8 || [fileType isEqualToString:@"CSV"]) {
DLog(@"Reading using connection encoding");
dumpFile = [SPSQLParser stringWithContentsOfFile:filename
- encoding:[CMMCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]]
+ encoding:[MCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]]
error:&errorStr];
}
@@ -588,9 +588,9 @@
[pool release];
return;
}
- CMMCPResult *theResult;
+ MCPResult *theResult;
int i;
- theResult = (CMMCPResult *) [mySQLConnection listTables];
+ theResult = (MCPResult *) [mySQLConnection listTables];
if ([theResult numOfRows]) [theResult dataSeek:0];
[fieldMappingPopup removeAllItems];
for ( i = 0 ; i < [theResult numOfRows] ; i++ ) {
@@ -835,7 +835,7 @@
int i,j,t,rowCount, colCount, lastProgressValue, queryLength;
// int progressBarWidth;
int tableType = SP_TABLETYPE_TABLE; //real tableType will be setup later
- CMMCPResult *queryResult;
+ MCPResult *queryResult;
NSString *tableName, *tableColumnTypeGrouping, *previousConnectionEncoding;
NSArray *fieldNames;
NSArray *theRow;
@@ -903,7 +903,7 @@
// Store the current connection encoding so it can be restored after the dump.
previousConnectionEncoding = [tableDocumentInstance connectionEncoding];
- previousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1];
+ previousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1:nil];
// Set the connection to UTF8 to be able to export correctly.
[tableDocumentInstance setConnectionEncoding:@"utf8" reloadingViews:NO];
@@ -1196,7 +1196,7 @@
// store connection encoding
previousConnectionEncoding = [tableDocumentInstance connectionEncoding];
- previousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1];
+ previousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1:nil];
NSMutableArray *fkInfo = [[NSMutableArray alloc] init];
@@ -1297,7 +1297,7 @@
/*
Takes an array and writes it in CSV format to the supplied NSFileHandle
*/
-- (BOOL)writeCsvForArray:(NSArray *)array orQueryResult:(CMMCPResult *)queryResult toFileHandle:(NSFileHandle *)fileHandle
+- (BOOL)writeCsvForArray:(NSArray *)array orQueryResult:(MCPResult *)queryResult toFileHandle:(NSFileHandle *)fileHandle
outputFieldNames:(BOOL)outputFieldNames
terminatedBy:(NSString *)fieldSeparatorString
enclosedBy:(NSString *)enclosingString
@@ -1306,7 +1306,7 @@
withNumericColumns:(NSArray *)tableColumnNumericStatus
silently:(BOOL)silently;
{
- NSStringEncoding tableEncoding = [CMMCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]];
+ NSStringEncoding tableEncoding = [MCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]];
NSMutableString *csvCell = [NSMutableString string];
NSMutableArray *csvRow = [NSMutableArray array];
NSMutableString *csvString = [NSMutableString string];
@@ -1655,9 +1655,9 @@
/*
Takes an array and writes it in XML format to the supplied NSFileHandle
*/
-- (BOOL)writeXmlForArray:(NSArray *)array orQueryResult:(CMMCPResult *)queryResult toFileHandle:(NSFileHandle *)fileHandle tableName:(NSString *)table withHeader:(BOOL)header silently:(BOOL)silently
+- (BOOL)writeXmlForArray:(NSArray *)array orQueryResult:(MCPResult *)queryResult toFileHandle:(NSFileHandle *)fileHandle tableName:(NSString *)table withHeader:(BOOL)header silently:(BOOL)silently
{
- NSStringEncoding tableEncoding = [CMMCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]];
+ NSStringEncoding tableEncoding = [MCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]];
NSMutableArray *xmlTags = [NSMutableArray array];
NSMutableArray *xmlRow = [NSMutableArray array];
NSMutableString *xmlString = [NSMutableString string];
@@ -1815,7 +1815,7 @@
- (BOOL)exportTables:(NSArray *)selectedTables toFileHandle:(NSFileHandle *)fileHandle usingFormat:(NSString *)type usingMulti:(BOOL)multi
{
int i, j;
- CMMCPResult *queryResult;
+ MCPResult *queryResult;
NSString *tableName, *tableColumnTypeGrouping;
NSMutableString *infoString = [NSMutableString string];
NSMutableString *errors = [NSMutableString string];
@@ -2173,7 +2173,7 @@
}
//additional methods
-- (void)setConnection:(CMMCPConnection *)theConnection
+- (void)setConnection:(MCPConnection *)theConnection
/*
sets the connection (received from TableDocument) and makes things that have to be done only once
*/