Extensions

The following extensions are available globally.

  • Data is convertible to and from DatabaseValue.

    See more
  • Swift’s Optional comes with built-in methods that allow to fetch cursors and arrays of optional DatabaseValueConvertible:

    try Optional<String>.fetchCursor(db, "SELECT name FROM ...", arguments:...) // Cursor of String?
    try Optional<String>.fetchAll(db, "SELECT name FROM ...", arguments:...)    // [String?]
    
    let statement = try db.makeSelectStatement("SELECT name FROM ...")
    try Optional<String>.fetchCursor(statement, arguments:...) // Cursor of String?
    try Optional<String>.fetchAll(statement, arguments:...)    // [String?]
    

    DatabaseValueConvertible is adopted by Bool, Int, String, etc.

    See more

    Declaration

    Swift

    enum Optional<Wrapped> : ExpressibleByNilLiteral
  • NSDate is stored in the database using the format yyyy-MM-dd HH:mm:ss.SSS, in the UTC time zone.

    See more
  • Date is stored in the database using the format yyyy-MM-dd HH:mm:ss.SSS, in the UTC time zone.

    See more

    Declaration

    Swift

    struct Date : ReferenceConvertible, Comparable, Equatable
  • NSData is convertible to and from DatabaseValue.

    See more

    Declaration

    Swift

    class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
  • Declaration

    Swift

    struct Range<Bound> where Bound : Comparable
  • Declaration

    Swift

    struct ClosedRange<Bound> where Bound : Comparable
  • Declaration

    Swift

    struct CountableRange<Bound> where Bound : Strideable, Bound.Stride : SignedInteger
  • Declaration

    Swift

    struct CountableClosedRange<Bound> where Bound : Strideable, Bound.Stride : SignedInteger
  • Bool adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Bool
  • Int

    Int adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Int : FixedWidthInteger, SignedInteger
  • Int8 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Int8 : FixedWidthInteger, SignedInteger
  • Int16 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Int16 : FixedWidthInteger, SignedInteger
  • Int32 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Int32 : FixedWidthInteger, SignedInteger
  • Int64 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Int64 : FixedWidthInteger, SignedInteger
  • UInt adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct UInt : FixedWidthInteger, UnsignedInteger
  • UInt8 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct UInt8 : FixedWidthInteger, UnsignedInteger
  • UInt16 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct UInt16 : FixedWidthInteger, UnsignedInteger
  • UInt32 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct UInt32 : FixedWidthInteger, UnsignedInteger
  • UInt64 adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct UInt64 : FixedWidthInteger, UnsignedInteger
  • Double adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Double
  • Float adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct Float
  • String adopts DatabaseValueConvertible and StatementColumnConvertible.

    See more

    Declaration

    Swift

    struct String
  • NSURL stores its absoluteString in the database.

    See more