aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableData.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-22 14:56:05 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-22 14:56:05 +0000
commitdb2d9565c996e206d82a441cfd8e60627f0eab6d (patch)
treecddd29b39dfaac95062a9412f4a70786f1205171 /Source/SPTableData.m
parentf4e32dd6a24793454e0af44a4429cdd9ca737724 (diff)
downloadsequelpro-db2d9565c996e206d82a441cfd8e60627f0eab6d.tar.gz
sequelpro-db2d9565c996e206d82a441cfd8e60627f0eab6d.tar.bz2
sequelpro-db2d9565c996e206d82a441cfd8e60627f0eab6d.zip
• CSV Import
- if a parsed row in the csv file doesn't have the same number of columns as the first row fill the missing columns with SPNotLoaded to allow while importing that these missing data can be replaced by the table column's DEFAULT value - fixed tiny issue for field mapper sheet to display the correct tooltip for default values • SPTableData - ATTENTION: changed the object for returned key 'default': if its value is NULL now it returns a [NSNull null] object - changed instances to handle this [NSNull null] object (must be checked)
Diffstat (limited to 'Source/SPTableData.m')
-rw-r--r--Source/SPTableData.m14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index 34ab2358..698270fe 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -749,13 +749,8 @@
}
// Select the column default if available
- if ([resultRow objectForKey:@"Default"]) {
- if ([[resultRow objectForKey:@"Default"] isNSNull]) {
- [tableColumn setValue:[NSString stringWithString:[[NSUserDefaults standardUserDefaults] objectForKey:SPNullValue]] forKey:@"default"];
- } else {
- [tableColumn setValue:[NSString stringWithString:[resultRow objectForKey:@"Default"]] forKey:@"default"];
- }
- }
+ if ([resultRow objectForKey:@"Default"])
+ [tableColumn setObject:[NSString stringWithString:[resultRow objectForKey:@"Default"]] forKey:@"default"];
// Add the column to the list
[tableColumns addObject:[NSDictionary dictionaryWithDictionary:tableColumn]];
@@ -1017,7 +1012,10 @@
// Field defaults
} else if ([detailString isEqualToString:@"DEFAULT"] && (definitionPartsIndex + 1 < partsArrayLength)) {
detailParser = [[SPSQLParser alloc] initWithString:[definitionParts objectAtIndex:definitionPartsIndex+1]];
- [fieldDetails setValue:[detailParser unquotedString] forKey:@"default"];
+ if([[detailParser unquotedString] isEqualToString:@"NULL"])
+ [fieldDetails setObject:[NSNull null] forKey:@"default"];
+ else
+ [fieldDetails setValue:[detailParser unquotedString] forKey:@"default"];
[detailParser release];
definitionPartsIndex++;