DataLireCoder swift package

This commit is contained in:
2025-04-27 12:53:43 +03:00
parent 2cca986016
commit 5aec6ea578
60 changed files with 7144 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import Foundation
protocol Container {
associatedtype Decoder: Swift.Decoder
var decoder: Decoder { get }
}

View File

@@ -0,0 +1,6 @@
import Foundation
public protocol DateDecoder {
func decode(from decoder: any ValueDecoder) throws -> Date
func decode(from decoder: any RowDecoder, for key: any CodingKey) throws -> Date
}

View File

@@ -0,0 +1,8 @@
import Foundation
public protocol Decoder: Swift.Decoder {
associatedtype SQLiteData
var dateDecoder: any DateDecoder { get }
var sqliteData: SQLiteData { get }
}

View File

@@ -0,0 +1,5 @@
import Foundation
public protocol KeyCheckingDecoder: Decoder {
func contains(_ key: CodingKey) -> Bool
}

View File

@@ -0,0 +1,11 @@
import Foundation
import DataLiteCore
public protocol RowDecoder: Decoder {
var count: Int? { get }
func decodeNil(for key: CodingKey) throws -> Bool
func decodeDate(for key: CodingKey) throws -> Date
func decode<T: SQLiteRawRepresentable>(_ type: T.Type, for key: CodingKey) throws -> T
func decoder(for key: CodingKey) throws -> any Decoder
}

View File

@@ -0,0 +1,8 @@
import Foundation
import DataLiteCore
public protocol ValueDecoder: Decoder {
func decodeNil() -> Bool
func decodeDate() throws -> Date
func decode<T: SQLiteRawRepresentable>(_ type: T.Type) throws -> T
}