Re: Generating SQL Statement from NSPredicate?
Re: Generating SQL Statement from NSPredicate?
- Subject: Re: Generating SQL Statement from NSPredicate?
- From: "Philip Q" <email@hidden>
- Date: Tue, 20 Mar 2007 19:25:51 +1200
On 20/03/07, Colin Cornaby <email@hidden> wrote:
Is it possible to generate a SQL statement from an NSPredicate? I'm
working with a MySQL backend here, and it would be great to work with
NSPredicates on the Cocoa side, and then push those NSPredicates to
the database as SQL statements.
There's nothing built in (since there's really no reason for anything
like it to be), my suggestion would be to make a category of
NSPredicate that returns the predicate in whatever format you want
(similar to -predicateFormat). However, this may be a lot harder that
it initially looks due to the complexity of predicate syntax and the
lack of any sort of parsing tool (outside of NSPredicate) for them.
-Phil
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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