Select
public struct Select<O, T> : SelectClause, Hashable where O : DynamicObject, T : SelectResultType
extension Select: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
The Select
clause indicates the attribute / aggregate value to be queried. The generic type is a SelectResultType
, and will be used as the return type for the query.
You can bind the return type by specializing the initializer:
let maximumAge = dataStack.queryValue(
From<MyPersonEntity>(),
Select<Int>(.maximum("age"))
)
or by casting the type of the return value:
let maximumAge: Int = dataStack.queryValue(
From<MyPersonEntity>(),
Select(.maximum("age"))
)
Valid return types depend on the query:
- for
queryValue(...)
methods:- all types that conform to
QueryableAttributeType
protocol
- all types that conform to
for
queryAttributes(...)
methods:NSDictionary
Parameters
sortDescriptors
|
a series of |
-
Initializes a
Select
clause with a list ofSelectTerm
sDeclaration
Swift
public init(_ selectTerm: SelectTerm<O>, _ selectTerms: SelectTerm<O>...)
Parameters
selectTerm
selectTerms
a series of
SelectTerm
s -
Initializes a
Select
clause with a list ofSelectTerm
sDeclaration
Swift
public init(_ selectTerms: [SelectTerm<O>])
Parameters
selectTerms
a series of
SelectTerm
s
-
Declaration
Swift
public static func == <T1, T2>(lhs: Select<O, T1>, rhs: Select<O, T2>) -> Bool where T1 : SelectResultType, T2 : SelectResultType
-
Declaration
Swift
public typealias ObjectType = O
-
Declaration
Swift
public typealias ReturnType = T
-
Declaration
Swift
public let selectTerms: [SelectTerm<O>]
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }
-
Initializes a
Select
that queries forNSManagedObjectID
resultsDeclaration
Swift
public init()
-
Initializes a
Select
that queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<O, T>)
Parameters
keyPath
the keyPath for the attribute
-
Initializes a
Select
that queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<O, ValueContainer<O>.Required<T>>)
Parameters
keyPath
the keyPath for the attribute
-
Initializes a
Select
that queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<O, ValueContainer<O>.Optional<T>>)
Parameters
keyPath
the keyPath for the attribute
-
Initializes a
Select
that queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<O, TransformableContainer<O>.Required<T>>)
Parameters
keyPath
the keyPath for the attribute
-
Initializes a
Select
that queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<O, TransformableContainer<O>.Optional<T>>)
Parameters
keyPath
the keyPath for the attribute