Skip to content

Commit eec220b

Browse files
authored
Merge pull request #1730 from groue/dev/issue-1728
Undeprecate Date coding strategies based on DateFormatter
2 parents 618e72d + 79a7820 commit eec220b

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

GRDB/Record/EncodableRecord.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ public enum DatabaseDataEncodingStrategy: Sendable {
526526
/// ```
527527
public enum DatabaseDateEncodingStrategy: @unchecked Sendable {
528528
// @unchecked Sendable because of `DateFormatter`, which lost its
529-
// `Sendable` conformance with Xcode 16.3. See
529+
// `Sendable` conformance with Xcode 16.3 beta. See
530530
// <https://github.com/swiftlang/swift/issues/78635>.
531-
// TODO GRDB8: remove @unchecked when the .formatted case has been removed.
531+
// TODO: remove @unchecked when the compiler issue is fixed.
532532

533533
/// The strategy that uses formatting from the Date structure.
534534
///
@@ -556,7 +556,6 @@ public enum DatabaseDateEncodingStrategy: @unchecked Sendable {
556556
case iso8601
557557

558558
/// Encodes a String, according to the provided formatter
559-
@available(*, deprecated, message: "Use .custom and a Date.FormatStyle instead.")
560559
case formatted(DateFormatter)
561560

562561
/// Encodes the result of the user-provided function

GRDB/Record/FetchableRecord.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -931,9 +931,9 @@ public enum DatabaseDataDecodingStrategy: Sendable {
931931
/// }
932932
public enum DatabaseDateDecodingStrategy: @unchecked Sendable {
933933
// @unchecked Sendable because of `DateFormatter`, which lost its
934-
// `Sendable` conformance with Xcode 16.3. See
934+
// `Sendable` conformance with Xcode 16.3 beta. See
935935
// <https://github.com/swiftlang/swift/issues/78635>.
936-
// TODO GRDB8: remove @unchecked when the .formatted case has been removed.
936+
// TODO: remove @unchecked when the compiler issue is fixed.
937937

938938
/// The strategy that uses formatting from the Date structure.
939939
///
@@ -968,7 +968,6 @@ public enum DatabaseDateDecodingStrategy: @unchecked Sendable {
968968
case iso8601
969969

970970
/// Decodes a String, according to the provided formatter
971-
@available(*, deprecated, message: "Use .custom and a Date.FormatStyle instead.")
972971
case formatted(DateFormatter)
973972

974973
/// Decodes according to the user-provided function.

Tests/GRDBTests/DatabaseDateDecodingStrategyTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private enum StrategyIso8601: StrategyProvider {
2626
static let strategy: DatabaseDateDecodingStrategy = .iso8601
2727
}
2828

29-
@available(*, deprecated)
3029
private enum StrategyFormatted: StrategyProvider {
3130
static let strategy: DatabaseDateDecodingStrategy = .formatted({
3231
let formatter = DateFormatter()
@@ -419,7 +418,6 @@ extension DatabaseDateDecodingStrategyTests {
419418
// MARK: - formatted(DateFormatter)
420419

421420
extension DatabaseDateDecodingStrategyTests {
422-
@available(*, deprecated)
423421
func testFormatted() throws {
424422
try makeDatabaseQueue().read { db in
425423
var calendar = Calendar(identifier: .gregorian)

Tests/GRDBTests/DatabaseDateEncodingStrategyTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ private enum StrategyIso8601: StrategyProvider {
3030
static let strategy: DatabaseDateEncodingStrategy = .iso8601
3131
}
3232

33-
@available(*, deprecated)
3433
private enum StrategyFormatted: StrategyProvider {
3534
static let strategy: DatabaseDateEncodingStrategy = .formatted({
3635
let formatter = DateFormatter()
@@ -198,7 +197,6 @@ extension DatabaseDateEncodingStrategyTests {
198197
// MARK: - formatted(DateFormatter)
199198

200199
extension DatabaseDateEncodingStrategyTests {
201-
@available(*, deprecated)
202200
func testFormatted() throws {
203201
try testNullEncoding(strategy: StrategyFormatted.self)
204202

0 commit comments

Comments
 (0)