aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSQLExporter.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-05-08 14:23:31 +0000
committerstuconnolly <stuart02@gmail.com>2012-05-08 14:23:31 +0000
commit343e4ed439ba0ccc255460df4fc69e25c4a3f91e (patch)
treefb1d7a981f2a371785d7008bf6563a9caf188cd0 /Source/SPSQLExporter.m
parentcb29bcb923804e844411fb4872f55993bf29ee91 (diff)
downloadsequelpro-343e4ed439ba0ccc255460df4fc69e25c4a3f91e.tar.gz
sequelpro-343e4ed439ba0ccc255460df4fc69e25c4a3f91e.tar.bz2
sequelpro-343e4ed439ba0ccc255460df4fc69e25c4a3f91e.zip
Improve formatting of SQL keywords in view syntax prettifier and add an associated test.
Diffstat (limited to 'Source/SPSQLExporter.m')
-rw-r--r--Source/SPSQLExporter.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m
index 907360ea..4def00d3 100644
--- a/Source/SPSQLExporter.m
+++ b/Source/SPSQLExporter.m
@@ -251,10 +251,10 @@
}
// Add a 'DROP TABLE' command if required
- if (sqlOutputIncludeDropSyntax)
+ if (sqlOutputIncludeDropSyntax) {
[[self exportOutputFile] writeData:[[NSString stringWithFormat:@"DROP %@ IF EXISTS %@;\n\n", ((tableType == SPTableTypeTable) ? @"TABLE" : @"VIEW"), [tableName backtickQuotedString]]
- dataUsingEncoding:[self exportOutputEncoding]]];
-
+ dataUsingEncoding:[self exportOutputEncoding]]];
+ }
// Add the create syntax for the table if specified in the export dialog
if (sqlOutputIncludeStructure && createTableSyntax) {
@@ -575,7 +575,7 @@
[metaString setString:@"\n\n"];
// Add the name of table
[metaString appendFormat:@"# Replace placeholder table for %@ with correct view syntax\n# ------------------------------------------------------------\n\n", tableName];
- [metaString appendFormat:@"DROP TABLE %@;\n", [tableName backtickQuotedString]];
+ [metaString appendFormat:@"DROP TABLE %@;\n\n", [tableName backtickQuotedString]];
[metaString appendFormat:@"%@;\n", [viewSyntaxes objectForKey:tableName]];
[[self exportOutputFile] writeData:[metaString dataUsingEncoding:NSUTF8StringEncoding]];