Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions CHANGES_AND_TODO_LIST.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
TODO:
Zip, nada, zilch. Got any ideas?

If you would like to contribute some code- awesome! I just ask that you make it conform to the coding conventions already set in here, and to add a couple of tests for your new code to fmdb.m. And of course, the code should be of general use to more than just a couple of folks. Send your patches to [email protected].
If you would like to contribute some code ... awesome! I just ask that you make it conform to the coding conventions already set in here, and to add the necessary of tests for your new code to tests target. And of course, the code should be of general use to more than just a couple of folks. Send your patches to [email protected].

2015.12.28
Removed `sqlite3.h` from the headers to simplify incorporation of FMDB into a framework. This eliminates the dreaded "non-modular headers" error in frameworks.

To accomplish this, the few references to SQLite pointers have been changed to return `void` pointers. This means that if you have application code that used SQLite pointers exposed by FMDB, you may have to cast the pointer to the appropriate type when you use it (and `#import <sqlite3.h>` yourself). In general, we would advise against using SQLite pointers unless you absolutely need to.

Also changed the `FMDatabaseVariadic.swift` to throw errors for Swift 2.

2015.10.29
Added renditions of `executeUpdate:values:error:` and `executeQuery:values:error:`, which in Swift 2 throw errors.

2015.01.23
Added Swift renditions of the variadic methods of FMDatabaseAdditions.
Added Swift renditions of the variadic methods of `FMDatabaseAdditions`.

2014.10.19
Added a 'nextWithError:' to FMResultSet. Thanks to Roshan Muralidharan for the patch.
Added a `nextWithError:` to `FMResultSet`. Thanks to Roshan Muralidharan for the patch.

2014.09.10
New classes for exposing SQLite's FTS features. Thanks to Andrew Goodale for the code.

2014.04.23
New executeStatements: method, which will take a single UTF-8 string with multiple statements in it. This is great for batch updates. There is also a executeStatements:withResultBlock: version which takes a callback block which will be used for any statements which return rows in the bulk statement. Thanks to Rob Ryan for contributing code for this.

Deprecated update:withErrorAndBindings: in favor of executeUpdate:withErrorAndBindings:
Deprecated `update:withErrorAndBindings:` in favor of `executeUpdate:withErrorAndBindings:` or `executeUpdate:values:error:`.

2014.04.09
Added back in busy handler code after a brief hiatus (check out the 2013.12.10 notes). But now doing so with sqlite3_busy_handler instead of while loops in the various execution places.
Expand Down
2 changes: 1 addition & 1 deletion FMDB.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FMDB'
s.version = '2.5.2'
s.version = '2.6'
s.summary = 'A Cocoa / Objective-C wrapper around SQLite.'
s.homepage = 'https://github.com/ccgus/fmdb'
s.license = 'MIT'
Expand Down
3 changes: 2 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# FMDB v2.5
# FMDB v2.6

This is an Objective-C wrapper around SQLite: http://sqlite.org/

## The FMDB Mailing List:
Expand Down
15 changes: 12 additions & 3 deletions Tests/FMDatabaseAdditionsTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#import <XCTest/XCTest.h>
#import "FMDatabaseAdditions.h"

#if FMDB_SQLITE_STANDALONE
#import <sqlite3/sqlite3.h>
#else
#import <sqlite3.h>
#endif

@interface FMDatabaseAdditionsTests : FMDBTempDBTests

@end
Expand Down Expand Up @@ -101,9 +107,8 @@ - (void)testUserVersion {
XCTAssertTrue([[self db] userVersion] == 12);
}

- (void)testApplicationID {
#if SQLITE_VERSION_NUMBER >= 3007017
- (void)testApplicationID
{
uint32_t appID = NSHFSTypeCodeFromFileType(NSFileTypeForHFSTypeCode('fmdb'));

[self.db setApplicationID:appID];
Expand All @@ -117,7 +122,11 @@ - (void)testApplicationID
NSString *s = [self.db applicationIDString];

XCTAssertEqualObjects(s, @"acrn");
}
#else
NSString *errorMessage = NSLocalizedString(@"Application ID functions require SQLite 3.7.17", nil);
XCTFail("%@", errorMessage);
if (self.db.logsErrors) NSLog(@"%@", errorMessage);
#endif
}

@end
6 changes: 6 additions & 0 deletions Tests/FMDatabaseQueueTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#import <XCTest/XCTest.h>
#import "FMDatabaseQueue.h"

#if FMDB_SQLITE_STANDALONE
#import <sqlite3/sqlite3.h>
#else
#import <sqlite3.h>
#endif

@interface FMDatabaseQueueTests : FMDBTempDBTests

@property FMDatabaseQueue *queue;
Expand Down
11 changes: 9 additions & 2 deletions Tests/FMDatabaseTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
#import "FMDatabase.h"
#import "FMDatabaseAdditions.h"

#if FMDB_SQLITE_STANDALONE
#import <sqlite3/sqlite3.h>
#else
#import <sqlite3.h>
#endif


@interface FMDatabaseTests : FMDBTempDBTests

@end
Expand Down Expand Up @@ -804,7 +811,7 @@ - (void)testCustomFunction
[self.db executeUpdate:@"insert into ftest values ('not h!')"];
[self.db executeUpdate:@"insert into ftest values ('definitely not h!')"];

[self.db makeFunctionNamed:@"StringStartsWithH" maximumArguments:1 withBlock:^(sqlite3_context *context, int aargc, sqlite3_value **aargv) {
[self.db makeFunctionNamed:@"StringStartsWithH" maximumArguments:1 withBlock:^(void *context, int aargc, void **aargv) {
if (sqlite3_value_type(aargv[0]) == SQLITE_TEXT) {

@autoreleasepool {
Expand Down Expand Up @@ -833,7 +840,7 @@ - (void)testCustomFunction
}

- (void)testVersionNumber {
XCTAssertTrue([FMDatabase FMDBVersion] == 0x0250); // this is going to break everytime we bump it.
XCTAssertTrue([FMDatabase FMDBVersion] == 0x0260); // this is going to break everytime we bump it.
}

- (void)testExecuteStatements
Expand Down
6 changes: 6 additions & 0 deletions Tests/FMResultSetTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
#import "FMDatabase.h"
#import "FMResultSet.h"

#if FMDB_SQLITE_STANDALONE
#import <sqlite3/sqlite3.h>
#else
#import <sqlite3.h>
#endif

@interface FMResultSetTests : FMDBTempDBTests

@end
Expand Down
Loading