aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSQLParser.h
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-04 14:11:55 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-04 14:11:55 +0000
commitfa3a82bd89eee142c575e13e47eb6a7bd5e1fc89 (patch)
treeee2536c1bafc17235d0d9d68ed5df3e100236319 /Source/SPSQLParser.h
parentf3e421d2e4ba9ec54878968c34044dce89dc6f09 (diff)
downloadsequelpro-fa3a82bd89eee142c575e13e47eb6a7bd5e1fc89.tar.gz
sequelpro-fa3a82bd89eee142c575e13e47eb6a7bd5e1fc89.tar.bz2
sequelpro-fa3a82bd89eee142c575e13e47eb6a7bd5e1fc89.zip
• added support for the “delimiter” command
- added (NSArray *) splitSqlStringByCharacter:(unichar)character; (NSArray *) splitSqlStringIntoRangesByCharacter:(unichar)character; (long) firstOccurrenceInSqlOfCharacter: to the SQLParser which recognize a “delimiter” command • queryAtPosition now works with ranges to speed it up - the current query ranges resp. the just activated query range are cached in order to avoid parsing if the user only navigates through the textView buffer, or if the user calls Run Prev/Current Query only • the "import dump" function makes usage of that new “delimiter” support - i.e. dumps with procs/funcs declaration could be imported IMPORTANT: Please check the new SQLParser exhaustively in order to prove that new approach
Diffstat (limited to 'Source/SPSQLParser.h')
-rw-r--r--Source/SPSQLParser.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/Source/SPSQLParser.h b/Source/SPSQLParser.h
index af60645a..022e17bb 100644
--- a/Source/SPSQLParser.h
+++ b/Source/SPSQLParser.h
@@ -64,6 +64,10 @@
unichar *stringCharCache;
long charCacheStart;
long charCacheEnd;
+ NSString *delimiter;
+ int delimiterLength;
+ BOOL charIsDelimiter;
+ BOOL isDelimiterCommand;
}
@@ -74,6 +78,7 @@ typedef enum _SPCommentTypes {
} SPCommentType;
+
/*
* Removes comments within the current string, trimming "#", "--[/s]", and "/* * /" style strings.
*/
@@ -212,25 +217,16 @@ 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;
+- (NSArray *) splitSqlStringByCharacter:(unichar)character;
+- (NSArray *) splitSqlStringIntoRangesByCharacter:(unichar)character;
/*
* Methods used internally by this class to power the methods above:
*/
- (long) firstOccurrenceOfCharacter:(unichar)character ignoringQuotedStrings:(BOOL)ignoreQuotedStrings;
- (long) firstOccurrenceOfCharacter:(unichar)character afterIndex:(long)startIndex ignoringQuotedStrings:(BOOL)ignoreQuotedStrings;
-- (long) firstOccurrenceOfCharacter:(unichar)character afterIndex:(long)startIndex skippingBrackets:(BOOL)skipBrackets ignoringQuotedStrings:(BOOL)ignoreQuotedStrings ;
+- (long) firstOccurrenceOfCharacter:(unichar)character afterIndex:(long)startIndex skippingBrackets:(BOOL)skipBrackets ignoringQuotedStrings:(BOOL)ignoreQuotedStrings;
+- (long) firstOccurrenceInSqlOfCharacter:(unichar)character afterIndex:(long)startIndex skippingBrackets:(BOOL)skipBrackets ignoringQuotedStrings:(BOOL)ignoreQuotedStrings;
- (long) endIndexOfStringQuotedByCharacter:(unichar)quoteCharacter startingAtIndex:(long)index;
- (long) endIndexOfCommentOfType:(SPCommentType)commentType startingAtIndex:(long)index;
@@ -242,11 +238,6 @@ typedef enum _SPCommentTypes {
- (void) deleteCharactersInRange:(NSRange)aRange;
- (void) insertString:(NSString *)aString atIndex:(NSUInteger)anIndex;
-/*
- * return an array of queries
- */
-- (NSArray *) parseQueries;
-
/* Required and primitive methods to allow subclassing class cluster */
#pragma mark -
- (id) init;