diff --git a/GRDB/Core/Cursor.swift b/GRDB/Core/Cursor.swift index 62c865956..d16503a59 100644 --- a/GRDB/Core/Cursor.swift +++ b/GRDB/Core/Cursor.swift @@ -670,24 +670,16 @@ extension Cursor where Element: Equatable { extension Cursor where Element: Comparable { /// Returns the maximum element in the cursor. /// - /// - Parameter areInIncreasingOrder: A predicate that returns `true` - /// if its first argument should be ordered before its second - /// argument; otherwise, `false`. - /// - Returns: The cursor's maximum element, according to - /// `areInIncreasingOrder`. If the cursor has no elements, returns - /// `nil`. + /// - Returns: The cursor's maximum element. If the cursor has no + /// elements, returns `nil`. public func max() throws -> Element? { try max(by: <) } /// Returns the minimum element in the cursor. /// - /// - Parameter areInIncreasingOrder: A predicate that returns `true` - /// if its first argument should be ordered before its second - /// argument; otherwise, `false`. - /// - Returns: The cursor's minimum element, according to - /// `areInIncreasingOrder`. If the cursor has no elements, returns - /// `nil`. + /// - Returns: The cursor's minimum element. If the cursor has no + /// elements, returns `nil`. public func min() throws -> Element? { try min(by: <) } diff --git a/GRDB/Core/Database/StatementArguments.swift b/GRDB/Core/Database/StatementArguments.swift index 5f9131f98..8ccf059cd 100644 --- a/GRDB/Core/Database/StatementArguments.swift +++ b/GRDB/Core/Database/StatementArguments.swift @@ -48,7 +48,8 @@ /// ## Concatenating Arguments /// /// Several arguments can be concatenated and mixed with the -/// ``append(contentsOf:)`` method and the `+`, `&+`, `+=` operators: +/// ``StatementArguments/append(contentsOf:)`` method and the `+`, `&+`, +/// `+=` operators: /// /// ```swift /// var arguments: StatementArguments = ["Arthur"] @@ -68,8 +69,8 @@ /// arguments += ["name": "Barbara"] /// ``` /// -/// On the other side, `&+` and ``append(contentsOf:)`` allow overriding -/// named arguments: +/// On the other side, `&+` and ``StatementArguments/append(contentsOf:)`` +/// allow overriding named arguments: /// /// ```swift /// var arguments: StatementArguments = ["name": "Arthur"] diff --git a/GRDB/Core/Row/Row+fetch.swift b/GRDB/Core/Row/Row+fetch.swift index 34d4ae90d..0c24188f9 100644 --- a/GRDB/Core/Row/Row+fetch.swift +++ b/GRDB/Core/Row/Row+fetch.swift @@ -33,8 +33,7 @@ extension Row { /// elements are undefined. /// /// - parameters: - /// - db: A database connection. - /// - sql: An SQL string. + /// - statement: The statement to run. /// - arguments: Optional statement arguments. /// - adapter: Optional RowAdapter /// - returns: A ``RowCursor`` over fetched rows. diff --git a/GRDB/Core/Row/Row+scopes.swift b/GRDB/Core/Row/Row+scopes.swift index 30f449098..abb7cf270 100644 --- a/GRDB/Core/Row/Row+scopes.swift +++ b/GRDB/Core/Row/Row+scopes.swift @@ -458,7 +458,7 @@ extension Row { /// /// See ``Row/scopesTree`` for more information. /// - /// - parameter key: An association key. + /// - parameter name: The name of a scope. public subscript(_ name: String) -> Row? { var fifo = Array(scopes) while !fifo.isEmpty { diff --git a/GRDB/Dump/Database+Dump.swift b/GRDB/Dump/Database+Dump.swift index d4abfb653..bb5aed264 100644 --- a/GRDB/Dump/Database+Dump.swift +++ b/GRDB/Dump/Database+Dump.swift @@ -45,7 +45,7 @@ extension Database { /// ``` /// /// - Parameters: - /// - request : The executed request. + /// - request: The executed request. /// - format: The output format. /// - stream: A stream for text output, which directs output to the /// console by default. diff --git a/GRDB/Dump/DatabaseReader+dump.swift b/GRDB/Dump/DatabaseReader+dump.swift index 55e829c89..cbe3e922d 100644 --- a/GRDB/Dump/DatabaseReader+dump.swift +++ b/GRDB/Dump/DatabaseReader+dump.swift @@ -38,7 +38,7 @@ extension DatabaseReader { /// ``` /// /// - Parameters: - /// - request : The executed request. + /// - request: The executed request. /// - format: The output format. /// - stream: A stream for text output, which directs output to the /// console by default. diff --git a/GRDB/JSON/SQLJSONFunctions.swift b/GRDB/JSON/SQLJSONFunctions.swift index 85122f289..e573c12a2 100644 --- a/GRDB/JSON/SQLJSONFunctions.swift +++ b/GRDB/JSON/SQLJSONFunctions.swift @@ -712,7 +712,7 @@ extension Database { /// /// - Parameters: /// - value: A JSON value. - /// - paths: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). + /// - path: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonRemove(_ value: some SQLExpressible, atPath path: some SQLExpressible) -> SQLExpression { .function("JSON_REMOVE", [value.sqlExpression, path.sqlExpression]) @@ -768,7 +768,7 @@ extension Database { /// /// - Parameters: /// - value: A JSON value. - /// - paths: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). + /// - path: A [JSON path](https://www.sqlite.org/json1.html#path_arguments). @available(iOS 16, macOS 10.15, tvOS 17, watchOS 9, *) // SQLite 3.38+ with exceptions for macOS public static func jsonType(_ value: some SQLExpressible, atPath path: some SQLExpressible) -> SQLExpression { .function("JSON_TYPE", [value.sqlExpression, path.sqlExpression]) diff --git a/GRDB/QueryInterface/Request/CommonTableExpression.swift b/GRDB/QueryInterface/Request/CommonTableExpression.swift index ee505fa3b..02b2a7d6a 100644 --- a/GRDB/QueryInterface/Request/CommonTableExpression.swift +++ b/GRDB/QueryInterface/Request/CommonTableExpression.swift @@ -380,8 +380,8 @@ extension CommonTableExpression { /// /// - parameter cte: A common table expression. /// - parameter condition: A function that returns the joining clause. - /// - parameter left: A `TableAlias` for the left table. - /// - parameter right: A `TableAlias` for the right table. + /// The `left` and `right` arguments are `TableAlias` for the joined + /// tables. /// - returns: An association to the common table expression. public func association( to cte: CommonTableExpression, @@ -416,8 +416,8 @@ extension CommonTableExpression { /// - parameter destination: The record type at the other side of /// the association. /// - parameter condition: A function that returns the joining clause. - /// - parameter left: A `TableAlias` for the left table. - /// - parameter right: A `TableAlias` for the right table. + /// The `left` and `right` arguments are `TableAlias` for the joined + /// tables. /// - returns: An association to the common table expression. public func association( to destination: Destination.Type, @@ -453,8 +453,8 @@ extension CommonTableExpression { /// /// - parameter destination: The table at the other side of the association. /// - parameter condition: A function that returns the joining clause. - /// - parameter left: A `TableAlias` for the left table. - /// - parameter right: A `TableAlias` for the right table. + /// The `left` and `right` arguments are `TableAlias` for the joined + /// tables. /// - returns: An association to the common table expression. public func association( to destination: Table, diff --git a/GRDB/QueryInterface/SQL/Table.swift b/GRDB/QueryInterface/SQL/Table.swift index 580aca9df..39ed19dc8 100644 --- a/GRDB/QueryInterface/SQL/Table.swift +++ b/GRDB/QueryInterface/SQL/Table.swift @@ -1292,8 +1292,8 @@ extension Table { /// /// - parameter cte: A common table expression. /// - parameter condition: A function that returns the joining clause. - /// - parameter left: A `TableAlias` for the left table. - /// - parameter right: A `TableAlias` for the right table. + /// The `left` and `right` arguments are `TableAlias` for the joined + /// tables. /// - returns: An association to the common table expression. public func association( to cte: CommonTableExpression, diff --git a/GRDB/QueryInterface/Schema/Database+SchemaDefinition.swift b/GRDB/QueryInterface/Schema/Database+SchemaDefinition.swift index 10b95ebc3..fb40efa73 100644 --- a/GRDB/QueryInterface/Schema/Database+SchemaDefinition.swift +++ b/GRDB/QueryInterface/Schema/Database+SchemaDefinition.swift @@ -356,7 +356,7 @@ extension Database { /// Related SQLite documentation: /// /// - parameters: - /// - view: The view name. + /// - name: The view name. /// - options: View creation options. /// - columns: The columns of the view. If nil, the columns are the /// columns of the request. @@ -410,7 +410,7 @@ extension Database { /// Related SQLite documentation: /// /// - parameters: - /// - view: The view name. + /// - name: The view name. /// - options: View creation options. /// - columns: The columns of the view. If nil, the columns are the /// columns of the request. diff --git a/GRDB/QueryInterface/Schema/TableDefinition.swift b/GRDB/QueryInterface/Schema/TableDefinition.swift index 235c54bf8..7a9c44c04 100644 --- a/GRDB/QueryInterface/Schema/TableDefinition.swift +++ b/GRDB/QueryInterface/Schema/TableDefinition.swift @@ -136,7 +136,8 @@ public final class TableDefinition { /// - /// - /// - /// - parameter conflictResolution: An optional conflict resolution + /// - parameter name: The name of the primary key column. + /// - parameter conflictResolution: An optional conflict resolution. /// (see ). /// - returns: `self` so that you can further refine the column definition. @discardableResult @@ -163,6 +164,8 @@ public final class TableDefinition { /// /// - parameter name: the column name. /// - parameter type: the column type. + /// - parameter conflictResolution: An optional conflict resolution. + /// (see ). /// - returns: A ``ColumnDefinition`` that allows you to refine the /// column definition. @discardableResult @@ -313,7 +316,7 @@ public final class TableDefinition { /// for more information. /// /// - parameter columns: The primary key columns. - /// - parameter conflictResolution: An optional conflict resolution + /// - parameter conflictResolution: An optional conflict resolution. /// (see ). public func primaryKey(_ columns: [String], onConflict conflictResolution: Database.ConflictResolution? = nil) { guard primaryKeyConstraint == nil else { @@ -355,7 +358,7 @@ public final class TableDefinition { /// Related SQLite documentation: /// /// - parameter columns: The unique key columns. - /// - parameter conflictResolution: An optional conflict resolution + /// - parameter conflictResolution: An optional conflict resolution. /// (see ). public func uniqueKey(_ columns: [String], onConflict conflictResolution: Database.ConflictResolution? = nil) { uniqueKeyConstraints.append(KeyConstraint(columns: columns, conflictResolution: conflictResolution)) diff --git a/GRDB/QueryInterface/Schema/VirtualTableModule.swift b/GRDB/QueryInterface/Schema/VirtualTableModule.swift index 07bdf7bdd..6194abe7b 100644 --- a/GRDB/QueryInterface/Schema/VirtualTableModule.swift +++ b/GRDB/QueryInterface/Schema/VirtualTableModule.swift @@ -113,7 +113,7 @@ extension Database { /// Related SQLite documentation: /// /// - parameters: - /// - name: The table name. + /// - tableName: The table name. /// - ifNotExists: If false (the default), an error is thrown if the /// table already exists. Otherwise, the table is created unless it /// already exists. diff --git a/GRDB/QueryInterface/TableRecord+Association.swift b/GRDB/QueryInterface/TableRecord+Association.swift index 46f7fe395..d2e408ac2 100644 --- a/GRDB/QueryInterface/TableRecord+Association.swift +++ b/GRDB/QueryInterface/TableRecord+Association.swift @@ -334,8 +334,8 @@ extension TableRecord { /// /// - parameter cte: A common table expression. /// - parameter condition: A function that returns the joining clause. - /// - parameter left: A `TableAlias` for the left table. - /// - parameter right: A `TableAlias` for the right table. + /// The `left` and `right` arguments are `TableAlias` for the joined + /// tables. /// - returns: An association to the common table expression. public static func association( to cte: CommonTableExpression, diff --git a/GRDB/Record/FetchableRecord.swift b/GRDB/Record/FetchableRecord.swift index e0e0846f8..5355bb896 100644 --- a/GRDB/Record/FetchableRecord.swift +++ b/GRDB/Record/FetchableRecord.swift @@ -574,7 +574,7 @@ extension FetchableRecord { /// /// - parameters: /// - db: A database connection. - /// - sql: a FetchRequest. + /// - request: The request to run. /// - returns: A ``RecordCursor`` over fetched records. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public static func fetchCursor(_ db: Database, _ request: some FetchRequest) throws -> RecordCursor { @@ -605,7 +605,7 @@ extension FetchableRecord { /// /// - parameters: /// - db: A database connection. - /// - sql: a FetchRequest. + /// - request: The request to run. /// - returns: An array of records. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public static func fetchAll(_ db: Database, _ request: some FetchRequest) throws -> [Self] { @@ -640,7 +640,7 @@ extension FetchableRecord { /// ``` /// - parameters: /// - db: A database connection. - /// - sql: a FetchRequest. + /// - request: The request to run. /// - returns: An optional record. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public static func fetchOne(_ db: Database, _ request: some FetchRequest) throws -> Self? { @@ -680,7 +680,7 @@ extension FetchableRecord where Self: Hashable { /// /// - parameters: /// - db: A database connection. - /// - sql: a FetchRequest. + /// - request: The request to run. /// - returns: A set of records. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public static func fetchSet(_ db: Database, _ request: some FetchRequest) throws -> Set { @@ -731,9 +731,7 @@ extension FetchRequest where RowDecoder: FetchableRecord { /// If the database is modified during the cursor iteration, the remaining /// elements are undefined. /// - /// - parameters: - /// - db: A database connection. - /// - sql: a FetchRequest. + /// - parameter db: A database connection. /// - returns: A ``RecordCursor`` over fetched records. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public func fetchCursor(_ db: Database) throws -> RecordCursor { @@ -760,9 +758,7 @@ extension FetchRequest where RowDecoder: FetchableRecord { /// } /// ``` /// - /// - parameters: - /// - db: A database connection. - /// - sql: a FetchRequest. + /// - parameter db: A database connection. /// - returns: An array of records. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public func fetchAll(_ db: Database) throws -> [RowDecoder] { @@ -788,9 +784,7 @@ extension FetchRequest where RowDecoder: FetchableRecord { /// let player = try request.fetchOne(db) /// } /// ``` - /// - parameters: - /// - db: A database connection. - /// - sql: a FetchRequest. + /// - parameter db: A database connection. /// - returns: An optional record. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public func fetchOne(_ db: Database) throws -> RowDecoder? { @@ -819,9 +813,7 @@ extension FetchRequest where RowDecoder: FetchableRecord & Hashable { /// } /// ``` /// - /// - parameters: - /// - db: A database connection. - /// - sql: a FetchRequest. + /// - parameter db: A database connection. /// - returns: A set of records. /// - throws: A ``DatabaseError`` whenever an SQLite error occurs. public func fetchSet(_ db: Database) throws -> Set { diff --git a/GRDB/Record/MutablePersistableRecord.swift b/GRDB/Record/MutablePersistableRecord.swift index d26cb1cbc..3741c06f7 100644 --- a/GRDB/Record/MutablePersistableRecord.swift +++ b/GRDB/Record/MutablePersistableRecord.swift @@ -193,6 +193,7 @@ public protocol MutablePersistableRecord: EncodableRecord, TableRecord { /// Default implementation does nothing. /// /// - parameter db: A database connection. + /// - parameter columns: The updated columns. func willUpdate(_ db: Database, columns: Set) throws /// Persistence callback called around the record update. @@ -253,7 +254,7 @@ public protocol MutablePersistableRecord: EncodableRecord, TableRecord { /// ``` /// /// - parameter db: A database connection. - /// - parameter update: A function that updates the record. Its result is + /// - parameter save: A function that saves the record. Its result is /// reserved for GRDB usage. func aroundSave(_ db: Database, save: () throws -> PersistenceSuccess) throws diff --git a/GRDB/Record/Record.swift b/GRDB/Record/Record.swift index 227bbae0e..1338e44d5 100644 --- a/GRDB/Record/Record.swift +++ b/GRDB/Record/Record.swift @@ -280,6 +280,7 @@ open class Record { /// your implementation. /// /// - parameter db: A database connection. + /// - parameter columns: The updated columns. open func willUpdate(_ db: Database, columns: Set) throws { } /// Called around the record update. @@ -347,7 +348,7 @@ open class Record { /// ``` /// /// - parameter db: A database connection. - /// - parameter update: A function that updates the record. Its result is + /// - parameter save: A function that saves the record. Its result is /// reserved for GRDB usage. open func aroundSave(_ db: Database, save: () throws -> PersistenceSuccess) throws { _ = try save() diff --git a/GRDB/ValueObservation/SharedValueObservation.swift b/GRDB/ValueObservation/SharedValueObservation.swift index 5dafbdcb5..b61ebb3d0 100644 --- a/GRDB/ValueObservation/SharedValueObservation.swift +++ b/GRDB/ValueObservation/SharedValueObservation.swift @@ -381,6 +381,8 @@ extension SharedValueObservation { /// print("Fresh players: \(players)") /// } /// ``` + /// + /// - parameter bufferingPolicy: See `AsyncThrowingStream`. @available(iOS 13, macOS 10.15, tvOS 13, *) public func values(bufferingPolicy: AsyncValueObservation.BufferingPolicy = .unbounded) -> AsyncValueObservation diff --git a/GRDB/ValueObservation/ValueObservation.swift b/GRDB/ValueObservation/ValueObservation.swift index 90254f150..455b856e9 100644 --- a/GRDB/ValueObservation/ValueObservation.swift +++ b/GRDB/ValueObservation/ValueObservation.swift @@ -297,6 +297,7 @@ extension ValueObservation { /// ``` /// /// - parameter reader: A DatabaseReader. + /// - parameter bufferingPolicy: See `AsyncThrowingStream`. @available(iOS 13, macOS 10.15, tvOS 13, *) public func values( in reader: some DatabaseReader,