aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-02-05 01:51:17 +0000
committerrowanbeentje <rowan@beent.je>2010-02-05 01:51:17 +0000
commitf880dea7369cb6ce57c552cd359f871bf7e2e414 (patch)
treee7ae9cecd00dd89dc8a3e66f0ce362fa2c023d6d /Source/CustomQuery.m
parent557d012ed48835423c36bcd0c10754ea3f7e2d3b (diff)
downloadsequelpro-f880dea7369cb6ce57c552cd359f871bf7e2e414.tar.gz
sequelpro-f880dea7369cb6ce57c552cd359f871bf7e2e414.tar.bz2
sequelpro-f880dea7369cb6ce57c552cd359f871bf7e2e414.zip
- Rework SPSQLParser, extending DELIMITER support into all the original functions (off by default). Remove the forked "...Sql..." functions, as they're now duplicates, and switch CustomQuery to using the original methods.
- TableDump imports can now process DELIMITERs correctly as a result. - Alter the TableDump display of tables etc to use TablesList as the source of information, and used cached lists where appropriate for a small speedup. Also means we gain consistent sorting. - Display procedures and functions in the toggleable list when exporting as SQL - Tweak the procedure and function export to only export selected items, and also to respect the "export drop syntax" and "export create syntax" checkboxes - Fix a crash when removing items from the TablesList resulted in an errorneous selection by deselecting all rows before deleting (and preemptively applying the same fix to TableContent)
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r--Source/CustomQuery.m12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index a891f35e..2d1dae4d 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -67,7 +67,8 @@
// Retrieve the custom query string and split it into separate SQL queries
queryParser = [[SPSQLParser alloc] initWithString:[textView string]];
- queries = [queryParser splitSqlStringByCharacter:';'];
+ [queryParser setDelimiterSupport:YES];
+ queries = [queryParser splitStringByCharacter:';'];
[queryParser release];
oldThreadedQueryRange = [textView selectedRange];
@@ -135,7 +136,8 @@
// Otherwise, run the selected text.
} else {
queryParser = [[SPSQLParser alloc] initWithString:[[textView string] substringWithRange:selectedRange]];
- queries = [queryParser splitSqlStringByCharacter:';'];
+ [queryParser setDelimiterSupport:YES];
+ queries = [queryParser splitStringByCharacter:';'];
[queryParser release];
// Remember query start position for error highlighting
@@ -965,7 +967,8 @@
// only if the textView was really changed, otherwise use the cache
if([[textView textStorage] editedMask] != 0) {
customQueryParser = [[SPSQLParser alloc] initWithString:[textView string]];
- queries = [[NSArray alloc] initWithArray:[customQueryParser splitSqlStringIntoRangesByCharacter:';']];
+ [customQueryParser setDelimiterSupport:YES];
+ queries = [[NSArray alloc] initWithArray:[customQueryParser splitStringIntoRangesByCharacter:';']];
numberOfQueries = [queries count];
if(currentQueryRanges)
[currentQueryRanges release];
@@ -1078,7 +1081,8 @@
// Split the current text into ranges of queries
customQueryParser = [[SPSQLParser alloc] initWithString:[[textView string] substringWithRange:NSMakeRange(position, [[textView string] length]-position)]];
- queries = [[NSArray alloc] initWithArray:[customQueryParser splitSqlStringIntoRangesByCharacter:';']];
+ [customQueryParser setDelimiterSupport:YES];
+ queries = [[NSArray alloc] initWithArray:[customQueryParser splitStringIntoRangesByCharacter:';']];
[customQueryParser release];
// Check for a valid index