aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDump.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-04-12 00:08:40 +0000
committerrowanbeentje <rowan@beent.je>2010-04-12 00:08:40 +0000
commitebfd8ca1dac81755451a22e364daa851992b386e (patch)
treeebc4ec3dbdbdb8e72f747d849a85a6a497bf6ea4 /Source/TableDump.h
parentcd9e9490ce6f073514cab18731cc0553f1c750d1 (diff)
downloadsequelpro-ebfd8ca1dac81755451a22e364daa851992b386e.tar.gz
sequelpro-ebfd8ca1dac81755451a22e364daa851992b386e.tar.bz2
sequelpro-ebfd8ca1dac81755451a22e364daa851992b386e.zip
Add a new SPFileHandle class to support gzip compression and writing on a background thread, and integrate for SQL import:
- Implement streaming reading of gzip-compressed files for SQL import - Support exporting SQL dumps into a gzip-compressed file - SPFileHandle supports the most-used subset of NSFileHandle commands for easy integration - Integrate zlib 1.2.4 for improved gzip streaming performance (and support for custom buffer sizes and file offset positions) This implements Issue #571 .
Diffstat (limited to 'Source/TableDump.h')
-rw-r--r--Source/TableDump.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/TableDump.h b/Source/TableDump.h
index af621f68..e506a6d2 100644
--- a/Source/TableDump.h
+++ b/Source/TableDump.h
@@ -27,7 +27,7 @@
#import <Cocoa/Cocoa.h>
#import <MCPKit/MCPKit.h>
-@class SPFieldMapperController;
+@class SPFieldMapperController, SPFileHandle;
@interface TableDump : NSObject
{
@@ -83,6 +83,7 @@
IBOutlet id addTableContentSwitch;
IBOutlet id addErrorsSwitch;
IBOutlet id sqlFullStreamingSwitch;
+ IBOutlet id sqlCompressionSwitch;
IBOutlet id csvFullStreamingSwitch;
IBOutlet id multiCSVFullStreamingSwitch;
IBOutlet id multiXMLFullStreamingSwitch;
@@ -121,6 +122,8 @@
NSUInteger exportMode;
NSUserDefaults *prefs;
BOOL progressCancelled;
+
+ NSSavePanel *currentExportPanel;
}
// IBAction methods
@@ -148,21 +151,21 @@
- (NSString *) mappedUpdateSetStatementStringForRowArray:(NSArray *)csvRowArray;
// Export methods
-- (BOOL)dumpSelectedTablesAsSqlToFileHandle:(NSFileHandle *)fileHandle;
-- (BOOL)dumpSchemaAsDotToFileHandle:(NSFileHandle *)fileHandle;
+- (BOOL)dumpSelectedTablesAsSqlToFileHandle:(SPFileHandle *)fileHandle;
+- (BOOL)dumpSchemaAsDotToFileHandle:(SPFileHandle *)fileHandle;
- (BOOL)writeCsvForArray:(NSArray *)array orStreamingResult:(MCPStreamingResult *)streamingResult
- toFileHandle:(NSFileHandle *)fileHandle
+ toFileHandle:(SPFileHandle *)fileHandle
outputFieldNames:(BOOL)firstLine terminatedBy:(NSString *)terminated
enclosedBy:(NSString *)enclosed escapedBy:(NSString *)escaped
lineEnds:(NSString *)lineEnds withNumericColumns:(NSArray *)tableColumnNumericStatus totalRows:(NSInteger)totalRows silently:(BOOL)silently;
- (BOOL)writeXmlForArray:(NSArray *)array orStreamingResult:(MCPStreamingResult *)streamingResult
- toFileHandle:(NSFileHandle *)fileHandle
+ toFileHandle:(SPFileHandle *)fileHandle
tableName:(NSString *)table withHeader:(BOOL)header totalRows:(NSInteger)totalRows silently:(BOOL)silently;
- (NSString *)htmlEscapeString:(NSString *)string;
- (NSString *)createViewPlaceholderSyntaxForView:(NSString *)viewName;
-- (BOOL)exportTables:(NSArray *)selectedTables toFileHandle:(NSFileHandle *)fileHandle usingFormat:(NSString *)type usingMulti:(BOOL)multi;
-- (BOOL)exportSelectedTablesToFileHandle:(NSFileHandle *)fileHandle usingFormat:(NSString *)type;
+- (BOOL)exportTables:(NSArray *)selectedTables toFileHandle:(SPFileHandle *)fileHandle usingFormat:(NSString *)type usingMulti:(BOOL)multi;
+- (BOOL)exportSelectedTablesToFileHandle:(SPFileHandle *)fileHandle usingFormat:(NSString *)type;
// New Export methods
- (IBAction)switchTab:(id)sender;
@@ -174,5 +177,6 @@
// Import/export delegate notifications
- (void)panelSelectionDidChange:(id)sender;
+- (IBAction)updateExportCompressionSetting:(id)sender;
@end