aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-10 19:23:42 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-10 19:23:42 +0000
commitbd1c8a535691781746f1a1ff4ea9d215744061c5 (patch)
tree5ee5d4b7f3a7f42b737ec8aa7bc42a7fde4bec0c /Source
parent602633c84982f4e8061cde8a3cb09ada6c4d11bf (diff)
downloadsequelpro-bd1c8a535691781746f1a1ff4ea9d215744061c5.tar.gz
sequelpro-bd1c8a535691781746f1a1ff4ea9d215744061c5.tar.bz2
sequelpro-bd1c8a535691781746f1a1ff4ea9d215744061c5.zip
• first preparations to improve the Custom Query database names/table names/field names + type and encoding completion
- after connecting and updating the table list a background task executed on a different connection will be performed to query the information_schema db (MySQL >= 5 only so far) - the MCPConnection object holds a NSDictionary with all structural data Note: not yet active
Diffstat (limited to 'Source')
-rw-r--r--Source/CMTextView.m3
-rw-r--r--Source/TableDocument.m2
-rw-r--r--Source/TablesList.m5
3 files changed, 9 insertions, 1 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 8346525b..bebea5c0 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -142,6 +142,9 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
if([mySQLConnection isConnected])
{
+
+ // NSLog(@"struct:\n %@", [mySQLConnection getDbStructure]);
+
// Add table names to completions list
for (id obj in [[[[self window] delegate] valueForKeyPath:@"tablesListInstance"] valueForKey:@"allTableNames"])
[possibleCompletions addObject:[NSDictionary dictionaryWithObjectsAndKeys:obj, @"display", @"table-small-square", @"image", nil]];
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 85cb99c5..30645361 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -680,6 +680,8 @@
window:tableWindow
notificationName:@"Connected"];
+ // Query the structure of all databases in the background (mainly for completion)
+ [mySQLConnection performSelector:@selector(queryDbStructure) withObject:nil afterDelay:0.1];
// Init Custom Query editor with the stored queries in a spf file if given.
[spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"];
diff --git a/Source/TablesList.m b/Source/TablesList.m
index 5a98971b..2846a85a 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -86,6 +86,9 @@
// Notify listeners that a query has started
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:tableDocumentInstance];
+ // Query the structure of all databases in the background (mainly for completion)
+ [mySQLConnection performSelector:@selector(queryDbStructure) withObject:nil afterDelay:0.1];
+
// Select the table list for the current database. On MySQL versions after 5 this will include
// views; on MySQL versions >= 5.0.02 select the "full" list to also select the table type column.
theResult = [mySQLConnection queryString:@"SHOW /*!50002 FULL*/ TABLES"];
@@ -105,7 +108,7 @@
} else {
[tableTypes addObject:[NSNumber numberWithInteger:SP_TABLETYPE_TABLE]];
}
- }
+ }
}
// Reorder the tables in alphabetical order