Skip to content

Commit

Permalink
fix CCKeyValue
Browse files Browse the repository at this point in the history
  • Loading branch information
ccworld1000 committed Sep 29, 2017
1 parent d273c29 commit bfde3bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CCSQLite/CCKeyValue.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ - (void) setObject: (id) object key : (NSString *) key inCollection: (NSString *
[innerQueue inTransaction:^(CCSQLite *db, BOOL *rollback) {
isOK = [db executeUpdate:@"insert into 'CCSQLite.Database2' (collection, key, data, metadata) values (?, ?, ?, ?);", c, key, data, metadata];

if (!isOK) {
isOK = [db executeUpdate:@"update 'CCSQLite.Database2' set collection = ? , key = ? , data = ? , metadata = ? ;", c, key, data, metadata];
}

if (!isOK) {
NSLog(@"execute excpetion!");
}
Expand Down

0 comments on commit bfde3bf

Please sign in to comment.