Skip to content

Commit d40474d

Browse files
committed
Merge branch 'development'
2 parents 98ca653 + 6850749 commit d40474d

File tree

24 files changed

+796
-201
lines changed

24 files changed

+796
-201
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
77

88
#### 5.x Releases
99

10+
- `5.21.x` Releases - [5.21.0](#5210)
1011
- `5.20.x` Releases - [5.20.0](#5200)
1112
- `5.19.x` Releases - [5.19.0](#5190)
1213
- `5.18.x` Releases - [5.18.0](#5180)
@@ -87,6 +88,14 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
8788

8889
---
8990

91+
## 5.21.0
92+
93+
Released February 6, 2022 • [diff](https://github.com/groue/GRDB.swift/compare/v5.20.0...v5.21.0)
94+
95+
- **New**: [#1165](https://github.com/groue/GRDB.swift/pull/1165) by [@guidedways](https://github.com/guidedways): Support dynamic linking via Swift Package Manager
96+
- **Breaking Change**: [#1164](https://github.com/groue/GRDB.swift/pull/1164) by [@groue](https://github.com/groue): Drop experimental async apis from DatabaseMigrator
97+
98+
9099
## 5.20.0
91100

92101
Released February 1, 2022 • [diff](https://github.com/groue/GRDB.swift/compare/v5.19.0...v5.20.0)

Documentation/FullTextSearch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ let pattern = FTS3Pattern(matchingAnyTokenIn: "") // nil
304304
let pattern = FTS3Pattern(matchingAnyTokenIn: "*") // nil
305305
```
306306

307-
FTS3Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/5.20/Structs/StatementArguments.html):
307+
FTS3Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/5.21/Structs/StatementArguments.html):
308308

309309
```swift
310310
let documents = try Document.fetchAll(db,
@@ -587,7 +587,7 @@ let pattern = FTS5Pattern(matchingAnyTokenIn: "") // nil
587587
let pattern = FTS5Pattern(matchingAnyTokenIn: "*") // nil
588588
```
589589

590-
FTS5Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/5.20/Structs/StatementArguments.html):
590+
FTS5Pattern are regular [values](../README.md#values). You can use them as query [arguments](http://groue.github.io/GRDB.swift/docs/5.21/Structs/StatementArguments.html):
591591

592592
```swift
593593
let documents = try Document.fetchAll(db,

Documentation/Migrations.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ try dbQueue.read { db in
7777
}
7878
```
7979

80-
See the [DatabaseMigrator reference](http://groue.github.io/GRDB.swift/docs/5.20/Structs/DatabaseMigrator.html) for more migrator methods.
80+
See the [DatabaseMigrator reference](http://groue.github.io/GRDB.swift/docs/5.21/Structs/DatabaseMigrator.html) for more migrator methods.
8181

8282

8383
## The `eraseDatabaseOnSchemaChange` Option
@@ -268,13 +268,7 @@ while let violation = try violations.next() {
268268

269269
## Asynchronous Migrations
270270

271-
`DatabaseMigrator` provides three ways to migrate a database in an asynchronous way.
272-
273-
The async `migrate()` method:
274-
275-
```swift
276-
try await migrator.migrate(dbQueue)
277-
```
271+
`DatabaseMigrator` provides the following ways to migrate a database in an asynchronous way.
278272

279273
The `asyncMigrate(_:completion:)` method:
280274

GRDB.swift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'GRDB.swift'
3-
s.version = '5.20.0'
3+
s.version = '5.21.0'
44

55
s.license = { :type => 'MIT', :file => 'LICENSE' }
66
s.summary = 'A toolkit for SQLite databases, with a focus on application development.'

GRDB/Migration/DatabaseMigrator.swift

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Combine
33
#endif
44
import Foundation
55

6+
// TODO: provide concurrent apis for migrations that run @Sendable closures.
67
/// A DatabaseMigrator registers and applies database migrations.
78
///
89
/// Migrations are named blocks of SQL statements that are guaranteed to be
@@ -196,33 +197,13 @@ public struct DatabaseMigrator {
196197
/// - parameter writer: A DatabaseWriter (DatabaseQueue or DatabasePool)
197198
/// where migrations should apply.
198199
/// - throws: An eventual error thrown by the registered migration blocks.
199-
@_disfavoredOverload // SR-15150 Async overloading in protocol implementation fails
200200
public func migrate(_ writer: DatabaseWriter) throws {
201201
guard let lastMigration = _migrations.last else {
202202
return
203203
}
204204
try migrate(writer, upTo: lastMigration.identifier)
205205
}
206206

207-
#if compiler(>=5.5.2) && canImport(_Concurrency)
208-
/// Iterate migrations in the same order as they were registered. If a
209-
/// migration has not yet been applied, its block is executed in
210-
/// a transaction.
211-
///
212-
/// [**Experimental**](http://github.com/groue/GRDB.swift#what-are-experimental-features)
213-
///
214-
/// - parameter writer: A DatabaseWriter (DatabaseQueue or DatabasePool)
215-
/// where migrations should apply.
216-
/// - throws: An eventual error thrown by the registered migration blocks.
217-
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
218-
public func migrate(_ writer: DatabaseWriter) async throws {
219-
guard let lastMigration = _migrations.last else {
220-
return
221-
}
222-
try await migrate(writer, upTo: lastMigration.identifier)
223-
}
224-
#endif
225-
226207
/// Iterate migrations in the same order as they were registered, up to the
227208
/// provided target. If a migration has not yet been applied, its block is
228209
/// executed in a transaction.
@@ -231,32 +212,12 @@ public struct DatabaseMigrator {
231212
/// where migrations should apply.
232213
/// - parameter targetIdentifier: The identifier of a registered migration.
233214
/// - throws: An eventual error thrown by the registered migration blocks.
234-
@_disfavoredOverload // SR-15150 Async overloading in protocol implementation fails
235215
public func migrate(_ writer: DatabaseWriter, upTo targetIdentifier: String) throws {
236216
try writer.barrierWriteWithoutTransaction { db in
237217
try migrate(db, upTo: targetIdentifier)
238218
}
239219
}
240220

241-
#if compiler(>=5.5.2) && canImport(_Concurrency)
242-
/// Iterate migrations in the same order as they were registered, up to the
243-
/// provided target. If a migration has not yet been applied, its block is
244-
/// executed in a transaction.
245-
///
246-
/// [**Experimental**](http://github.com/groue/GRDB.swift#what-are-experimental-features)
247-
///
248-
/// - parameter writer: A DatabaseWriter (DatabaseQueue or DatabasePool)
249-
/// where migrations should apply.
250-
/// - parameter targetIdentifier: The identifier of a registered migration.
251-
/// - throws: An eventual error thrown by the registered migration blocks.
252-
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
253-
public func migrate(_ writer: DatabaseWriter, upTo targetIdentifier: String) async throws {
254-
try await writer.barrierWriteWithoutTransaction { [self] db in
255-
try migrate(db, upTo: targetIdentifier)
256-
}
257-
}
258-
#endif
259-
260221
/// Iterate migrations in the same order as they were registered. If a
261222
/// migration has not yet been applied, its block is executed in
262223
/// a transaction.

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ test_install_manual:
379379
clean build \
380380
$(XCPRETTY)
381381

382-
test_install_SPM: test_install_SPM_Package test_install_SPM_Project test_install_SPM_macos_release test_install_SPM_ios_release
382+
test_install_SPM: test_install_SPM_Package test_install_SPM_Project test_install_SPM_Dynamic_Project test_install_SPM_macos_release test_install_SPM_ios_release
383383

384384
test_install_SPM_Package:
385385
cd Tests/SPM/PlainPackage && \
@@ -393,6 +393,15 @@ test_install_SPM_Project:
393393
-configuration Release \
394394
clean build \
395395
$(XCPRETTY)
396+
397+
test_install_SPM_Dynamic_Project:
398+
$(XCODEBUILD) \
399+
-project Tests/SPM/ios-dynamic/ios-dynamic.xcodeproj \
400+
-scheme ios-dynamic \
401+
-destination $(MAX_IOS_DESTINATION) \
402+
-configuration Release \
403+
clean build \
404+
$(XCPRETTY)
396405

397406
test_install_SPM_macos_release:
398407
$(XCODEBUILD) \
@@ -520,10 +529,10 @@ ifdef JAZZY
520529
--author 'Gwendal Roué' \
521530
--author_url https://github.com/groue \
522531
--github_url https://github.com/groue/GRDB.swift \
523-
--github-file-prefix https://github.com/groue/GRDB.swift/tree/v5.20.0 \
524-
--module-version 5.20.0 \
532+
--github-file-prefix https://github.com/groue/GRDB.swift/tree/v5.21.0 \
533+
--module-version 5.21.0 \
525534
--module GRDB \
526-
--root-url http://groue.github.io/GRDB.swift/docs/5.20/ \
535+
--root-url http://groue.github.io/GRDB.swift/docs/5.21/ \
527536
--output Documentation/Reference \
528537
--xcodebuild-arguments -project,GRDB.xcodeproj,-scheme,GRDBiOS
529538
else

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ let package = Package(
1313
],
1414
products: [
1515
.library(name: "GRDB", targets: ["GRDB"]),
16+
.library(name: "GRDB-dynamic", type: .dynamic, targets: ["GRDB"]),
1617
],
1718
dependencies: [
1819
],

0 commit comments

Comments
 (0)