DatabaseValue

DatabaseValue is the intermediate type between SQLite and your values.

See https://www.sqlite.org/datatype3.html

  • The SQLite storage

  • The NULL DatabaseValue.

  • An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).

    See more

    Declaration

    Swift

  • Creates a DatabaseValue from Any.

    The result is nil unless object adopts DatabaseValueConvertible.

Extracting Value

  • Returns true if databaseValue is NULL.

DatabaseValue

Hashable & Equatable

  • Returns whether two DatabaseValues are equal.

    1.databaseValue == "foo".databaseValue // false
    1.databaseValue == 1.databaseValue     // true
    

    When comparing integers and doubles, the result is true if and only values are equal, and if converting one type to the other does not lose information:

    1.databaseValue == 1.0.databaseValue   // true
    

    For a comparison that distinguishes integer and doubles, compare storages instead:

    1.databaseValue.storage == 1.0.databaseValue.storage // false
    
  • Returns self

  • Returns the database value