forked from ccgus/fmdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To use FMDB in framework, one should eliminate all non-modular headers. The main culprit here is `#import <sqlite3.h>`. The thing is, FMDB uses SQLite types and constants in these headers, so they had to be removed. 1. Removed `#import <sqlite3.h>` from all of the headers. 2. Moved `sqlite3` and `sqlite3_stmt` declarations in `FMDatabase.h` into `FMDatabasePrivate.h`. FMDB source that needs these will now `#import "FMDatabasePrivate.h" and will have access to them. 3. Removed `#if SQLITE_VERSION_NUMBER >= xxx` logic from the headers. 4. `lastInsertRowId` now returns `long long int`, not `sqlite3_int64`. 5. `sqliteHandle` now returns `void *` not `sqlite3 *`. 6. The `savepoint` and `release savepoint` and `rollback` now always compile regardless of SQLite version (but you'll get SQLite errors if you try those commands with earlier SQLite versions). 7. `makeFunctionNamed` has changed the block parameter type. 8. The FMDatabaseAdditions routines for `applicationID`, much like the `savepoint` routines, will be compiled regardless of SQLite version. 9. Some random usage of deferencing ivars from another class have been replaced with accessor methods. Note, with all of these changes, in order to conform to modular headers, this is not entirely backward compatible. They'll have to make changes if - If they referenced the `_db` variable themselves (which they shouldn't be doing anyway; this never should have been in the public interface to start with); - If they referenced `_statement` variable of `FMStatement` (which is even less likely); or - If they used `makeFunctionNamed`, the signature of the block has changed (now uses `void` instead of SQLite types). See issue ccgus#309.
- Loading branch information
1 parent
1b346b5
commit 11f6701
Showing
12 changed files
with
68 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// FMDatabase+Private.h | ||
// deleteme2 | ||
// | ||
// Created by Robert Ryan on 8/2/15. | ||
// Copyright (c) 2015 Robert Ryan. All rights reserved. | ||
// | ||
|
||
#ifndef deleteme2_FMDatabase_Private_h | ||
#define deleteme2_FMDatabase_Private_h | ||
|
||
#import <sqlite3.h> | ||
|
||
@class FMDatabase; | ||
@class FMStatement; | ||
|
||
@interface FMDatabase (Private) | ||
|
||
/** SQLite sqlite3 | ||
@see [`sqlite3`](http://www.sqlite.org/c3ref/sqlite3.html) | ||
*/ | ||
|
||
@property (nonatomic, assign, readonly) sqlite3 *db; | ||
|
||
@end | ||
|
||
@interface FMStatement (Private) | ||
|
||
/** SQLite sqlite3_stmt | ||
@see [`sqlite3_stmt`](http://www.sqlite.org/c3ref/stmt.html) | ||
*/ | ||
|
||
@property (nonatomic, assign) sqlite3_stmt *statement; | ||
|
||
@end | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "sqlite3.h" | ||
|
||
@class FMDatabase; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "sqlite3.h" | ||
|
||
@class FMDatabase; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
#import "FMDatabaseQueue.h" | ||
#import "FMDatabase.h" | ||
#import "FMDatabase+Private.h" | ||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters