• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Generating SQL Statement from NSPredicate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Generating SQL Statement from NSPredicate? (From: Colin Cornaby <email@hidden>)

  • Prev by Date: Re : NON-ASCII Compiler Warning
  • Next by Date: Re: Non-ASCII Compiler Warning
  • Previous by thread: Re: Generating SQL Statement from NSPredicate?
  • Next by thread: 10.4.9 stangeness?
  • Index(es):
    • Date
    • Thread