Select
public struct Select<D, T> : SelectClause, Hashable where D : DynamicObject, T : SelectResultType
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 = CoreStore.queryValue(
From<MyPersonEntity>(),
Select<Int>(.maximum("age"))
)
or by casting the type of the return value:
let maximumAge: Int = CoreStore.queryValue(
From<MyPersonEntity>(),
Select(.maximum("age"))
)
Valid return types depend on the query:
- for
queryValue(...)methods:- all types that conform to
QueryableAttributeTypeprotocol
- all types that conform to
for
queryAttributes(...)methods:NSDictionary
-
Initializes a
Selectclause with a list ofSelectTermsDeclaration
Swift
public init(_ selectTerm: SelectTerm<D>, _ selectTerms: SelectTerm<D>...)Parameters
selectTermselectTermsa series of
SelectTerms -
Initializes a
Selectclause with a list ofSelectTermsDeclaration
Swift
public init(_ selectTerms: [SelectTerm<D>])Parameters
selectTermsa series of
SelectTerms
-
Declaration
Swift
public static func == <T, U>(lhs: Select<D, T>, rhs: Select<D, U>) -> Bool where T : SelectResultType, U : SelectResultType
-
Declaration
Swift
public typealias ObjectType = D -
Declaration
Swift
public typealias ReturnType = T -
Declaration
Swift
public let selectTerms: [SelectTerm<D>]
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }
-
Initializes a
Selectthat queries forNSManagedObjectIDresultsDeclaration
Swift
public init()
-
Initializes a
Selectthat queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<D, T>)Parameters
keyPaththe keyPath for the attribute
-
Initializes a
Selectthat queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<D, ValueContainer<D>.Required<T>>)Parameters
keyPaththe keyPath for the attribute
-
Initializes a
Selectthat queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<T>>)Parameters
keyPaththe keyPath for the attribute
-
Initializes a
Selectthat queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<T>>)Parameters
keyPaththe keyPath for the attribute
-
Initializes a
Selectthat queries the value of an attribute pertained by a keyPathDeclaration
Swift
public init(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<T>>)Parameters
keyPaththe keyPath for the attribute
View on GitHub
Select Structure Reference