Skip to content

Commit 315ee36

Browse files
committed
docs
1 parent 699c9aa commit 315ee36

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ To define a Swift data type that represents this table, one can use the `@Table`
5151
}
5252
```
5353

54+
> Note: If your project is using [default main actor isolation] then you further need to annotate
55+
> your struct as `nonisolated`.
56+
[default main actor isolation]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0466-control-default-actor-isolation.md
57+
5458
Note that the struct's field names match the column tables of the table exactly. In order to support
5559
property names that differ from the columns names, you can use the `@Column` macro. See the section
5660
below, <doc:DefiningYourSchema#Customizing-a-table>, for more information on how to customize your

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ extension Reminder {
5050
}
5151
```
5252

53+
> Note: If your project is using [default main actor isolation] then you further need to annotate
54+
> your extension as `nonisolated`, or define the helpers directly in the declaration of the struct.
55+
[default main actor isolation]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0466-control-default-actor-isolation.md
56+
5357
Then these helpers can be used when composing together a larger, more complex query. For example,
5458
we can select all non-deleted lists with the count of all non-deleted reminders in each list like
5559
so:
@@ -131,6 +135,10 @@ extension Reminder.TableColumns {
131135
}
132136
```
133137
138+
> Note: If your project is using [default main actor isolation] then you further need to annotate
139+
> your extension as `nonisolated`.
140+
[default main actor isolation]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0466-control-default-actor-isolation.md
141+
134142
Then you can use these helpers when building a query. For example, you can use
135143
``PrimaryKeyedTableDefinition/count(distinct:filter:)`` to count the number of past due, current and
136144
scheduled reminders in one single query like so:

Sources/StructuredQueriesSQLiteCore/Documentation.docc/Articles/CustomFunctions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ func exclaim(_ string: String) -> String {
1818
}
1919
```
2020

21+
> Note: If your project is using [default main actor isolation] then you further need to annotate
22+
> your function as `nonisolated`.
23+
[default main actor isolation]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0466-control-default-actor-isolation.md
24+
2125
And will be immediately callable in a query by prefixing the function with `$`:
2226

2327
```swift

0 commit comments

Comments
 (0)