3.29.0 - Major overhaul of the entire SQLKit package
This is expected to be the last release of SQLKit version 3.
A hopefully complete (but probably not) list of significant changes:
- A massive sweep to add at least minimal documentation to everything in the package.
- 100% test coverage.
- Reorganized the source code layout
- Require Swift 5.8
- Package is now
ExistentialAny
-compliant - Numerous poorly-designed APIs have been deprecated. Replacement suggestions are available in all cases.
- 100%
Sendable
-complaint (zero concurrency warnings). SQLDatabaseReportedVersion
is nowEquatable
andComparable
, as it ought to have been from the start.- Efficiency improvements for the
async
versions of various APIs. SQLQueryEncoder
andSQLRowDecoder
have been massively overhauled; both are now considerably more flexible and less restrictive.SQLBenchmark
is nowasync
.- Numerous ugly
assert()
s andprint()
s are now consistently routed through the database's logger instead, and less noisy logging is done. - Several bits of missing functionality in
SQLCreateTrigger
are now correctly implemented. SQLIdentifier
andSQLLiteral.string
now automatically escape the appropriate quote characters when serializing.- Added
SQLBetween
(x BETWEEN y AND z
),SQLQualifiedTable
(schema.table
),SQLSubquery
andSQLSubqueryBuilder
,SQLUnqualifiedColumnListBuilder
, andSQLAliasedColumnListBuilder
. SQLPredicateBuilder
andSQLSecondaryPredicateBuilder
now provide 1-to-1 corresponding APIs for all four variants ("and where", "and having", "or where", "or having").- Serialization of expressions is now a bit faster across the board.
SQLInsert
andSQLInsertBuilder
now support theINSERT ... SELECT
syntax.SQLQueryFetcher
gained a number of convenience APIs for decoding models and single columns. Several builders also gained convenience methods for encoding or decoding of models. (Note that "models" in this usage does NOT refer to Fluent'sModel
protocol, but rather to anyCodable
structure.)SQLDropBehavior
is now used by all builders that support the modifier and respects the current dialect properly.SQLCreateIndex
now supports index predicates.SQLDistinct
now serializes correctly.- Several expressions and queries are now more tolerant of missing configuration when serialized.
SQLDatabase
gained awithSession(_:)
API which, when implemented correctly by drivers, allows implementing transactions safely using pure SQLKit (no need for Fluent-level or driver-level intervention).SQLColumnConstraintAlgorithm.primaryKey
no longer emits incorrect SQL if the active dialect usesNULL
as itsDEFAULT
literal.