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 100% test coverage #223

Merged
merged 5 commits into from
May 1, 2024
Merged

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Apr 30, 2024

These changes are now available in 4.5.0

Adds Sendable correctness and ExistentialAny compliance, bumps min Swift version to 5.8, leverages the new SQLKit functionality, throws errors instead of crashes, updates CI, modernizes README, and achieves 100% test and documentation coverage.

gwynne added 5 commits April 29, 2024 12:44
…ncoder/decoders to the SQLKit layer. Add support for new SQLKit functionality. Throw DecodingErrors instead of fatalErrors(). Remove unused properties and files.
…d missing FluentBenchmark test set. Use singleton ELG and thread pool for tests.
@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 15:45
Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.87%. Comparing base (acfd0e7) to head (a6823fe).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #223       +/-   ##
===========================================
+ Coverage   77.86%   98.87%   +21.00%     
===========================================
  Files           7        7               
  Lines         253      266       +13     
===========================================
+ Hits          197      263       +66     
+ Misses         56        3       -53     
Files Coverage Δ
Sources/FluentMySQLDriver/Exports.swift 100.00% <100.00%> (+100.00%) ⬆️
...s/FluentMySQLDriver/FluentMySQLConfiguration.swift 98.64% <100.00%> (+44.59%) ⬆️
...ources/FluentMySQLDriver/FluentMySQLDatabase.swift 100.00% <100.00%> (+13.79%) ⬆️
Sources/FluentMySQLDriver/FluentMySQLDriver.swift 100.00% <100.00%> (+16.66%) ⬆️
...ces/FluentMySQLDriver/MySQLConverterDelegate.swift 100.00% <100.00%> (ø)
...ources/FluentMySQLDriver/MySQLError+Database.swift 100.00% <ø> (+16.66%) ⬆️
Sources/FluentMySQLDriver/MySQLRow+Database.swift 92.30% <100.00%> (+3.84%) ⬆️



/// This is here because it allows for full test coverage; it serves no actual purpose functionally.
/*private*/ func ignoreRow(_: MySQLRow) throws {}
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to remove the access modifier?

Copy link
Member Author

Choose a reason for hiding this comment

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

Needed in order to use it in tests. Also, "remove"? This code is new in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

I meant just remove the commented out private

}
}

private struct LastInsertRow: DatabaseOutput {
/// A `DatabaseOutput` used to provide last insert IDs from query metadata to the Fluent layer.
/*private*/ struct LastInsertRow: DatabaseOutput {
Copy link
Member

Choose a reason for hiding this comment

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

Access modifier again

Copy link
Member Author

Choose a reason for hiding this comment

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

Again, needed in tests.

}
}

/// Retroactive conformance to `Sendable` for `MySQLConnection`, which happens to actually be `Senable`-correct
/// but not annotated as such.
extension MySQLNIO.MySQLConnection: @unchecked Swift.Sendable {}
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to do this with @preconcurrency import MySQLNIO - this would provide a warning when it's no longer needed and avoid the situation where it might accidentally be not-Sendable-correct in the future

Copy link
Member Author

Choose a reason for hiding this comment

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

MySQLNIO is most of the way done being completely rewritten - MySQLConnection will no longer be the type in use; it isn't expected to be changed again at all.

@gwynne gwynne merged commit 26f142d into main May 1, 2024
21 checks passed
@gwynne gwynne deleted the general-update branch May 1, 2024 08:46
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