Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Sources/FluentKitExtras/SwiftCompatibility.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import FluentKit

#if compiler(>=6.2)
@_marker public protocol _SQLKitExtrasSendableMetatype: SendableMetatype {}
public typealias _SQLKitExtrasSendableMetatype = SendableMetatype
#else
@_marker public protocol _SQLKitExtrasSendableMetatype {}
public typealias _SQLKitExtrasSendableMetatype = Any
#endif

extension FluentKit.FieldProperty: _SQLKitExtrasSendableMetatype {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Once the protocol became a typealias, it wasn't needed; the Sendable on the original property covered it all along. Now the addition is only made to the property wrappers that aren't already Sendable (it's still not a great solution, but Fluent 4 is a hopeless mess for Concurrency anyway).

extension FluentKit.BooleanProperty: _SQLKitExtrasSendableMetatype {}
extension FluentKit.OptionalBooleanProperty: _SQLKitExtrasSendableMetatype {}

extension FlatGroupProperty: _SQLKitExtrasSendableMetatype {}
extension OptionalPointerProperty: _SQLKitExtrasSendableMetatype {}
extension OptionalReferenceProperty: _SQLKitExtrasSendableMetatype {}
extension PointerProperty: _SQLKitExtrasSendableMetatype {}
extension ReferencesProperty: _SQLKitExtrasSendableMetatype {}
extension RequiredTimestampProperty: _SQLKitExtrasSendableMetatype {}