From 3014ddb00af3e1d7cf2db80e80fbb14909e1de4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Wed, 9 Nov 2022 19:50:28 +0100 Subject: [PATCH] Enhance Documentation --- Documentation/AppGroupContainers.md | 2 +- GRDB/Core/Database.swift | 4 +-- GRDB/Documentation.docc/Concurrency.md | 1 - GRDB/Documentation.docc/SQLSupport.md | 10 ++++--- .../MutablePersistableRecord+Update.swift | 28 +++++++++---------- README.md | 2 +- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Documentation/AppGroupContainers.md b/Documentation/AppGroupContainers.md index 88afbef8e..15007ede4 100644 --- a/Documentation/AppGroupContainers.md +++ b/Documentation/AppGroupContainers.md @@ -1,4 +1,4 @@ Sharing a Database in an App Group Container ============================================ -This guide [has moved](SharingADatabase.md). +This guide [has moved](https://groue.github.io/GRDB.swift/docs/6.3/documentation/grdb/databasesharing). diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index 75fbd9f70..82863327a 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -22,8 +22,8 @@ let SQLITE_TRANSIENT = unsafeBitCast(OpaquePointer(bitPattern: -1), to: sqlite3_ /// } /// ``` /// -/// `Database` methods that modify or query the database schema are listed -/// in . +/// `Database` methods that modify, query, or validate the database schema are +/// listed in . /// /// ## Topics /// diff --git a/GRDB/Documentation.docc/Concurrency.md b/GRDB/Documentation.docc/Concurrency.md index 396be90bf..6a23ab6de 100644 --- a/GRDB/Documentation.docc/Concurrency.md +++ b/GRDB/Documentation.docc/Concurrency.md @@ -343,6 +343,5 @@ Types that conform to ``TransactionObserver`` can also use those methods in thei [demo apps]: https://github.com/groue/GRDB.swift/tree/master/Documentation/DemoApps [`SQLITE_BUSY`]: https://www.sqlite.org/rescode.html#busy -[Sharing a Database]: SharingADatabase.md [RxGRDB]: https://github.com/RxSwiftCommunity/RxGRDB [demo applications]: https://github.com/groue/GRDB.swift/tree/master/Documentation/DemoApps diff --git a/GRDB/Documentation.docc/SQLSupport.md b/GRDB/Documentation.docc/SQLSupport.md index f32fcc707..f857f08ef 100644 --- a/GRDB/Documentation.docc/SQLSupport.md +++ b/GRDB/Documentation.docc/SQLSupport.md @@ -6,11 +6,13 @@ SQL is the fundamental language for accessing SQLite databases. This section of the documentation focuses on low-level SQLite concepts: the SQL language, prepared statements, database rows and values. -If SQL is not your cup of tea, jump to . +If SQL is not your cup of tea, jump to 🙂 ## SQL Support -GRDB has a wide support for SQL. You can execute raw SQL statements: +GRDB has a wide support for SQL. + +Once connected with one of the , you can execute raw SQL statements: ```swift try dbQueue.write { db in @@ -21,7 +23,7 @@ try dbQueue.write { db in } ``` -You can build prepared statements and lazily iterate fetched rows with great performances: +Build prepared ``Statement`` and lazily iterate fetched rows with an efficient and fast ``DatabaseCursor``: ```swift try dbQueue.read { db in @@ -35,7 +37,7 @@ try dbQueue.read { db in } ``` -And you can leverage ``SQLRequest`` and ``FetchableRecord`` for defining streamlined apis with powerful SQL interpolation features: +Leverage ``SQLRequest`` and ``FetchableRecord`` for defining streamlined apis with powerful SQL interpolation features: ```swift struct Player: Decodable { diff --git a/GRDB/Record/MutablePersistableRecord+Update.swift b/GRDB/Record/MutablePersistableRecord+Update.swift index 9f9479993..713cc191e 100644 --- a/GRDB/Record/MutablePersistableRecord+Update.swift +++ b/GRDB/Record/MutablePersistableRecord+Update.swift @@ -130,7 +130,7 @@ extension MutablePersistableRecord { /// If the record has any difference from the other record, executes an /// `UPDATE` statement so that those differences and only those differences - /// are saved in the database. + /// are updated in the database. /// /// For example: /// @@ -174,7 +174,7 @@ extension MutablePersistableRecord { /// Modifies the record according to the provided `modify` closure, and /// executes an `UPDATE` statement that updates the modified columns, if and - /// only the record was modified. + /// only if the record was modified. /// /// For example: /// @@ -273,8 +273,8 @@ extension MutablePersistableRecord { /// Modifies the record according to the provided `modify` closure, and /// executes an `UPDATE RETURNING` statement that updates the modified - /// columns, if and only the record was modified. The method returns a new - /// record built from the updated row. + /// columns, if and only if the record was modified. The method returns a + /// new record built from the updated row. /// /// - parameter db: A database connection. /// - parameter conflictResolution: A policy for conflict resolution. If @@ -300,8 +300,8 @@ extension MutablePersistableRecord { /// Modifies the record according to the provided `modify` closure, and /// executes an `UPDATE RETURNING` statement that updates the modified - /// columns, if and only the record was modified. The method returns a new - /// record built from the updated row. + /// columns, if and only if the record was modified. The method returns a + /// new record built from the updated row. /// /// - parameter db: A database connection. /// - parameter conflictResolution: A policy for conflict resolution. If @@ -484,8 +484,8 @@ extension MutablePersistableRecord { /// Modifies the record according to the provided `modify` closure, and /// executes an `UPDATE RETURNING` statement that updates the modified - /// columns, if and only the record was modified. The method returns a new - /// record built from the updated row. + /// columns, if and only if the record was modified. The method returns a + /// new record built from the updated row. /// /// - parameter db: A database connection. /// - parameter conflictResolution: A policy for conflict resolution. If @@ -571,8 +571,8 @@ extension MutablePersistableRecord { /// Modifies the record according to the provided `modify` closure, and /// executes an `UPDATE RETURNING` statement that updates the modified - /// columns, if and only the record was modified. The method returns a new - /// record built from the updated row. + /// columns, if and only if the record was modified. The method returns a + /// new record built from the updated row. /// /// - parameter db: A database connection. /// - parameter conflictResolution: A policy for conflict resolution. If @@ -599,8 +599,8 @@ extension MutablePersistableRecord { /// Modifies the record according to the provided `modify` closure, and /// executes an `UPDATE RETURNING` statement that updates the modified - /// columns, if and only the record was modified. The method returns a new - /// record built from the updated row. + /// columns, if and only if the record was modified. The method returns a + /// new record built from the updated row. /// /// - parameter db: A database connection. /// - parameter conflictResolution: A policy for conflict resolution. If @@ -787,8 +787,8 @@ extension MutablePersistableRecord { /// Modifies the record according to the provided `modify` closure, and /// executes an `UPDATE RETURNING` statement that updates the modified - /// columns, if and only the record was modified. The method returns a new - /// record built from the updated row. + /// columns, if and only if the record was modified. The method returns a + /// new record built from the updated row. /// /// - parameter db: A database connection. /// - parameter conflictResolution: A policy for conflict resolution. If diff --git a/README.md b/README.md index 8d903a113..e98766c98 100644 --- a/README.md +++ b/README.md @@ -8815,7 +8815,7 @@ This chapter was renamed to [Embedding SQL in Query Interface Requests]. [Combine Support]: Documentation/Combine.md [Concurrency]: https://groue.github.io/GRDB.swift/docs/6.3/documentation/grdb/concurrency [Demo Applications]: Documentation/DemoApps -[Sharing a Database]: Documentation/SharingADatabase.md +[Sharing a Database]: https://groue.github.io/GRDB.swift/docs/6.3/documentation/grdb/databasesharing [FAQ]: #faq [Database Observation]: #database-changes-observation [SQLRequest]: https://groue.github.io/GRDB.swift/docs/6.3/documentation/grdb/sqlrequest