Skip to content

SQLite: Add @DatabaseCollation - #345

Draft
stephencelis wants to merge 4 commits into
isolation-checksfrom
custom-collations
Draft

SQLite: Add @DatabaseCollation#345
stephencelis wants to merge 4 commits into
isolation-checksfrom
custom-collations

Conversation

@stephencelis

Copy link
Copy Markdown
Member

This macro is similar to @DatabaseFunction but can be used to define custom collating sequences:

@DatabaseCollation
func unicode(_ lhs: String, _ rhs: String) -> CollationOrder {
  CollationOrder(lhs, rhs)
}

db.install(collation: $unicode)

Reminder.order { $0.title.collate($unicode) }

This macro is similar to `@DatabaseFunction` but can be used to define
custom collating sequences:

```swift
@DatabaseCollation
func unicode(_ lhs: String, _ rhs: String) -> CollationOrder {
  CollationOrder(lhs, rhs)
}

db.install(collation: $unicode)

Reminder.order { $0.title.collate($unicode) }
```
@stephencelis
stephencelis requested a review from mbrandonw August 4, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant