aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMTextView.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-25 22:46:54 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-25 22:46:54 +0000
commit947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3 (patch)
treea651086f83f8c98d96c72b3b624d56bd0608e4db /Source/CMTextView.m
parent429879a5060d5fe0a27794a1e53b131ab04dba91 (diff)
downloadsequelpro-947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3.tar.gz
sequelpro-947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3.tar.bz2
sequelpro-947cb3e7725ee0e67cd0b2a22c34c5c1122d6cc3.zip
• Query Favorites:
- added snippet variable $SP_SELECTED_TABLES which inserts `table1`,`table2`, etc. (ONLY tables) • improved "Check Table" - now one can select more than one table to execute "CHECK TABLE table1,table2,… ; if all tables passed successfully alert OK, if not show the result as accessory table in the sheet note: OPTIMIZE, REPAIR, FLUSH, CHECKSUM, ANALYZE follow
Diffstat (limited to 'Source/CMTextView.m')
-rw-r--r--Source/CMTextView.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/CMTextView.m b/Source/CMTextView.m
index 582df6c2..7d140ccb 100644
--- a/Source/CMTextView.m
+++ b/Source/CMTextView.m
@@ -32,6 +32,7 @@
#import "SPConstants.h"
#import "SPQueryController.h"
#import "SPTooltip.h"
+#import "TablesList.h"
#pragma mark -
#pragma mark lex init
@@ -1182,6 +1183,18 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse)
if ([[[[self window] delegate] valueForKeyPath:@"tablesListInstance"] valueForKey:@"selectedDatabase"] != nil)
currentDb = [[[[self window] delegate] valueForKeyPath:@"tablesListInstance"] valueForKeyPath:@"selectedDatabase"];
+ while([theHintString isMatchedByRegex:@"(?<!\\\\)\\$SP_SELECTED_TABLES"]) {
+ r = [theHintString rangeOfRegex:@"(?<!\\\\)\\$SP_SELECTED_TABLES"];
+ if(r.length) {
+ NSArray *selTables = [[[self delegate] valueForKeyPath:@"tablesListInstance"] selectedTableNames];
+ if([selTables count])
+ [theHintString replaceCharactersInRange:r withString:[selTables componentsJoinedAndBacktickQuoted]];
+ else
+ [theHintString replaceCharactersInRange:r withString:@"<tables>"];
+ }
+ [theHintString flushCachedRegexData];
+ }
+
while([theHintString isMatchedByRegex:@"(?<!\\\\)\\$SP_SELECTED_TABLE"]) {
r = [theHintString rangeOfRegex:@"(?<!\\\\)\\$SP_SELECTED_TABLE"];
if(r.length) {