diff options
author | stuconnolly <stuart02@gmail.com> | 2010-11-07 20:57:55 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-11-07 20:57:55 +0000 |
commit | 1c52c1074f8758977dda4a85bdc33b0f190b8aa5 (patch) | |
tree | e270e2d9155c995206f81450efe1446a1c273737 | |
parent | 5b74654f969a6878dc0f85cab52eeee68053fb62 (diff) | |
download | sequelpro-1c52c1074f8758977dda4a85bdc33b0f190b8aa5.tar.gz sequelpro-1c52c1074f8758977dda4a85bdc33b0f190b8aa5.tar.bz2 sequelpro-1c52c1074f8758977dda4a85bdc33b0f190b8aa5.zip |
When exporting either a filtered or custom query result include the query in the opening resultset tag that produced the result.
-rw-r--r-- | Source/SPExportFileUtilities.m | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/SPExportFileUtilities.m b/Source/SPExportFileUtilities.m index 86631495..5a9d16ee 100644 --- a/Source/SPExportFileUtilities.m +++ b/Source/SPExportFileUtilities.m @@ -88,11 +88,17 @@ [header appendString:@"-\n-->\n\n"]; if ([exportXMLFormatPopUpButton indexOfSelectedItem] == SPXMLExportMySQLFormat) { - [header appendFormat:@"<%@ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n", (exportSource == SPTableExport) ? @"mysqldump" : @"resultset"]; + + NSString *tag = @""; if (exportSource == SPTableExport) { - [header appendFormat:@"<database name=\"%@\">\n\n", [tableDocumentInstance database]]; + tag = [NSString stringWithFormat:@"<mysqldump xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<database name=\"%@\">\n\n", [tableDocumentInstance database]]; + } + else { + tag = [NSString stringWithFormat:@"<resultset statement=\"%@\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n\n", (exportSource == SPFilteredExport) ? [tableContentInstance usedQuery] : [customQueryInstance usedQuery]]; } + + [header appendString:tag]; } else { [header appendFormat:@"<%@>\n\n", [[tableDocumentInstance database] HTMLEscapeString]]; |