All Versions
267
Latest Version
Avg Release Cycle
15 days
Latest Release
-

Changelog History
Page 4

  • v5.9.0 Changes

    ๐Ÿš€ Released August 15, 2021 • diff

    • ๐Ÿ›  Fixed: #980 by @jroselightricks: Fix spelling
    • ๐Ÿ›  Fixed: #989 by @pp5x: FTS: add support of ifNotExists in synchronize()
    • ๐Ÿ›  Fixed: #999: request(for: association) no longer crashes when the foreign key contains a NULL value.
    • ๐Ÿ›  Fixed: #1025 by @mattgallagher: Fix ValueObservation crash
    • ๐Ÿ›  Fixed: Fix thread unsafety in ValueObservation.print()
    • ๐Ÿ†• New: The selectID() method is now available for [Identifiable Records](README.md#identifiable-records)
    • ๐Ÿ†• New: Cached prepared statements can profit from [SQL Interpolation](Documentation/SQLInterpolation.md):

      let updateStatement = try db.cachedStatement(literal: "INSERT ...")
      //                                           ~~~~~~~
      
    • ๐Ÿ†• New: #993 by @groue: QueryInterfaceRequest builder with dynamic table/view name

    • ๐Ÿ†• New: Types that adopt both DatabaseValueConvertible and Codable now profit from automatic JSON encoding and decoding.

    • ๐Ÿ†• New: #1010 by @tternes: Add VACUUM INTO Support

    • ๐Ÿ†• New: #1012 by @ZevEisenberg: Add brackets to urls in doc comments to make them clickable

    • ๐Ÿ†• New: #1019 by @groue: Merge prepared statement types, and introduce statement cursor

    • ๐Ÿ“š Documentation Update: The [Requests](README.md#requests) chapter was updated for the new Table type that can build requests without any record type.

    • ๐Ÿ“š Documentation Update: The [Custom Value Types](README.md#custom-value-types) chapter was extended about the new support for codable value types encoded as JSON arrays or objects.

    • ๐Ÿ“š Documentation Update: The [Fetching Methods](README.md#fetching-methods) and [Prepared Statements](README.md#prepared-statements) chapters have been updated for the unique Statement class, and the new Database.allStatements() method.

  • v5.8.0 Changes

    ๐Ÿš€ Released May 16, 2021 • diff

    • ๐Ÿ†• New: Support for the ESCAPE clause with the LIKE operator.
    • ๐Ÿ†• New: You can now define an SQLRequest without any generic qualifier (which defaults to Row):

      let request = SQLRequest("SELECT ...")
      
    • ๐Ÿ†• New: #967 by @steipete: Make SelectStatement conform to CustomStringConvertible

    • ๐Ÿ›  Fixed: The DerivableRequest.limit(_:offset:) method was ill-designed, and removed from the documentation. It is unfortunately impossible to deprecate it without triggering warnings on the legit use cases (on QueryInterfaceRequest).

    • ๐Ÿ›  Fixed: #973: Restore access to attached databases from record types

    • ๐Ÿ›  Fixed: #974: Provide access to included associations when root table is not selected

    • ๐Ÿ“š Documentation Update: A new [Query Interface Organization](Documentation/QueryInterfaceOrganization.md) document reveals the relationship between the various components of the GRDB query builder.

  • v5.7.4 Changes

    ๐Ÿš€ Released April 11, 2021 • diff

    • ๐Ÿ†• New: #953: Refactor the SwiftUI demo app
    • ๐Ÿ›  Fixed: #955 by @steipete: Robustness of @Query in the SwiftUI demo app
    • ๐Ÿ›  Fixed: #956: Fix case-sensitivity of region-based database observation
    • ๐Ÿ†• New: #958 by @chrisballinger: Always add userInfo to databaseJSONDecoder and databaseJSONEncoder
    • ๐Ÿ†• New: #960 by @MartinP7r: Add tests for userInfo being applied to database encoder/decoder
  • v5.7.3 Changes

    ๐Ÿš€ Released April 5, 2021 • diff

    • ๐Ÿ›  Fixed: #950 by @MartinP7r: Fix memory consumption when encoding JSON columns
    • ๐Ÿ›  Fixed: #951 by @alexwlchan: Fix documentation typo
    • ๐Ÿ›  Fixed: #952 by @holsety: Fix documentation typo
    • ๐Ÿ“š Documentation Update: #953: Refactor the SwiftUI demo app
  • v5.7.2 Changes

    • ๐Ÿ›  Fixed: Really fix breaking change and restore SQLLiteral as a deprecated alias for SQL.
  • v5.7.1 Changes

    • ๐Ÿ›  Fixed: Fix breaking change and restore SQLLiteral as a deprecated alias for SQL.
  • v5.7.0 Changes

    ๐Ÿš€ Released March 28, 2021 • diff

    • ๐Ÿ†• New: #947 by @chrisballinger: Allow access to Encoder from KeyedEncodingContainer

    • ๐Ÿ†• New: Record types that adopt the standard Identifiable protocol have gained type-safe methods that deal with the primary key. For example:

      let player = try Player.fetchOne(db, id: 42)
      try Player.deleteAll(db, ids: [1, 2, 3])
      

      See the new [Identifiable Records](README.md#identifiable-records) documentation chapter for more information.

    • ๐Ÿ†• New: SQLLiteral has more use cases than initialy expected, and is renamed SQL.

    • ๐Ÿ†• New: [SQL literal](Documentation/SQLInterpolation.md#sql-literal) can now be directly used as an expression, an ordering term, or a selection item.:

      let name = "O'Brien"
      let request = Player
          .select(SQL("id, score"), ...)
          .filter(SQL("name = \(name)") && ...)
          .order(SQL("score DESC"), ...)
      
    • ๐Ÿ†• New: Table creation DSL now supports columns and constraints defined with raw SQL String or [SQL literal](Documentation/SQLInterpolation.md#sql-literal):

      try db.create(table: "player") do { t in
          t.column(sql: "id INTEGER PRIMARY KEY AUTOINCREMENT")
          t.column(literal: "name TEXT DEFAULT \("Anonymous")")
          t.constraint(sql: "CHECK (LENGTH(name) > 0)")
          t.constraint(literal: "CHECK (LENGTH(name) <= \(100))")
      }
      
    • ๐Ÿ†• New: Prepared statements can profit from [SQL Interpolation](Documentation/SQLInterpolation.md):

      let updateStatement = try db.makeUpdateStatement(literal: "INSERT ...")
      let selectStatement = try db.makeSelectStatement(literal: "SELECT ...")
      //                                               ~~~~~~~
      
    • ๐Ÿ†• New: [DatabaseMigrator](Documentation/Migrations.md#asynchronous-migrations) can now asynchronously migrate a database. A Combine publisher is also available.

    • ๐Ÿ†• New: Added support for the EXISTS and NOT EXISTS subquery operators. See the updated [SQL Operators](README.md#sql-operators) documentation.

    • ๐Ÿ†• New: Foundation.Decimal can now be stored in the database, and all Foundation number types can be decoded from decimal numbers stored as strings. See the [NSNumber, NSDecimalNumber, and Decimal](README.md#nsnumber-nsdecimalnumber-and-decimal) chapter for details.

  • v5.6.0 Changes

    ๐Ÿš€ Released March 12, 2021 • diff

    • ๐Ÿ›  Fixed: #933: Fix DatabaseMigrator.eraseDatabaseOnSchemaChange in the context of shared databases

    • ๐Ÿ›  Fixed: #934: Fix a crash in the ValueObservation publisher

    • ๐Ÿ†• New: #936: Complete Associations and the DerivableRequest Protocol

    • ๐Ÿ†• New: Database cursors can feed more standard Swift collections: Array(cursor, minimumCapacity: ...), Dictionary(uniqueKeysWithValues: cursor), etc (see [Cursors](README.md#cursors)).

    • ๐Ÿ“š Documentation update: The [Associations Guide](Documentation/AssociationsBasics.md) has gained a new [Further Refinements to Associations](Documentation/AssociationsBasics.md#further-refinements-to-associations) chapter which shows the new association methods brought by #936.

    • ๐Ÿ“š Documentation update: The [Good Practices for Designing Record Types](Documentation/GoodPracticesForDesigningRecordTypes.md) guide has an updated [Define Record Requests](Documentation/GoodPracticesForDesigningRecordTypes.md#define-record-requests) chapter, now that the DerivableRequest protocol has access to limit, distinct, group, having, association aggregates, and common table expressions.

    • ๐Ÿ“š Documentation update: The [Good Practices for Designing Record Types](Documentation/GoodPracticesForDesigningRecordTypes.md) guide has a new chapter of good practices: [Record Types Hide Intimate Database Details](Documentation/GoodPracticesForDesigningRecordTypes.md#record-types-hide-intimate-database-details).

    • ๐Ÿ“š Documentation update: A new [Single-Row Tables](Documentation/SingleRowTables.md) guide provides guidance for designing tables that store configuration values, user preferences, and generally some global application state.

  • v5.5.0 Changes

    ๐Ÿš€ Released March 3, 2021 • diff

    • ๐Ÿ†• New: You can now define common table expressions without any generic qualifier (which defaults to Row):

      let cte = CommonTableExpression(...)
      

      The [Common Table Expressions Guide](Documentation/CommonTableExpressions.md) was updated accordingly.

    • ๐Ÿ†• New: DatabaseQueue reading methods are now wrapped in a deferred transaction. This guarantees snapshot isolation in case of concurrent writes performed by external connections, and makes DatabaseQueue a type suitable for shared databases.

    • ๐Ÿ›  Fixed: DatabaseQueue.read is now declared throws instead of rethrows.

    • ๐Ÿ›  Fixed: #930: Fix SQL generation for COLLATE, IN, NOT IN

  • v5.4.0 Changes

    ๐Ÿš€ Released February 15, 2021 • diff

    • ๐Ÿ’ฅ Breaking Change: The query interface was refactored and some types such as SQLExpression are no longer a protocol.

      This may break some applications that rely on Swift type inference, such as in the following example:

      // No longer compiles
      let values = [Column("score"), Column("score") + Column("bonus")]
      

      The fix is to add an explicit declaration of the desired type:

      // A possible fix
      let values: [SQLExpressible] = [Column("score"), Column("score") + Column("bonus")]
      

      Occurrences of such code breakage should be very rare.

    • ๐Ÿ†• New: [SQL Interpolation](Documentation/SQLInterpolation.md) supports embedding collations into SQL literals:

      let request: SQLRequest<Player> = "SELECT * FROM player ORDER BY email COLLATION \(.nocase)"
      let request: SQLRequest<Player> = "SELECT * FROM player ORDER BY name COLLATION \(.localizedCompare)"
      
    • ๐Ÿ“š Documentation update: [Adding support for missing SQL functions or operators](README.md#adding-support-for-missing-sql-functions-or-operators) explains how to extend the query interface when needed.

    • ๐Ÿ“š Documentation update: The [Demo Applications](Documentation/DemoApps/) now provide tests for the database access layer.