Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primary Sendable support for Fluent #601

Merged
merged 28 commits into from
Apr 26, 2024
Merged

Primary Sendable support for Fluent #601

merged 28 commits into from
Apr 26, 2024

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Apr 19, 2024

These changes are now available in 1.48.0

Adds as much Sendable correctness to FluentKit as it is possible to add.

Important

It was not possible to make Model correctly Sendable due to limitations of how property wrappers work, even though the wrappers themselves are Sendable. Users can get around this by adding @unchecked Sendable to each individual Model class, but this of course does not confer actual safety; it just disables the compiler's warnings.

Also adds some missing APIs to FluentSQL to allow encoding Fluent models to SQLKit queries. The existing APIs for decoding Fluent models from SQLKit queries have been renamed, and the old names deprecated.

Other changes:

  • The performance improvements for Mirror are now used in Swift 5.10
  • QueryHistory is no longer thread-unsafe for reading
  • The minimum supported Swift version is now 5.8
  • SomeCodingKey is now an alias for SQLKit's version

@gwynne gwynne added enhancement New feature or request semver-minor Contains new APIs labels Apr 19, 2024
@gwynne gwynne marked this pull request as ready for review April 26, 2024 15:43
@gwynne gwynne requested a review from 0xTim as a code owner April 26, 2024 15:43
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

One change I want, the rest I can live with.

Not overly happy with the property wrappers requiring unchecked, especially given the lack of access management internally but we don't have a huge amount of leeway here.

Very happy to drop 5.9 though

Sources/FluentKit/Database/Databases.swift Show resolved Hide resolved
Sources/FluentKit/Properties/Boolean.swift Outdated Show resolved Hide resolved
Sources/FluentKit/Query/QueryHistory.swift Outdated Show resolved Hide resolved
@gwynne gwynne changed the title [WIP] Partial Sendable support for Fluent Primary Sendable support for Fluent Apr 26, 2024
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy April 26, 2024 17:55
@gwynne gwynne merged commit 4fffbaa into main Apr 26, 2024
12 of 15 checks passed
@gwynne gwynne deleted the sendableness branch April 26, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver-minor Contains new APIs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants