Replies: 2 comments 13 replies
-
Thanks for the report, @seanmrich. I haven't installed the latest beta yet. Strictly speaking, associations are not Sendable, because they can embed non-Sendable values or closures. See for example the family of methods name Practically speaking, I'm sure that most apps define requests and associations that only embed values and closures that are free of data races. Still, making them strictly Sendable would introduce a lot of breaking changes, that will require bumping GRDB to GRDB 7. I'm torn. I wish we could find a step-by-step way forward. Besides changing |
Beta Was this translation helpful? Give feedback.
-
Hello! I am not a GRDB user, and I know basically zero about how it works. However, I am a Swift concurrency "enthusiast" and @groue got me interested because it turns out I do not understand what's going on. First, why doesn't for i in 0..<1000 {
DispatchQueue.global().async {
Author.books.someActionOnBooks()
}
} Is this safe? If so, perhaps the type that |
Beta Was this translation helpful? Give feedback.
-
In the associations section of the documentation there is this code on how to define associations:
When using strict concurrency since the implementation of SE-0412 you get a warning as annotated in the code above. A workaround is to write the declarations as
static var
rather thanstatic let
, but then you have to fully specify the type and thereby lose the nice ergonomics of the example above. Would it be possible to conform types likeBelongsToAssociation
andHasManyAssociation
toSendable
?Beta Was this translation helpful? Give feedback.
All reactions