Releases: groue/GRDB.swift
v7.9.0
A new release of the Swift toolkit for SQLite databases.
What's Changed
-
BREAKING CHANGE: Simplify the compiler checks for the availability of SQLite snapshots by @groue in #1826
This change aims at easing Linux and Android compatibility.
The library requirements are raised to Swift 6.1+, Xcode 16.3+.
-
BREAKING CHANGE: Accept multiple SQLCipher libraries by @groue in #1819
This change aims at easing building GRDB against various SQLCipher flavors.
The compiler flag that enables new GRDB APIs for SQLCipher is now
SQLITE_HAS_CODEC. -
Fix cancellation of async tasks that use the FTS5 full-text engine. by @groue in #1839
This workarounds an SQLite bug that would trigger a GRDB crash, and improves the robustness of the library regarding cancellation and interruption of database accesses.
-
Improve the ergonomics of
DatabaseMigrator.registerMigration(_:foreignKeyChecks:merging:migrate)by accepting that the name of the merged migration is included in the set of merged migrations:// Used to fail, now OK: migrator.registerMigration("v3", merging: ["v1", "v2", "v3"]) { ... } // ~~~~ ~~~~ // The above code is equivalent to: migrator.registerMigration("v3", merging: ["v1", "v2"]) { ... }
Full Changelog: v7.8.0...v7.9.0
v7.8.0
v7.7.1
v7.7.0
A new release of the Swift toolkit for SQLite databases.
What's Changed
- Fix: add
Sendableconformance toDispatchQueueExecutoron Linux by @alephao in #1814 - Support for Xcode 26 by @groue in #1813
- Persistable Database Views by @groue in #1810 — see View Records
- Update
GRDB7MigrationGuide.mdreference by @emmanuel-ferdman in #1807 - Fix a race condition regarding Task cancellation, completing #1797
New Contributors
- @emmanuel-ferdman made their first contribution in #1807
- @alephao made their first contribution in #1814
Full Changelog: v7.6.1...v7.7.0
v7.6.1
v7.6.0
A new release of the Swift toolkit for SQLite databases.
Caution
this release has a race condition regarding cancelled async database accesses. Please upgrade to v7.6.1.
What's Changed
- All closures that accept DatabaseComponents can throw by @groue in #1768
- Add Sendable conformance to DatabasePreUpdateEvent.Kind, matching DatabaseEvent.Kind by @Jason-Abbott in #1773
- Add custom build instruction for hardened runtime by @Jason-Abbott in #1776
- Access task locals from asynchronous database accesses by @groue in #1794
- Throwing row accessors by @groue in #1796
Full Changelog: v7.5.0...v7.6.0
v7.5.0
A new release of the Swift toolkit for SQLite databases.
GRDB 7.5.0 brings a new way to write database requests
// GRDB 7.4
let count = try Player.filter(Column("score") >= 1000).fetchCount(db)
let players = try Player.order(Column("score")).fetchAll(db)
// NEW with GRDB 7.5.0
let count = try Player.filter { $0.score >= 1000 }.fetchCount(db)
let players = try Player.order(\.score).fetchAll(db)Record types profit from this new syntax if they define a nested Columns enum. If you follow the Recommended Practices for Designing Record Types, this Columns enum is already defined, and you can profit from the new syntax right away.
With Swift 6.1+, Table Aliases have learned to use the Columns enum:
// GRDB 7.4
let authorAlias = TableAlias()
let request = Book
.joining(required: Book.author.aliased(authorAlias))
.order(authorAlias[Column("name")], Column("publishDate"))
// NEW with GRDB 7.5.0 and Swift 6.1
let authorAlias = TableAlias<Author>()
let request = Book
.joining(required: Book.author.aliased(authorAlias))
.order { [authorAlias.name, $0.publishDate] }Breaking Changes
The benefits of this release are so important that two breaking changes were shipped:
-
If you define a
publicrecord type with a nestedColumnsenum, you have to make this enumpublicas well.public struct Player: FetchableRecord, PersistableRecord { - enum Columns { ... } + public enum Columns { ... } } -
TableAliasis now a generic type. This will break existing code that accepts aTableAliasas an argument. You will have to make those methods generic as well.
What's Changed
- Make it possible to create a raw FTS5Pattern without any database connection by @groue in #1764
- Build request with closures by @groue in #1759
Full Changelog: v7.4.1...v7.5.0
v7.4.1
A new release of the Swift toolkit for SQLite databases.
What's Changed
- Removed a compiler warning.
Full Changelog: v7.4.0...v7.4.1
v7.4.0
A new release of the Swift toolkit for SQLite databases.
This release is a recommended upgrade: it fixes unexpected ValueObservation failures in applications that perform asynchronous writes from a Task that gets cancelled.
What's Changed
- Add the MIN and MAX multi-argument SQL functions to the query interface by @groue in #1745
- Transaction observers are not impacted by Task Cancellation by @groue in #1747
Full Changelog: v7.3.0...v7.4.0