aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSQLParser.h
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/SPSQLParser.h
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/SPSQLParser.h')
-rw-r--r--Source/SPSQLParser.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/SPSQLParser.h b/Source/SPSQLParser.h
index 4821d775..af60645a 100644
--- a/Source/SPSQLParser.h
+++ b/Source/SPSQLParser.h
@@ -213,6 +213,19 @@ typedef enum _SPCommentTypes {
- (NSArray *) splitStringByCharacter:(unichar)character skippingBrackets:(BOOL)skipBrackets ignoringQuotedStrings:(BOOL)ignoreQuotedStrings;
/*
+ * As splitStringByCharacter: ..., but allows control over quoting
+ * - it recognises CREATE ... BEGIN ... END statements
+ * - it can detect a SINGLE SQL statement in between
+ * delimiter foo ... foo delimiter ;
+ * ['delimiter ;' MUST be given!]
+ * - it returns an array of ranges (as NSString "{loc, length}").
+ * FromPosition: is needed if a subrange is passed to sync the ranges
+ * according to the CQ textView ones.
+ */
+- (NSArray *) splitStringIntoRangesOfSQLQueries;
+- (NSArray *) splitStringIntoRangesOfSQLQueriesFromPosition:(long)position;
+
+/*
* Methods used internally by this class to power the methods above:
*/
- (long) firstOccurrenceOfCharacter:(unichar)character ignoringQuotedStrings:(BOOL)ignoreQuotedStrings;