aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-05-19 19:53:26 +0000
committerBibiko <bibiko@eva.mpg.de>2009-05-19 19:53:26 +0000
commit641eeff363a2864456a985b246576bfd5d41b144 (patch)
treebe9353ad60b0c282cf0a2014a78ab63e61b3101d /Source/CustomQuery.m
parent2ff722a0de334e4fc4df1dc6219734e85326637c (diff)
downloadsequelpro-641eeff363a2864456a985b246576bfd5d41b144.tar.gz
sequelpro-641eeff363a2864456a985b246576bfd5d41b144.tar.bz2
sequelpro-641eeff363a2864456a985b246576bfd5d41b144.zip
• implemented a new approach to split a string into single SQL statements by using the lexer SPTokenizer
- the new method is called splitStringIntoRangesOfSQLQueries: in SPSQLParser - in CustomQuery's method queryAtPosition: can be found a test case which is as default not activated - must be improved further
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 76c767d7..27f72b04 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -780,6 +780,16 @@ sets the tableView columns corresponding to the mysql-result
// Split the current text into queries
customQueryParser = [[SPSQLParser alloc] initWithString:[textView string]];
queries = [[NSArray alloc] initWithArray:[customQueryParser splitStringByCharacter:';']];
+
+ // ========= test case for SQL splitting into ranges == START
+ // NSArray *qs; int qc;
+ // qs = [[NSArray alloc] initWithArray:[customQueryParser splitStringIntoRangesOfSQLQueries]];
+ // NSLog(@"---START---");
+ // for(qc=0;qc<[qs count];qc++) {
+ // NSLog(@"%d:", qc);
+ // NSLog(@"%@", [[textView string] substringWithRange:NSRangeFromString([qs objectAtIndex:qc])]);
+ // }
+ // ========= test case for SQL splitting into ranges == END
[customQueryParser release];
// Walk along the array of queries to identify the current query - taking into account