Skip to content

Commit 8330469

Browse files
committed
Merge branch 'development'
2 parents 2d31ed4 + 72f56a1 commit 8330469

File tree

114 files changed

+3906
-2266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+3906
-2266
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ Podfile.lock
106106

107107
# SPM
108108
.build
109-
.swiftpm/
110109
GRDB.xcworkspace/xcshareddata/swiftpm
111110
#Package.resolved
112111
Tests/SPM/Packages

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1410"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "GRDB_GRDBTests"
18+
BuildableName = "GRDB_GRDBTests"
19+
BlueprintName = "GRDB_GRDBTests"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "GRDB"
32+
BuildableName = "GRDB"
33+
BlueprintName = "GRDB"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "YES"
41+
buildForArchiving = "YES"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "GRDB-dynamic"
46+
BuildableName = "GRDB-dynamic"
47+
BlueprintName = "GRDB-dynamic"
48+
ReferencedContainer = "container:">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
<BuildActionEntry
52+
buildForTesting = "YES"
53+
buildForRunning = "YES"
54+
buildForProfiling = "NO"
55+
buildForArchiving = "NO"
56+
buildForAnalyzing = "YES">
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "GRDBTests"
60+
BuildableName = "GRDBTests"
61+
BlueprintName = "GRDBTests"
62+
ReferencedContainer = "container:">
63+
</BuildableReference>
64+
</BuildActionEntry>
65+
<BuildActionEntry
66+
buildForTesting = "YES"
67+
buildForRunning = "YES"
68+
buildForProfiling = "YES"
69+
buildForArchiving = "YES"
70+
buildForAnalyzing = "YES">
71+
<BuildableReference
72+
BuildableIdentifier = "primary"
73+
BlueprintIdentifier = "CSQLite"
74+
BuildableName = "CSQLite"
75+
BlueprintName = "CSQLite"
76+
ReferencedContainer = "container:">
77+
</BuildableReference>
78+
</BuildActionEntry>
79+
</BuildActionEntries>
80+
</BuildAction>
81+
<TestAction
82+
buildConfiguration = "Debug"
83+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
84+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
85+
shouldUseLaunchSchemeArgsEnv = "YES">
86+
<Testables>
87+
<TestableReference
88+
skipped = "NO"
89+
parallelizable = "YES">
90+
<BuildableReference
91+
BuildableIdentifier = "primary"
92+
BlueprintIdentifier = "GRDBTests"
93+
BuildableName = "GRDBTests"
94+
BlueprintName = "GRDBTests"
95+
ReferencedContainer = "container:">
96+
</BuildableReference>
97+
</TestableReference>
98+
</Testables>
99+
</TestAction>
100+
<LaunchAction
101+
buildConfiguration = "Debug"
102+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
103+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
104+
launchStyle = "0"
105+
useCustomWorkingDirectory = "NO"
106+
ignoresPersistentStateOnLaunch = "NO"
107+
debugDocumentVersioning = "YES"
108+
debugServiceExtension = "internal"
109+
allowLocationSimulation = "YES">
110+
</LaunchAction>
111+
<ProfileAction
112+
buildConfiguration = "Release"
113+
shouldUseLaunchSchemeArgsEnv = "YES"
114+
savedToolIdentifier = ""
115+
useCustomWorkingDirectory = "NO"
116+
debugDocumentVersioning = "YES">
117+
<MacroExpansion>
118+
<BuildableReference
119+
BuildableIdentifier = "primary"
120+
BlueprintIdentifier = "GRDB_GRDBTests"
121+
BuildableName = "GRDB_GRDBTests"
122+
BlueprintName = "GRDB_GRDBTests"
123+
ReferencedContainer = "container:">
124+
</BuildableReference>
125+
</MacroExpansion>
126+
</ProfileAction>
127+
<AnalyzeAction
128+
buildConfiguration = "Debug">
129+
</AnalyzeAction>
130+
<ArchiveAction
131+
buildConfiguration = "Release"
132+
revealArchiveInOrganizer = "YES">
133+
</ArchiveAction>
134+
</Scheme>

CHANGELOG.md

Lines changed: 14 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
#### 6.x Releases
99

10+
- `6.4.x` Releases - [6.4.0](#640)
1011
- `6.3.x` Releases - [6.3.0](#630) - [6.3.1](#631)
1112
- `6.2.x` Releases - [6.2.0](#620)
1213
- `6.1.x` Releases - [6.1.0](#610)
@@ -101,6 +102,19 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
101102

102103
---
103104

105+
## 6.4.0
106+
107+
Released November 28, 2022 &bull; [diff](https://github.com/groue/GRDB.swift/compare/v6.3.1...v6.4.0)
108+
109+
- **New**: [#1293](https://github.com/groue/GRDB.swift/pull/1293) by [@groue](https://github.com/groue): Enable concurrent reads from a WAL snapshot.
110+
- **New**: [#1297](https://github.com/groue/GRDB.swift/pull/1297) by [@groue](https://github.com/groue): SPM: expose the CSQLite product.
111+
- **New**: `DatabaseReader.configuration.readQoS` and `writeQoS` return the effective quality of service of read-only and write database accesses. This helps application code avoid priority inversion and similar scheduling misuses when needed.
112+
- **New**: `DatabaseReader.configuration.maximumReaderCount` returns the effective capacity for concurrent reads, so that application code can adapt when needed.
113+
- **New**: `DatabasePool.makeSnapshot()` no longer throws an error when the database is not in the WAL mode. In such case, the returned snapshot prevents all database modifications during its lifetime.
114+
- **New**: `Database.registerAccess(to:)` has `ValueObservation` track a region. This helps building optimized observations of a constant database region with `ValueObservation.trackingConstantRegion(_:)`.
115+
- **New**: Open several connections to the same in-memory database with `DatabaseQueue(named:)`.
116+
- **New**: [`TableDefinition`](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/tabledefinition)) has new methods for defining primary keys, with automatic NOT NULL constraints. They workaround [an SQLite bug](https://www.sqlite.org/quirks.html#primary_keys_can_sometimes_contain_nulls). Previous techniques for defining primary keys are preserved for backwards compatibility, but their use is not recommended.
117+
104118
## 6.3.1
105119

106120
Released November 11, 2022 &bull; [diff](https://github.com/groue/GRDB.swift/compare/v6.3.0...v6.3.1)

Documentation/AssociationsBasics.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ When using class names composed of two or more words, the table name should use
511511
| Mouse | mouse | `mouse`, `mice`, `maxMouseSize` |
512512
| Person | person | `person`, `people`, `personCount` |
513513

514-
If your application relies on non-English names, GRDB may generate unexpected identifiers. If this happens, please [open an issue](http://github.com/groue/GRDB.swift/issues).
514+
If your application relies on non-English names, GRDB may generate unexpected identifiers. If this happens, please [open an issue](https://github.com/groue/GRDB.swift/issues).
515515

516516
See [The Structure of a Joined Request] for more information.
517517

@@ -649,7 +649,7 @@ Here is the recommended [migration] for the **[HasOne]** association:
649649
```swift
650650
migrator.registerMigration("Countries") { db in
651651
try db.create(table: "country") { t in
652-
t.column("code", .text).primaryKey() // (1)
652+
t.primaryKey("code", .text) // (1)
653653
t.column("name", .text)
654654
}
655655
try db.create(table: "demographics") { t in
@@ -3008,8 +3008,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30083008
[PersistableRecord]: ../README.md#persistablerecord-protocol
30093009
[Codable Records]: ../README.md#codable-records
30103010
[persistence methods]: ../README.md#persistence-methods
3011-
[database observation tools]: ../README.md#database-changes-observation
3012-
[ValueObservation]: ../README.md#valueobservation
3011+
[database observation tools]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseobservation
30133012
[FAQ]: ../README.md#faq-associations
30143013
[common table expressions]: CommonTableExpressions.md
30153014
[Common Table Expressions]: CommonTableExpressions.md

Documentation/Combine.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ This publisher has the same behavior as ValueObservation:
226226

227227
- It notifies an initial value before the eventual changes.
228228
- It may coalesce subsequent changes into a single notification.
229-
- It may notify consecutive identical values. You can filter out the undesired duplicates with the `removeDuplicates()` Combine operator, but we suggest you have a look at the [removeDuplicates()](../README.md#valueobservationremoveduplicates) GRDB operator also.
229+
- It may notify consecutive identical values. You can filter out the undesired duplicates with the `removeDuplicates()` Combine operator, but we suggest you have a look at the [removeDuplicates()](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation/removeduplicates()) GRDB operator also.
230230
- It only completes when it is cancelled.
231231
- By default, it notifies the initial value, as well as eventual changes and errors, on the main thread, asynchronously.
232232

233-
This can be configured with the `scheduling` argument. It does not accept a Combine scheduler, but a [ValueObservation scheduler](../README.md#valueobservation-scheduling).
233+
This can be configured with the `scheduling` argument. It does not accept a Combine scheduler, but a [ValueObservationScheduler](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservationscheduler).
234234

235235
For example, the `.immediate` scheduler makes sure the initial value is notified immediately when the publisher is subscribed. It can help your application update the user interface without having to wait for any asynchronous notifications:
236236

@@ -248,8 +248,6 @@ This publisher has the same behavior as ValueObservation:
248248

249249
Note that the `.immediate` scheduler requires that the publisher is subscribed from the main thread. It raises a fatal error otherwise.
250250

251-
See [ValueObservation Scheduling](../README.md#valueobservation-scheduling) for more information.
252-
253251

254252
#### `SharedValueObservation.publisher()`
255253

@@ -384,14 +382,14 @@ let cancellable = hallOfFamePublisher.sink(
384382
[Usage]: #usage
385383
[Asynchronous Database Access]: #asynchronous-database-access
386384
[Combine]: https://developer.apple.com/documentation/combine
387-
[Database Changes Observation]: ../README.md#database-changes-observation
385+
[Database Changes Observation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseobservation
388386
[Database Observation]: #database-observation
389387
[Combine and Data Consistency]: #combine-and-data-consistency
390-
[DatabaseRegionObservation]: ../README.md#databaseregionobservation
388+
[DatabaseRegionObservation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseregionobservation
391389
[Demo Application]: DemoApps/GRDBCombineDemo/README.md
392390
[SQLite]: http://sqlite.org
393-
[ValueObservation]: ../README.md#valueobservation
394-
[SharedValueObservation]: ../README.md#valueobservation-sharing
391+
[ValueObservation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation
392+
[SharedValueObservation]: https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/sharedvalueobservation
395393
[`DatabaseRegionObservation.publisher(in:)`]: #databaseregionobservationpublisherin
396394
[`ValueObservation.publisher(in:scheduling:)`]: #valueobservationpublisherinscheduling
397395
[`SharedValueObservation.publisher()`]: #sharedvalueobservationpublisher

Documentation/CustomSQLiteBuilds.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ By default, GRDB uses the version of SQLite that ships with the target operating
55

66
**You can build GRDB with a custom build of [SQLite 3.39.3](https://www.sqlite.org/changes.html).**
77

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](../../../#support-for-sqlite-pre-update-hooks).
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).
99

1010
GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfalling/SQLiteLib), which uses the same SQLite configuration as the one used by Apple in its operating systems, and lets you add extra compilation options that leverage the features you need.
1111

@@ -21,7 +21,7 @@ GRDB builds SQLite with [swiftlyfalling/SQLiteLib](https://github.com/swiftlyfal
2121

2222
2. Choose your [extra compilation options](https://www.sqlite.org/compile.html). For example, `SQLITE_ENABLE_FTS5`, `SQLITE_ENABLE_PREUPDATE_HOOK`.
2323

24-
It is recommended that you enable the `SQLITE_ENABLE_SNAPSHOT` option. It allows GRDB to optimize [ValueObservation](../README.md#valueobservation) when you use a [Database Pool](../README.md#database-pools).
24+
It is recommended that you enable the `SQLITE_ENABLE_SNAPSHOT` option. It allows GRDB to optimize [ValueObservation](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation) when you use a [Database Pool](../README.md#database-pools).
2525

2626
3. Create a folder named `GRDBCustomSQLite` somewhere in your project directory.
2727

Documentation/DemoApps/GRDBAsyncDemo/GRDBAsyncDemo/AppDatabase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct AppDatabase {
3434

3535
migrator.registerMigration("createPlayer") { db in
3636
// Create a table
37-
// See https://github.com/groue/GRDB.swift#create-tables
37+
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseschema>
3838
try db.create(table: "player") { t in
3939
t.autoIncrementedPrimaryKey("id")
4040
t.column("name", .text).notNull()

Documentation/DemoApps/GRDBAsyncDemo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The topics covered in this demo are:
1313

1414
- How to setup a database in an iOS app.
1515
- How to define a simple [Codable Record](../../../README.md#codable-records).
16-
- How to track database changes and animate a SwiftUI List with an async sequence built from [ValueObservation](../../../README.md#valueobservation).
16+
- How to track database changes and animate a SwiftUI List with an async sequence built from [ValueObservation](https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/valueobservation).
1717
- How to apply the recommendations of [Good Practices for Designing Record Types](../../GoodPracticesForDesigningRecordTypes.md).
1818
- How to feed SwiftUI previews with a transient database.
1919

Documentation/DemoApps/GRDBCombineDemo/GRDBCombineDemo/AppDatabase.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct AppDatabase {
3535

3636
migrator.registerMigration("createPlayer") { db in
3737
// Create a table
38-
// See https://github.com/groue/GRDB.swift#create-tables
38+
// See <https://swiftpackageindex.com/groue/grdb.swift/documentation/grdb/databaseschema>
3939
try db.create(table: "player") { t in
4040
t.autoIncrementedPrimaryKey("id")
4141
t.column("name", .text).notNull()

0 commit comments

Comments
 (0)