Skip to content

Releases: groue/GRDB.swift

v7.5.0

11 May 12:44
Compare
Choose a tag to compare

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 public record type with a nested Columns enum, you have to make this enum public as well.

     public struct Player: FetchableRecord, PersistableRecord {
    -  enum Columns { ... }
    +  public enum Columns { ... }
     }
  • TableAlias is now a generic type. This will break existing code that accepts a TableAlias as 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

28 Mar 07:20
Compare
Choose a tag to compare

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

22 Mar 14:04
Compare
Choose a tag to compare

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

v7.3.0

23 Feb 18:57
Compare
Choose a tag to compare

A new release of the Swift toolkit for SQLite databases.

What's Changed

Full Changelog: v7.2.0...v7.3.0

7.2.0

12 Feb 13:32
Compare
Choose a tag to compare

A new release of the Swift toolkit for SQLite databases.

What's Changed

Full Changelog: v7.1.0...v7.2.0

7.1.0

05 Feb 14:58
Compare
Choose a tag to compare

A new release of the Swift toolkit for SQLite databases.

What's Changed

  • New: Expose sqlite3_libversion_number as Database.sqliteLibVersionNumber by @groue in #1713
  • Fix: DatabaseQueue restores its read/write abilities when an async read-only database access is cancelled. by @groue in #1716
  • New: Allow RxGRDB to compile without warning by @groue in #1717

Full Changelog: v7.0.0...v7.1.0

7.0.0

26 Jan 17:14
Compare
Choose a tag to compare

A new release of the Swift toolkit for SQLite databases.

GRDB 7 is Xcode 16 and Swift 6 ready!

To upgrade, please follow the migration guide.

Raising the Swift concurrency checkings of Swift 6 can create compiler warnings. The new Swift Concurrency and GRDB guide is there to help you use GRDB from your Swift 6 code.

If you are looking for inspiration, the demo app was rewritten from scratch in a brand new Xcode 16 project.

What's Changed

  • 7.0.0-beta
    • Breaking Change: Bump requirements by @groue in #1598 and #1634
    • Breaking Change: enhance ergonomics of record methods that insert/save/upsert and fetch by @groue in #1599
    • Breaking Change: Rename the CSQLite module to GRDBSQLite, and stop exporting the C SQLite functions. by @groue in #1600
    • Breaking Change: Perform all writes with immediate transactions by default by @groue in #1602
    • Breaking Change: Remove DatabasePool.concurrentRead by @groue in #1603
    • Breaking Change: Coding strategies depend on the column by @groue in #1606
    • Breaking Change: Add missing Sendable conformances by @groue in #1607 and #1639
    • Breaking Change: Async database accesses honor Task cancellation by @groue in #1610
    • Breaking Change: Prefer Collection over Sequence for filter(keys:) and related APIs by @groue in #1617
    • Breaking Change: MainActor ValueObservation scheduling by @groue in #1633
    • Breaking Change: prefer any DatabaseReader and DatabaseWriter by @groue in #1635
    • DatabaseCursor has a primary associated type by @groue in #1605
    • Sendable database accesses by @groue in #1618
    • New demo app by @groue in #1636
    • Migration Guide by @groue in #1638
    • Stop mentioning the Record base class in the documentation by @groue in #1640
    • Enable the Swift 6 language mode by @groue in #1641
  • 7.0.0-beta.2
  • 7.0.0-beta.3
    • use #if directives to conditionally @preconcurrency import the Dispatch module to enable building the package on linux by @tayloraswift in #1644
    • Add coalesce free function and Row method by @philmitchell in #1645
    • Add DatabaseValueConvertible tip for JSON columns by @bok- in #1649
  • 7.0.0-beta.4
    • Allow applications to handle DatabaseMigrator schema changes. by @groue in #1651
  • 7.0.0-beta.5
    • Fix DatabaseMigrator.hasSchemaChanges failing for readonly connections by @Jnosh in #1653
    • Enhance the database schema documentation by @groue in #1652
  • 7.0.0-beta.6
    • Bump custom SQLite builds to 3.46.1 by @groue in #1654
  • 7.0.0-beta.7
  • 7.0.0
    • Breaking Change: Fix inflections of Bias, Focus, Gas, and Lens by @groue in #1703
    • Support for JSONB expressions by @groue in #1699

New Contributors

Full Changelog: v6.29.3...v7.0.0

v7.0.0-beta.7

19 Jan 17:26
Compare
Choose a tag to compare
v7.0.0-beta.7 Pre-release
Pre-release

A new release of the Swift toolkit for SQLite databases.

What's Changed

New Contributors

Full Changelog: v7.0.0-beta.6...v7.0.0-beta.7

v7.0.0-beta.6

13 Oct 17:15
Compare
Choose a tag to compare
v7.0.0-beta.6 Pre-release
Pre-release

A new release of the Swift toolkit for SQLite databases.

What's Changed

  • Bump custom SQLite builds to 3.46.1 by @groue in #1654

Full Changelog: v7.0.0-beta.5...v7.0.0-beta.6

v7.0.0-beta.5

13 Oct 10:20
Compare
Choose a tag to compare
v7.0.0-beta.5 Pre-release
Pre-release

A new release of the Swift toolkit for SQLite databases.

What's Changed

  • Fix DatabaseMigrator.hasSchemaChanges failing for readonly connections by @Jnosh in #1653
  • Enhance the database schema documentation by @groue in #1652

New Contributors

Full Changelog: v7.0.0-beta.4...v7.0.0-beta.5