aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-12-07 11:16:55 +0000
committerBibiko <bibiko@eva.mpg.de>2010-12-07 11:16:55 +0000
commit44cf4df2bbe2e9208faef346abc0a64e62432592 (patch)
treefc612e1368ed310bcb6a866674367730ca1804d0 /Source/SPDatabaseDocument.m
parent5365d66a60b03889dc8ed165f190155b6e2c0a83 (diff)
downloadsequelpro-44cf4df2bbe2e9208faef346abc0a64e62432592.tar.gz
sequelpro-44cf4df2bbe2e9208faef346abc0a64e62432592.tar.bz2
sequelpro-44cf4df2bbe2e9208faef346abc0a64e62432592.zip
• Bundle command support
- fixed issue for commands without assigning a key equivalent - output table meta data about type, type grouping, length, auto_inc, PRI key etc. for Data Table scope commands and sequelpro url scheme command ExecuteQuery
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index cc5185ac..5f05573c 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -4691,6 +4691,28 @@
NSArray *columnDefinition = [theResult fetchResultFieldsStructure];
+ // Write table meta data
+ NSMutableString *tableMetaData = [NSMutableString string];
+ for(NSDictionary* col in columnDefinition) {
+ [tableMetaData appendFormat:@"%@\t", [col objectForKey:@"type"]];
+ [tableMetaData appendFormat:@"%@\t", [col objectForKey:@"typegrouping"]];
+ [tableMetaData appendFormat:@"%@\t", ([col objectForKey:@"char_length"]) ? : @""];
+ [tableMetaData appendFormat:@"%@\t", [col objectForKey:@"UNSIGNED_FLAG"]];
+ [tableMetaData appendFormat:@"%@\t", [col objectForKey:@"AUTO_INCREMENT_FLAG"]];
+ [tableMetaData appendFormat:@"%@\t", [col objectForKey:@"PRI_KEY_FLAG"]];
+ [tableMetaData appendString:@"\n"];
+ }
+ NSError *err = nil;
+ [tableMetaData writeToFile:metaFileName
+ atomically:YES
+ encoding:NSUTF8StringEncoding
+ error:&err];
+ if(err != nil) {
+ NSLog(@"Error while writing “%@”", tableMetaData);
+ NSBeep();
+ return;
+ }
+
// write data
NSInteger i, j;
NSArray *theRow;