Refactoring

This commit is contained in:
2025-11-07 20:38:09 +02:00
parent 5566f6f6ba
commit 5bbb722b20
26 changed files with 1097 additions and 770 deletions

View File

@@ -0,0 +1,35 @@
import Foundation
/// A type that describes a database schema version.
///
/// ## Overview
///
/// Types conforming to this alias can be compared, checked for equality, hashed, and safely used
/// across concurrent contexts. Such types are typically used to track and manage schema migrations.
///
/// ## Conformance
///
/// Conforming types must implement:
/// - `Equatable` for equality checks
/// - `Comparable` for ordering versions
/// - `Hashable` for dictionary/set membership
/// - `Sendable` for concurrency safety
///
/// ## Usage
///
/// Use this type alias when defining custom version types for use with ``VersionStorage``.
///
/// ```swift
/// struct SemanticVersion: VersionRepresentable {
/// let major: Int
/// let minor: Int
/// let patch: Int
///
/// static func < (lhs: Self, rhs: Self) -> Bool {
/// if lhs.major != rhs.major { return lhs.major < rhs.major }
/// if lhs.minor != rhs.minor { return lhs.minor < rhs.minor }
/// return lhs.patch < rhs.patch
/// }
/// }
/// ```
public typealias VersionRepresentable = Equatable & Comparable & Hashable & Sendable