You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -131,6 +131,18 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
131
131
132
132
---
133
133
134
+
## 7.0.0-beta.7
135
+
136
+
Released January 19, 2025
137
+
138
+
- **New**: Select all columns from a table, but a few ones by [@groue](https://github.com/groue) in [#1700](https://github.com/groue/GRDB.swift/pull/1700)
139
+
- **Fixed**: Fix typo in Readme.md by [@kevinlg](https://github.com/kevinlg) in [#1697](https://github.com/groue/GRDB.swift/pull/1697)
140
+
- **New**: Bump custom SQLite to 3.47.2 by [@groue](https://github.com/groue) in [#1696](https://github.com/groue/GRDB.swift/pull/1696)
141
+
- **Fixed**: Update LICENSE, fix copyright license year by [@JasonnnW3000](https://github.com/JasonnnW3000) in [#1695](https://github.com/groue/GRDB.swift/pull/1695)
142
+
- **Fixed**: Core: import `ucrt` on Windows for `strcmp` by [@compnerd](https://github.com/compnerd) in [#1662](https://github.com/groue/GRDB.swift/pull/1662)
143
+
- **Fixed**: Foundation: elide extensions on Windows to match Linux by [@compnerd](https://github.com/compnerd) in [#1661](https://github.com/groue/GRDB.swift/pull/1661)
144
+
- **Fixed**: Docs: fixes typos "FST"->"FTS" by [@nylki](https://github.com/nylki) in [#1660](https://github.com/groue/GRDB.swift/pull/1660)
145
+
134
146
## 7.0.0-beta.6
135
147
136
148
Released October 13, 2024
@@ -172,7 +184,7 @@ Released September 29, 2024
172
184
173
185
[Migrating From GRDB 6 to GRDB 7](Documentation/GRDB7MigrationGuide.md) describes in detail how to bump the GRDB version in your application.
174
186
175
-
The new [Swift Concurrency and GRDB](https://swiftpackageindex.com/groue/grdb.swift/v7.0.0-beta.6/documentation/grdb/swiftconcurrency) guide explains how to best integrate GRDB and Swift Concurrency.
187
+
The new [Swift Concurrency and GRDB](https://swiftpackageindex.com/groue/grdb.swift/v7.0.0-beta.7/documentation/grdb/swiftconcurrency) guide explains how to best integrate GRDB and Swift Concurrency.
176
188
177
189
The [demo app](Documentation/DemoApps/) was rewritten from scratch in a brand new Xcode 16 project.
Copy file name to clipboardExpand all lines: Documentation/CustomSQLiteBuilds.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ Custom SQLite Builds
3
3
4
4
By default, GRDB uses the version of SQLite that ships with the target operating system.
5
5
6
-
**You can build GRDB with a custom build of [SQLite 3.46.1](https://www.sqlite.org/changes.html).**
6
+
**You can build GRDB with a custom build of [SQLite 3.47.2](https://www.sqlite.org/changes.html).**
7
7
8
8
A custom SQLite build can activate extra SQLite features, and extra GRDB features as well, such as support for the [FTS5 full-text search engine](../../../#full-text-search), and [SQLite Pre-Update Hooks](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/transactionobserver).
Copy file name to clipboardExpand all lines: Documentation/FTS5Tokenizers.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ FTS5 Tokenizers
3
3
4
4
**[FTS5](https://www.sqlite.org/fts5.html) is an extensible full-text search engine.**
5
5
6
-
GRDB lets you define your own custom FST5 tokenizers, and extend SQLite built-in tokenizers. Possible use cases are:
6
+
GRDB lets you define your own custom FTS5 tokenizers, and extend SQLite built-in tokenizers. Possible use cases are:
7
7
8
8
- Have "fi" match the ligature "fi" (U+FB01)
9
9
- Have "first" match "1st"
@@ -95,7 +95,7 @@ let documents = try Document.matching(pattern).fetchAll(db)
95
95
96
96
## FTS5Tokenizer
97
97
98
-
**FST5Tokenizer** is the protocol for all FTS5 tokenizers.
98
+
**FTS5Tokenizer** is the protocol for all FTS5 tokenizers.
99
99
100
100
It only requires a tokenization method that matches the low-level `xTokenize` C function documented at https://www.sqlite.org/fts5.html#custom_tokenizers. We'll discuss it more when describing custom tokenizers.
Copy file name to clipboardExpand all lines: Documentation/FullTextSearch.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ Generally speaking, FTS5 is better than FTS4 which improves on FTS3. But this do
82
82
83
83
-**The location of the indexed text in your database schema.** Only FTS4 and FTS5 support "contentless" and "external content" tables.
84
84
85
-
- See [FST3 vs. FTS4](https://www.sqlite.org/fts3.html#differences_between_fts3_and_fts4) and [FTS5 vs. FTS3/4](https://www.sqlite.org/fts5.html#appendix_a) for more differences.
85
+
- See [FTS3 vs. FTS4](https://www.sqlite.org/fts3.html#differences_between_fts3_and_fts4) and [FTS5 vs. FTS3/4](https://www.sqlite.org/fts5.html#appendix_a) for more differences.
86
86
87
87
> **Note**: In case you were still wondering, it is recommended to read the SQLite documentation: [FTS3 & FTS4](https://www.sqlite.org/fts3.html) and [FTS5](https://www.sqlite.org/fts5.html).
Copy file name to clipboardExpand all lines: Documentation/GRDB7MigrationGuide.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -228,7 +228,7 @@ Do not miss [Swift Concurrency and GRDB], for more recommendations regarding non
228
228
- The async sequence returned by [`ValueObservation.values`](https://swiftpackageindex.com/groue/grdb.swiftdocumentation/grdb/valueobservation/values(in:scheduling:bufferingpolicy:)) now iterates on the cooperative thread pool by default. Use .mainActor as the scheduler if you need the previous behavior.
229
229
230
230
[Migrating to Swift 6]: https://www.swift.org/migration/documentation/migrationguide
231
-
[Sharing a Database]: https://swiftpackageindex.com/groue/grdb.swift/v7.0.0-beta.6/documentation/grdb/databasesharing
In the Swift 5 language mode, the compiler emits a warning when a database access is written with the shorthand closure notation:
50
+
51
+
```swift
52
+
// Standard closure:
53
+
let count =tryawait writer.read { db in
54
+
try Player.fetchCount(db)
55
+
}
56
+
57
+
// Shorthand notation:
58
+
// ⚠️ Converting non-sendable function value to '@Sendable (Database)
59
+
// throws -> Int' may introduce data races.
60
+
let count =tryawait writer.read(Player.fetchCount)
61
+
```
62
+
63
+
**You can remove this warning** by enabling [SE-0418: Inferring `Sendable` for methods and key path literals](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0418-inferring-sendable-for-methods.md), as below:
64
+
65
+
-**Using Xcode**
66
+
67
+
Set `SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES` to `YES` in the build settings of your target.
68
+
69
+
-**In a SwiftPM package manifest**
70
+
71
+
Enable the `InferSendableFromCaptures` upcoming feature:
This language feature is not enabled by default, because it can potentially [affect source compatibility](https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/sourcecompatibility#Inferring-Sendable-for-methods-and-key-path-literals).
83
+
84
+
### Non-Sendable Configuration of Record Types
85
+
86
+
In the Swift 6 language mode, and in the Swift 5 language mode with strict concurrency checkings, the compiler emits an error or a warning when a record type specifies which columns it fetches from the database, with the ``TableRecord/databaseSelection-7iphs`` static property:
In the Swift 6 language mode, and in the Swift 5 language mode with strict concurrency checkings, the compiler emits an error or a warning when the application reads, writes, or observes a non-[`Sendable`](https://developer.apple.com/documentation/swift/sendable) type.
@@ -128,97 +190,6 @@ You do not need to perform this refactoring right away: you can compile your app
128
190
129
191
Yes. Classes that can not be modified, made of constant `let` properties, are Sendable. Those immutable classes will not make it easy to modify the database, though.
130
192
131
-
#### FAQ: Why this Sendable requirement?
132
-
133
-
**GRDB needs new features in the Swift language and the SDKs in order to deal with non-Sendable types.**
134
-
135
-
[SE-0430: `sending` parameter and result values](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0430-transferring-parameters-and-results.md) looks like the language feature we need, but:
136
-
137
-
-`DispatchQueue.async` does not accept a `sending` closure. GRDB needs this in order to accept non-Sendable records to be sent to the database, as below:
138
-
139
-
```swift
140
-
let nonSendableRecord: Player
141
-
tryawait writer.write { db in
142
-
try nonSendableRecord.insert(db)
143
-
}
144
-
```
145
-
146
-
Please [file a feedback](http://feedbackassistant.apple.com) for requesting this DispatchQueue improvement. The more the merrier. I personally filed FB15270949.
147
-
148
-
- Database access methods taint the values they fetch. In the code below, the rules of [SE-0414: Region based Isolation](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0414-region-based-isolation.md) have the compiler refuse that the fetched player is sent back to the caller:
149
-
150
-
```swift
151
-
let player =tryawait writer.read { db in
152
-
try Player.fetchOne(db, id: 42)
153
-
}
154
-
```
155
-
156
-
Strictly speaking, the compiler diagnostic is correct: one could copy the non-Sendable `db` argument into the fetched `Player` instance, making it unsuitable for later use. In practice, nobody does that. Copying `db` is a programmer error, and GRDB promptly raises a fatal error whenever a `db` copy would be improperly used. But there is no way to tell the compiler about this practice.
157
-
158
-
For all those reasons, GRDB has to require values that are asynchronously written and read from the database to be `Sendable`.
159
-
160
-
### Shorthand Closure Notation
161
-
162
-
In the Swift 5 language mode, the compiler emits a warning when a database access is written with the shorthand closure notation:
163
-
164
-
```swift
165
-
// Standard closure:
166
-
let count =tryawait writer.read { db in
167
-
try Player.fetchCount(db)
168
-
}
169
-
170
-
// Shorthand notation:
171
-
// ⚠️ Converting non-sendable function value to '@Sendable (Database)
172
-
// throws -> Int' may introduce data races.
173
-
let count =tryawait writer.read(Player.fetchCount)
174
-
```
175
-
176
-
**You can remove this warning** by enabling [SE-0418: Inferring `Sendable` for methods and key path literals](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0418-inferring-sendable-for-methods.md), as below:
177
-
178
-
-**Using Xcode**
179
-
180
-
Set `SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES` to `YES` in the build settings of your target.
181
-
182
-
-**In a SwiftPM package manifest**
183
-
184
-
Enable the `InferSendableFromCaptures` upcoming feature:
This language feature is not enabled by default, because it can potentially [affect source compatibility](https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/sourcecompatibility#Inferring-Sendable-for-methods-and-key-path-literals).
196
-
197
-
### Non-Sendable Configuration of Record Types
198
-
199
-
In the Swift 6 language mode, and in the Swift 5 language mode with strict concurrency checkings, the compiler emits an error or a warning when a record type specifies which columns it fetches from the database, with the ``TableRecord/databaseSelection-7iphs`` static property:
### Choosing between Synchronous and Asynchronous Database Accesses
223
194
224
195
GRDB connections provide two versions of `read` and `write`, one that is synchronous, and one that is asynchronous. It might not be clear how to choose one or the other.
0 commit comments