Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing some conflicts.

  • Loading branch information...
commit 5160fc0566892e36b112e3938cc729315ec09b87 2 parents 355a591 + 87748d1
@ccgus authored
View
2  README.markdown
@@ -109,7 +109,7 @@ Alternatively, you may use named parameters syntax:
The parameters *must* start with a colon. SQLite itself supports other characters, but internally the Dictionary keys are prefixed with a colon, do **not** include the colon in your dictionary keys.
NSDictionary *argsDict = [NSDictionary dictionaryWithObjectsAndKeys:@"My Name", @"name", nil];
- [db executeUpdate:@"INSERT INTO myTable (name) VALUES (:name)" withArgumentsInDictionary:argsDict];
+ [db executeUpdate:@"INSERT INTO myTable (name) VALUES (:name)" withParameterDictionary:argsDict];
Thus, you SHOULD NOT do this (or anything like this):
View
3  src/FMDatabase.m
@@ -350,6 +350,9 @@ - (void)bindObject:(id)obj toColumn:(int)idx inStatement:(sqlite3_stmt*)pStmt {
else if (strcmp([obj objCType], @encode(long long)) == 0) {
sqlite3_bind_int64(pStmt, idx, [obj longLongValue]);
}
+ else if (strcmp([obj objCType], @encode(unsigned long long)) == 0) {
+ sqlite3_bind_int64(pStmt, idx, [obj unsignedLongLongValue]);
+ }
else if (strcmp([obj objCType], @encode(float)) == 0) {
sqlite3_bind_double(pStmt, idx, [obj floatValue]);
}
View
3  src/FMResultSet.h
@@ -52,6 +52,9 @@
- (long long int)longLongIntForColumn:(NSString*)columnName;
- (long long int)longLongIntForColumnIndex:(int)columnIdx;
+- (unsigned long long int)unsignedLongLongIntForColumn:(NSString*)columnName;
+- (unsigned long long int)unsignedLongLongIntForColumnIndex:(int)columnIdx;
+
- (BOOL)boolForColumn:(NSString*)columnName;
- (BOOL)boolForColumnIndex:(int)columnIdx;
View
8 src/FMResultSet.m
@@ -228,6 +228,14 @@ - (long long int)longLongIntForColumnIndex:(int)columnIdx {
return sqlite3_column_int64([_statement statement], columnIdx);
}
+- (unsigned long long int)unsignedLongLongIntForColumn:(NSString*)columnName {
+ return [self unsignedLongLongIntForColumnIndex:[self columnIndexForName:columnName]];
+}
+
+- (unsigned long long int)unsignedLongLongIntForColumnIndex:(int)columnIdx {
+ return (unsigned long long int)[self longLongIntForColumnIndex:columnIdx];
+}
+
- (BOOL)boolForColumn:(NSString*)columnName {
return [self boolForColumnIndex:[self columnIndexForName:columnName]];
}
View
13 src/fmdb.m
@@ -119,6 +119,19 @@ int main (int argc, const char * argv[]) {
FMDBQuickCheck(![db hasOpenResultSets]);
+ [db executeUpdate:@"create table ull (a integer)"];
+
+ [db executeUpdate:@"insert into ull (a) values (?)" , [NSNumber numberWithUnsignedLongLong:ULLONG_MAX]];
+
+ rs = [db executeQuery:@"select a from ull"];
+ while ([rs next]) {
+ unsigned long long a = [rs unsignedLongLongIntForColumnIndex:0];
+ unsigned long long b = [rs unsignedLongLongIntForColumn:@"a"];
+
+ FMDBQuickCheck(a == ULLONG_MAX);
+ FMDBQuickCheck(b == ULLONG_MAX);
+ }
+
// ----------------------------------------------------------------------------------------
// blob support.
[db executeUpdate:@"create table blobTable (a text, b blob)"];
Please sign in to comment.
Something went wrong with that request. Please try again.