Skip to content

Commit

Permalink
Avoid ambiguity
Browse files Browse the repository at this point in the history
Either packs or the plain thing.
  • Loading branch information
helje5 committed Dec 4, 2024
1 parent 9e5385f commit 0275bc1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Sources/ZeeQL/Control/FetchSpecification+Builder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ public extension DatabaseFetchSpecification
`where`(key, .EqualTo, value)
}

@inlinable
func order<V>(by key: Swift.KeyPath<Object.FullEntity, CodeAttribute<V>>,
_ selector: SortOrdering.Selector = .CompareAscending)
-> Self
where V: AttributeValue
{
let attribute = Object.e[keyPath: key]
let so = SortOrdering(key: AttributeKey(attribute), selector: selector)
return order(by: so)
}

#if swift(>=5.9)
@inlinable
func order<each V: AttributeValue>(
Expand All @@ -186,5 +175,16 @@ public extension DatabaseFetchSpecification
}
return fs
}
#else
@inlinable
func order<V>(by key: Swift.KeyPath<Object.FullEntity, CodeAttribute<V>>,
_ selector: SortOrdering.Selector = .CompareAscending)
-> Self
where V: AttributeValue
{
let attribute = Object.e[keyPath: key]
let so = SortOrdering(key: AttributeKey(attribute), selector: selector)
return order(by: so)
}
#endif // swift(>=5.9
}

0 comments on commit 0275bc1

Please sign in to comment.