SQLite.swift icon indicating copy to clipboard operation
SQLite.swift copied to clipboard

Will this lib consider `sendable`?

Open Horse888 opened this issue 1 year ago • 2 comments

Horse888 avatar Apr 25 '24 13:04 Horse888

I'm also interested in this answer. With the move to more strict Swift 6 concurrency there are a few objects that are advertised as and appear to be thread safe, but are not marked as such at the language level and as a result cannot be used with strict concurrency checking.

The primary one that would help us right now is the Connection object. Its only property right now is _handle which technically is a variable optional, however, it is always initialized in the constructor and never changed. Is there any reason this couldn't be a constant, non-optional and the Connection be marked Sendable?

Edit: the OpaquePointer might complicate fully checked Sendable marking as there is no way for the swift compiler to check it. @unchecked Sendable on connection might be appropriate?

zaphoyd avatar Dec 27 '24 14:12 zaphoyd

In addition to Connection, I'd like types like Table("t") and SQLite.Expression<String>("f") be Sendable so that we can define immutable let constants like let myTable = Table("t") without nonisolated(unsafe).

battlmonstr avatar Oct 27 '25 12:10 battlmonstr