Skip to content

Conversation

@stephencelis
Copy link
Member

It's possible you want to animate a query sometimes but not other times. Technically this will maintain 2 separate observations of the same query when done.

@mbrandonw mbrandonw merged commit 83ad526 into main Feb 27, 2025
2 checks passed
@mbrandonw mbrandonw deleted the fetch-key-id-animation branch February 27, 2025 21:07
mbrandonw added a commit that referenced this pull request Aug 4, 2025
mackoj pushed a commit to mackoj/sqlite-data that referenced this pull request Dec 5, 2025
Currently, the various query representable wrappers must be used a very
specific way when dealing with optionals, where the optional must be on
the representation type, not the type being represented:

```swift
@column(as: Date.ISO8601Representation?.self)  // ✅
var date: Date?

@column(as: Date?.ISO8601Representation.self)  // ❌
var date: Date?
```

This PR adds a few helper type aliases to address this issue, so both
now compile and do the right thing:

```swift
@column(as: Date.ISO8601Representation?.self)  // ✅
var date: Date?

@column(as: Date?.ISO8601Representation.self)  // ✅
var date: Date?
```

It also renames `JSONRepresentation` to `Codable.JSONRepresentation`,
deprecating the former spelling. This also allows the optionality to be
placed either place:

```swift
@column(as: Notes.JSONRepresentation?.self)  // ✅
var notes: Notes?

@column(as: Notes?.JSONRepresentation.self)  // ✅
var notes: Notes?
```
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.

3 participants