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

Update package for Sendable, and other cleanup #217

Merged
merged 3 commits into from
May 1, 2024
Merged

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Apr 30, 2024

These changes are now available in 2.9.0

Adds Sendable correctness and ExistentialAny compliance, bumps min Swift version to 5.8, leverages the new SQLKit functionality, removes .error-level logging (uses .debug instead), updates CI, modernizes README and docs.

@gwynne gwynne added enhancement New feature or request semver-minor Contains new APIs labels Apr 30, 2024
@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy April 30, 2024 17:21
Copy link

codecov bot commented Apr 30, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 63.77%. Comparing base (a538fc6) to head (8a456d7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   63.12%   63.77%   +0.64%     
==========================================
  Files           8        8              
  Lines         339      334       -5     
==========================================
- Hits          214      213       -1     
+ Misses        125      121       -4     
Files Coverage Δ
...ntPostgresDriver/FluentPostgresConfiguration.swift 36.76% <100.00%> (ø)
...es/FluentPostgresDriver/FluentPostgresDriver.swift 100.00% <ø> (ø)
.../FluentPostgresDriver/PostgresError+Database.swift 92.30% <100.00%> (+7.69%) ⬆️
...s/FluentPostgresDriver/DatabaseID+PostgreSQL.swift 0.00% <0.00%> (ø)
.../FluentPostgresDriver/FluentPostgresDatabase.swift 81.08% <83.33%> (-3.73%) ⬇️

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.

Good to merge but I'm not overly comfortable with slapping an unchecked sendable to silence warnings instead of making the underlying types Sendable

@@ -81,7 +81,9 @@ extension DatabaseConfigurationFactory {
decodingContext: PostgresDecodingContext<some PostgresJSONDecoder>,
sqlLogLevel: Logger.Level = .debug
) -> DatabaseConfigurationFactory {
.init {
let configuration = FakeSendable(wrappedValue: configuration)
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't configuration Sendable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Too much mutability. The correct solution is to do what was done in PostgresKit, deprecating the old one and making a completely new type, but that's more work than I'm willing to do this late in the lifetime of Fluent 4. This is more of a workaround for the lack of transferring; the configuration doesn't actually need to be Sendable conceptually.

@gwynne gwynne merged commit 2cc10e8 into main May 1, 2024
5 of 6 checks passed
@gwynne gwynne deleted the general-update branch May 1, 2024 15:56
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