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
andCodable
now profit from automatic JSON encoding and decoding.๐ 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 newDatabase.allStatements()
method.
-
v5.8.0 Changes
๐ Released May 16, 2021 • diff
- ๐ New: Support for the
ESCAPE
clause with theLIKE
operator. ๐ New: You can now define an
SQLRequest
without any generic qualifier (which defaults toRow
):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 (onQueryInterfaceRequest
).๐ 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.
- ๐ New: Support for the
-
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 forSQL
.
- ๐ Fixed: Really fix breaking change and restore
-
v5.7.1 Changes
- ๐ Fixed: Fix breaking change and restore
SQLLiteral
as a deprecated alias forSQL
.
- ๐ Fixed: Fix breaking change and restore
-
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 renamedSQL
.๐ 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
andNOT 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 tolimit
,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 makesDatabaseQueue
a type suitable for shared databases.๐ Fixed:
DatabaseQueue.read
is now declaredthrows
instead ofrethrows
.๐ 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.