Refactor entire codebase and rewrite documentation

This commit is contained in:
2025-10-10 18:06:34 +03:00
parent b4e9755c15
commit 8e471f2b9f
74 changed files with 3405 additions and 4149 deletions

View File

@@ -0,0 +1,24 @@
import Foundation
/// A protocol representing a collection of SQLite argument values.
///
/// Conforming types provide indexed access to a sequence of ``SQLiteValue`` elements. This protocol
/// extends `Collection` to allow convenient typed subscripting using types conforming to
/// ``SQLiteRepresentable``.
public protocol ArgumentsProtocol: Collection where Element == SQLiteValue, Index == Int {
/// Returns the element at the specified index, converted to the specified type.
///
/// This subscript retrieves the argument value at the given index and attempts to convert it to
/// a type conforming to ``SQLiteRepresentable``. If the conversion succeeds, the resulting
/// value of type `T` is returned. Otherwise, `nil` is returned.
///
/// - Parameter index: The index of the value to retrieve and convert.
/// - Returns: A value of type `T` if conversion succeeds, or `nil` if it fails.
subscript<T: SQLiteRepresentable>(index: Index) -> T? { get }
}
public extension ArgumentsProtocol {
subscript<T: SQLiteRepresentable>(index: Index) -> T? {
T.init(self[index])
}
}