Skip to content

Commit e9b8df6

Browse files
committed
Merge branch 'development'
2 parents 9b0e41a + 9fa831b commit e9b8df6

37 files changed

+1582
-768
lines changed

CHANGELOG.md

Lines changed: 8 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.22.x` Releases - [5.22.0](#5220)
1011
- `5.21.x` Releases - [5.21.0](#5210)
1112
- `5.20.x` Releases - [5.20.0](#5200)
1213
- `5.19.x` Releases - [5.19.0](#5190)
@@ -88,6 +89,13 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception:
8889

8990
---
9091

92+
## 5.22.0
93+
94+
Released March 22, 2022 • [diff](https://github.com/groue/GRDB.swift/compare/v5.21.0...v5.22.0)
95+
96+
- **New**: [#1186](https://github.com/groue/GRDB.swift/pull/1186) by [@benrb](https://github.com/benrb): DatabaseError provide error message as localizedFailureReason
97+
- **Breaking Change**: [#1183](https://github.com/groue/GRDB.swift/pull/1183) by [@groue](https://github.com/groue): Starting a ValueObservation keeps a strong reference on the database connection.
98+
9199
## 5.21.0
92100

93101
Released February 6, 2022 • [diff](https://github.com/groue/GRDB.swift/compare/v5.20.0...v5.21.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.21/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.22/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.21/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.22/Structs/StatementArguments.html):
591591

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

Documentation/Migrations.md

Lines changed: 1 addition & 1 deletion
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.21/Structs/DatabaseMigrator.html) for more migrator methods.
80+
See the [DatabaseMigrator reference](http://groue.github.io/GRDB.swift/docs/5.22/Structs/DatabaseMigrator.html) for more migrator methods.
8181

8282

8383
## The `eraseDatabaseOnSchemaChange` Option

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.21.0'
3+
s.version = '5.22.0'
44

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

GRDB.xcodeproj/project.pbxproj

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@
287287
564448831EF56B1B00DD2861 /* DatabaseAfterNextTransactionCommitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564448821EF56B1B00DD2861 /* DatabaseAfterNextTransactionCommitTests.swift */; };
288288
564448871EF56B1B00DD2861 /* DatabaseAfterNextTransactionCommitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564448821EF56B1B00DD2861 /* DatabaseAfterNextTransactionCommitTests.swift */; };
289289
564A50C81BFF4B7F00B3A3A2 /* DatabaseCollationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564A50C61BFF4B7F00B3A3A2 /* DatabaseCollationTests.swift */; };
290-
564CE43121AA901800652B19 /* ValueObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueObserver.swift */; };
291-
564CE43221AA901800652B19 /* ValueObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueObserver.swift */; };
292-
564CE43321AA901800652B19 /* ValueObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueObserver.swift */; };
290+
564CE43121AA901800652B19 /* ValueConcurrentObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueConcurrentObserver.swift */; };
291+
564CE43221AA901800652B19 /* ValueConcurrentObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueConcurrentObserver.swift */; };
292+
564CE43321AA901800652B19 /* ValueConcurrentObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueConcurrentObserver.swift */; };
293293
564CE4E921B2E06F00652B19 /* ValueObservationMapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE4E821B2E06F00652B19 /* ValueObservationMapTests.swift */; };
294294
564CE4EA21B2E06F00652B19 /* ValueObservationMapTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE4E821B2E06F00652B19 /* ValueObservationMapTests.swift */; };
295295
564CE59D21B7A8B500652B19 /* RemoveDuplicates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE59621B7A8B500652B19 /* RemoveDuplicates.swift */; };
@@ -539,6 +539,10 @@
539539
56781B0C243F86E600650A83 /* Refinable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56781B0A243F86E600650A83 /* Refinable.swift */; };
540540
56781B0D243F86E600650A83 /* Refinable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56781B0A243F86E600650A83 /* Refinable.swift */; };
541541
56781B0E243F86E600650A83 /* Refinable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56781B0A243F86E600650A83 /* Refinable.swift */; };
542+
5679533327E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5679533227E0A2FB004D18BD /* ValueWriteOnlyObserver.swift */; };
543+
5679533427E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5679533227E0A2FB004D18BD /* ValueWriteOnlyObserver.swift */; };
544+
5679533527E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5679533227E0A2FB004D18BD /* ValueWriteOnlyObserver.swift */; };
545+
5679533627E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5679533227E0A2FB004D18BD /* ValueWriteOnlyObserver.swift */; };
542546
567A80571D41350C00C7DCEC /* IndexInfoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 567A80521D41350C00C7DCEC /* IndexInfoTests.swift */; };
543547
567DAF1C1EAB61ED00FC0928 /* grdb_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 567DAF141EAB61ED00FC0928 /* grdb_config.h */; settings = {ATTRIBUTES = (Private, ); }; };
544548
567DAF1F1EAB61ED00FC0928 /* grdb_config.h in Headers */ = {isa = PBXBuildFile; fileRef = 567DAF141EAB61ED00FC0928 /* grdb_config.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -949,7 +953,7 @@
949953
AAA4DC85230F1E0600C74B15 /* Column.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56CEB5401EAA359A00BFAF62 /* Column.swift */; };
950954
AAA4DC87230F1E0600C74B15 /* Date.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F14F1C672E4000235C62 /* Date.swift */; };
951955
AAA4DC89230F1E0600C74B15 /* TransactionObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 566B91321FA4D3810012D5B0 /* TransactionObserver.swift */; };
952-
AAA4DC8A230F1E0600C74B15 /* ValueObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueObserver.swift */; };
956+
AAA4DC8A230F1E0600C74B15 /* ValueConcurrentObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 564CE43021AA901800652B19 /* ValueConcurrentObserver.swift */; };
953957
AAA4DC8B230F1E0600C74B15 /* Fetch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56AACAA722ACED7100A40F2A /* Fetch.swift */; };
954958
AAA4DC8C230F1E0600C74B15 /* DatabaseValueConvertible+RawRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5605F1571C672E4000235C62 /* DatabaseValueConvertible+RawRepresentable.swift */; };
955959
AAA4DC8D230F1E0600C74B15 /* FTS3+QueryInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56CEB5101EAA324B00BFAF62 /* FTS3+QueryInterface.swift */; };
@@ -1385,7 +1389,7 @@
13851389
5643676D272EDF2400C718C7 /* Scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Scripts; sourceTree = "<group>"; };
13861390
564448821EF56B1B00DD2861 /* DatabaseAfterNextTransactionCommitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseAfterNextTransactionCommitTests.swift; sourceTree = "<group>"; };
13871391
564A50C61BFF4B7F00B3A3A2 /* DatabaseCollationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseCollationTests.swift; sourceTree = "<group>"; };
1388-
564CE43021AA901800652B19 /* ValueObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueObserver.swift; sourceTree = "<group>"; };
1392+
564CE43021AA901800652B19 /* ValueConcurrentObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ValueConcurrentObserver.swift; sourceTree = "<group>"; };
13891393
564CE4E821B2E06F00652B19 /* ValueObservationMapTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationMapTests.swift; sourceTree = "<group>"; };
13901394
564CE59621B7A8B500652B19 /* RemoveDuplicates.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemoveDuplicates.swift; sourceTree = "<group>"; };
13911395
564CE5AB21B8FAB400652B19 /* DatabaseRegionObservation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatabaseRegionObservation.swift; sourceTree = "<group>"; };
@@ -1480,6 +1484,7 @@
14801484
5674A7261F30A9090095F066 /* FetchableRecordDecodableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchableRecordDecodableTests.swift; sourceTree = "<group>"; };
14811485
5676FB9F22F5CAD9004717D9 /* ValueObservationRegionRecordingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueObservationRegionRecordingTests.swift; sourceTree = "<group>"; };
14821486
56781B0A243F86E600650A83 /* Refinable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Refinable.swift; sourceTree = "<group>"; };
1487+
5679533227E0A2FB004D18BD /* ValueWriteOnlyObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueWriteOnlyObserver.swift; sourceTree = "<group>"; };
14831488
567A80521D41350C00C7DCEC /* IndexInfoTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndexInfoTests.swift; sourceTree = "<group>"; };
14841489
567DAF141EAB61ED00FC0928 /* grdb_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = grdb_config.h; sourceTree = "<group>"; };
14851490
567DAF341EAB789800FC0928 /* DatabaseLogErrorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseLogErrorTests.swift; sourceTree = "<group>"; };
@@ -1815,9 +1820,10 @@
18151820
children = (
18161821
563082E32430B6BE00C14A05 /* DatabaseCancellable.swift */,
18171822
560233C32724234F00529DF3 /* SharedValueObservation.swift */,
1823+
564CE43021AA901800652B19 /* ValueConcurrentObserver.swift */,
18181824
563B06AA217EF0CC00B38F35 /* ValueObservation.swift */,
18191825
56848972242DE36F002F9702 /* ValueObservationScheduler.swift */,
1820-
564CE43021AA901800652B19 /* ValueObserver.swift */,
1826+
5679533227E0A2FB004D18BD /* ValueWriteOnlyObserver.swift */,
18211827
56AACAA022ACEC9700A40F2A /* ValueReducer */,
18221828
);
18231829
path = ValueObservation;
@@ -2583,9 +2589,9 @@
25832589
isa = PBXNativeTarget;
25842590
buildConfigurationList = 565490B31D5A4798005622CB /* Build configuration list for PBXNativeTarget "GRDBWatchOS" */;
25852591
buildPhases = (
2592+
5654909D1D5A4798005622CB /* Headers */,
25862593
5654909B1D5A4798005622CB /* Sources */,
25872594
5654909C1D5A4798005622CB /* Frameworks */,
2588-
5654909D1D5A4798005622CB /* Headers */,
25892595
5654909E1D5A4798005622CB /* Resources */,
25902596
);
25912597
buildRules = (
@@ -2619,9 +2625,9 @@
26192625
isa = PBXNativeTarget;
26202626
buildConfigurationList = 56E5D7DB1B4D3FEE00430942 /* Build configuration list for PBXNativeTarget "GRDBiOS" */;
26212627
buildPhases = (
2628+
56E5D7C71B4D3FED00430942 /* Headers */,
26222629
56E5D7C51B4D3FED00430942 /* Sources */,
26232630
56E5D7C61B4D3FED00430942 /* Frameworks */,
2624-
56E5D7C71B4D3FED00430942 /* Headers */,
26252631
56E5D7C81B4D3FED00430942 /* Resources */,
26262632
56EB54FA22C9115E00850069 /* Swiftlint */,
26272633
);
@@ -2674,9 +2680,9 @@
26742680
isa = PBXNativeTarget;
26752681
buildConfigurationList = AAA4DCFB230F1E0600C74B15 /* Build configuration list for PBXNativeTarget "GRDBtvOS" */;
26762682
buildPhases = (
2683+
AAA4DCF5230F1E0600C74B15 /* Headers */,
26772684
AAA4DC76230F1E0600C74B15 /* Sources */,
26782685
AAA4DCF4230F1E0600C74B15 /* Frameworks */,
2679-
AAA4DCF5230F1E0600C74B15 /* Headers */,
26802686
AAA4DCF9230F1E0600C74B15 /* Resources */,
26812687
AAA4DCFA230F1E0600C74B15 /* Swiftlint */,
26822688
);
@@ -2711,9 +2717,9 @@
27112717
isa = PBXNativeTarget;
27122718
buildConfigurationList = DC37740919C8CBB3004FCF85 /* Build configuration list for PBXNativeTarget "GRDBOSX" */;
27132719
buildPhases = (
2720+
DC3773F019C8CBB3004FCF85 /* Headers */,
27142721
DC3773EE19C8CBB3004FCF85 /* Sources */,
27152722
DC3773EF19C8CBB3004FCF85 /* Frameworks */,
2716-
DC3773F019C8CBB3004FCF85 /* Headers */,
27172723
DC3773F119C8CBB3004FCF85 /* Resources */,
27182724
56EB54F322C8ED5100850069 /* Swiftlint */,
27192725
);
@@ -2943,11 +2949,12 @@
29432949
564F9C341F07611900877A00 /* DatabaseFunction.swift in Sources */,
29442950
5659F4961EA8D964004A4992 /* ReadWriteBox.swift in Sources */,
29452951
56894FD12606589C00268F4D /* Decimal.swift in Sources */,
2952+
5679533527E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */,
29462953
56172950223533F40006E219 /* EncodableRecord.swift in Sources */,
29472954
56AE64142229A53700AD1B0B /* HasOneThroughAssociation.swift in Sources */,
29482955
5613ED3721A95A5C00DC7A68 /* Map.swift in Sources */,
29492956
5659F48E1EA8D94E004A4992 /* Utils.swift in Sources */,
2950-
564CE43321AA901800652B19 /* ValueObserver.swift in Sources */,
2957+
564CE43321AA901800652B19 /* ValueConcurrentObserver.swift in Sources */,
29512958
563B8FC724A1D3B9007A48C9 /* OnDemandFuture.swift in Sources */,
29522959
566B9C2225C6CC24004542CF /* RowDecodingError.swift in Sources */,
29532960
565490B91D5AE236005622CB /* DatabasePool.swift in Sources */,
@@ -3094,7 +3101,7 @@
30943101
56CEB5481EAA359A00BFAF62 /* Column.swift in Sources */,
30953102
5605F1641C672E4000235C62 /* Date.swift in Sources */,
30963103
566B91361FA4D3810012D5B0 /* TransactionObserver.swift in Sources */,
3097-
564CE43221AA901800652B19 /* ValueObserver.swift in Sources */,
3104+
564CE43221AA901800652B19 /* ValueConcurrentObserver.swift in Sources */,
30983105
568ECA8B25D7013000B71526 /* SQLSelection.swift in Sources */,
30993106
56AACAA922ACED7100A40F2A /* Fetch.swift in Sources */,
31003107
5605F1721C672E4000235C62 /* DatabaseValueConvertible+RawRepresentable.swift in Sources */,
@@ -3179,6 +3186,7 @@
31793186
C96C0F2C2084A459006B2981 /* SQLiteDateParser.swift in Sources */,
31803187
5605F1681C672E4000235C62 /* NSNumber.swift in Sources */,
31813188
564CE5AD21B8FAB400652B19 /* DatabaseRegionObservation.swift in Sources */,
3189+
5679533427E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */,
31823190
56CEB5041EAA2F4D00BFAF62 /* FTS4.swift in Sources */,
31833191
563B8F93249E6171007A48C9 /* Trace.swift in Sources */,
31843192
5605F1741C672E4000235C62 /* StandardLibrary.swift in Sources */,
@@ -3699,7 +3707,7 @@
36993707
AAA4DC85230F1E0600C74B15 /* Column.swift in Sources */,
37003708
AAA4DC87230F1E0600C74B15 /* Date.swift in Sources */,
37013709
AAA4DC89230F1E0600C74B15 /* TransactionObserver.swift in Sources */,
3702-
AAA4DC8A230F1E0600C74B15 /* ValueObserver.swift in Sources */,
3710+
AAA4DC8A230F1E0600C74B15 /* ValueConcurrentObserver.swift in Sources */,
37033711
568ECA8D25D7013000B71526 /* SQLSelection.swift in Sources */,
37043712
AAA4DC8B230F1E0600C74B15 /* Fetch.swift in Sources */,
37053713
AAA4DC8C230F1E0600C74B15 /* DatabaseValueConvertible+RawRepresentable.swift in Sources */,
@@ -3784,6 +3792,7 @@
37843792
AAA4DCD8230F1E0600C74B15 /* SQLiteDateParser.swift in Sources */,
37853793
AAA4DCD9230F1E0600C74B15 /* NSNumber.swift in Sources */,
37863794
AAA4DCDB230F1E0600C74B15 /* DatabaseRegionObservation.swift in Sources */,
3795+
5679533627E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */,
37873796
AAA4DCDC230F1E0600C74B15 /* FTS4.swift in Sources */,
37883797
563B8F95249E6171007A48C9 /* Trace.swift in Sources */,
37893798
AAA4DCDD230F1E0600C74B15 /* StandardLibrary.swift in Sources */,
@@ -4146,14 +4155,15 @@
41464155
56B964B91DA51D0A0002DA19 /* FTS5Pattern.swift in Sources */,
41474156
56FBFEDA2210731A00945324 /* SQLRequest.swift in Sources */,
41484157
563363C01C942C04000BE133 /* DatabaseReader.swift in Sources */,
4149-
564CE43121AA901800652B19 /* ValueObserver.swift in Sources */,
4158+
564CE43121AA901800652B19 /* ValueConcurrentObserver.swift in Sources */,
41504159
5605F1651C672E4000235C62 /* NSNull.swift in Sources */,
41514160
56CEB5191EAA328900BFAF62 /* FTS5+QueryInterface.swift in Sources */,
41524161
568ECB1825D9161600B71526 /* SQLSubquery.swift in Sources */,
41534162
5674A6FB1F307F600095F066 /* FetchableRecord+Decodable.swift in Sources */,
41544163
5653EB0620944C7C00F46237 /* SQLForeignKeyRequest.swift in Sources */,
41554164
56E9FACB221046FD00C703A8 /* SQLInterpolation+QueryInterface.swift in Sources */,
41564165
563B8F92249E6171007A48C9 /* Trace.swift in Sources */,
4166+
5679533327E0A2FB004D18BD /* ValueWriteOnlyObserver.swift in Sources */,
41574167
5698AC781DA37DCB0056AF8C /* VirtualTableModule.swift in Sources */,
41584168
56A2387D1B9C75030082EB20 /* Database.swift in Sources */,
41594169
566AD8B21D5318F4002EC1A8 /* TableDefinition.swift in Sources */,

GRDB/Core/Configuration.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ public struct Configuration {
297297
(self.label ?? defaultLabel) + (purpose.map { "." + $0 } ?? "")
298298
}
299299

300+
/// Creates a DispatchQueue which has the quality of service and target
301+
/// queue of write accesses.
300302
func makeWriterDispatchQueue(label: String) -> DispatchQueue {
301303
if let targetQueue = writeTargetQueue ?? targetQueue {
302304
return DispatchQueue(label: label, target: targetQueue)
@@ -305,6 +307,8 @@ public struct Configuration {
305307
}
306308
}
307309

310+
/// Creates a DispatchQueue which has the quality of service and target
311+
/// queue of read accesses.
308312
func makeReaderDispatchQueue(label: String) -> DispatchQueue {
309313
if let targetQueue = targetQueue {
310314
return DispatchQueue(label: label, target: targetQueue)

GRDB/Core/Database+Schema.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,9 @@ struct SchemaInfo: Equatable {
10461046

10471047
/// - parameter masterTable: "sqlite_master" or "sqlite_temp_master"
10481048
init(_ db: Database, masterTableName: String) throws { // swiftlint:disable:this inclusive_language
1049-
objects = try Set(SchemaObject.fetchCursor(db, sql: """
1049+
objects = try SchemaObject.fetchSet(db, sql: """
10501050
SELECT type, name, tbl_name, sql FROM \(masterTableName)
1051-
"""))
1051+
""")
10521052
}
10531053

10541054
/// All names for a given type

GRDB/Core/Database.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,8 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib
10011001

10021002
/// Runs the block with an isolation level equal or greater than
10031003
/// snapshot isolation.
1004+
///
1005+
/// - parameter readOnly: If true, writes are forbidden.
10041006
func isolated<T>(readOnly: Bool = false, _ block: () throws -> T) throws -> T {
10051007
var result: T?
10061008
try inSavepoint {

GRDB/Core/DatabaseError.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,5 +506,11 @@ extension DatabaseError {
506506

507507
/// NSError bridging: the user-info dictionary.
508508
/// :nodoc:
509-
public var errorUserInfo: [String: Any] { [NSLocalizedDescriptionKey: description] }
509+
public var errorUserInfo: [String: Any] {
510+
var userInfo = [NSLocalizedDescriptionKey: description]
511+
if let message = message {
512+
userInfo[NSLocalizedFailureReasonErrorKey] = message
513+
}
514+
return userInfo
515+
}
510516
}

0 commit comments

Comments
 (0)