Skip to content

Commit 1625bc8

Browse files
committed
Documentation organization
1 parent be9740b commit 1625bc8

File tree

8 files changed

+33
-23
lines changed

8 files changed

+33
-23
lines changed

GRDB/Core/Database.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ let SQLITE_TRANSIENT = unsafeBitCast(OpaquePointer(bitPattern: -1), to: sqlite3_
6969
/// - ``add(transactionObserver:extent:)``
7070
/// - ``afterNextTransaction(onCommit:onRollback:)``
7171
/// - ``remove(transactionObserver:)``
72-
/// - ``TransactionObservationExtent``
7372
///
7473
/// ### Collations
7574
///

GRDB/Core/DatabaseWriter.swift

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

6-
/// A type that write into an SQLite database.
6+
/// A type that writes into an SQLite database.
77
///
88
/// Do not declare new conformances to `DatabaseWriter`. Only the
99
/// ``DatabaseQueue`` and ``DatabasePool`` types are valid conforming types.

GRDB/Core/TransactionObserver.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ extension Database {
9393
extent: .nextTransaction)
9494
}
9595

96-
/// The extent of a transaction observation.
97-
///
98-
/// See ``Database/add(transactionObserver:extent:)``.
96+
/// The extent of the observation performed by a ``TransactionObserver``.
9997
public enum TransactionObservationExtent {
10098
/// Observation lasts until observer is deallocated.
10199
case observerLifetime
@@ -726,7 +724,7 @@ class DatabaseObservationBroker {
726724
/// ``DatabaseWriter/add(transactionObserver:extent:)`` `DatabaseWriter` method,
727725
/// or the ``Database/add(transactionObserver:extent:)`` `Database` method.
728726
///
729-
/// All observer methods are called in a the writer dispatch queue, serialized
727+
/// All observer methods are called in the writer dispatch queue, serialized
730728
/// with all database updates (see ``DatabaseWriter``).
731729
///
732730
/// Some changes and transactions are not notified:

GRDB/Documentation.docc/Concurrency.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ Types that conform to ``TransactionObserver`` can also use those methods in thei
342342
- ``DatabaseReader``
343343
- ``DatabaseWriter``
344344

345+
### Advanced Concurrency
346+
347+
- <doc:DatabaseSharing>
348+
349+
345350
[demo apps]: https://github.com/groue/GRDB.swift/tree/master/Documentation/DemoApps
346351
[`SQLITE_BUSY`]: https://www.sqlite.org/rescode.html#busy
347352
[RxGRDB]: https://github.com/RxSwiftCommunity/RxGRDB

GRDB/Documentation.docc/DatabaseObservation.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Database Observation
22

3-
Observe database changes and transactions.
3+
Observe database changes and transactions.
44

55
## Topics
66

@@ -13,7 +13,11 @@ Observe database changes and transactions.
1313
### Observing Database Transactions
1414

1515
- ``DatabaseRegionObservation``
16+
17+
### Low-Level Transaction Observers
18+
1619
- ``TransactionObserver``
20+
- ``Database/TransactionObservationExtent``
1721

1822
### Database Regions
1923

GRDB/Documentation.docc/Documentation.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ GRDB provides raw access to SQL and advanced SQLite features, because one someti
1919

2020
- <doc:DatabaseSchema>
2121
- <doc:Migrations>
22+
- <doc:SingleRowTables>
2223

2324
### Record Types and the Query Interface
2425

@@ -30,13 +31,7 @@ GRDB provides raw access to SQL and advanced SQLite features, because one someti
3031

3132
### Full-Text Search
3233

33-
- ``FTS3``
34-
- ``FTS4``
35-
36-
### Database Techniques
37-
38-
- <doc:DatabaseSharing>
39-
- <doc:SingleRowTables>
34+
- <doc:FullTextSearch>
4035

4136
### Combine Publishers
4237

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Full-Text Search
2+
3+
Search a corpus of textual documents.
4+
5+
## Overview
6+
7+
Please refer to the [Full-Text Search](https://github.com/groue/GRDB.swift/blob/master/Documentation/FullTextSearch.md) guide. It also describes how to enable support for the FTS5 engine.
8+
9+
## Topics
10+
11+
### Full-Text Engines
12+
13+
- ``FTS3``
14+
- ``FTS4``

GRDB/Documentation.docc/SingleRowTables.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ It is not a good idea to populate the table in a migration, for two reasons:
6565

6666
1. This migration is not a hard guarantee that the table will never be empty. As a consequence, this won't prevent the application code from dealing with the possibility of a missing row. On top of that, this application code may not use the same default values as the SQLite schema, with unclear consequences.
6767

68-
2. Migrations that have been release on the users' devices should never change (see <doc:Migrations#Good-Practices-for-Defining-Migrations>). Inserting an initial row in a migration, makes it difficult for the application to adjust the sensible default values in a future version.
68+
2. Migrations that have been deployed on the users' devices should never change (see <doc:Migrations#Good-Practices-for-Defining-Migrations>). Inserting an initial row in a migration makes it difficult for the application to adjust the sensible default values in a future version.
6969

7070
The recommended migration creates the table, nothing more:
7171

@@ -150,25 +150,20 @@ if config.flag {
150150

151151
// WRITE
152152
try dbQueue.write { db in
153+
// Saves a new config in the database
153154
var config = try AppConfiguration.fetch(db)
154-
155-
// Update some config values
156155
try config.updateChanges(db) {
157156
$0.flag = true
158157
}
159158

160-
// Other possible ways to write config:
161-
try config.update(db)
159+
// Other possible ways to save the config:
162160
try config.save(db)
161+
try config.update(db)
163162
try config.insert(db)
164163
try config.upsert(db)
165164
}
166165
```
167166

168-
The ``MutablePersistableRecord/updateChanges(_:onConflict:modify:)`` method only updates the values changed by its closure argument (and performs an initial insert of default configuration if the database table is empty).
169-
170-
The four `update`, `save`, `insert` and `upsert` methods can be used interchangeably. They all make sure the configuration is fully stored in the database.
171-
172167
See ``MutablePersistableRecord`` for more information about persistence methods.
173168

174169

0 commit comments

Comments
 (0)