diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-10-09 17:13:37 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-10-09 17:13:37 +0000 |
commit | 61a58f40267ee3d83a5c8135261cd0b3cab8ff55 (patch) | |
tree | 46b3b399930353468156cdac03de79b778e52fca /Source/SPCopyTable.m | |
parent | 2206c9cdc5bea1552a0fbf66e7e9f310e7bdc880 (diff) | |
download | sequelpro-61a58f40267ee3d83a5c8135261cd0b3cab8ff55.tar.gz sequelpro-61a58f40267ee3d83a5c8135261cd0b3cab8ff55.tar.bz2 sequelpro-61a58f40267ee3d83a5c8135261cd0b3cab8ff55.zip |
• for each export/copy/drag method other than SQL pass any spatial fields as WKT string; for SQL pass them as X'…' binary data
Diffstat (limited to 'Source/SPCopyTable.m')
-rw-r--r-- | Source/SPCopyTable.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 736052dc..886fe1e8 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -301,6 +301,9 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; [result appendFormat:@"%@\t", displayString]; [displayString release]; } + } + else if ([cellData isKindOfClass:[MCPGeometryData class]]) { + [result appendFormat:@"%@\t", [cellData wktString]]; } else [result appendFormat:@"%@\t", [cellData description]]; } else { @@ -374,6 +377,10 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; else if ([t isEqualToString:@"blobdata"] || [t isEqualToString:@"textdata"]) columnTypes[c] = 2; + // GEOMETRY data + else if ([t isEqualToString:@"geometry"]) + columnTypes[c] = 3; + // Default to strings else columnTypes[c] = 1; @@ -440,6 +447,10 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; } break; + // GEOMETRY + case 3: + [value appendFormat:@"X'%@', ", [mySQLConnection prepareBinaryData:[cellData data]]]; + break; // Unhandled cases - abort default: NSBeep(); @@ -540,6 +551,9 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; [result appendString:displayString]; [displayString release]; } + } + else if ([cellData isKindOfClass:[MCPGeometryData class]]) { + [result appendFormat:@"%@\t", [cellData wktString]]; } else [result appendFormat:@"%@\t", [cellData description]]; } else { |