From f4ba50508f2c89b3ca5df46a7ec09e0002f7e2e5 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 6 Dec 2008 22:34:18 +0000 Subject: - Identified and corrected a major n^2 bottleneck in working with all query result sets - when iterating through a mysql result set, all the data up to each row was seeked through again. With this fixed SP can work with very large result sets at much, much higher speeds. - Fixed incorrect query splitting in splitQueries - improves custom queries and imports. - CSV export now exports NULLs as an empty cell (eg "1,,3"). This resolved Issue #67. Correspondingly, CSV import now also accepts this syntax. - CSV and SQL exports no longer quote numeric values for file size and neatness improvements. - Multi-table exports now show progress through the tables in the text description, and use the progress bar for export of each table, for improved feedback. - The old "Export Table Content" menu has been split into two - "Current Browse View" which matches the old behaviour, and a new "Current Table" entry. This addresses Issue #97. - Exports now write data to a file stream as data is processed for export, and also parse data from the database as a stream where possible. This leads to lower memory usage, speed improvements, and much more accurate and constant feedback. - The export processes have been restructured and rewritten for further speed and memory improvements. - SQL exports now correctly export BLOB and TEXT contents ready for re-import into all systems. - SQL exports now group multiple VALUES for each INSERT INTO command for much, much faster imports of exported data. --- TableDump.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'TableDump.h') diff --git a/TableDump.h b/TableDump.h index 13ba4493..a382e082 100644 --- a/TableDump.h +++ b/TableDump.h @@ -114,20 +114,26 @@ - (IBAction)changeTable:(id)sender; - (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(NSString *)contextInfo; - (void)setupFieldMappingArray; - -//format methods -- (NSString *)dumpForSelectedTables; -- (NSString *)csvForArray:(NSArray *)array useFirstLine:(BOOL)firstLine terminatedBy:(NSString *)terminated - enclosedBy:(NSString *)enclosed escapedBy:(NSString *)escaped lineEnds:(NSString *)lineEnds silently:(BOOL)silently; - (NSArray *)arrayForCSV:(NSString *)csv terminatedBy:(NSString *)terminated enclosedBy:(NSString *)enclosed escapedBy:(NSString *)escaped lineEnds:(NSString *)lineEnds; -- (NSString *)xmlForArray:(NSArray *)array tableName:(NSString *)table withHeader:(BOOL)header silently:(BOOL)silently; -- (NSString *)stringForSelectedTablesWithType:(NSString *)type; -- (NSString *)htmlEscapeString:(NSString *)string; - (NSArray *)arrayForString:(NSString *)string enclosed:(NSString *)enclosed escaped:(NSString *)escaped terminated:(NSString *)terminated; - (NSArray *)splitQueries:(NSString *)query; +// Export methods +- (BOOL)dumpSelectedTablesAsSqlToFileHandle:(NSFileHandle *)fileHandle; +- (BOOL)writeCsvForArray:(NSArray *)array orQueryResult:(CMMCPResult *)queryResult + toFileHandle:(NSFileHandle *)fileHandle + outputFieldNames:(BOOL)firstLine terminatedBy:(NSString *)terminated + enclosedBy:(NSString *)enclosed escapedBy:(NSString *)escaped + lineEnds:(NSString *)lineEnds silently:(BOOL)silently; +- (BOOL)writeXmlForArray:(NSArray *)array orQueryResult:(CMMCPResult *)queryResult + toFileHandle:(NSFileHandle *)fileHandle + tableName:(NSString *)table withHeader:(BOOL)header silently:(BOOL)silently; +- (NSString *)htmlEscapeString:(NSString *)string; +- (BOOL)exportTables:(NSArray *)selectedTables toFileHandle:(NSFileHandle *)fileHandle usingFormat:(NSString *)type; +- (BOOL)exportSelectedTablesToFileHandle:(NSFileHandle *)fileHandle usingFormat:(NSString *)type; + //additional methods - (void)setConnection:(CMMCPConnection *)theConnection; -- cgit v1.2.3