Re: Clarification of NSPredicate constraints for Core Data SQL store
Re: Clarification of NSPredicate constraints for Core Data SQL store
- Subject: Re: Clarification of NSPredicate constraints for Core Data SQL store
- From: "Melissa J. Turner" <email@hidden>
- Date: Tue, 30 Jun 2009 13:18:01 -0700
On Jun 30, 2009, at 09:44, Barry Wark wrote:
In the "Constraints and Limitations" section of the Predicate
Programming Guide
(http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/Articles/pBasics.html#//apple_ref/doc/uid/TP40001792-249799
),
the second bullet states than only one operator (ALL, IN, ANY) and
only one instance of that operator per query. I can't find any
reference to such a limitation in the SQLite documentation, so I
assume that this is an NSPredicate or Core Data limitation. From the
doc, it seems that a predicate with a format @"self.first_name IN
{'Joe', 'Bob', 'Bertha'} OR self.last_name IN {'Smith', 'Jones'}" is
illegal. It seems that this is quite restrictive. In true lazy web
style, can any one confirm whether this restriction is really per
query or whether it is per clause in a compound predicate?
That's a bad paragraph. (The documentation I mean. Yes, a bug has been
filed.)
The CoreData SQLite store:
1) Does not support ALL
2) Supports as many IN/ANY clauses as you want
3) Does not support more than one to-many component in a single
keypath, but will support multiple keypaths each of which contains a
single to-many (your performance will probably stink because you're
doing lots of joins)
All of these are true for Leopard and SnowLeopard, and may or may not
continue to be true into the future, as the SQL generation is a work
in progress. This is not a full listing of the restrictions, but you
can play around with various predicates and see what happens.
Cheers,
+Melissa
(ps http://bugreporter.apple.com is a great place to let us know if
there's something you really need/want)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden