SelectTerm
public enum SelectTerm<D> : ExpressibleByStringLiteral, Hashable where D : DynamicObject
The SelectTerm is passed to the Select clause to indicate the attributes/aggregate keys to be queried.
-
Provides a
SelectTermto aSelectclause for querying an entity attribute. A shorter way to do the same is to assign from the string keypath directly:let fullName = CoreStore.queryValue( From<MyPersonEntity>(), Select<String>(.attribute("fullName")), Where("employeeID", isEqualTo: 1111) )is equivalent to:
let fullName = CoreStore.queryValue( From<MyPersonEntity>(), Select<String>("fullName"), Where("employeeID", isEqualTo: 1111) )Declaration
Swift
public static func attribute(_ keyPath: KeyPathString) -> SelectTerm<D>Parameters
keyPaththe attribute name
Return Value
a
SelectTermto aSelectclause for querying an entity attribute -
Provides a
SelectTermto aSelectclause for querying the average value of an attribute.let averageAge = CoreStore.queryValue( From<MyPersonEntity>(), Select<Int>(.average("age")) )Declaration
Swift
public static func average(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyaverage(
is used) Return Value
a
SelectTermto aSelectclause for querying the average value of an attribute -
Provides a
SelectTermto aSelectclause for a count query.let numberOfEmployees = CoreStore.queryValue( From<MyPersonEntity>(), Select<Int>(.count("employeeID")) )Declaration
Swift
public static func count(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keycount(
is used) Return Value
a
SelectTermto aSelectclause for a count query -
Provides a
SelectTermto aSelectclause for querying the maximum value for an attribute.let maximumAge = CoreStore.queryValue( From<MyPersonEntity>(), Select<Int>(.maximum("age")) )Declaration
Swift
public static func maximum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymax(
is used) Return Value
a
SelectTermto aSelectclause for querying the maximum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the minimum value for an attribute.let minimumAge = CoreStore.queryValue( From<MyPersonEntity>(), Select<Int>(.minimum("age")) )Declaration
Swift
public static func minimum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymin(
is used) Return Value
a
SelectTermto aSelectclause for querying the minimum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the sum value for an attribute.let totalAge = CoreStore.queryValue( From<MyPersonEntity>(), Select<Int>(.sum("age")) )Declaration
Swift
public static func sum(_ keyPath: KeyPathString, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keysum(
is used) Return Value
a
SelectTermto aSelectclause for querying the sum value for an attribute -
Provides a
SelectTermto aSelectclause for querying theNSManagedObjectID.let objectID = CoreStore.queryValue( From<MyPersonEntity>(), Select<NSManagedObjectID>(), Where("employeeID", isEqualTo: 1111) )Declaration
Swift
public static func objectID(as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyobjecID
is usedReturn Value
a
SelectTermto aSelectclause for querying the sum value for an attribute
-
Declaration
Swift
public init(stringLiteral value: KeyPathString) -
Declaration
Swift
public init(unicodeScalarLiteral value: KeyPathString) -
Declaration
Swift
public init(extendedGraphemeClusterLiteral value: KeyPathString)
-
Declaration
Swift
public static func == (lhs: SelectTerm<D>, rhs: SelectTerm<D>) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var debugDescription: String { get }
-
Provides a
SelectTermto aSelectclause for querying the average value of an attribute.Declaration
Swift
public static func average<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyaverage(
is used) Return Value
a
SelectTermto aSelectclause for querying the average value of an attribute -
Provides a
SelectTermto aSelectclause for a count query.Declaration
Swift
public static func count<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keycount(
is used) Return Value
a
SelectTermto aSelectclause for a count query -
Provides a
SelectTermto aSelectclause for querying the maximum value for an attribute.Declaration
Swift
public static func maximum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymax(
is used) Return Value
a
SelectTermto aSelectclause for querying the maximum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the minimum value for an attribute.Declaration
Swift
public static func minimum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymin(
is used) Return Value
a
SelectTermto aSelectclause for querying the minimum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the sum value for an attribute.Declaration
Swift
public static func sum<V>(_ keyPath: KeyPath<D, V>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keysum(
is used) Return Value
a
SelectTermto aSelectclause for querying the sum value for an attribute
-
Provides a
SelectTermto aSelectclause for querying an entity attribute.Declaration
Swift
public static func attribute<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>) -> SelectTerm<D> where V : ImportableAttributeTypeParameters
keyPaththe attribute name
Return Value
a
SelectTermto aSelectclause for querying an entity attribute -
Provides a
SelectTermto aSelectclause for querying an entity attribute.Declaration
Swift
public static func attribute<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>) -> SelectTerm<D> where V : ImportableAttributeTypeParameters
keyPaththe attribute name
Return Value
a
SelectTermto aSelectclause for querying an entity attribute -
Provides a
SelectTermto aSelectclause for querying an entity attribute.Declaration
Swift
public static func attribute<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>) -> SelectTerm<D> where V : NSCoding, V : NSCopyingParameters
keyPaththe attribute name
Return Value
a
SelectTermto aSelectclause for querying an entity attribute -
Provides a
SelectTermto aSelectclause for querying an entity attribute.Declaration
Swift
public static func attribute<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>) -> SelectTerm<D> where V : NSCoding, V : NSCopyingParameters
keyPaththe attribute name
Return Value
a
SelectTermto aSelectclause for querying an entity attribute -
Provides a
SelectTermto aSelectclause for querying the average value of an attribute.Declaration
Swift
public static func average<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyaverage(
is used) Return Value
a
SelectTermto aSelectclause for querying the average value of an attribute -
Provides a
SelectTermto aSelectclause for querying the average value of an attribute.Declaration
Swift
public static func average<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyaverage(
is used) Return Value
a
SelectTermto aSelectclause for querying the average value of an attribute -
Provides a
SelectTermto aSelectclause for querying the average value of an attribute.Declaration
Swift
public static func average<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyaverage(
is used) Return Value
a
SelectTermto aSelectclause for querying the average value of an attribute -
Provides a
SelectTermto aSelectclause for querying the average value of an attribute.Declaration
Swift
public static func average<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keyaverage(
is used) Return Value
a
SelectTermto aSelectclause for querying the average value of an attribute -
Provides a
SelectTermto aSelectclause for a count query.Declaration
Swift
public static func count<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keycount(
is used) Return Value
a
SelectTermto aSelectclause for a count query -
Provides a
SelectTermto aSelectclause for a count query.Declaration
Swift
public static func count<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keycount(
is used) Return Value
a
SelectTermto aSelectclause for a count query -
Provides a
SelectTermto aSelectclause for a count query.Declaration
Swift
public static func count<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keycount(
is used) Return Value
a
SelectTermto aSelectclause for a count query -
Provides a
SelectTermto aSelectclause for a count query.Declaration
Swift
public static func count<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keycount(
is used) Return Value
a
SelectTermto aSelectclause for a count query -
Provides a
SelectTermto aSelectclause for querying the maximum value for an attribute.Declaration
Swift
public static func maximum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymax(
is used) Return Value
a
SelectTermto aSelectclause for querying the maximum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the maximum value for an attribute.Declaration
Swift
public static func maximum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymax(
is used) Return Value
a
SelectTermto aSelectclause for querying the maximum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the maximum value for an attribute.Declaration
Swift
public static func maximum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymax(
is used) Return Value
a
SelectTermto aSelectclause for querying the maximum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the maximum value for an attribute.Declaration
Swift
public static func maximum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymax(
is used) Return Value
a
SelectTermto aSelectclause for querying the maximum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the minimum value for an attribute.Declaration
Swift
public static func minimum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymin(
is used) Return Value
a
SelectTermto aSelectclause for querying the minimum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the minimum value for an attribute.Declaration
Swift
public static func minimum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymin(
is used) Return Value
a
SelectTermto aSelectclause for querying the minimum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the minimum value for an attribute.Declaration
Swift
public static func minimum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymin(
is used) Return Value
a
SelectTermto aSelectclause for querying the minimum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the minimum value for an attribute.Declaration
Swift
public static func minimum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keymin(
is used) Return Value
a
SelectTermto aSelectclause for querying the minimum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the sum value for an attribute.Declaration
Swift
public static func sum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keysum(
is used) Return Value
a
SelectTermto aSelectclause for querying the sum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the sum value for an attribute.Declaration
Swift
public static func sum<V>(_ keyPath: KeyPath<D, ValueContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keysum(
is used) Return Value
a
SelectTermto aSelectclause for querying the sum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the sum value for an attribute.Declaration
Swift
public static func sum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Required<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keysum(
is used) Return Value
a
SelectTermto aSelectclause for querying the sum value for an attribute -
Provides a
SelectTermto aSelectclause for querying the sum value for an attribute.Declaration
Swift
public static func sum<V>(_ keyPath: KeyPath<D, TransformableContainer<D>.Optional<V>>, as alias: KeyPathString? = nil) -> SelectTerm<D>Parameters
keyPaththe attribute name
aliasthe dictionary key to use to access the result. Ignored when the query return value is not an
NSDictionary. Ifnil, the default keysum(
is used) Return Value
a
SelectTermto aSelectclause for querying the sum value for an attribute
View on GitHub
SelectTerm Enumeration Reference