Skip to content

Commit 8b69a9e

Browse files
authored
Merge pull request #2710 from abhibeckert/master
New URL for feedback reporter, and some other small things
2 parents b87faac + cbf8095 commit 8b69a9e

File tree

3 files changed

+70
-8
lines changed

3 files changed

+70
-8
lines changed

Diff for: Interfaces/English.lproj/MainMenu.xib

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6751" systemVersion="13F1507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<development version="5100" identifier="xcode"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6751"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
76
</dependencies>
87
<objects>
98
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -12,7 +11,7 @@
1211
</connections>
1312
</customObject>
1413
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
15-
<customObject id="-3" userLabel="Application">
14+
<customObject id="-3" userLabel="Application" customClass="NSObject">
1615
<connections>
1716
<outlet property="delegate" destination="213" id="1001"/>
1817
</connections>

Diff for: Resources/Plists/Info.plist

+1-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
<key>FRFeedbackReporter.maxConsoleLogSize</key>
188188
<integer>10000</integer>
189189
<key>FRFeedbackReporter.targetURL</key>
190-
<string>http://log.sequelpro.com/submit</string>
190+
<string>https://sequelpro.com/api?action=feedback-submit</string>
191191
<key>LSApplicationCategoryType</key>
192192
<string>public.app-category.developer-tools</string>
193193
<key>LSMinimumSystemVersion</key>
@@ -199,7 +199,6 @@
199199
<key>x86_64</key>
200200
<string>10.6.0</string>
201201
</dict>
202-
203202
<key>NSAppTransportSecurity</key>
204203
<dict>
205204
<key>NSExceptionDomains</key>
@@ -223,7 +222,6 @@
223222
</dict>
224223
</dict>
225224
</dict>
226-
227225
<key>NSAppleScriptEnabled</key>
228226
<true/>
229227
<key>NSHumanReadableCopyright</key>

Diff for: Source/SPDatabaseDocument.m

+65
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,71 @@ - (IBAction)alterDatabase:(id)sender
856856
contextInfo:SPAlterDatabaseAction];
857857
}
858858

859+
- (IBAction)compareDatabase:(id)sender
860+
{
861+
/*
862+
863+
864+
This method is a basic experiment to see how long it takes to read an string compare an entire database. It works,
865+
well, good performance and very little memory usage.
866+
867+
Next we need to ask the user to select another connection (from the favourites list) and compare chunks of ~1000 rows
868+
at a time, ordered by primary key, between the two databases, using three threads (one for each database and one for
869+
comparisons).
870+
871+
We will the write to disk every difference that has been found and open the result in FileMerge.
872+
873+
In future, add the ability to write all difference to the current database.
874+
875+
876+
*/
877+
NSLog(@"=================");
878+
879+
SPMySQLResult *showTablesQuery = [mySQLConnection queryString:@"show tables"];
880+
881+
NSArray *tableRow;
882+
while ((tableRow = [showTablesQuery getRowAsArray]) != nil) {
883+
@autoreleasepool {
884+
NSString *table = tableRow[0];
885+
886+
NSLog(@"-----------------");
887+
NSLog(@"Scanning %@", table);
888+
889+
890+
NSDictionary *tableStatus = [[mySQLConnection queryString:[NSString stringWithFormat:@"SHOW TABLE STATUS LIKE %@", [table tickQuotedString]]] getRowAsDictionary];
891+
NSInteger rowCountEstimate = [tableStatus[@"Rows"] integerValue];
892+
NSLog(@"Estimated row count: %li", rowCountEstimate);
893+
894+
895+
896+
SPMySQLResult *tableContentsQuery = [mySQLConnection streamingQueryString:[NSString stringWithFormat:@"select * from %@", [table backtickQuotedString]] useLowMemoryBlockingStreaming:NO];
897+
//NSDate *lastProgressUpdate = [NSDate date];
898+
time_t lastProgressUpdate = time(NULL);
899+
NSInteger rowCount = 0;
900+
NSArray *row;
901+
while (true) {
902+
@autoreleasepool {
903+
row = [tableContentsQuery getRowAsArray];
904+
if (!row) {
905+
break;
906+
}
907+
908+
[row isEqualToArray:row]; // TODO: compare to the other database, instead of the same one (just doing that to test performance)
909+
910+
rowCount++;
911+
if ((time(NULL) - lastProgressUpdate) > 0) {
912+
NSLog(@"Progress: %.1f%%", (((float)rowCount) / ((float)rowCountEstimate)) * 100);
913+
lastProgressUpdate = time(NULL);
914+
}
915+
}
916+
}
917+
NSLog(@"Done. Actual row count: %li", rowCount);
918+
}
919+
}
920+
921+
NSLog(@"=================");
922+
}
923+
859924
#ifndef SP_CODA /* operations on whole databases */
860925
/**
861926
* opens the copy database sheet and copies the databsae

0 commit comments

Comments
 (0)