Releases: Nike-Inc/SQift
Swift 4, Hooks, Backups, and Query APIs
Released on 2017-10-25. All issues associated with this milestone can be found using this filter.
Breaking Changes
The SQift 3.0.0 release is a MAJOR version bump that comes with many new APIs and a few breaking changes worth calling out.
Swift 4
The SQift 3 release has been converted to only support Swift 4. If you need to use Swift 3.2 or earlier, please stick with the latest SQift 2.x release until you can move to Swift 4.
Sequence Conformance on Statement
The biggest source code change in SQift 3 was the removal of Sequence
conformance on Statement
. This change was made because it's not safe to assume errors will not be encountered while stepping through a result set.
New Query APIs
New query
APIs have been added to safely iterate through a result set and throw if an error is encountered. These are meant to replace the Sequence
conformance on Statement
and are safer and more robust as well.
The fetch
APIs have also been removed and replaced with new query
variants. SQift 3 unifies all SQL "queries" underneath the query
APIs. The ExpressibleByRow
protocol was also added to make it easier to convert result sets to model objects.
Non-Optional Query APIs
The other breaking change worth noting is the removal of non-optional query
APIs. In SQift 2.x, you could query for non-optional Extractable
values directly. SQift would internally force unwrap the optional value for you. In SQift 3, these APIs have been removed entirely for safety reasons.
Generic Subscripts on Row
Swift 4 added the ability to make use of generics in subscripts. This means that you no longer need to write custom extensions on Row
to support your own custom bindings. We were able to delete all the custom subscript functions in SQift itself for each of the primitive type bindings.
Release Notes
Added
- A new test verifying that
Connection
supports FTS4 out-of-the-box. - New
query
APIs toConnection
andStatement
to replace theSequence
conformance onStatement
. - Better support for converting result sets into model objects through the
ExpressibleByRow
andExpressibleByRowError
types. - New APIs allowing you to query for
Column
information for each column in aRow
. - A
SQL
typealias used throughout the codebase to represent SQL statement strings. - Support to
Connection
for interrupts. - Support to
Statement
to query for busy, read-only status, and bound SQL. BaseTestCase
class to the test suite to help DRY up the tests.- Support to
Connection
to checkpoint a WAL database. - Support to
Connection
for wiring up a busy handler or busy timeout. - Support to
Connection
for update, commit, and rollback hooks. - Support to
Connection
to backup database with progress monitoring, cancellation, and pausing. - The ability to add an
Authorizer
to aConnection
to prevent certain types of statements from being executed. - Support for codable bindings along with array, set, and dictionary bindings.
- Database test demonstrating how a shared cache can compensate for checkpoint gaps in WAL databases.
- Deployment and documentation groups to the Xcode project.
- LICENSE and NOTICE documents to the project.
Updated
- The trace and transaction APIs to use Swift boxes instead of Objective-C block typealiases.
- The Xcode project and source code to compile against Swift 4 only.
- The
Row
subscript APIs to leverage generic subscripts in Swift 4 so you no longer need to write you own. - The source code structure by separating out
Connection
extensions into separate files. - The Xcode project to
import SQLite3
directly rather than including thesqlite3.h
header. - The copyright headers throughout the project to conform to the LICENSE.
Removed
- The
Sequence
conformance onStatement
since stepping through the result set can throw an error in certain conditions. - The
fetch
APIs fromStatement
andConnection
and replaced with newquery
APIs. - The non-optional
query
APIs onConnection
due to them being unsafe.