aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h3
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m41
-rw-r--r--Interfaces/English.lproj/DBView.xib796
-rw-r--r--Interfaces/English.lproj/MainMenu.xib89
-rw-r--r--Source/SPDatabaseCopy.h80
-rw-r--r--Source/SPDatabaseCopy.m113
-rw-r--r--Source/SPDatabaseInfo.h54
-rw-r--r--Source/SPDatabaseInfo.m66
-rw-r--r--Source/SPDatabaseRename.h89
-rw-r--r--Source/SPDatabaseRename.m135
-rw-r--r--Source/SPTableCopy.h74
-rw-r--r--Source/SPTableCopy.m151
-rw-r--r--Source/TableDocument.h10
-rw-r--r--Source/TableDocument.m90
-rw-r--r--UnitTests/SPDatabaseCopyTest.h36
-rw-r--r--UnitTests/SPDatabaseCopyTest.m100
-rw-r--r--UnitTests/SPDatabaseInfoTest.h23
-rw-r--r--UnitTests/SPDatabaseInfoTest.m67
-rw-r--r--UnitTests/SPDatabaseRenameTest.h35
-rw-r--r--UnitTests/SPDatabaseRenameTest.m91
-rw-r--r--UnitTests/SPTableCopyTest.h21
-rw-r--r--UnitTests/SPTableCopyTest.m45
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj84
23 files changed, 2239 insertions, 54 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
index 10d46df2..60c9dcb6 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.h
@@ -288,7 +288,8 @@ void performThreadedKeepAlive(void *ptr);
- (MCPResult *)listDBsLike:(NSString *)dbsName;
- (MCPResult *)listTables;
- (MCPResult *)listTablesLike:(NSString *)tablesName;
-- (MCPResult *)listTablesFromDB:(NSString *)dbName like:(NSString *)tablesName;
+- (NSArray *)listTablesFromDB:(NSString *)dbName;
+- (NSArray *)listTablesFromDB:(NSString *)dbName like:(NSString *)tablesName;
- (MCPResult *)listFieldsFromTable:(NSString *)tableName;
- (MCPResult *)listFieldsFromTable:(NSString *)tableName like:(NSString *)fieldsName;
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
index 27ae11ae..a8eb923a 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
@@ -33,6 +33,7 @@
#import "MCPStreamingResult.h"
#import "MCPConnectionProxy.h"
#import "MCPStringAdditions.h"
+#import "SPStringAdditions.h"
#import "RegexKitLite.h"
#include <unistd.h>
@@ -1847,26 +1848,41 @@ void performThreadedKeepAlive(void *ptr)
return theResult;
}
+- (NSArray *)listTablesFromDB:(NSString *)dbName {
+ return [self listTablesFromDB:dbName like:nil];
+}
+
/**
* List tables in DB specified by dbName and corresponding to pattern.
* This method indeed issues a !{SHOW TABLES FROM dbName LIKE ...} query to the server.
* This is done this way to make sure the selected DB is not changed by this method.
*/
-- (MCPResult *)listTablesFromDB:(NSString *)dbName like:(NSString *)tablesName
-{
+- (NSArray *)listTablesFromDB:(NSString *)dbName like:(NSString *)tablesName {
MCPResult *theResult;
-
if ((tablesName == nil) || ([tablesName isEqualToString:@""])) {
- NSString *theQuery = [NSString stringWithFormat:@"SHOW TABLES FROM %@", dbName];
+ NSString *theQuery = [NSString stringWithFormat:@"SHOW TABLES FROM %@",
+ [dbName backtickQuotedString]];
theResult = [self queryString:theQuery];
- }
- else {
- NSString *theQuery = [NSString stringWithFormat:@"SHOW TABLES FROM %@ LIKE '%@'", dbName, tablesName];
+ } else {
+ NSString *theQuery = [NSString stringWithFormat:@"SHOW TABLES FROM %@ LIKE '%@'",
+ [dbName backtickQuotedString],
+ [tablesName backtickQuotedString]];
theResult = [self queryString:theQuery];
}
[theResult setReturnDataAsStrings:YES];
-
- return theResult;
+ NSString *theTableName;
+ NSMutableArray *theDBTables = [NSMutableArray array];
+
+ // NSLog(@"num of fields: %@; num of rows: %@", [theResult numOfFields], [theResult numOfRows]);
+ if ([theResult numOfRows] > 0) {
+ int i;
+ for ( i = 0 ; i < [theResult numOfRows] ; i++ ) {
+ theTableName = [[theResult fetchRowAsArray] objectAtIndex:0];
+ [theDBTables addObject:theTableName];
+ }
+ }
+
+ return theDBTables;
}
/**
@@ -1887,11 +1903,14 @@ void performThreadedKeepAlive(void *ptr)
MCPResult *theResult;
if ((fieldsName == nil) || ([fieldsName isEqualToString:@""])) {
- NSString *theQuery = [NSString stringWithFormat:@"SHOW COLUMNS FROM %@", tableName];
+ NSString *theQuery = [NSString stringWithFormat:@"SHOW COLUMNS FROM %@",
+ [tableName backtickQuotedString]];
theResult = [self queryString:theQuery];
}
else {
- NSString *theQuery = [NSString stringWithFormat:@"SHOW COLUMNS FROM %@ LIKE '%@'", tableName, fieldsName];
+ NSString *theQuery = [NSString stringWithFormat:@"SHOW COLUMNS FROM %@ LIKE '%@'",
+ [tableName backtickQuotedString],
+ [fieldsName backtickQuotedString]];
theResult = [self queryString:theQuery];
}
[theResult setReturnDataAsStrings:YES];
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index c4b17d79..b052d40e 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -23,8 +23,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="910"/>
- <integer value="5"/>
+ <integer value="6990"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -63,7 +62,7 @@
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{780, 480}</string>
<object class="NSView" key="NSWindowView" id="579726586">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -5575,7 +5574,6 @@
</object>
</object>
<string key="NSFrameSize">{944, 550}</string>
- <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMinSize">{780, 502}</string>
@@ -5595,7 +5593,7 @@
<string key="NSWindowContentMaxSize">{292, 112}</string>
<string key="NSWindowContentMinSize">{292, 112}</string>
<object class="NSView" key="NSWindowView" id="70075497">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -5604,6 +5602,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{36, 75}, {91, 14}}</string>
<reference key="NSSuperview" ref="70075497"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="45988560">
<int key="NSCellFlags">68288064</int>
@@ -5620,6 +5619,7 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{17, 50}, {110, 14}}</string>
<reference key="NSSuperview" ref="70075497"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="410467805">
<int key="NSCellFlags">68288064</int>
@@ -5636,6 +5636,7 @@
<int key="NSvFlags">258</int>
<string key="NSFrame">{{135, 74}, {137, 18}}</string>
<reference key="NSSuperview" ref="70075497"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="212969926">
<int key="NSCellFlags">-1804468671</int>
@@ -5658,6 +5659,7 @@
<int key="NSvFlags">259</int>
<string key="NSFrame">{{207, 13}, {70, 28}}</string>
<reference key="NSSuperview" ref="70075497"/>
+ <reference key="NSWindow"/>
<int key="NSTag">1</int>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="169260261">
@@ -5685,6 +5687,7 @@
<int key="NSvFlags">259</int>
<string key="NSFrame">{{139, 13}, {70, 28}}</string>
<reference key="NSSuperview" ref="70075497"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="994559297">
<int key="NSCellFlags">67239424</int>
@@ -5706,6 +5709,7 @@
<int key="NSvFlags">258</int>
<string key="NSFrame">{{132, 45}, {143, 22}}</string>
<reference key="NSSuperview" ref="70075497"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="1000126742">
<int key="NSCellFlags">-2076049856</int>
@@ -6026,11 +6030,262 @@
</object>
</object>
<string key="NSFrameSize">{292, 112}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{292, 134}</string>
<string key="NSMaxSize">{292, 134}</string>
</object>
+ <object class="NSWindowTemplate" id="1003190366">
+ <int key="NSWindowStyleMask">1</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{343, 483}, {292, 112}}</string>
+ <int key="NSWTFlags">1886912512</int>
+ <string key="NSWindowTitle">Copy Database</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <string key="NSWindowContentMaxSize">{292, 112}</string>
+ <string key="NSWindowContentMinSize">{292, 112}</string>
+ <object class="NSView" key="NSWindowView" id="351046403">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextField" id="941161511">
+ <reference key="NSNextResponder" ref="351046403"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{36, 75}, {91, 14}}</string>
+ <reference key="NSSuperview" ref="351046403"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="292220806">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71304192</int>
+ <string key="NSContents">Database Name:</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="941161511"/>
+ <reference key="NSBackgroundColor" ref="62854682"/>
+ <reference key="NSTextColor" ref="454249633"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="791604690">
+ <reference key="NSNextResponder" ref="351046403"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{17, 50}, {110, 14}}</string>
+ <reference key="NSSuperview" ref="351046403"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="970440435">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71304192</int>
+ <string key="NSContents">Only Structure:</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="791604690"/>
+ <reference key="NSBackgroundColor" ref="62854682"/>
+ <reference key="NSTextColor" ref="454249633"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="362774263">
+ <reference key="NSNextResponder" ref="351046403"/>
+ <int key="NSvFlags">258</int>
+ <string key="NSFrame">{{135, 74}, {137, 18}}</string>
+ <reference key="NSSuperview" ref="351046403"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="322980098">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">4326400</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="362774263"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <reference key="NSBackgroundColor" ref="480189472"/>
+ <reference key="NSTextColor" ref="690893883"/>
+ </object>
+ </object>
+ <object class="NSButton" id="61396236">
+ <reference key="NSNextResponder" ref="351046403"/>
+ <int key="NSvFlags">259</int>
+ <string key="NSFrame">{{207, 13}, {70, 28}}</string>
+ <reference key="NSSuperview" ref="351046403"/>
+ <reference key="NSWindow"/>
+ <int key="NSTag">1</int>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="261586860">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">138018816</int>
+ <string key="NSContents">Copy</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="61396236"/>
+ <int key="NSTag">1</int>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="932958253"/>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="41421287">
+ <reference key="NSNextResponder" ref="351046403"/>
+ <int key="NSvFlags">259</int>
+ <string key="NSFrame">{{139, 13}, {70, 28}}</string>
+ <reference key="NSSuperview" ref="351046403"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="1011860722">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">138018816</int>
+ <string key="NSContents">Cancel</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="41421287"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="932958253"/>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="560080814">
+ <reference key="NSNextResponder" ref="351046403"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{256, 48}, {18, 18}}</string>
+ <reference key="NSSuperview" ref="351046403"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="852298622">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Check</string>
+ <reference key="NSSupport" ref="244931163"/>
+ <reference key="NSControlView" ref="560080814"/>
+ <int key="NSButtonFlags">1215582719</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSNormalImage" ref="653588312"/>
+ <reference key="NSAlternateImage" ref="386686735"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{292, 112}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1280, 778}}</string>
+ <string key="NSMinSize">{292, 134}</string>
+ <string key="NSMaxSize">{292, 134}</string>
+ </object>
+ <object class="NSWindowTemplate" id="223499819">
+ <int key="NSWindowStyleMask">1</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{343, 483}, {292, 83}}</string>
+ <int key="NSWTFlags">1886912512</int>
+ <string key="NSWindowTitle">Rename Database</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <object class="NSMutableString" key="NSViewClass">
+ <characters key="NS.bytes">View</characters>
+ </object>
+ <string key="NSWindowContentMaxSize">{292, 112}</string>
+ <string key="NSWindowContentMinSize">{292, 108}</string>
+ <object class="NSView" key="NSWindowView" id="1034135752">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextField" id="92013996">
+ <reference key="NSNextResponder" ref="1034135752"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{12, 47}, {118, 14}}</string>
+ <reference key="NSSuperview" ref="1034135752"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="315512815">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71304192</int>
+ <string key="NSContents">New Database Name:</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="92013996"/>
+ <reference key="NSBackgroundColor" ref="62854682"/>
+ <reference key="NSTextColor" ref="454249633"/>
+ </object>
+ </object>
+ <object class="NSTextField" id="888396188">
+ <reference key="NSNextResponder" ref="1034135752"/>
+ <int key="NSvFlags">258</int>
+ <string key="NSFrame">{{135, 45}, {137, 18}}</string>
+ <reference key="NSSuperview" ref="1034135752"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="1071800920">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">4326400</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="888396188"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <reference key="NSBackgroundColor" ref="480189472"/>
+ <reference key="NSTextColor" ref="690893883"/>
+ </object>
+ </object>
+ <object class="NSButton" id="39894315">
+ <reference key="NSNextResponder" ref="1034135752"/>
+ <int key="NSvFlags">259</int>
+ <string key="NSFrame">{{207, 13}, {70, 28}}</string>
+ <reference key="NSSuperview" ref="1034135752"/>
+ <int key="NSTag">1</int>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="991476255">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">138018816</int>
+ <string key="NSContents">Rename</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="39894315"/>
+ <int key="NSTag">1</int>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="932958253"/>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="681566428">
+ <reference key="NSNextResponder" ref="1034135752"/>
+ <int key="NSvFlags">259</int>
+ <string key="NSFrame">{{139, 13}, {70, 28}}</string>
+ <reference key="NSSuperview" ref="1034135752"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="103081067">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">138018816</int>
+ <string key="NSContents">Cancel</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSControlView" ref="681566428"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">1</int>
+ <reference key="NSAlternateImage" ref="932958253"/>
+ <string key="NSAlternateContents"/>
+ <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{292, 83}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
+ <string key="NSMinSize">{292, 130}</string>
+ <string key="NSMaxSize">{292, 134}</string>
+ </object>
<object class="NSWindowTemplate" id="291331305">
<int key="NSWindowStyleMask">9</int>
<int key="NSWindowBacking">2</int>
@@ -7236,8 +7491,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<bool key="NS.raise.underflow">YES</bool>
<bool key="NS.raise.dividebyzero">YES</bool>
</object>
- <string key="NS.decimal">.</string>
- <string key="NS.thousand">,</string>
+ <string key="NS.decimal">,</string>
+ <string key="NS.thousand">.</string>
<bool key="NS.hasthousands">NO</bool>
<bool key="NS.localized">YES</bool>
<bool key="NS.allowsfloats">NO</bool>
@@ -10090,7 +10345,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSExtension">NSResponder</string>
</object>
<object class="NSCustomView" id="774289419">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -10447,7 +10702,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<string key="NSFrameSize">{457, 191}</string>
- <reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
<string key="NSExtension">NSResponder</string>
</object>
@@ -12522,14 +12776,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">databaseNameField</string>
- <reference key="source" ref="427689665"/>
- <reference key="destination" ref="839031135"/>
- </object>
- <int key="connectionID">583</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">databaseSheet</string>
<reference key="source" ref="427689665"/>
<reference key="destination" ref="554105051"/>
@@ -16425,6 +16671,206 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<int key="connectionID">6936</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="362774263"/>
+ <reference key="destination" ref="427689665"/>
+ </object>
+ <int key="connectionID">6977</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">closePanelSheet:</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="41421287"/>
+ </object>
+ <int key="connectionID">6978</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">closePanelSheet:</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="61396236"/>
+ </object>
+ <int key="connectionID">6979</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">copyDatabaseButton</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="61396236"/>
+ </object>
+ <int key="connectionID">6983</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">databaseNewSheet</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="1003190366"/>
+ </object>
+ <int key="connectionID">6984</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">copyOnlyStructureButton</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="560080814"/>
+ </object>
+ <int key="connectionID">6985</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="560080814"/>
+ <reference key="destination" ref="41421287"/>
+ </object>
+ <int key="connectionID">6988</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="41421287"/>
+ <reference key="destination" ref="61396236"/>
+ </object>
+ <int key="connectionID">6989</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="681566428"/>
+ <reference key="destination" ref="39894315"/>
+ </object>
+ <int key="connectionID">7007</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">closePanelSheet:</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="681566428"/>
+ </object>
+ <int key="connectionID">7008</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">closePanelSheet:</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="39894315"/>
+ </object>
+ <int key="connectionID">7009</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="888396188"/>
+ <reference key="destination" ref="427689665"/>
+ </object>
+ <int key="connectionID">7010</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">renameDatabaseButton</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="39894315"/>
+ </object>
+ <int key="connectionID">7011</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">databaseRenameSheet</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="223499819"/>
+ </object>
+ <int key="connectionID">7012</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="362774263"/>
+ <reference key="destination" ref="560080814"/>
+ </object>
+ <int key="connectionID">7017</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="888396188"/>
+ <reference key="destination" ref="681566428"/>
+ </object>
+ <int key="connectionID">7019</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="39894315"/>
+ <reference key="destination" ref="888396188"/>
+ </object>
+ <int key="connectionID">7020</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="839031135"/>
+ <reference key="destination" ref="437431578"/>
+ </object>
+ <int key="connectionID">7021</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="437431578"/>
+ <reference key="destination" ref="681100483"/>
+ </object>
+ <int key="connectionID">7022</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="681100483"/>
+ <reference key="destination" ref="875952722"/>
+ </object>
+ <int key="connectionID">7023</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="875952722"/>
+ <reference key="destination" ref="839031135"/>
+ </object>
+ <int key="connectionID">7024</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="61396236"/>
+ <reference key="destination" ref="362774263"/>
+ </object>
+ <int key="connectionID">7026</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">databaseNameField</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="839031135"/>
+ </object>
+ <int key="connectionID">7029</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">databaseCopyNameField</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="362774263"/>
+ </object>
+ <int key="connectionID">7030</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">databaseRenameNameField</string>
+ <reference key="source" ref="427689665"/>
+ <reference key="destination" ref="888396188"/>
+ </object>
+ <int key="connectionID">7031</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -23093,6 +23539,192 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="object" ref="273153393"/>
<reference key="parent" ref="38579786"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6937</int>
+ <reference key="object" ref="1003190366"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="351046403"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Copy Database Sheet</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6938</int>
+ <reference key="object" ref="351046403"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="61396236"/>
+ <reference ref="791604690"/>
+ <reference ref="941161511"/>
+ <reference ref="362774263"/>
+ <reference ref="41421287"/>
+ <reference ref="560080814"/>
+ </object>
+ <reference key="parent" ref="1003190366"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6939</int>
+ <reference key="object" ref="61396236"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="261586860"/>
+ </object>
+ <reference key="parent" ref="351046403"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6941</int>
+ <reference key="object" ref="791604690"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="970440435"/>
+ </object>
+ <reference key="parent" ref="351046403"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6942</int>
+ <reference key="object" ref="941161511"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="292220806"/>
+ </object>
+ <reference key="parent" ref="351046403"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6943</int>
+ <reference key="object" ref="362774263"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="322980098"/>
+ </object>
+ <reference key="parent" ref="351046403"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6944</int>
+ <reference key="object" ref="41421287"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1011860722"/>
+ </object>
+ <reference key="parent" ref="351046403"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6945</int>
+ <reference key="object" ref="1011860722"/>
+ <reference key="parent" ref="41421287"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6946</int>
+ <reference key="object" ref="322980098"/>
+ <reference key="parent" ref="362774263"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6947</int>
+ <reference key="object" ref="292220806"/>
+ <reference key="parent" ref="941161511"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6948</int>
+ <reference key="object" ref="970440435"/>
+ <reference key="parent" ref="791604690"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6976</int>
+ <reference key="object" ref="261586860"/>
+ <reference key="parent" ref="61396236"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6980</int>
+ <reference key="object" ref="560080814"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="852298622"/>
+ </object>
+ <reference key="parent" ref="351046403"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6981</int>
+ <reference key="object" ref="852298622"/>
+ <reference key="parent" ref="560080814"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6990</int>
+ <reference key="object" ref="223499819"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1034135752"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Rename Database Sheet</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6991</int>
+ <reference key="object" ref="1034135752"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="39894315"/>
+ <reference ref="681566428"/>
+ <reference ref="92013996"/>
+ <reference ref="888396188"/>
+ </object>
+ <reference key="parent" ref="223499819"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6993</int>
+ <reference key="object" ref="681566428"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="103081067"/>
+ </object>
+ <reference key="parent" ref="1034135752"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6994</int>
+ <reference key="object" ref="888396188"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1071800920"/>
+ </object>
+ <reference key="parent" ref="1034135752"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6995</int>
+ <reference key="object" ref="92013996"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="315512815"/>
+ </object>
+ <reference key="parent" ref="1034135752"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6997</int>
+ <reference key="object" ref="39894315"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="991476255"/>
+ </object>
+ <reference key="parent" ref="1034135752"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6998</int>
+ <reference key="object" ref="991476255"/>
+ <reference key="parent" ref="39894315"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7000</int>
+ <reference key="object" ref="315512815"/>
+ <reference key="parent" ref="92013996"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7001</int>
+ <reference key="object" ref="1071800920"/>
+ <reference key="parent" ref="888396188"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7002</int>
+ <reference key="object" ref="103081067"/>
+ <reference key="parent" ref="681566428"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -24486,6 +25118,55 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>6933.IBPluginDependency</string>
<string>6933.ImportedFromIB2</string>
<string>6934.IBPluginDependency</string>
+ <string>6937.IBEditorWindowLastContentRect</string>
+ <string>6937.IBPluginDependency</string>
+ <string>6937.IBWindowTemplateEditedContentRect</string>
+ <string>6937.ImportedFromIB2</string>
+ <string>6937.windowTemplate.hasMaxSize</string>
+ <string>6937.windowTemplate.hasMinSize</string>
+ <string>6937.windowTemplate.maxSize</string>
+ <string>6937.windowTemplate.minSize</string>
+ <string>6938.IBPluginDependency</string>
+ <string>6938.ImportedFromIB2</string>
+ <string>6939.IBPluginDependency</string>
+ <string>6939.ImportedFromIB2</string>
+ <string>6941.IBPluginDependency</string>
+ <string>6941.ImportedFromIB2</string>
+ <string>6942.IBPluginDependency</string>
+ <string>6942.ImportedFromIB2</string>
+ <string>6943.IBPluginDependency</string>
+ <string>6943.ImportedFromIB2</string>
+ <string>6944.IBPluginDependency</string>
+ <string>6944.ImportedFromIB2</string>
+ <string>6945.IBPluginDependency</string>
+ <string>6946.IBPluginDependency</string>
+ <string>6947.IBPluginDependency</string>
+ <string>6948.IBPluginDependency</string>
+ <string>6976.IBPluginDependency</string>
+ <string>6980.IBPluginDependency</string>
+ <string>6981.IBPluginDependency</string>
+ <string>6990.IBEditorWindowLastContentRect</string>
+ <string>6990.IBPluginDependency</string>
+ <string>6990.IBWindowTemplateEditedContentRect</string>
+ <string>6990.ImportedFromIB2</string>
+ <string>6990.windowTemplate.hasMaxSize</string>
+ <string>6990.windowTemplate.hasMinSize</string>
+ <string>6990.windowTemplate.maxSize</string>
+ <string>6990.windowTemplate.minSize</string>
+ <string>6991.IBPluginDependency</string>
+ <string>6991.ImportedFromIB2</string>
+ <string>6993.IBPluginDependency</string>
+ <string>6993.ImportedFromIB2</string>
+ <string>6994.IBPluginDependency</string>
+ <string>6994.ImportedFromIB2</string>
+ <string>6995.IBPluginDependency</string>
+ <string>6995.ImportedFromIB2</string>
+ <string>6997.IBPluginDependency</string>
+ <string>6997.ImportedFromIB2</string>
+ <string>6998.IBPluginDependency</string>
+ <string>7000.IBPluginDependency</string>
+ <string>7001.IBPluginDependency</string>
+ <string>7002.IBPluginDependency</string>
<string>711.IBPluginDependency</string>
<string>711.ImportedFromIB2</string>
<string>713.IBPluginDependency</string>
@@ -25295,10 +25976,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{54, 306}, {944, 550}}</string>
+ <string>{{54, 206}, {944, 550}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO"/>
- <string>{{54, 306}, {944, 550}}</string>
+ <string>{{54, 206}, {944, 550}}</string>
<integer value="1"/>
<integer value="1"/>
<string>{{62, 352}, {845, 504}}</string>
@@ -25740,9 +26421,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{456, 425}, {292, 112}}</string>
+ <string>{{850, 373}, {292, 112}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{456, 425}, {292, 112}}</string>
+ <string>{{850, 373}, {292, 112}}</string>
<integer value="1"/>
<integer value="1"/>
<integer value="1"/>
@@ -26502,6 +27183,55 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{558, 399}, {292, 112}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{558, 399}, {292, 112}}</string>
+ <integer value="1"/>
+ <integer value="1"/>
+ <integer value="1"/>
+ <string>{292, 112}</string>
+ <string>{292, 112}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{854, 253}, {292, 83}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{854, 253}, {292, 83}}</string>
+ <integer value="1"/>
+ <integer value="1"/>
+ <integer value="1"/>
+ <string>{292, 112}</string>
+ <string>{292, 108}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -26528,7 +27258,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{193, 665}, {457, 191}}</string>
+ <string>{{193, 565}, {457, 191}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -26645,7 +27375,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">6936</int>
+ <int key="maxID">7031</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -27693,6 +28423,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>copyChecksumFromSheet:</string>
<string>copyCreateTableSyntax:</string>
<string>copyCreateTableSyntaxFromSheet:</string>
+ <string>copyDatabase:</string>
<string>export:</string>
<string>exportMultipleTables:</string>
<string>exportTable:</string>
@@ -27705,6 +28436,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>openCurrentConnectionInNewWindow:</string>
<string>optimizeTable:</string>
<string>removeDatabase:</string>
+ <string>renameDatabase:</string>
<string>repairTable:</string>
<string>saveConnectionSheet:</string>
<string>saveCreateSyntax:</string>
@@ -27773,6 +28505,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -27783,14 +28517,20 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>chooseDatabaseButton</string>
<string>connectionErrorDialog</string>
<string>contentViewSplitter</string>
+ <string>copyDatabaseButton</string>
+ <string>copyOnlyStructureButton</string>
<string>createTableSyntaxTextField</string>
<string>createTableSyntaxTextView</string>
<string>createTableSyntaxWindow</string>
<string>customQueryInstance</string>
<string>customQueryTextView</string>
+ <string>databaseCopyNameField</string>
<string>databaseDataInstance</string>
<string>databaseEncodingButton</string>
<string>databaseNameField</string>
+ <string>databaseNewSheet</string>
+ <string>databaseRenameNameField</string>
+ <string>databaseRenameSheet</string>
<string>databaseSheet</string>
<string>dbTablesTableView</string>
<string>encodingPopUp</string>
@@ -27804,6 +28544,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>inputTextWindowSecureTextField</string>
<string>listFilterField</string>
<string>queryProgressBar</string>
+ <string>renameDatabaseButton</string>
<string>saveConnectionAccessory</string>
<string>saveConnectionAutoConnect</string>
<string>saveConnectionEncrypt</string>
@@ -27846,6 +28587,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>id</string>
<string>NSWindow</string>
<string>NSSplitView</string>
+ <string>id</string>
+ <string>id</string>
<string>NSTextField</string>
<string>NSTextView</string>
<string>NSWindow</string>
@@ -27855,6 +28598,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
<string>NSTableView</string>
<string>NSPopUpButton</string>
<string>id</string>
@@ -27870,6 +28617,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
<string>NSSecureTextField</string>
<string>id</string>
<string>id</string>
@@ -27891,7 +28639,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>id</string>
<string>NSTabView</string>
<string>id</string>
- <string>id</string>
+ <string>NSWindow</string>
<string>id</string>
<string>NSButton</string>
<string>id</string>
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib
index 73ac41f5..b37bd0ad 100644
--- a/Interfaces/English.lproj/MainMenu.xib
+++ b/Interfaces/English.lproj/MainMenu.xib
@@ -1264,6 +1264,22 @@
<reference key="NSOnImage" ref="625762401"/>
<reference key="NSMixedImage" ref="315854375"/>
</object>
+ <object class="NSMenuItem" id="820553150">
+ <reference key="NSMenu" ref="172963563"/>
+ <string key="NSTitle">Duplicate Database...</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="625762401"/>
+ <reference key="NSMixedImage" ref="315854375"/>
+ </object>
+ <object class="NSMenuItem" id="97991687">
+ <reference key="NSMenu" ref="172963563"/>
+ <string key="NSTitle">Rename Database...</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="625762401"/>
+ <reference key="NSMixedImage" ref="315854375"/>
+ </object>
<object class="NSMenuItem" id="602994413">
<reference key="NSMenu" ref="172963563"/>
<string key="NSTitle">Delete Database...</string>
@@ -1273,13 +1289,12 @@
<reference key="NSOnImage" ref="625762401"/>
<reference key="NSMixedImage" ref="315854375"/>
</object>
- <object class="NSMenuItem" id="788707136">
+ <object class="NSMenuItem" id="93508151">
<reference key="NSMenu" ref="172963563"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="625762401"/>
<reference key="NSMixedImage" ref="315854375"/>
@@ -2970,6 +2985,22 @@
</object>
<int key="connectionID">1076</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copyDatabase:</string>
+ <reference key="source" ref="63651044"/>
+ <reference key="destination" ref="820553150"/>
+ </object>
+ <int key="connectionID">1080</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">renameDatabase:</string>
+ <reference key="source" ref="63651044"/>
+ <reference key="destination" ref="97991687"/>
+ </object>
+ <int key="connectionID">1083</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -3408,7 +3439,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="653250987"/>
<reference ref="602994413"/>
- <reference ref="788707136"/>
<reference ref="265095049"/>
<reference ref="14535230"/>
<reference ref="197143231"/>
@@ -3418,6 +3448,9 @@
<reference ref="6656160"/>
<reference ref="806896137"/>
<reference ref="7204100"/>
+ <reference ref="93508151"/>
+ <reference ref="820553150"/>
+ <reference ref="97991687"/>
</object>
<reference key="parent" ref="693420496"/>
</object>
@@ -3432,11 +3465,6 @@
<reference key="parent" ref="172963563"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">632</int>
- <reference key="object" ref="788707136"/>
- <reference key="parent" ref="172963563"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">633</int>
<reference key="object" ref="265095049"/>
<reference key="parent" ref="172963563"/>
@@ -4383,6 +4411,21 @@
<reference key="object" ref="853409386"/>
<reference key="parent" ref="709725194"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1077</int>
+ <reference key="object" ref="820553150"/>
+ <reference key="parent" ref="172963563"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1079</int>
+ <reference key="object" ref="93508151"/>
+ <reference key="parent" ref="172963563"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1081</int>
+ <reference key="object" ref="97991687"/>
+ <reference key="parent" ref="172963563"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -4417,6 +4460,11 @@
<string>106.editorWindowContentRectSynchronizationRect</string>
<string>1061.IBPluginDependency</string>
<string>1071.IBPluginDependency</string>
+ <string>1077.IBPluginDependency</string>
+ <string>1077.ImportedFromIB2</string>
+ <string>1079.IBPluginDependency</string>
+ <string>1081.IBPluginDependency</string>
+ <string>1081.ImportedFromIB2</string>
<string>111.IBPluginDependency</string>
<string>111.ImportedFromIB2</string>
<string>129.IBPluginDependency</string>
@@ -4583,8 +4631,6 @@
<string>629.ImportedFromIB2</string>
<string>631.IBPluginDependency</string>
<string>631.ImportedFromIB2</string>
- <string>632.IBPluginDependency</string>
- <string>632.ImportedFromIB2</string>
<string>633.IBPluginDependency</string>
<string>633.ImportedFromIB2</string>
<string>634.IBPluginDependency</string>
@@ -4789,6 +4835,11 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
@@ -4865,7 +4916,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{449, 1007}, {197, 53}}</string>
- <string>{{230, 474}, {511, 20}}</string>
+ <string>{{318, 1027}, {511, 20}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{506, 836}, {511, 20}}</string>
@@ -4944,7 +4995,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{472, 271}, {255, 203}}</string>
+ <string>{{560, 784}, {255, 243}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{312, 683}, {231, 153}}</string>
@@ -4956,9 +5007,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>{{849, 130}, {276, 423}}</string>
+ <string>{{815, 44}, {276, 423}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{556, 185}, {279, 383}}</string>
@@ -5191,7 +5240,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">1076</int>
+ <int key="maxID">1083</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -5890,6 +5939,7 @@
<string>copyChecksumFromSheet:</string>
<string>copyCreateTableSyntax:</string>
<string>copyCreateTableSyntaxFromSheet:</string>
+ <string>copyDatabase:</string>
<string>export:</string>
<string>exportMultipleTables:</string>
<string>exportTable:</string>
@@ -5970,6 +6020,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -5980,6 +6031,8 @@
<string>chooseDatabaseButton</string>
<string>connectionErrorDialog</string>
<string>contentViewSplitter</string>
+ <string>copyDatabaseButton</string>
+ <string>copyOnlyStructureButton</string>
<string>createTableSyntaxTextField</string>
<string>createTableSyntaxTextView</string>
<string>createTableSyntaxWindow</string>
@@ -5988,6 +6041,7 @@
<string>databaseDataInstance</string>
<string>databaseEncodingButton</string>
<string>databaseNameField</string>
+ <string>databaseNewSheet</string>
<string>databaseSheet</string>
<string>dbTablesTableView</string>
<string>encodingPopUp</string>
@@ -6043,6 +6097,8 @@
<string>id</string>
<string>NSWindow</string>
<string>NSSplitView</string>
+ <string>id</string>
+ <string>id</string>
<string>NSTextField</string>
<string>NSTextView</string>
<string>NSWindow</string>
@@ -6052,6 +6108,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
<string>NSTableView</string>
<string>NSPopUpButton</string>
<string>id</string>
diff --git a/Source/SPDatabaseCopy.h b/Source/SPDatabaseCopy.h
new file mode 100644
index 00000000..f0e2e03a
--- /dev/null
+++ b/Source/SPDatabaseCopy.h
@@ -0,0 +1,80 @@
+//
+// $Id: $
+//
+// SPDatabaseCopy.h
+// sequel-pro
+//
+// Created by David Rekowski on Apr 13, 2010
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+
+#import <Foundation/Foundation.h>
+#import <MCPKit/MCPConnection.h>
+#import "SPDatabaseInfo.h"
+
+/**
+ * The SPDatabaseCopy class povides functionality to create a copy of a database.
+ */
+@interface SPDatabaseCopy : NSObject {
+ MCPConnection *connection;
+ SPDatabaseInfo *dbInfo;
+ NSObject *parent;
+}
+
+/**
+ * @property MCPConnection references the MCPKit connection to MySQL; it has to be set.
+ */
+@property (retain) MCPConnection *connection;
+
+/**
+ * @property SPDatabaseInfo an instance of the database info class
+ */
+@property (retain) SPDatabaseInfo *dbInfo;
+
+/**
+ * @property the parent object that issues the action, needs to provide stuff like tableWindow for messages
+ */
+@property (retain) NSObject *parent;
+
+
+/**
+ * This method retrieves the dbInfo object if it exists; otherwise it is generated and the
+ * connection is passed to it.
+ *
+ * @result SPDatabaseInfo dbInfo object
+ */
+- (SPDatabaseInfo *)getDBInfoObject;
+
+/**
+ * This method clones an existing database.
+ *
+ * @param NSString sourceDatabaseName the name of the source database
+ * @param NSString targetDatabaseName the name of the target database
+ * @result BOOL success
+ */
+- (BOOL)copyDatabaseFrom: (NSString *)sourceDatabaseName to: (NSString *)targetDatabaseName withContent: (BOOL)copyWithContent;
+
+/**
+ * This method creates a new database.
+ *
+ * @param NSString newDatabaseName name of the new database to be created
+ * @return BOOL YES on success, otherwise NO
+ */
+- (BOOL) createDatabase: (NSString *)newDatabaseName;
+
+@end
diff --git a/Source/SPDatabaseCopy.m b/Source/SPDatabaseCopy.m
new file mode 100644
index 00000000..98c97587
--- /dev/null
+++ b/Source/SPDatabaseCopy.m
@@ -0,0 +1,113 @@
+//
+// $Id: $
+//
+// SPDatabaseCopy.m
+// sequel-pro
+//
+// Created by David Rekowski on Apr 13, 2010
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#import <MCPKit/MCPConnection.h>
+#import <MCPKit/MCPResult.h>
+#import "SPAlertSheets.h"
+#import "SPStringAdditions.h"
+#import "SPDatabaseCopy.h"
+#import "SPTableCopy.h"
+#import "SPDatabaseInfo.h"
+#import "Sequel-Pro.pch"
+
+@implementation SPDatabaseCopy
+
+@synthesize connection;
+@synthesize dbInfo;
+@synthesize parent;
+
+- (SPDatabaseInfo *)getDBInfoObject {
+ if (dbInfo != nil) {
+ return dbInfo;
+ } else {
+ dbInfo = [[SPDatabaseInfo alloc] init];
+ [dbInfo setConnection:[self connection]];
+ [dbInfo setParent:[self parent]];
+ }
+ return dbInfo;
+}
+
+- (NSObject *)getTableWindow {
+ return [NSApp mainWindow];
+}
+
+- (BOOL)copyDatabaseFrom: (NSString *)sourceDatabaseName to: (NSString *)targetDatabaseName withContent:(BOOL)copyWithContent {
+
+ SPDatabaseInfo *databaseInfo = [self getDBInfoObject];
+ // check, whether the source database exists and the target database doesn't.
+ NSArray *tables = [NSArray array];
+ BOOL sourceExists = [databaseInfo databaseExists:sourceDatabaseName];
+ BOOL targetExists = [databaseInfo databaseExists:targetDatabaseName];
+ if (sourceExists && !targetExists) {
+ // retrieve the list of tables/views/funcs/triggers from the source database
+
+ tables = [connection listTablesFromDB:sourceDatabaseName];
+ } else {
+ SPBeginAlertSheet(NSLocalizedString(@"Cannot create existing database", @"create database exists error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to create the target database.\n\nDatabase %@ already exists.",
+ @"create database error informative message"),
+ targetDatabaseName]);
+
+ return NO;
+ }
+ DLog(@"list of found tables of source db: %@", tables);
+
+ [self createDatabase:targetDatabaseName];
+ SPTableCopy *dbActionTableCopy = [[SPTableCopy alloc] init];
+ [dbActionTableCopy setConnection:connection];
+
+ for (NSString *currentTable in tables) {
+ if ([dbActionTableCopy copyTable:currentTable
+ from:sourceDatabaseName
+ to:targetDatabaseName
+ withContent:copyWithContent]) {
+ }
+ }
+}
+
+- (BOOL) createDatabase: (NSString *)newDatabaseName {
+ NSString *createStatement = [NSString stringWithFormat:@"CREATE DATABASE %@",
+ [newDatabaseName backtickQuotedString]];
+ [connection queryString:createStatement];
+
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to create database", @"create database error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to create the target database.\n\nMySQL said: %@",
+ @"create database error informative message"),
+ [connection getLastErrorMessage]]);
+ return NO;
+ }
+ return YES;
+
+
+}
+
+- (void)dealloc {
+ [dbInfo dealloc];
+}
+
+
+@end \ No newline at end of file
diff --git a/Source/SPDatabaseInfo.h b/Source/SPDatabaseInfo.h
new file mode 100644
index 00000000..e71863eb
--- /dev/null
+++ b/Source/SPDatabaseInfo.h
@@ -0,0 +1,54 @@
+//
+// SPDatabaseInfo.h
+// sequel-pro
+//
+// Created by David Rekowski on 19.04.10.
+// Copyright 2010 Papaya Software GmbH. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "MCPConnection.h"
+#import "MCPResult.h"
+
+/*
+ * The SPDatabaseInfo class provides means of retrieving a list of database names
+ */
+@interface SPDatabaseInfo : NSObject {
+ MCPConnection *connection;
+ NSObject *parent;
+}
+
+/**
+ * @property MCPConnection references the MCPKit connection to MySQL; it has to be set.
+ */
+@property (retain) MCPConnection *connection;
+
+/**
+ * @property the parent object that issues the action, needs to provide stuff like tableWindow for messages
+ */
+@property (retain) NSObject *parent;
+
+/**
+ * This method checks, whether a database exists.
+ *
+ * @param databaseName the name of the database to check
+ * @result TRUE if it exists, otherwise FALSE
+ */
+-(BOOL)databaseExists:(NSString *)databaseName;
+
+/**
+ * This method retrieves a list of all databases.
+ *
+ * @result NSArray databaseNames
+ */
+- (NSArray *)listDBs;
+
+/**
+ * This method retrieves a list of databases like the given string
+ *
+ * @param NSString dbsName name of the database substring to match
+ * @result NSArray databaseNames
+ */
+- (NSArray *)listDBsLike:(NSString *)dbsName;
+
+@end
diff --git a/Source/SPDatabaseInfo.m b/Source/SPDatabaseInfo.m
new file mode 100644
index 00000000..b2c2469d
--- /dev/null
+++ b/Source/SPDatabaseInfo.m
@@ -0,0 +1,66 @@
+//
+// SPDatabaseInfo.m
+// sequel-pro
+//
+// Created by David Rekowski on 19.04.10.
+// Copyright 2010 Papaya Software GmbH. All rights reserved.
+//
+
+#import "SPAlertSheets.h"
+#import "SPDatabaseInfo.h"
+#import "SPStringAdditions.h"
+#import "Sequel-Pro.pch"
+
+@implementation SPDatabaseInfo
+
+@synthesize connection;
+@synthesize parent;
+
+- (NSObject *)getTableWindow {
+ return [NSApp mainWindow];
+}
+
+-(BOOL)databaseExists:(NSString *)databaseName {
+ NSArray *names = [self listDBs];
+ return [names containsObject:databaseName];
+}
+
+- (NSArray *)listDBs {
+ return [self listDBsLike:nil];
+}
+
+- (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]];
+ }
+ DLog(@"running query : %@", listDBStatement);
+ MCPResult *theResult = [connection queryString:listDBStatement];
+
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to retrieve databases list", @"database list error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to retrieve a list of databases.\n\nMySQL said: %@",
+ @"database list error informative message"),
+ [connection getLastErrorMessage]]);
+ return NO;
+ }
+
+ NSMutableArray *names = [NSMutableArray array];
+ NSMutableString *name;
+ if ([theResult numOfRows] > 1) {
+ int i;
+ for ( i = 0 ; i < [theResult numOfRows] ; i++ ) {
+ name = [[theResult fetchRowAsArray] objectAtIndex:0];
+ [names addObject:name];
+ }
+ }
+
+ return names;
+}
+
+@end
diff --git a/Source/SPDatabaseRename.h b/Source/SPDatabaseRename.h
new file mode 100644
index 00000000..66ed2d7b
--- /dev/null
+++ b/Source/SPDatabaseRename.h
@@ -0,0 +1,89 @@
+//
+// $Id: $
+//
+// SPDatabaseRename.h
+// sequel-pro
+//
+// Created by David Rekowski on Apr 13, 2010
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+
+#import <Foundation/Foundation.h>
+#import <MCPKit/MCPConnection.h>
+#import "SPDatabaseInfo.h"
+#import "SPStringAdditions.h"
+
+/**
+ * The SPDatabaseRename class povides functionality to rename a database.
+ */
+@interface SPDatabaseRename : NSObject {
+ MCPConnection *connection;
+ SPDatabaseInfo *dbInfo;
+ NSObject *parent;
+}
+
+/**
+ * @property MCPConnection references the MCPKit connection to MySQL; it has to be set.
+ */
+@property (retain) MCPConnection *connection;
+
+/**
+ * @property SPDatabaseInfo an instance of the database info class
+ */
+@property (retain) SPDatabaseInfo *dbInfo;
+
+/**
+ * @property the parent object that issues the action, needs to provide stuff like tableWindow for messages
+ */
+@property (retain) NSObject *parent;
+
+
+/**
+ * This method retrieves the dbInfo object if it exists; otherwise it is generated and the
+ * connection is passed to it.
+ *
+ * @result SPDatabaseInfo dbInfo object
+ */
+- (SPDatabaseInfo *)getDBInfoObject;
+
+/**
+ * This method renames an existing database.
+ *
+ * @param NSString sourceDatabaseName the name of the source database
+ * @param NSString targetDatabaseName the name of the target database
+ * @result BOOL success
+ */
+- (BOOL)renameDatabaseFrom: (NSString *)sourceDatabaseName to: (NSString *)targetDatabaseName;
+
+/**
+ * This method creates a new database.
+ *
+ * @param NSString newDatabaseName name of the new database to be created
+ * @return BOOL YES on success, otherwise NO
+ */
+- (BOOL) createDatabase: (NSString *)newDatabaseName;
+
+/**
+ * This method drops a database.
+ *
+ * @param NSString databaseName name of the database to drop
+ * @return BOOL YES on success, otherwise NO
+ */
+- (BOOL) dropDatabase: (NSString *)databaseName;
+
+@end
diff --git a/Source/SPDatabaseRename.m b/Source/SPDatabaseRename.m
new file mode 100644
index 00000000..c4b2e52c
--- /dev/null
+++ b/Source/SPDatabaseRename.m
@@ -0,0 +1,135 @@
+//
+// $Id: $
+//
+// SPDatabaseRename.m
+// sequel-pro
+//
+// Created by David Rekowski on Apr 13, 2010
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+
+#import <MCPKit/MCPConnection.h>
+#import <MCPKit/MCPResult.h>
+#import "SPAlertSheets.h"
+#import "SPStringAdditions.h"
+#import "SPDatabaseRename.h"
+#import "SPDatabaseInfo.h"
+#import "SPTableCopy.h"
+#import "Sequel-Pro.pch"
+
+@implementation SPDatabaseRename
+
+@synthesize connection;
+@synthesize dbInfo;
+@synthesize parent;
+
+- (SPDatabaseInfo *)getDBInfoObject {
+ if (dbInfo != nil) {
+ return dbInfo;
+ } else {
+ dbInfo = [[SPDatabaseInfo alloc] init];
+ [dbInfo setConnection:[self connection]];
+ [dbInfo setParent:[self parent]];
+ }
+ return dbInfo;
+}
+
+- (NSObject *)getTableWindow {
+ return [NSApp mainWindow];
+}
+
+- (BOOL)renameDatabaseFrom: (NSString *)sourceDatabaseName to: (NSString *)targetDatabaseName {
+ SPDatabaseInfo *databaseInfo = [self getDBInfoObject];
+
+ // check, whether the source database exists and the target database doesn't.
+ NSArray *tables = [NSArray array];
+ BOOL sourceExists = [databaseInfo databaseExists:sourceDatabaseName];
+ BOOL targetExists = [databaseInfo databaseExists:targetDatabaseName];
+ if (sourceExists && !targetExists) {
+ // retrieve the list of tables/views/funcs/triggers from the source database
+
+ tables = [connection listTablesFromDB:sourceDatabaseName];
+ } else {
+ SPBeginAlertSheet(NSLocalizedString(@"Cannot create existing database", @"create database exists error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to create the target database.\n\nDatabase %@ already exists.",
+ @"create database error informative message"),
+ targetDatabaseName]);
+ return NO;
+ }
+ DLog(@"list of found tables of source db: %@", tables);
+
+ [self createDatabase:targetDatabaseName];
+ SPTableCopy *dbActionTableCopy = [[SPTableCopy alloc] init];
+ [dbActionTableCopy setConnection:connection];
+
+ for (NSString *currentTable in tables) {
+ if ([dbActionTableCopy moveTable:currentTable
+ from:sourceDatabaseName
+ to:targetDatabaseName]) {
+ }
+ }
+ tables = [connection listTablesFromDB:sourceDatabaseName];
+ if ([tables count] == 0) {
+ [self dropDatabase:sourceDatabaseName];
+ } else {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to delete database", @"delete database error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"Database %@ not empty, skipping drop database.",
+ @"delete database not empty error informative message"),
+ sourceDatabaseName]);
+ }
+}
+
+- (BOOL) createDatabase: (NSString *)newDatabaseName {
+ NSString *createStatement = [NSString stringWithFormat:@"CREATE DATABASE %@",
+ [newDatabaseName backtickQuotedString]];
+ [connection queryString:createStatement];
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to create database", @"create database error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to create a database.\n\nMySQL said: %@",
+ @"create database error informative message"),
+ [connection getLastErrorMessage]]);
+ return NO;
+ }
+ return YES;
+
+}
+
+- (BOOL) dropDatabase: (NSString *)databaseName {
+ NSString *dropStatement = [NSString stringWithFormat:@"DROP DATABASE %@",
+ [databaseName backtickQuotedString]];
+ [connection queryString:dropStatement];
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to drop database", @"drop database error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to drop a database.\n\nMySQL said: %@",
+ @"drop database error informative message"),
+ [connection getLastErrorMessage]]);
+ return NO;
+ }
+ return YES;
+
+}
+
+- (void)dealloc {
+ [dbInfo dealloc];
+}
+
+@end \ No newline at end of file
diff --git a/Source/SPTableCopy.h b/Source/SPTableCopy.h
new file mode 100644
index 00000000..23cf9dc1
--- /dev/null
+++ b/Source/SPTableCopy.h
@@ -0,0 +1,74 @@
+//
+// $Id: $
+//
+// SPTableCopy.h
+// sequel-pro
+//
+// Created by David Rekowski on Apr 13, 2010
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#import <Foundation/Foundation.h>
+#import <MCPKit/MCPConnection.h>
+
+/**
+ * The SPTableCopy class povides functionality to copy tables between databases.
+ */
+@interface SPTableCopy : NSObject {
+ MCPConnection *connection;
+ NSObject *parent;
+}
+
+/**
+ * @property MCPConnection references the MCPKit connection to MySQL; it has to be set.
+ */
+@property (retain) MCPConnection *connection;
+
+/**
+ * @property the parent object that issues the action, needs to provide stuff like tableWindow for messages
+ */
+@property (retain) NSObject *parent;
+
+/**
+ * This method copies a table structure from one db to another.
+ *
+ * @param name name of the table in the source database
+ * @param sourceDB name of the source database
+ * @param targetDB name of the target database
+ */
+- (BOOL)copyTable:(NSString *)name from: (NSString *)sourceDB to: (NSString *)targetDB;
+
+/**
+ * This method moves a table from one db to another.
+ *
+ * @param name name of the table in the source database
+ * @param sourceDB name of the source database
+ * @param targetDB name of the target database
+ */
+- (BOOL)moveTable:(NSString *)name from: (NSString *)sourceDB to: (NSString *)targetDB;
+
+/**
+ * This method copies a table including its data from one db to another.
+ *
+ * @param name name of the table in the source database
+ * @param sourceDB name of the source database
+ * @param targetDB name of the target database
+ * @param copyWithContent whether to copy the content too, otherwise only structure
+ */
+- (BOOL)copyTable:(NSString *)tableName from: (NSString *)sourceDB to: (NSString *)targetDB withContent:(BOOL)copyWithContent;
+
+@end
diff --git a/Source/SPTableCopy.m b/Source/SPTableCopy.m
new file mode 100644
index 00000000..2e8c2461
--- /dev/null
+++ b/Source/SPTableCopy.m
@@ -0,0 +1,151 @@
+//
+// $Id: $
+//
+// SPTableCopy.m
+// sequel-pro
+//
+// Created by David Rekowski on Apr 13, 2010
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#import <MCPKit/MCPConnection.h>
+#import "SPAlertSheets.h"
+#import "SPStringAdditions.h"
+#import "SPTableCopy.h"
+#import "Sequel-Pro.pch"
+
+@implementation SPTableCopy
+
+@synthesize connection;
+@synthesize parent;
+
+- (NSObject *)getTableWindow {
+ return [NSApp mainWindow];
+}
+
+- (NSString *)getCreateTableStatementFor: (NSString *)tableName inDB: (NSString *)sourceDB {
+ NSString *showCreateTableStatment = [NSString stringWithFormat:@"SHOW CREATE TABLE %@.%@",
+ [sourceDB backtickQuotedString],
+ [tableName backtickQuotedString]
+ ];
+ NSLog(showCreateTableStatment);
+ MCPResult *theResult = [connection queryString:showCreateTableStatment];
+
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to show create table statement", @"show create table error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to retrieve the create table statement for a table.\n\nMySQL said: %@",
+ @"show create table error informative message"),
+ [connection getLastErrorMessage]]);
+ }
+ NSLog(@"%i", [theResult numOfRows]);
+ if ([theResult numOfRows] != 0) {
+ NSString *createTableStatment = [[theResult fetchRowAsArray] objectAtIndex:1];
+ return createTableStatment;
+ }
+}
+
+- (BOOL)copyTable:(NSString *)tableName from: (NSString *)sourceDB to: (NSString *)targetDB {
+
+ NSMutableString *createTableStatement = [[NSMutableString alloc] initWithString:[self getCreateTableStatementFor:tableName inDB:sourceDB]];
+
+ // adding the target DB name and the separator dot after "CREATE TABLE ".
+ [createTableStatement insertString:@"." atIndex:13];
+ [createTableStatement insertString:[targetDB backtickQuotedString] atIndex:13];
+ /*
+ // this only works with MySQL >= 4.1
+ NSString *copyStatement = [NSString stringWithFormat:@"CREATE TABLE %@.%@ LIKE %@.%@",
+ [targetDB backtickQuotedString],
+ [tableName backtickQuotedString],
+ [sourceDB backtickQuotedString],
+ [tableName backtickQuotedString]
+ ];
+ DLog(@"Copying table %@ from %@ to %@", tableName, sourceDB, targetDB);
+ DLog(@"Copying table: %@", copyStatement);
+ [connection queryString:copyStatement];
+ */
+
+ [connection queryString:createTableStatement];
+ [createTableStatement release];
+
+
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to copy table", @"copy table error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to copy a table.\n\nMySQL said: %@",
+ @"copy table error informative message"),
+ [connection getLastErrorMessage]]);
+ return NO;
+ }
+ return YES;
+}
+
+- (BOOL)copyTable:(NSString *)tableName from: (NSString *)sourceDB to: (NSString *)targetDB withContent:(BOOL)copyWithContent{
+ // copy the table structure
+ BOOL structureCopyResult = [self copyTable:tableName from:sourceDB to:targetDB];
+
+ // optionally copy the table data using an insert select
+ if (copyWithContent == YES) {
+ NSString *copyDataStatement = [NSString stringWithFormat:@"INSERT INTO %@.%@ SELECT * FROM %@.%@",
+ [targetDB backtickQuotedString],
+ [tableName backtickQuotedString],
+ [sourceDB backtickQuotedString],
+ [tableName backtickQuotedString]
+ ];
+ DLog(@"Copying table data: %@", copyDataStatement);
+ [connection queryString:copyDataStatement];
+
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to copy table data", @"copy table data error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to copy a table's data.\n\nMySQL said: %@",
+ @"copy table data error informative message"),
+ [connection getLastErrorMessage]]);
+ return NO;
+ }
+ return YES;
+
+ }
+ return structureCopyResult;
+}
+
+- (BOOL)moveTable:(NSString *)tableName from: (NSString *)sourceDB to: (NSString *)targetDB {
+
+ NSString *moveStatement = [NSString stringWithFormat:@"RENAME TABLE %@.%@ TO %@.%@",
+ [sourceDB backtickQuotedString],
+ [tableName backtickQuotedString],
+ [targetDB backtickQuotedString],
+ [tableName backtickQuotedString]
+ ];
+ // moving the table
+ DLog(@"Moving table %@ from %@ to %@", tableName, sourceDB, targetDB);
+ DLog(@"Moving table: %@", moveStatement);
+ [connection queryString:moveStatement];
+
+ if ([connection queryErrored]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Failed to move table", @"move table error message"),
+ NSLocalizedString(@"OK", @"OK button"), nil, nil, [self getTableWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occured while trying to move a table.\n\nMySQL said: %@",
+ @"move table error informative message"),
+ [connection getLastErrorMessage]]);
+ return NO;
+ }
+ return YES;
+}
+
+
+@end
diff --git a/Source/TableDocument.h b/Source/TableDocument.h
index 530fa1b4..8eb6cb4b 100644
--- a/Source/TableDocument.h
+++ b/Source/TableDocument.h
@@ -65,6 +65,8 @@
IBOutlet id titleStringView;
IBOutlet id databaseSheet;
+ IBOutlet id databaseNewSheet;
+ IBOutlet id databaseRenameSheet;
IBOutlet id queryProgressBar;
IBOutlet NSBox *taskProgressLayer;
@@ -75,8 +77,13 @@
IBOutlet id favoritesButton;
IBOutlet id databaseNameField;
+ IBOutlet id databaseCopyNameField;
+ IBOutlet id databaseRenameNameField;
IBOutlet id databaseEncodingButton;
+ IBOutlet id copyOnlyStructureButton;
IBOutlet id addDatabaseButton;
+ IBOutlet id copyDatabaseButton;
+ IBOutlet id renameDatabaseButton;
IBOutlet id chooseDatabaseButton;
IBOutlet id historyControl;
IBOutlet NSTabView *tableTabView;
@@ -174,6 +181,7 @@
- (void)initWithConnectionFile:(NSString *)path;
// Connection callback and methods
- (void)setConnection:(MCPConnection *)theConnection;
+- (MCPConnection *) getConnection;
- (void)setShouldAutomaticallyConnect:(BOOL)shouldAutomaticallyConnect;
- (BOOL)shouldAutomaticallyConnect;
- (void)setKeychainID:(NSString *)theID;
@@ -184,6 +192,8 @@
- (void)selectDatabase:(NSString *)aDatabase item:(NSString *)anItem;
- (IBAction)addDatabase:(id)sender;
- (IBAction)removeDatabase:(id)sender;
+- (IBAction)copyDatabase:(id)sender;
+- (IBAction)renameDatabase:(id)sender;
- (IBAction)showMySQLHelp:(id)sender;
- (IBAction)showServerVariables:(id)sender;
- (IBAction)showServerProcesses:(id)sender;
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 3cda7ad1..6e0cac4c 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -57,10 +57,15 @@
#import "SPConstants.h"
#import "SPMainThreadTrampoline.h"
#import "SPLogger.h"
+#import "SPDatabaseCopy.h"
+#import "SPTableCopy.h"
+#import "SPDatabaseRename.h"
@interface TableDocument (PrivateAPI)
- (void)_addDatabase;
+- (void)_copyDatabase;
+- (void)_renameDatabase;
- (void)_removeDatabase;
- (void)_selectDatabaseAndItem:(NSDictionary *)selectionDetails;
@@ -755,6 +760,11 @@
}
}
+- (MCPConnection *) getConnection {
+ return mySQLConnection;
+}
+
+
/**
* Set whether the connection controller should automatically start
* connecting; called by maincontroller, but only for first window.
@@ -911,9 +921,9 @@
- (IBAction)addDatabase:(id)sender
{
if (![tablesListInstance selectionShouldChangeInTableView:nil]) return;
-
+
[databaseNameField setStringValue:@""];
-
+
[NSApp beginSheet:databaseSheet
modalForWindow:tableWindow
modalDelegate:self
@@ -921,6 +931,39 @@
contextInfo:@"addDatabase"];
}
+
+/**
+ * opens the copy database sheet and copies the databsae
+ */
+- (IBAction)copyDatabase:(id)sender
+{
+ if (![tablesListInstance selectionShouldChangeInTableView:nil]) return;
+
+ [databaseCopyNameField setStringValue:@""];
+
+ [NSApp beginSheet:databaseNewSheet
+ modalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo:@"copyDatabase"];
+}
+
+/**
+ * opens the rename database sheet and renames the databsae
+ */
+- (IBAction)renameDatabase:(id)sender
+{
+ if (![tablesListInstance selectionShouldChangeInTableView:nil]) return;
+
+ [databaseRenameNameField setStringValue:@""];
+
+ [NSApp beginSheet:databaseRenameSheet
+ modalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
+ contextInfo:@"renameDatabase"];
+}
+
/**
* opens sheet to ask user if he really wants to delete the db
*/
@@ -1035,6 +1078,12 @@
else
[chooseDatabaseButton selectItemAtIndex:0];
}
+ }
+ else if ([contextInfo isEqualToString:@"copyDatabase"]) {
+ [self _copyDatabase];
+ }
+ else if ([contextInfo isEqualToString:@"renameDatabase"]) {
+ [self _renameDatabase];
}
// Close error status sheet for OPTIMIZE, CHECK, REPAIR etc.
else if ([contextInfo isEqualToString:@"statusError"]) {
@@ -4086,6 +4135,43 @@
@implementation TableDocument (PrivateAPI)
+- (void)_copyDatabase {
+ if ([[databaseCopyNameField stringValue] isEqualToString:@""]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil, NSLocalizedString(@"Database must have a name.", @"message of panel when no db name is given"));
+ return;
+ }
+ SPDatabaseCopy *dbActionCopy = [[SPDatabaseCopy alloc] init];
+ [dbActionCopy setConnection: [self getConnection]];
+ [dbActionCopy setParent: self];
+
+ BOOL copyWithContent = [copyOnlyStructureButton state] == NSOffState;
+
+ [dbActionCopy copyDatabaseFrom: [self database]
+ to: [databaseCopyNameField stringValue]
+ withContent: copyWithContent];
+ [dbActionCopy release];
+ [selectedDatabase release];
+ selectedDatabase = [[NSString alloc] initWithString:[databaseCopyNameField stringValue]];
+ [self setDatabases: self];
+}
+
+- (void)_renameDatabase {
+ if ([[databaseRenameNameField stringValue] isEqualToString:@""]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil, NSLocalizedString(@"Database must have a name.", @"message of panel when no db name is given"));
+ return;
+ }
+ SPDatabaseRename *dbActionRename = [[SPDatabaseRename alloc] init];
+ [dbActionRename setConnection: [self getConnection]];
+ [dbActionRename setParent: self];
+
+ [dbActionRename renameDatabaseFrom: [self database]
+ to: [databaseRenameNameField stringValue]];
+ [dbActionRename release];
+ [selectedDatabase release];
+ selectedDatabase = [[NSString alloc] initWithString:[databaseRenameNameField stringValue]];
+ [self setDatabases: self];
+}
+
/**
* Adds a new database.
*/
diff --git a/UnitTests/SPDatabaseCopyTest.h b/UnitTests/SPDatabaseCopyTest.h
new file mode 100644
index 00000000..31885c05
--- /dev/null
+++ b/UnitTests/SPDatabaseCopyTest.h
@@ -0,0 +1,36 @@
+//
+// $Id: $
+//
+// DatabaseCopyTest.h
+// sequel-pro
+//
+// Created by David Rekowski
+// Copyright (c) 2010 David Rekowski. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#define USE_APPLICATION_UNIT_TEST 1
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface SPDatabaseCopyTest : SenTestCase {
+}
+- (void) testCopyDatabase;
+- (void) testCopyDatabaseTables;
+- (void) testCreateDatabase;
+
+@end
diff --git a/UnitTests/SPDatabaseCopyTest.m b/UnitTests/SPDatabaseCopyTest.m
new file mode 100644
index 00000000..bb90d35d
--- /dev/null
+++ b/UnitTests/SPDatabaseCopyTest.m
@@ -0,0 +1,100 @@
+//
+// $Id: $
+//
+// DatabaseCopyTest.m
+// sequel-pro
+//
+// Created by David Rekowski
+// Copyright (c) 2010 David Rekowski. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#import <OCMock/OCMock.h>
+#import "SPAlertSheets.h"
+#import "SPDatabaseCopyTest.h"
+#import "SPDatabaseCopy.h"
+#import "SPTableCopy.h"
+#import "MCPConnection.h"
+#import "SPDatabaseInfo.h"
+#import "SPStringAdditions.h"
+#import "SPLogger.h"
+
+@implementation SPDatabaseCopyTest
+
+- (SPDatabaseCopy *) getDatabaseCopyFixture {
+ SPDatabaseCopy *dbCopy = [[SPDatabaseCopy alloc] init];
+ return [dbCopy autorelease];
+}
+
+- (SPTableCopy *) getTableCopyFixture {
+ SPTableCopy *tableCopy = [[SPTableCopy alloc] init];
+ return [tableCopy autorelease];
+}
+
+- (id) getMockConnection {
+ id mockConnection = [OCMockObject niceMockForClass:[MCPConnection class]];
+ return mockConnection;
+}
+
+- (id) getMockDBInfo {
+ id mockDBInfo = [OCMockObject niceMockForClass:[SPDatabaseInfo class]];
+ return mockDBInfo;
+}
+
+- (void) testCopyDatabase {
+
+ SPDatabaseCopy *dbCopy = [self getDatabaseCopyFixture];
+ id mockConnection = [self getMockConnection];
+ [[mockConnection expect] queryString:@"CREATE DATABASE `target_name`"];
+ [[mockConnection expect] listTablesFromDB:@"source_name"];
+ [[[mockConnection stub] andReturn:[[NSArray alloc] init]] listTablesFromDB:@"source_name"];
+ [dbCopy setConnection:mockConnection];
+
+ id mockDBInfo = [self getMockDBInfo];
+
+ BOOL varNo = NO;
+ BOOL varYes = YES;
+ [[[mockDBInfo expect] andReturnValue:[NSValue value:&varYes withObjCType:@encode(BOOL)]] databaseExists:@"source_name"];
+
+ [[[mockDBInfo expect] andReturnValue:[NSValue value:&varNo withObjCType:@encode(BOOL)]] databaseExists:@"target_name"];
+
+ [dbCopy setDbInfo:mockDBInfo];
+
+ NSString *source = [[NSString alloc] initWithString:@"source_name"];
+ NSString *target = [[NSString alloc] initWithString:@"target_name"];
+ [dbCopy copyDatabaseFrom:source to:target withContent:YES];
+
+ [mockConnection verify];
+ [source release];
+ [target release];
+}
+
+- (void) testCopyDatabaseTables {
+ SPDatabaseCopy *dbCopy = [self getDatabaseCopyFixture];
+ SPTableCopy *tableCopy = [self getTableCopyFixture];
+ STAssertTrue([tableCopy copyTable:@"table_one" from: @"source_db" to: @"target_db"],
+ @"Should have copied database table table_one.");
+ STAssertTrue([tableCopy copyTable:@"table_two" from: @"source_db" to: @"target_db"],
+ @"Should have copied database table table_two.");
+}
+
+- (void) testCreateDatabase {
+ SPDatabaseCopy *dbCopy = [self getDatabaseCopyFixture];
+ // test missing :)
+}
+
+@end
diff --git a/UnitTests/SPDatabaseInfoTest.h b/UnitTests/SPDatabaseInfoTest.h
new file mode 100644
index 00000000..2c31cf1e
--- /dev/null
+++ b/UnitTests/SPDatabaseInfoTest.h
@@ -0,0 +1,23 @@
+//
+// SPDatabaseInfoTest.h
+// sequel-pro
+//
+// Created by David Rekowski on 22.04.10.
+// Copyright 2010 Papaya Software GmbH. All rights reserved.
+//
+
+#define USE_APPLICATION_UNIT_TEST 1
+
+#import <SenTestingKit/SenTestingKit.h>
+
+
+@interface SPDatabaseInfoTest : SenTestCase {
+
+}
+
+- (void)testDatabaseExists;
+- (void)testListDBs;
+- (void)testListDBsLike;
+
+
+@end
diff --git a/UnitTests/SPDatabaseInfoTest.m b/UnitTests/SPDatabaseInfoTest.m
new file mode 100644
index 00000000..0e813350
--- /dev/null
+++ b/UnitTests/SPDatabaseInfoTest.m
@@ -0,0 +1,67 @@
+//
+// SPDatabaseInfoTest.m
+// sequel-pro
+//
+// Created by David Rekowski on 22.04.10.
+// Copyright 2010 Papaya Software GmbH. All rights reserved.
+//
+
+#import <OCMock/OCMock.h>
+#import "SPDatabaseInfo.h"
+#import "SPDatabaseInfoTest.h"
+
+
+@implementation SPDatabaseInfoTest
+
+- (SPDatabaseInfo *)getDatabaseInfoFixture {
+ SPDatabaseInfo *dbInfo = [[SPDatabaseInfo alloc] init];
+ return dbInfo;
+}
+
+- (id) getMockConnection {
+ id mockConnection = [OCMockObject niceMockForClass:[MCPConnection class]];
+ return mockConnection;
+}
+
+- (id) getMockMCPResult {
+ id mockResult = [OCMockObject niceMockForClass:[MCPResult class]];
+ return mockResult;
+}
+
+- (void)testDatabaseExists {
+ SPDatabaseInfo *dbInfo = [self getDatabaseInfoFixture];
+
+ NSArray *tables = [[NSArray alloc] initWithObjects: @"db_one", nil];
+ id mockMCPResult = [self getMockMCPResult];
+ [[mockMCPResult expect] numOfRows];
+ [[[mockMCPResult stub] andReturn:[[NSNumber alloc] initWithInt:1]] numOfRows];
+ [[mockMCPResult expect] fetchRowAsArray];
+ [[[mockMCPResult stub] andReturn:tables] fetchRowAsArray];
+ id mockConnection = [self getMockConnection];
+
+ [[[mockConnection expect] andReturn:mockMCPResult] queryString:@"SHOW DATABASES"];
+ [dbInfo setConnection:mockConnection];
+ [dbInfo databaseExists:@"db_one"];
+ [mockConnection verify];
+}
+
+- (void)testListDBs {
+ SPDatabaseInfo *dbInfo = [self getDatabaseInfoFixture];
+ id mockConnection = [self getMockConnection];
+ [[mockConnection expect] queryString:@"SHOW DATABASES"];
+ [dbInfo setConnection:mockConnection];
+ [dbInfo listDBs];
+ [mockConnection verify];
+}
+
+- (void)testListDBsLike {
+ SPDatabaseInfo *dbInfo = [self getDatabaseInfoFixture];
+ id mockConnection = [self getMockConnection];
+ [[mockConnection expect] queryString:@"SHOW DATABASES LIKE `test_db`"];
+ [dbInfo setConnection:mockConnection];
+ [dbInfo listDBsLike:@"test_db"];
+ [mockConnection verify];
+}
+
+
+@end
diff --git a/UnitTests/SPDatabaseRenameTest.h b/UnitTests/SPDatabaseRenameTest.h
new file mode 100644
index 00000000..a6f92ac1
--- /dev/null
+++ b/UnitTests/SPDatabaseRenameTest.h
@@ -0,0 +1,35 @@
+//
+// $Id: $
+//
+// SPDatabaseRenameTest.h
+// sequel-pro
+//
+// Created by David Rekowski
+// Copyright (c) 2010 David Rekowski. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#define USE_APPLICATION_UNIT_TEST 1
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface SPDatabaseRenameTest : SenTestCase {
+}
+- (void) testRenameDatabase;
+- (void) testCreateDatabase;
+
+@end
diff --git a/UnitTests/SPDatabaseRenameTest.m b/UnitTests/SPDatabaseRenameTest.m
new file mode 100644
index 00000000..ae3f1ab2
--- /dev/null
+++ b/UnitTests/SPDatabaseRenameTest.m
@@ -0,0 +1,91 @@
+//
+// $Id: $
+//
+// SPDatabaseRenameTest.m
+// sequel-pro
+//
+// Created by David Rekowski
+// Copyright (c) 2010 David Rekowski. All rights reserved.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// More info at <http://code.google.com/p/sequel-pro/>
+
+#import <OCMock/OCMock.h>
+#import "SPDatabaseRenameTest.h"
+#import "SPDatabaseRename.h"
+#import "SPTableCopy.h"
+#import "MCPConnection.h"
+#import "SPDatabaseInfo.h"
+#import "SPStringAdditions.h"
+#import "SPLogger.h"
+
+
+@implementation SPDatabaseRenameTest
+
+- (SPDatabaseRename *) getDatabaseRenameFixture {
+ SPDatabaseRename *dbRename = [[SPDatabaseRename alloc] init];
+ return [dbRename autorelease];
+}
+
+- (SPTableCopy *) getTableCopyFixture {
+ SPTableCopy *tableCopy = [[SPTableCopy alloc] init];
+ return [tableCopy autorelease];
+}
+
+- (id) getMockConnection {
+ id mockConnection = [OCMockObject niceMockForClass:[MCPConnection class]];
+ return mockConnection;
+}
+
+- (id) getMockDBInfo {
+ id mockDBInfo = [OCMockObject niceMockForClass:[SPDatabaseInfo class]];
+ return mockDBInfo;
+}
+
+- (void) testRenameDatabase {
+
+ SPDatabaseRename *dbRename = [self getDatabaseRenameFixture];
+
+ id mockConnection = [self getMockConnection];
+ [[mockConnection expect] queryString:@"CREATE DATABASE `target_name`"];
+ [[mockConnection expect] listTablesFromDB:@"source_name"];
+ [[[mockConnection stub] andReturn:[[NSArray alloc] init]] listTablesFromDB:@"source_name"];
+ [dbRename setConnection:mockConnection];
+
+ id mockDBInfo = [self getMockDBInfo];
+
+ BOOL varNo = NO;
+ BOOL varYes = YES;
+ [[[mockDBInfo expect] andReturnValue:[NSValue value:&varYes withObjCType:@encode(BOOL)]] databaseExists:@"source_name"];
+
+ [[[mockDBInfo expect] andReturnValue:[NSValue value:&varNo withObjCType:@encode(BOOL)]] databaseExists:@"target_name"];
+
+ [dbRename setDbInfo:mockDBInfo];
+
+ NSString *source = [[NSString alloc] initWithString:@"source_name"];
+ NSString *target = [[NSString alloc] initWithString:@"target_name"];
+ [dbRename renameDatabaseFrom:source to:target];
+
+ [mockConnection verify];
+ [source release];
+ [target release];
+}
+
+- (void) testCreateDatabase {
+ SPDatabaseRename *dbRename = [self getDatabaseRenameFixture];
+}
+
+@end
diff --git a/UnitTests/SPTableCopyTest.h b/UnitTests/SPTableCopyTest.h
new file mode 100644
index 00000000..84cb6552
--- /dev/null
+++ b/UnitTests/SPTableCopyTest.h
@@ -0,0 +1,21 @@
+//
+// SPTableCopyTest.h
+// sequel-pro
+//
+// Created by David Rekowski on 22.04.10.
+// Copyright 2010 Papaya Software GmbH. All rights reserved.
+//
+
+#define USE_APPLICATION_UNIT_TEST 1
+
+#import <SenTestingKit/SenTestingKit.h>
+
+@interface SPTableCopyTest : SenTestCase {
+
+}
+
+- (void)testCopyTableFromTo;
+- (void)testCopyTableFromToWithData;
+
+
+@end
diff --git a/UnitTests/SPTableCopyTest.m b/UnitTests/SPTableCopyTest.m
new file mode 100644
index 00000000..8d989ccf
--- /dev/null
+++ b/UnitTests/SPTableCopyTest.m
@@ -0,0 +1,45 @@
+//
+// SPTableCopyTest.m
+// sequel-pro
+//
+// Created by David Rekowski on 22.04.10.
+// Copyright 2010 Papaya Software GmbH. All rights reserved.
+//
+
+#import <OCMock/OCMock.h>
+#import "SPTableCopy.h"
+#import "SPTableCopyTest.h"
+
+
+@implementation SPTableCopyTest
+
+- (SPTableCopy *)getTableCopyFixture {
+ SPTableCopy *tableCopy = [[SPTableCopy alloc] init];
+ return tableCopy;
+}
+
+- (id) getMockConnection {
+ id mockConnection = [OCMockObject niceMockForClass:[MCPConnection class]];
+ return mockConnection;
+}
+
+- (void)testCopyTableFromTo {
+ id tableCopy = [self getTableCopyFixture];
+ id mockConnection = [self getMockConnection];
+ [[mockConnection expect] queryString:@"CREATE TABLE `target_db`.`table_name` LIKE `source_db`.`table_name`"];
+ [tableCopy setConnection:mockConnection];
+ [tableCopy copyTable: @"table_name" from: @"source_db" to: @"target_db"];
+ [mockConnection verify];
+}
+
+- (void)testCopyTableFromToWithData {
+ id tableCopy = [self getTableCopyFixture];
+ id mockConnection = [self getMockConnection];
+ [[mockConnection expect] queryString:@"CREATE TABLE `target_db`.`table_name` LIKE `source_db`.`table_name`"];
+ [[mockConnection expect] queryString:@"INSERT INTO `target_db`.`table_name` SELECT * FROM `source_db`.`table_name`"];
+ [tableCopy setConnection:mockConnection];
+ [tableCopy copyTable: @"table_name" from: @"source_db" to: @"target_db" withContent: YES];
+ [mockConnection verify];
+}
+
+@end
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index 35cdb5c7..3bd6fd36 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -7,6 +7,19 @@
objects = {
/* Begin PBXBuildFile section */
+ 112730571180788A000737FD /* SPTableCopyTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 112730551180788A000737FD /* SPTableCopyTest.m */; };
+ 1127305B11807894000737FD /* SPDatabaseInfoTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1127305911807894000737FD /* SPDatabaseInfoTest.m */; };
+ 1141A389117BBFF200126A28 /* SPTableCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1141A388117BBFF200126A28 /* SPTableCopy.m */; };
+ 1141A38A117BBFF200126A28 /* SPTableCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1141A388117BBFF200126A28 /* SPTableCopy.m */; };
+ 115D63E2117CBC5900419057 /* SPDatabaseInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 115D63E1117CBC5900419057 /* SPDatabaseInfo.m */; };
+ 115D63E3117CBC5900419057 /* SPDatabaseInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 115D63E1117CBC5900419057 /* SPDatabaseInfo.m */; };
+ 1198F5B31174EDD500670590 /* SPDatabaseCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */; };
+ 1198F5C41174EF3F00670590 /* SPDatabaseCopyTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1198F5C31174EF3F00670590 /* SPDatabaseCopyTest.m */; };
+ 1198F7541174FFCF00670590 /* SPDatabaseCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */; };
+ 1198F873117510EE00670590 /* OCMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1198F872117510EE00670590 /* OCMock.framework */; };
+ 11C211261180EBFF00758039 /* SPDatabaseRenameTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 11C210DE1180E9B800758039 /* SPDatabaseRenameTest.m */; };
+ 11C211271180EC0400758039 /* SPDatabaseRename.m in Sources */ = {isa = PBXBuildFile; fileRef = 11C2109D1180E70800758039 /* SPDatabaseRename.m */; };
+ 11C211301180EC9A00758039 /* SPDatabaseRename.m in Sources */ = {isa = PBXBuildFile; fileRef = 11C2109D1180E70800758039 /* SPDatabaseRename.m */; };
171312CE109D23C700FB465F /* SPTableTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 171312CD109D23C700FB465F /* SPTableTextFieldCell.m */; };
17292443107AC41000B21980 /* SPXMLExporter.m in Sources */ = {isa = PBXBuildFile; fileRef = 17292442107AC41000B21980 /* SPXMLExporter.m */; };
172A65110F7BED7A001E861A /* SPConsoleMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 172A65100F7BED7A001E861A /* SPConsoleMessage.m */; };
@@ -308,6 +321,23 @@
/* Begin PBXFileReference section */
1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 112730541180788A000737FD /* SPTableCopyTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableCopyTest.h; sourceTree = "<group>"; };
+ 112730551180788A000737FD /* SPTableCopyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableCopyTest.m; sourceTree = "<group>"; };
+ 1127305811807894000737FD /* SPDatabaseInfoTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseInfoTest.h; sourceTree = "<group>"; };
+ 1127305911807894000737FD /* SPDatabaseInfoTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseInfoTest.m; sourceTree = "<group>"; };
+ 1141A387117BBFF200126A28 /* SPTableCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableCopy.h; sourceTree = "<group>"; };
+ 1141A388117BBFF200126A28 /* SPTableCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPTableCopy.m; sourceTree = "<group>"; };
+ 115D63E0117CBC5900419057 /* SPDatabaseInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseInfo.h; sourceTree = "<group>"; };
+ 115D63E1117CBC5900419057 /* SPDatabaseInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseInfo.m; sourceTree = "<group>"; };
+ 1198F5B11174EDD500670590 /* SPDatabaseCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseCopy.h; sourceTree = "<group>"; };
+ 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseCopy.m; sourceTree = "<group>"; };
+ 1198F5C21174EF3F00670590 /* SPDatabaseCopyTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseCopyTest.h; sourceTree = "<group>"; };
+ 1198F5C31174EF3F00670590 /* SPDatabaseCopyTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseCopyTest.m; sourceTree = "<group>"; };
+ 1198F872117510EE00670590 /* OCMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OCMock.framework; path = Library/Frameworks/OCMock.framework; sourceTree = DEVELOPER_DIR; };
+ 11C2109C1180E70800758039 /* SPDatabaseRename.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseRename.h; sourceTree = "<group>"; };
+ 11C2109D1180E70800758039 /* SPDatabaseRename.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseRename.m; sourceTree = "<group>"; };
+ 11C210DD1180E9B800758039 /* SPDatabaseRenameTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPDatabaseRenameTest.h; sourceTree = "<group>"; };
+ 11C210DE1180E9B800758039 /* SPDatabaseRenameTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPDatabaseRenameTest.m; sourceTree = "<group>"; };
17128B8A0FE6E0210035DD75 /* QLPreviewPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLPreviewPanel.h; sourceTree = "<group>"; };
1713122F109C7DF600FB465F /* build.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = build.sh; sourceTree = "<group>"; };
171312CC109D23C700FB465F /* SPTableTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPTableTextFieldCell.h; sourceTree = "<group>"; };
@@ -715,6 +745,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1198F873117510EE00670590 /* OCMock.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -774,6 +805,44 @@
name = "Other Frameworks";
sourceTree = "<group>";
};
+ 1198F5B01174EDA700670590 /* DatabaseActions */ = {
+ isa = PBXGroup;
+ children = (
+ 1198F5B11174EDD500670590 /* SPDatabaseCopy.h */,
+ 1198F5B21174EDD500670590 /* SPDatabaseCopy.m */,
+ 1141A387117BBFF200126A28 /* SPTableCopy.h */,
+ 1141A388117BBFF200126A28 /* SPTableCopy.m */,
+ 115D63E0117CBC5900419057 /* SPDatabaseInfo.h */,
+ 115D63E1117CBC5900419057 /* SPDatabaseInfo.m */,
+ 11C2109C1180E70800758039 /* SPDatabaseRename.h */,
+ 11C2109D1180E70800758039 /* SPDatabaseRename.m */,
+ );
+ name = DatabaseActions;
+ sourceTree = "<group>";
+ };
+ 1198F5B41174EDDE00670590 /* Other */ = {
+ isa = PBXGroup;
+ children = (
+ 1198F5B51174EDE400670590 /* DatabaseActions */,
+ );
+ name = Other;
+ sourceTree = "<group>";
+ };
+ 1198F5B51174EDE400670590 /* DatabaseActions */ = {
+ isa = PBXGroup;
+ children = (
+ 1198F5C21174EF3F00670590 /* SPDatabaseCopyTest.h */,
+ 1198F5C31174EF3F00670590 /* SPDatabaseCopyTest.m */,
+ 112730541180788A000737FD /* SPTableCopyTest.h */,
+ 112730551180788A000737FD /* SPTableCopyTest.m */,
+ 1127305811807894000737FD /* SPDatabaseInfoTest.h */,
+ 1127305911807894000737FD /* SPDatabaseInfoTest.m */,
+ 11C210DD1180E9B800758039 /* SPDatabaseRenameTest.h */,
+ 11C210DE1180E9B800758039 /* SPDatabaseRenameTest.m */,
+ );
+ name = DatabaseActions;
+ sourceTree = "<group>";
+ };
17128B890FE6DFFA0035DD75 /* QuickLook */ = {
isa = PBXGroup;
children = (
@@ -1185,6 +1254,7 @@
17E6416E0EF01F3B001BC333 /* Other */ = {
isa = PBXGroup;
children = (
+ 1198F5B01174EDA700670590 /* DatabaseActions */,
296DC8A40F90914B002A3258 /* MGTemplateEngine */,
17128B890FE6DFFA0035DD75 /* QuickLook */,
583CE39511722B70008F148E /* Compression */,
@@ -1428,6 +1498,7 @@
children = (
1058C7A6FEA54F5311CA2CBB /* Linked Frameworks */,
1058C7A8FEA54F5311CA2CBB /* Other Frameworks */,
+ 1198F872117510EE00670590 /* OCMock.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -1435,6 +1506,7 @@
380F4EF20FC0B67A00B0BFD7 /* Unit Tests */ = {
isa = PBXGroup;
children = (
+ 1198F5B41174EDDE00670590 /* Other */,
380F4F230FC0C3D300B0BFD7 /* MCPKitTest.h */,
380F4F240FC0C3D300B0BFD7 /* MCPKitTest.m */,
380F4EF30FC0B68F00B0BFD7 /* SPStringAdditionsTest.h */,
@@ -1809,8 +1881,16 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 11C211271180EC0400758039 /* SPDatabaseRename.m in Sources */,
+ 11C211261180EBFF00758039 /* SPDatabaseRenameTest.m in Sources */,
+ 1141A38A117BBFF200126A28 /* SPTableCopy.m in Sources */,
+ 115D63E3117CBC5900419057 /* SPDatabaseInfo.m in Sources */,
+ 112730571180788A000737FD /* SPTableCopyTest.m in Sources */,
+ 1127305B11807894000737FD /* SPDatabaseInfoTest.m in Sources */,
+ 1198F7541174FFCF00670590 /* SPDatabaseCopy.m in Sources */,
380F4EF50FC0B68F00B0BFD7 /* SPStringAdditionsTest.m in Sources */,
380F4F250FC0C3D300B0BFD7 /* MCPKitTest.m in Sources */,
+ 1198F5C41174EF3F00670590 /* SPDatabaseCopyTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1828,6 +1908,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 11C211301180EC9A00758039 /* SPDatabaseRename.m in Sources */,
17E641460EF01EB5001BC333 /* main.m in Sources */,
17E641560EF01EF6001BC333 /* CustomQuery.m in Sources */,
17E641570EF01EF6001BC333 /* SPAppController.m in Sources */,
@@ -1911,6 +1992,9 @@
589582151154F8F400EDCC28 /* SPMainThreadTrampoline.m in Sources */,
BC4DF1981158FB280059FABD /* SPNavigatorOutlineView.m in Sources */,
5885CF4A116A63B200A85ACB /* SPFileHandle.m in Sources */,
+ 1198F5B31174EDD500670590 /* SPDatabaseCopy.m in Sources */,
+ 1141A389117BBFF200126A28 /* SPTableCopy.m in Sources */,
+ 115D63E2117CBC5900419057 /* SPDatabaseInfo.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};