Skip to content

Commit ca51460

Browse files
authored
Clean up declarations in docs (#201)
Add missing declarations to docs, fix mis-specified declarations. update README.
1 parent bc949d9 commit ca51460

5 files changed

Lines changed: 33 additions & 22 deletions

File tree

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
<p align="center">
1+
<div align="center">
22
<img src="https://design.vapor.codes/images/vapor-sqlkit.svg" height="96" alt="SQLKit">
33
<br>
4-
<br>
5-
<a href="https://docs.vapor.codes/4.0/"><img src="https://design.vapor.codes/images/readthedocs.svg" alt="Documentation"></a>
6-
<a href="https://discord.gg/vapor"><img src="https://design.vapor.codes/images/discordchat.svg" alt="Team Chat"></a>
7-
<a href="LICENSE"><img src="https://design.vapor.codes/images/mitlicense.svg" alt="MIT License"></a>
8-
<a href="https://github.com/vapor/sql-kit/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/vapor/sql-kit/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=%23ccc" alt="Continuous Integration"></a>
9-
<a href="https://codecov.io/github/vapor/sql-kit"><img src="https://img.shields.io/codecov/c/github/vapor/sql-kit?style=plastic&logo=codecov&label=codecov" alt="Code Coverage"></a>
10-
<a href="https://swift.org"><img src="https://design.vapor.codes/images/swift60up.svg" alt="Swift 6.0+"></a>
11-
</p>
4+
5+
[![Documentation](https://design.vapor.codes/images/readthedocs.svg)](https://docs.vapor.codes/4.0/)
6+
[![Team Chat](https://design.vapor.codes/images/discordchat.svg)](https://discord.gg/vapor)
7+
[![MIT License](https://design.vapor.codes/images/mitlicense.svg)](LICENSE)
8+
[![Continuous Integration](https://img.shields.io/github/actions/workflow/status/vapor/sql-kit/test.yml?event=push&style=plastic&logo=github&label=tests&logoColor=ccc)](https://github.com/vapor/sql-kit/actions/workflows/test.yml)
9+
[![Code Coverage](https://img.shields.io/codecov/c/github/vapor/sql-kit?style=plastic&logo=codecov&label=codecov)](https://codecov.io/github/vapor/sql-kit)
10+
[![Swift 6.1+](https://design.vapor.codes/images/swift61up.svg)](https://swift.org)
11+
12+
</div>
1213

1314
<br>
1415

Sources/SQLKit/Builders/Prototypes/SQLQueryFetcher.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,13 @@ extension SQLQueryFetcher {
128128
/// If `self` conforms to ``SQLPartialResultBuilder``, ``SQLPartialResultBuilder/limit(_:)`` is used to avoid
129129
/// loading more rows than necessary from the database.
130130
///
131+
/// > Note: This method returns `Optional<any SQLRow>` rather than the semantically identical `(any SQLRow)?`
132+
/// > due to a bug in Swift DocC causing it to become confused by the latter. The syntactic sugar will be
133+
/// > restored once the bug is fixed.
134+
///
131135
/// - Returns: The first output row, if any.
132136
@inlinable
133-
public func first() async throws -> (any SQLRow)? {
137+
public func first() async throws -> Optional<any SQLRow> {
134138
(self as? any SQLPartialResultBuilder)?.limit(1)
135139
nonisolated(unsafe) var rows = [any SQLRow]()
136140
try await self.run { if rows.isEmpty { rows.append($0) } }

Sources/SQLKit/Docs.docc/BasicUsage.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,16 @@ Notice that `Encodable` values are automatically bound as parameters instead of
166166

167167
The select builder includes the following methods (most of which have numerous variations):
168168

169-
- `columns()` (specify a list of columns and/or expressions to return)
170-
- `from()` (specify a table to select from)
171-
- `join()` (specify additional tables and how to relate them to others)
172-
- `where()` and `orWhere()` (specify conditions that narrow down the possible results)
173-
- `limit()` and `offset()` (specify a limited and/or offsetted range of results to return)
174-
- `orderBy()` (specify how to sort results before returning them)
175-
- `groupBy()` (specify columns and/or expressions for aggregating results)
176-
- `having()` and `orHaving()` (specify secondary conditions to apply to the results after aggregation)
177-
- `distinct()` (specify coalescing of duplicate results)
178-
- `for()` and `lockingClause()` (specify locking behavior for rows that appear in results)
169+
- ``SQLSelectBuilder/columns(_:)-([SQLExpression])`` (specify a list of columns and/or expressions to return)
170+
- ``SQLSelectBuilder/from(_:)-(String)`` (specify a table to select from)
171+
- ``SQLSelectBuilder/join(_:method:on:_:_:)-(SQLExpression,_,_,_,_)`` (specify additional tables and how to relate them to others)
172+
- ``SQLSelectBuilder/where(_:_:_:)-(SQLExpression,SQLBinaryOperator,_)`` and ``SQLSelectBuilder/orWhere(_:_:_:)-(SQLExpression,SQLBinaryOperator,_)`` (specify conditions that narrow down the possible results)
173+
- ``SQLSelectBuilder/limit(_:)`` and ``SQLSelectBuilder/offset(_:)`` (specify a limited and/or offsetted range of results to return)
174+
- ``SQLSelectBuilder/orderBy(_:_:)-(String,_)`` (specify how to sort results before returning them)
175+
- ``SQLSelectBuilder/groupBy(_:)-(SQLExpression)`` (specify columns and/or expressions for aggregating results)
176+
- ``SQLSelectBuilder/having(_:_:_:)-(SQLExpression,SQLBinaryOperator,_)`` and ``SQLSelectBuilder/orHaving(_:_:_:)-(SQLExpression,SQLBinaryOperator,_)`` (specify secondary conditions to apply to the results after aggregation)
177+
- ``SQLSelectBuilder/distinct()`` (specify coalescing of duplicate results)
178+
- ``SQLSelectBuilder/for(_:)`` and ``SQLSelectBuilder/lockingClause(_:)`` (specify locking behavior for rows that appear in results)
179179

180180
Conditional expressions provided to `where()` or `having()` are joined with `AND`. Corresponding `orWhere()` and `orHaving()` methods join conditions with `OR` instead.
181181

Sources/SQLKit/Docs.docc/SQLKit.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ SQLKit does _not_ provide facilities for creating or managing database connectio
4343

4444
- ``SQLAliasedColumnListBuilder``
4545
- ``SQLColumnUpdateBuilder``
46+
- ``SQLCommonTableExpressionBuilder``
47+
- ``SQLCommonUnionBuilder``
4648
- ``SQLJoinBuilder``
4749
- ``SQLPartialResultBuilder``
4850
- ``SQLPredicateBuilder``
@@ -75,6 +77,7 @@ SQLKit does _not_ provide facilities for creating or managing database connectio
7577
- ``SQLSelectBuilder``
7678
- ``SQLSubqueryBuilder``
7779
- ``SQLUnionBuilder``
80+
- ``SQLUnionSubqueryBuilder``
7881
- ``SQLUpdateBuilder``
7982

8083
### Syntactic Expressions
@@ -109,6 +112,8 @@ SQLKit does _not_ provide facilities for creating or managing database connectio
109112
- ``SQLColumnAssignment``
110113
- ``SQLColumnConstraintAlgorithm``
111114
- ``SQLColumnDefinition``
115+
- ``SQLCommonTableExpression``
116+
- ``SQLCommonTableExpressionGroup``
112117
- ``SQLConflictAction``
113118
- ``SQLConflictResolutionStrategy``
114119
- ``SQLDropBehavior``
@@ -124,6 +129,7 @@ SQLKit does _not_ provide facilities for creating or managing database connectio
124129
- ``SQLSubquery``
125130
- ``SQLTableConstraintAlgorithm``
126131
- ``SQLUnionJoiner``
132+
- ``SQLUnionSubquery``
127133

128134
### Query Expressions
129135

Sources/SQLKit/Docs.docc/SQLQueryFetcher+ExtensionDocs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212
### Getting All Rows
1313

14-
- ``SQLQueryFetcher/all(decoding:with:)->[D]``
14+
- ``SQLQueryFetcher/all()->[SQLRow]``
1515
- ``SQLQueryFetcher/all(decoding:)->[D]``
1616
- ``SQLQueryFetcher/all(decoding:prefix:keyDecodingStrategy:userInfo:)->[D]``
1717
- ``SQLQueryFetcher/all(decoding:with:)->[D]``
1818
- ``SQLQueryFetcher/all(decodingColumn:as:)->[D]``
1919

2020
### Getting One Row
2121

22-
- ``SQLQueryFetcher/first()->EventLoopFuture<(SQLRow)?>``
22+
- ``SQLQueryFetcher/first()->SQLRow?``
2323
- ``SQLQueryFetcher/first(decoding:)->D?``
2424
- ``SQLQueryFetcher/first(decoding:prefix:keyDecodingStrategy:userInfo:)->D?``
2525
- ``SQLQueryFetcher/first(decoding:with:)->D?``

0 commit comments

Comments
 (0)