GRDB.swift v4.2.0 Release Notes

Release Date: 2019-08-06 // 13 days ago
  • 🚀 Released August 6, 2019 • diff

    🆕 New

    • #570 by @chrisballinger: Allow Swift static library integration via CocoaPods
    • #576: Expose table name and full-text filtering methods to DerivableRequest
    • #586: Automatic region tracking for ValueObservation

    🛠 Fixed

    • #560 by @bellebethcooper: Minor typo fix
    • #562: Fix crash when using more than one DatabaseCollation
    • #577: Rename aliased(_:) methods to forKey(_:)
    • #585: Fix use of SQLite authorizers

    Other

    • #563: More tests for eager loading of hasMany associations
    • 👕 #574: SwiftLint

    📚 Documentation Diff

    ⚡️ The [ValueObservation](README.md#valueobservation) chapter has been updated so that it fosters the new ValueObservation.tracking(value:) method. Other ways to define observations are now described as optimizations.

    API Diff

    -protocol DerivableRequest: FilteredRequest, JoinableRequest, OrderedRequest, SelectionRequest { }
    +protocol DerivableRequest: FilteredRequest, JoinableRequest, OrderedRequest, SelectionRequest, TableRequest { }
    
    -extension QueryInterfaceRequest {
    -    func matching(_ pattern: FTS3Pattern?) -> QueryInterfaceRequest<T>
    -}
    -extension QueryInterfaceRequest {
    -    func matching(_ pattern: FTS5Pattern?) -> QueryInterfaceRequest<T>
    -}
    +extension TableRequest where Self: FilteredRequest {
    +    func matching(_ pattern: FTS3Pattern?) -> Self
    +}
    +extension TableRequest where Self: FilteredRequest {
    +    func matching(_ pattern: FTS5Pattern?) -> Self
    +}
    
     protocol Association: DerivableRequest {
    -    associatedtype OriginRowDecoder
    +    associatedtype OriginRowDecoder: TableRecord
     }
    
    -struct BelongsToAssociation<Origin, Destination>: AssociationToOne { }
    -struct HasManyAssociation<Origin, Destination>: AssociationToMany { }
    -struct HasManyThroughAssociation<Origin, Destination>: AssociationToMany { }
    -struct HasOneAssociation<Origin, Destination>: AssociationToOne { }
    -struct HasOneThroughAssociation<Origin, Destination>: AssociationToOne { }
    +struct BelongsToAssociation<Origin: TableRecord, Destination: TableRecord>: AssociationToOne { }
    +struct HasManyAssociation<Origin: TableRecord, Destination: TableRecord>: AssociationToMany { }
    +struct HasManyThroughAssociation<Origin: TableRecord, Destination: TableRecord>: AssociationToMany { }
    +struct HasOneAssociation<Origin: TableRecord, Destination: TableRecord>: AssociationToOne { }
    +struct HasOneThroughAssociation<Origin: TableRecord, Destination: TableRecord>: AssociationToOne { }
    
    -struct QueryInterfaceRequest<T>: DerivableRequest { }
    +struct QueryInterfaceRequest<T>: FilteredRequest, OrderedRequest, SelectionRequest, TableRequuest { }
    +extension QueryInterfaceRequest: JoinableRequest where T: TableRecord { }
    +extension QueryInterfaceRequest: DerivableRequest where T: TableRecord { }
    
     extension AssociationAggregate {
    +    @available(*, deprecated, renamed: "forKey(_:)")
         func aliased(_ name: String) -> AssociationAggregate<RowDecoder>
    +    func forKey(_ name: String) -> AssociationAggregate<RowDecoder>
    
    +    @available(*, deprecated, renamed: "forKey(_:)")
         func aliased(_ key: CodingKey) -> AssociationAggregate<RowDecoder>
    +    func forKey(_ key: CodingKey) -> AssociationAggregate<RowDecoder>
     }
    
     extension SQLSpecificExpressible {
    +    @available(*, deprecated, renamed: "forKey(_:)")
         func aliased(_ name: String) -> SQLSelectable
    +    func forKey(_ name: String) -> SQLSelectable
    
    +    @available(*, deprecated, renamed: "forKey(_:)")
         func aliased(_ key: CodingKey) -> SQLSelectable
    +    func forKey(_ key: CodingKey) -> SQLSelectable
     }
    
     extension ValueObservation where Reducer == Void {
    +    static func tracking<Value>(fetch: @escaping (Database) throws -> Value) -> ValueObservation<ValueReducers.Fetch<Value>>
     }