diff options
author | stuconnolly <stuart02@gmail.com> | 2010-12-08 19:03:47 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-12-08 19:03:47 +0000 |
commit | 61e398816badc49b301a6ae70c3697d581258cfb (patch) | |
tree | cca1e18f88c42556b4a5e48c1e685cb2b6574b78 /Source/SPDatabaseDocument.m | |
parent | 3fccc9c751cded1360aa22796ed3c6d700fd04c1 (diff) | |
parent | 5b88ac6a6d0c02b1b51f295cf79e84b61c1f1bd5 (diff) | |
download | sequelpro-61e398816badc49b301a6ae70c3697d581258cfb.tar.gz sequelpro-61e398816badc49b301a6ae70c3697d581258cfb.tar.bz2 sequelpro-61e398816badc49b301a6ae70c3697d581258cfb.zip |
Bring outline view branch up to date with trunk (r2976:2988).
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 4e36c5e1..f1ac803f 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; |