Skip to content

SQLite: Add @DatabaseCollation - #345

Merged
stephencelis merged 15 commits into
mainfrom
custom-collations
Aug 31, 2026
Merged

SQLite: Add @DatabaseCollation#345
stephencelis merged 15 commits into
mainfrom
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) }

@stephencelis
stephencelis requested a review from mbrandonw August 4, 2026 21:11
Base automatically changed from isolation-checks to main August 19, 2026 00:05
@stephencelis
stephencelis marked this pull request as ready for review August 19, 2026 00:20
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 disabled the stack merge August 31, 2026 18:29
@stephencelis
stephencelis merged commit 1599336 into main Aug 31, 2026
3 checks passed
@stephencelis
stephencelis deleted the custom-collations branch August 31, 2026 18:29
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.

2 participants