Commit Graph

570 Commits

Author SHA1 Message Date
August Mueller
7397e456a6 Version bump. 2018-09-18 10:18:48 -07:00
August Mueller
54062d16e8 Merge branch 'cnoon-feature/xcode-10-support' 2018-09-18 10:13:51 -07:00
Christian Noon
a5218b4ce1 Fixed localization issue with InfoPlist.strings for test target 2018-09-17 17:55:31 -07:00
Christian Noon
a28dbb5f38 Updated the Xcode compatibility version from 3.2 to 8.0 2018-09-17 17:49:20 -07:00
Christian Noon
90cfa12b37 Updated the Xcode project to Xcode 10 and accepted all project updates 2018-09-17 17:48:47 -07:00
August Mueller
d57bab8d63 fix a warning for folks. 2018-09-05 11:08:31 -07:00
August Mueller
a161fc45be Well, we should make sure this actually compiles. 2018-08-16 22:01:35 -07:00
August "Gus" Mueller
e5ef469ae1
Merge pull request #697 from jhammer/localized-string-table
Use NSLocalizedStringFromTable
2018-08-14 14:30:45 -07:00
August "Gus" Mueller
c27491ecaf
Merge pull request #696 from jfahrenkrug/mark_dateformatter_method_args_nullable
Mark the setDateFormat method's parameter as _Nullable
2018-08-14 14:25:01 -07:00
Jonathan Hammer
3ce5c0a994
Use NSLocalizedStringFromTable
Use NSLocalizedStringFromTable instead of NSLocalizedString in order to avoid polluting the global Localizable.strings table
2018-08-14 13:07:36 -07:00
Jonathan Hammer
3426909a8a
Use NSLocalizedStringFromTable
Use NSLocalizedStringFromTable instead of NSLocalizedString in order to avoid polluting the global Localizable.strings table
2018-08-14 13:06:47 -07:00
Jonathan Hammer
17ac6f37da
Use NSLocalizedStringFromTable
Use NSLocalizedStringFromTable instead of NSLocalizedString in order to avoid polluting the global Localizable.strings table
2018-08-14 13:05:44 -07:00
Jonathan Hammer
439559d887
Use NSLocalizedStringFromTable
Use NSLocalizedStringFromTable instead of NSLocalizedString in order to avoid polluting the global Localizable.strings table
2018-08-14 13:05:04 -07:00
Jonathan Hammer
8ea3d1f224
Switch to NSLocalizedStringFromTable
Use NSLocalizedStringFromTable instead of NSLocalizedString in order to avoid polluting the global Localizable.strings table.
2018-08-14 13:03:34 -07:00
Johannes Fahrenkrug
7566f036fa The setDateFormat: method explicitly allows a nil parameter to reset to default
Passing in nil resets the DB to use a default unix format. At the moment calling
this method with nil raises a warning in Xcode because it is marked as nonnull
because of the NS_ASSUME_NONNULL_BEGIN marcro.

This commit marks it correctly as _Nullable.
2018-08-14 09:34:38 -07:00
August "Gus" Mueller
1b09ecae13
Merge pull request #683 from qmoya/patch-1
Fix errors
2018-07-10 09:43:21 -07:00
Quico Moya
4b4b8f5b2a
Update README.markdown 2018-07-10 16:49:35 +02:00
August Mueller
928b71de83 Cleanup for the static analyzer. 2018-06-26 15:49:08 -07:00
August "Gus" Mueller
61828b418a
Merge pull request #677 from philippec/master
Added attributes to method implementations
2018-06-09 08:57:40 -07:00
Philippe Casgrain
3de4910a34 Added attributes to method implementations
In Xcode 10, if the `__attribute__((noescape))` is present in the header file,
it must also be present in the implementation.
2018-06-05 10:38:25 -07:00
August Mueller
114ca97f5e Merge branch 'rob2468-master' 2018-06-01 12:19:07 -07:00
August Mueller
4cdedc7801 Merge branch 'master' of git://github.com/rob2468/fmdb into rob2468-master 2018-06-01 12:15:59 -07:00
August "Gus" Mueller
18152d3ea8
Merge pull request #672 from R4N/sqlcipher-header
Adds SQLCipher to the HEADER_SEARCH_PATHS of FMDB within the SQLCiphe…
2018-05-22 13:00:08 -07:00
Micah Moore
b0d1bcbd2b Consolidates header search paths into the same line as other SQLCipher subspec xcconfig. 2018-05-21 13:07:02 -04:00
jam.chenjun
4b03d3f0ed bugfix, -[FMDatabase executeStatements:withResultBlock:] method has potential crash bugs, for setting nil object as NSMutableDictionary value 2018-05-21 20:05:08 +08:00
jam.chenjun
06e97b996b add unit test case for -[FMDatabase executeStatements:withResultBlock:], SELECT records with blob fields 2018-05-21 20:02:09 +08:00
Micah Moore
d78bdcef51 Only sets HEADER_SEARCH_PATHS to SQLCipher in the podspec for subspec SQLCipher. 2018-05-17 16:46:01 -04:00
Micah Moore
4bd04f7bee Adds SQLCipher to the HEADER_SEARCH_PATHS of FMDB within the SQLCipher subspec. 2018-05-17 09:56:05 -04:00
August "Gus" Mueller
fa03304c67
Merge pull request #651 from PaxLabs/schema-nullability
Update nullability annotations for `-[FMDatabase getSchema]` and `-[FMDatabase getTableSchema]`
2018-03-01 13:36:00 -08:00
Eric Amorde
d0fbec49a2 Update nullability annotations for -[FMDatabase getSchema] and -[FMDatabase getTableSchema] 2018-03-01 11:27:10 -08:00
August Mueller
240667c4d4 A nicer way to import < https://github.com/ccgus/fmdb/issues/628 ) 2018-02-18 13:12:49 -08:00
August Mueller
f847caed10 typo fix 2018-02-18 12:57:55 -08:00
August "Gus" Mueller
f36732ca5c
Merge pull request #645 from hankinsoft/master
Fix for 'This function declaration is not a prototype'.
2018-02-15 09:30:38 -08:00
Kyle Hankinson
465e4cff34 + Fix for 'This function declaration is not a prototype'. 2018-02-15 11:45:45 -04:00
August "Gus" Mueller
8d6ef7a4f4
Merge pull request #636 from robertmryan/master
Refine close logic
2017-12-19 08:59:34 -08:00
Robert M. Ryan
b9c456867b Refine close logic
- If you call `[db close]`, it should reset `isOpen` to false;
- When you try to use `[queue database]`, it should not only check that the `FMDatabase` is non-nil, but also whether the database is open or not;
- Added `testClose` test to `FMDatabaseQueue` logic if the queue's `FMDatabase` was closed.
2017-12-18 15:59:18 -08:00
August "Gus" Mueller
ab79803c86
Merge pull request #629 from rupey/master
Added build target for watchOS
2017-11-28 09:49:08 -08:00
Rupert Hanson
44c01d7da7 Added build target for watchOS 2017-11-27 20:31:04 +11:00
August "Gus" Mueller
efcfb3cc79
Merge pull request #621 from robertmryan/master
Fix isOpen logic
2017-10-28 15:28:18 -07:00
Robert M. Ryan
884ee3dc41 Fix isOpen logic
`FMDatabase` was previously checking `_db` to determine whether the opening of a database was successful or not. But that's not a valid assumption. If you had previously attempted to open a database and it failed, _it still returns a `sqlite*` pointer._ As the [`sqlite_open` documentation](http://sqlite.org/c3ref/open.html) says (emphasis added):

> _Whether or not an error occurs_ when it is opened, resources associated with the [database connection](http://sqlite.org/c3ref/sqlite3.html) handle should be released by passing it to [sqlite3_close()](http://sqlite.org/c3ref/close.html) when it is no longer required.

The reason this is important is that if an `openWithOptions` failed (e.g. opening from application support directory without `SQLITE_OPEN_CREATE` option), you want to be able to fix the problem (copy database from bundle to destination directory) and then try `openWithOptions` again. But because the `open` method was checking the existence of `_db` as evidence whether it was successfully opened or not, it was falsely reporting that the second attempt to reopen the database was successful, even though it didn't even try.

So, I created a test case that manifested this problem, `testOpenFailure`, and then modified `FMDatabase` accordingly. I could have made this a private property, but I saw no downside in exposing this in the public interface.

As a more general note, the reason I'm doing this is I've been seeing examples on the interwebs where people were (a) checking for existence of database; (b) if not there, copying one from bundle; and (c) then opening database. But this is not a practice that Apple advocates. One should really just (a) try to open (without create option) and if it failed, only then (b) copy from bundle and try again. As [they say](https://developer.apple.com/documentation/foundation/nsfilemanager/1415645-fileexistsatpath?language=objc):

> Note
>
> Attempting to predicate behavior based on the current state of the file system or a particular file on the file system is not recommended. Doing so can cause odd behavior or race conditions. It’s far better to attempt an operation (such as loading a file or creating a directory), check for errors, and handle those errors gracefully than it is to try to figure out ahead of time whether the operation will succeed. For more information on file-system race conditions, see [Race Conditions and Secure File Operations](https://developer.apple.com/library/content/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html#//apple_ref/doc/uid/TP40002585) in [Secure Coding Guide](https://developer.apple.com/library/content/documentation/Security/Conceptual/SecureCodingGuide/Introduction.html#//apple_ref/doc/uid/TP40002415).
2017-10-27 13:01:31 -07:00
August "Gus" Mueller
e0fcde9a0e Merge pull request #620 from robertmryan/master
Update transactions
2017-10-24 09:30:13 -07:00
Robert M. Ryan
1da3a20b00 Update comments for online documentation 2017-10-24 00:21:37 -07:00
Robert M. Ryan
cb92845077 Update transactions
- Add explicit exclusive transaction code
- Add warning to beginTransaction and inTransaction calls that while it's currently exclusive, we reserve the right to change this in the future
- Add a few tests while I was here
2017-10-24 00:09:25 -07:00
Robert M. Ryan
7ebbfd055c Bump version to 2.7.3 2017-10-20 20:57:11 -07:00
Robert M. Ryan
78ea4d9221 Revise README
- Eliminate discussion of `FMDatabaseQueue` no longer being optional in 2.7, because it actually is.
- Given new Apple guidance regarding "Documents" vs "Application Support", changed Swift example to use the latter instead of the former.
2017-10-20 20:41:35 -07:00
Rob Ryan
b4bd097249 Merge pull request #609 from benasher44/basher/transaction-checkpoint-support
Added support for immediate transactions and checkpoint
2017-10-20 20:26:45 -07:00
Rob Ryan
a76844e317 Merge pull request #606 from robotive/master
Fixed nullability annotations for various FMDatabaseQueue initializers.
2017-10-20 20:26:20 -07:00
August Mueller
e384164490 Fix for a memory leak ( via https://github.com/ccgus/fmdb/issues/615 ) 2017-09-26 10:59:33 -07:00
Ben Asher
89d699a694 Add tests 2017-09-11 13:54:10 -07:00
Ben Asher
3475cb2c53 Merge pull request #1 from robertmryan/basher/transaction-checkpoint-support
Checkpoint tweaks
2017-09-11 10:19:00 -07:00