DatabaseDateComponents

public struct DatabaseDateComponents : DatabaseValueConvertible, StatementColumnConvertible, Codable

DatabaseDateComponents reads and stores DateComponents in the database.

  • The available formats for reading and storing date components.

    See more

    Declaration

    Swift

    public enum Format : String

NSDateComponents conversion

  • The date components

    Declaration

    Swift

    public let dateComponents: DateComponents
  • The database format

    Declaration

    Swift

    public let format: Format
  • Creates a DatabaseDateComponents from a DateComponents and a format.

    Declaration

    Swift

    public init(_ dateComponents: DateComponents, format: Format)

    Parameters

    dateComponents

    An optional DateComponents.

    format

    The format used for storing the date components in the database.

StatementColumnConvertible adoption

  • Returns a value initialized from a raw SQLite statement pointer.

    Declaration

    Swift

    @inline(__always)
    @inlinable
    public init?(sqliteStatement: SQLiteStatement, index: Int32)

    Parameters

    sqliteStatement

    A pointer to an SQLite statement.

    index

    The column index.

DatabaseValueConvertible adoption

Codable adoption

  • Creates a new instance by decoding from the given decoder.

    Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to read data from.

  • Encodes this value into the given encoder.

    Declaration

    Swift

    public func encode(to encoder: Encoder) throws

    Parameters

    encoder

    The encoder to write data to.