Skip to content

Commit c5c55db

Browse files
stephencelisgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent ad208c7 commit c5c55db

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

Sources/StructuredQueriesCore/Documentation.docc/Articles/QueryCookbook.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ RemindersList
425425

426426
> Note: There are 2 important things to note about this query:
427427
>
428-
> * Since not every reminders list will have a reminder associated with it, we are using a
428+
> * Since not every reminders list will have a reminder associated with it, we are using a
429429
> ``Select/leftJoin(_:on:)``. That will make sure to select all lists no matter what.
430430
> * The left join introduces _optional_ reminders, but we are using a special overload of
431431
> `jsonGroupArray` on optionals that automatically filters out `nil` reminders and unwraps them.
@@ -436,13 +436,13 @@ but that cost may be smaller than executing multiple SQLite requests and transfo
436436
into `Row` manually, not to mention the additional code you need to write and maintain to process
437437
the data.
438438

439-
It is even possible to load multiple associations at once. For example, suppose that there is a
439+
It is even possible to load multiple associations at once. For example, suppose that there is a
440440
`Milestone` table that is associated with a `RemindersList`:
441441

442442
```swift
443443
@Table
444444
struct Milestone: Identifiable, Codable {
445-
let id: Int
445+
let id: Int
446446
var title = ""
447447
var remindersListID: RemindersList.ID
448448
}
@@ -478,7 +478,7 @@ RemindersList
478478
```
479479

480480
> Note: Because we are now joining two independent tables to `RemindersList`, we will get duplicate
481-
> entries for all pairs of reminders with milestones. To remove those duplicates we use the
481+
> entries for all pairs of reminders with milestones. To remove those duplicates we use the
482482
> `isDistinct` option for `jsonGroupArray`.
483483
484484
This will now load all reminders lists with all of their reminders and milestones in one single

Sources/StructuredQueriesCore/SQLite/JSONFunctions.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ extension PrimaryKeyedTableDefinition {
168168
order: (some QueryExpression)? = Bool?.none,
169169
filter: (some QueryExpression<Bool>)? = Bool?.none
170170
) -> some QueryExpression<[Wrapped].JSONRepresentation>
171-
where QueryValue == Wrapped?
172-
{
173-
let filterQueryFragment = if let filter {
174-
self.primaryKey.isNot(nil).and(filter).queryFragment
175-
} else {
176-
self.primaryKey.isNot(nil).queryFragment
177-
}
171+
where QueryValue == Wrapped? {
172+
let filterQueryFragment =
173+
if let filter {
174+
self.primaryKey.isNot(nil).and(filter).queryFragment
175+
} else {
176+
self.primaryKey.isNot(nil).queryFragment
177+
}
178178
return AggregateFunction(
179179
"json_group_array",
180180
isDistinct: isDistinct,
@@ -216,8 +216,8 @@ extension PrimaryKeyedTableDefinition {
216216
} else if Value.self == Date.JulianDayRepresentation.self {
217217
return "\(quote: column.name, delimiter: .text), datetime(\(column), 'julianday')"
218218
} else if let codableType = TableColumn.QueryValue.QueryOutput.self
219-
as? any (Codable & Sendable).Type,
220-
isJSONRepresentation(codableType)
219+
as? any (Codable & Sendable).Type,
220+
isJSONRepresentation(codableType)
221221
{
222222
return "\(quote: column.name, delimiter: .text), json(\(column))"
223223
} else {

Tests/StructuredQueriesTests/JSONFunctionsTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ extension SnapshotTests {
150150
GROUP BY "reminders"."id"
151151
LIMIT 2
152152
"""
153-
}results: {
153+
} results: {
154154
"""
155155
┌──────────────────────────────────────────────┐
156156
│ ReminderRow( │
@@ -234,7 +234,7 @@ extension SnapshotTests {
234234
GROUP BY "remindersLists"."id"
235235
LIMIT 1
236236
"""
237-
}results: {
237+
} results: {
238238
"""
239239
┌────────────────────────────────────────────────┐
240240
│ RemindersListRow( │

0 commit comments

Comments
 (0)