Skip to content

Commit 61e2ef0

Browse files
authored
Some docs updates: (#163)
- Improve migration guide for qualified types like `FTS5` - Improve Tagged docs with custom representation example
1 parent 5ea01b6 commit 61e2ef0

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ To enable the trait, specify it in the Package.swift file that depends on Struct
270270
```diff
271271
.package(
272272
url: "https://github.com/pointfreeco/swift-structured-queries",
273-
from: "0.2.0",
273+
from: "0.17.0",
274274
+ traits: ["StructuredQueriesTagged"]
275275
),
276276
```
@@ -305,6 +305,20 @@ RemindersList.leftJoin(Reminder.all) {
305305
}
306306
```
307307

308+
Tagged works with any query-representable value. For example, if you want a Tagged UUID to use the
309+
`UUID.BytesRepresentation` from StructuredQueriesSQLite:
310+
311+
```swift
312+
@Table
313+
struct RemindersList: Identifiable {
314+
typealias ID = Tagged<Self, UUID>
315+
316+
@Column(as: Tagged<Self, UUID.BytesRepresentation>.self)
317+
let id: ID
318+
// ...
319+
}
320+
```
321+
308322
### Primary keyed tables
309323

310324
It is possible to let the `@Table` macro know which property of your data type is the primary

Sources/StructuredQueriesCore/Documentation.docc/Articles/MigrationGuides/MigratingTo0.18.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,12 @@ helper module:
1616
import StructuredQueries
1717
+import StructuredQueriesSQLite
1818
```
19+
20+
If you are qualifying a SQLite-specific API, like the `FTS5` protocol, you must also update the
21+
qualification:
22+
23+
```diff
24+
@Table
25+
-struct ReminderText: StructuredQueries.FTS5 {
26+
+struct ReminderText: StructuredQueries.FTS5 {
27+
```

0 commit comments

Comments
 (0)