diff --git a/Documentation/ReleaseProcess.md b/Documentation/ReleaseProcess.md index e721dbd7e..249d22130 100644 --- a/Documentation/ReleaseProcess.md +++ b/Documentation/ReleaseProcess.md @@ -18,14 +18,12 @@ To release a new GRDB version: - Documentation/CustomSQLiteBuilds.md - GRDB.swift.podspec - GRDBCipher.podspec - - GRDBPlus.podspec - README.md - Support/Info.plist - Commit and tag - Check tag authors: `git for-each-ref --format '%(refname) %(authorname)' refs/tags` - Push to the master branch - `pod trunk push --allow-warnings GRDB.swift.podspec` -- `pod trunk push --allow-warnings GRDBPlus.podspec` - `pod trunk push --allow-warnings GRDBCipher.podspec` - `make doc`, and update index.html in the `gh-pages` branch - Update http://github.com/groue/WWDCCompanion diff --git a/GRDB/Core/Support/Foundation/SQLiteDateParser.swift b/GRDB/Core/Support/Foundation/SQLiteDateParser.swift index ba2f83814..cd42663c0 100644 --- a/GRDB/Core/Support/Foundation/SQLiteDateParser.swift +++ b/GRDB/Core/Support/Foundation/SQLiteDateParser.swift @@ -23,16 +23,20 @@ class SQLiteDateParser { func components(cString: UnsafePointer, length: Int) -> DatabaseDateComponents? { assert(strlen(cString) == length) + // "HH:MM" is the shortest valid string guard length >= 5 else { return nil } - if cString.advanced(by: 4).pointee == 45 /* '-' */ { + // "YYYY-..." -> datetime + if cString[4] == UInt8(ascii: "-") { return datetimeComponents(cString: cString, length: length) } - if cString.advanced(by: 2).pointee == 58 /* ':' */ { + // "HH-:..." -> time + if cString[2] == UInt8(ascii: ":") { return timeComponents(cString: cString, length: length) } + // Invalid return nil } diff --git a/README.md b/README.md index e0475b41b..fc3e43641 100644 --- a/README.md +++ b/README.md @@ -5132,12 +5132,25 @@ let documents = try Document.filter(Column("content").match(pattern)).fetchAll(d When the FTS3 and FTS4 full-text engines don't suit your needs, you may want to use FTS5. See [Choosing the Full-Text Engine](#choosing-the-full-text-engine) to help you make a decision. The version of SQLite that ships with iOS, macOS and watchOS does not always support the FTS5 engine. To enable FTS5 support, you'll need to install GRDB with one of those installation techniques: - -1. Use the GRDBPlus CocoaPod. It uses the system SQLite, and requires iOS 11.4+ / macOS 10.13+ / watchOS 4.3+: - + +1. Use the GRDB.swift CocoaPod with a custom compilation option, as below. It uses the system SQLite, which is compiled with FTS5 support, but only on iOS 11.4+ / macOS 10.13+ / watchOS 4.3+: + ```ruby - pod 'GRDBPlus' + pod 'GRDB.swift' + platform :ios, '11.4' # or above + + post_install do |installer| + installer.pods_project.targets.select { |target| target.name == "GRDB.swift" }.each do |target| + target.build_configurations.each do |config| + config.build_settings['OTHER_SWIFT_FLAGS'] = "$(inherited) -D SQLITE_ENABLE_FTS5" + end + end + end ``` + + > :warning: **Warning**: make sure you use the right platform version! You will get runtime errors on devices with a lower version. + + > :point_up: **Note**: there used to be a GRDBPlus CocoaPod with pre-enabled FTS5 support. This CocoaPod is deprecated: please switch to the above technique. 2. Use the GRDBCipher CocoaPod. It uses SQLCipher (see [encryption](#encryption)), and requires iOS 9.0+ / macOS 10.9+ / watchOS 2.0+: @@ -8625,7 +8638,7 @@ Sample Code **Thanks** - [Pierlis](http://pierlis.com), where we write great software. -- [@bellebethcooper](https://github.com/bellebethcooper), [@bfad](https://github.com/bfad), [@cfilipov](https://github.com/cfilipov), [@Chiliec](https://github.com/Chiliec), [@darrenclark](https://github.com/darrenclark), [@fpillet](http://github.com/fpillet), [@gusrota](https://github.com/gusrota), [@hartbit](https://github.com/hartbit), [@kdubb](https://github.com/kdubb), [@kluufger](https://github.com/kluufger), [@KyleLeneau](https://github.com/KyleLeneau), [@Marus](https://github.com/Marus), [@pakko972](https://github.com/pakko972), [@peter-ss](https://github.com/peter-ss), [@pierlo](https://github.com/pierlo), [@pocketpixels](https://github.com/pocketpixels), [@schveiguy](https://github.com/schveiguy), [@SD10](https://github.com/SD10), [@sobri909](https://github.com/sobri909), [@sroddy](https://github.com/sroddy), [@swiftlyfalling](https://github.com/swiftlyfalling), [@valexa](https://github.com/valexa), and [@zmeyc](https://github.com/zmeyc) for their contributions, help, and feedback on GRDB. +- [@bellebethcooper](https://github.com/bellebethcooper), [@bfad](https://github.com/bfad), [@cfilipov](https://github.com/cfilipov), [@Chiliec](https://github.com/Chiliec), [@darrenclark](https://github.com/darrenclark), [@davidkraus](https://github.com/davidkraus), [@fpillet](http://github.com/fpillet), [@gusrota](https://github.com/gusrota), [@hartbit](https://github.com/hartbit), [@kdubb](https://github.com/kdubb), [@kluufger](https://github.com/kluufger), [@KyleLeneau](https://github.com/KyleLeneau), [@Marus](https://github.com/Marus), [@pakko972](https://github.com/pakko972), [@peter-ss](https://github.com/peter-ss), [@pierlo](https://github.com/pierlo), [@pocketpixels](https://github.com/pocketpixels), [@schveiguy](https://github.com/schveiguy), [@SD10](https://github.com/SD10), [@sobri909](https://github.com/sobri909), [@sroddy](https://github.com/sroddy), [@swiftlyfalling](https://github.com/swiftlyfalling), [@valexa](https://github.com/valexa), and [@zmeyc](https://github.com/zmeyc) for their contributions, help, and feedback on GRDB. - [@aymerick](https://github.com/aymerick) and [@kali](https://github.com/kali) because SQL. - [ccgus/fmdb](https://github.com/ccgus/fmdb) for its excellency.