Skip to content

Releases: square/predicate-builder

1.0.2

22 Sep 15:08
6235637
Compare
Choose a tag to compare

Fixed

  • Fixed representation of optional comparison values in the resulting format string. Optionals will now correctly be represented as "nil" instead of <null>

1.0.1

20 Sep 17:00
c5575f4
Compare
Choose a tag to compare

Changed

  • Use HTTPS in Podspec source

Fixed

  • Removed a crash on comparison of an Optional key path to nil

1.0.0

19 Jul 15:19
16d5f04
Compare
Choose a tag to compare

Added

  • Result builder-based DSL for declarative predicate composition
  • DSL types
    • Value, And, Or, Not, AnyMembers, NoMembers
  • String comparisons
    • like, starts(with:), ends(with:), in
  • Collection operations
    • contains(_:)
  • Predicate literals
    • true, false, NSPredicate (for composing custom prdicates using an expression string for a predicate type that does not yet exist in the DSL)
  • Operators
    • ==, !=, <, <=, >, >=, &&, ||, !
  • #PredicateBuilder macro for Swift 5.9 users
  • Disallow Foundation.Predicate types in the DSL
    • While in beta at the time of writing, the #Predicate macro does not offer as much type safety when converting itself to NSPredicate--and contains some of the same runtime crash pitfalls as the string-based predicate expression language. This restriction will be re-evaluated when Swift 5.9 is fully-released.
  • Allow TypedPredicate types to be constructed with a key path which is agnostic about the optionality of its Value
  • Constrain the builder to NSManagedObject subclasses.
    • This allows for enhanced type safety over the previous NSObject constraint, as @NSManaged stored properties are guaranteed to be operable with the predicate expression language