Skip to content

3.29.0 - Major overhaul of the entire SQLKit package

Compare
Choose a tag to compare
@gwynne gwynne released this 13 Apr 20:08
· 8 commits to main since this release
f1263a2

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 now Equatable and Comparable, as it ought to have been from the start.
  • Efficiency improvements for the async versions of various APIs.
  • SQLQueryEncoder and SQLRowDecoder have been massively overhauled; both are now considerably more flexible and less restrictive.
  • SQLBenchmark is now async.
  • Numerous ugly assert()s and print()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 and SQLLiteral.string now automatically escape the appropriate quote characters when serializing.
  • Added SQLBetween (x BETWEEN y AND z), SQLQualifiedTable (schema.table), SQLSubquery and SQLSubqueryBuilder, SQLUnqualifiedColumnListBuilder, and SQLAliasedColumnListBuilder.
  • SQLPredicateBuilder and SQLSecondaryPredicateBuilder 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 and SQLInsertBuilder now support the INSERT ... 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's Model protocol, but rather to any Codable 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 a withSession(_:) 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 uses NULL as its DEFAULT literal.