DatabaseValue
public struct DatabaseValue
DatabaseValue is the intermediate type between SQLite and your values.
-
An SQLite storage (NULL, INTEGER, REAL, TEXT, BLOB).
See moreDeclaration
Swift
public enum Storage
-
The SQLite storage
Declaration
Swift
public let storage: Storage
-
The NULL DatabaseValue.
Declaration
Swift
public static let null = DatabaseValue(storage: .null)
-
Creates a DatabaseValue from Any.
The result is nil unless object adopts DatabaseValueConvertible.
Declaration
Swift
public init?(value: Any)
-
Returns true if databaseValue is NULL.
Declaration
Swift
public var isNull: Bool
-
Returns Int64, Double, String, Data or nil.
Declaration
Swift
public func value() -> DatabaseValueConvertible?
-
Returns the value, converted to the requested type.
If the SQLite value is NULL, the result is nil. Otherwise the SQLite value is converted to the requested type
Value
. Should this conversion fail, a fatal error is raised.If this fatal error is unacceptable to you, use DatabaseValueConvertible.fromDatabaseValue() method.
Declaration
Swift
public func value<Value: DatabaseValueConvertible>() -> Value?
Return Value
An optional .
-
Returns the value, converted to the requested type.
This method crashes if the SQLite value is NULL, or if the SQLite value can not be converted to
Value
.Declaration
Swift
public func value<Value: DatabaseValueConvertible>() -> Value
Return Value
A .
-
The hash value
Declaration
Swift
public var hashValue: Int
-
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
Declaration
Swift
public static func ==(lhs: DatabaseValue, rhs: DatabaseValue) -> Bool
-
Returns self
Declaration
Swift
public var databaseValue: DatabaseValue
-
Returns
databaseValue
Declaration
Swift
public static func fromDatabaseValue(_ databaseValue: DatabaseValue) -> DatabaseValue?
-
This property is an implementation detail of the query interface. Do not use it directly.
See https://github.com/groue/GRDB.swift/#the-query-interface
Low Level Query Interface
See SQLExpression.sqlExpression
Declaration
Swift
public var sqlExpression: SQLExpression
-
A textual representation of
self
.Declaration
Swift
public var description: String
-
This function is an implementation detail of the query interface. Do not use it directly.
See https://github.com/groue/GRDB.swift/#the-query-interface
Low Level Query Interface
See SQLExpression.expressionSQL(_:arguments:)
Declaration
Swift
public func expressionSQL(_ arguments: inout StatementArguments?) -> String
-
This property is an implementation detail of the query interface. Do not use it directly.
See https://github.com/groue/GRDB.swift/#the-query-interface
Low Level Query Interface
See SQLExpression.negated
Declaration
Swift
public var negated: SQLExpression