aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSQLExporter.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-10-09 17:13:37 +0000
committerBibiko <bibiko@eva.mpg.de>2010-10-09 17:13:37 +0000
commit61a58f40267ee3d83a5c8135261cd0b3cab8ff55 (patch)
tree46b3b399930353468156cdac03de79b778e52fca /Source/SPSQLExporter.m
parent2206c9cdc5bea1552a0fbf66e7e9f310e7bdc880 (diff)
downloadsequelpro-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/SPSQLExporter.m')
-rw-r--r--Source/SPSQLExporter.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m
index becccab2..64251456 100644
--- a/Source/SPSQLExporter.m
+++ b/Source/SPSQLExporter.m
@@ -385,7 +385,7 @@
else if ([object isKindOfClass:[NSData class]]) {
if ([self sqlOutputEncodeBLOBasHex]) {
- [sqlString appendFormat:@"X'%@", [connection prepareBinaryData:object]];
+ [sqlString appendFormat:@"X'%@'", [connection prepareBinaryData:object]];
}
else {
[sqlString appendString:@"'"];
@@ -403,6 +403,10 @@
[sqlString appendString:@"'"];
}
+ // GEOMETRY data types directly as hex data
+ else if ([object isKindOfClass:[MCPGeometryData class]]) {
+ [sqlString appendFormat:@"X'%@'", [connection prepareBinaryData:[object data]]];
+ }
else {
[cellValue setString:[object description]];