Page 1 of 1

SQL Smart Folder?

Posted: Sun Mar 21, 2010 4:43 pm
by noisyscott
Hello,

Would it be possible to create a Smart Folder based on an SQL query? I have been messing about with some simple SQL queries recently and have had a go at creating some more complicated searches using my DVDpedia and CDpedia databases as a testing ground. I understand that we would have to have some limitations on the usable SQL commands (i.e. only allow commands that do not actually modify the database) but thought this might be useful for the more advanced and adventurous users out there.

Thanks!

Scott

Re: SQL Smart Folder?

Posted: Mon Mar 22, 2010 1:09 pm
by Conor
Thank you for the suggestion. Although an advance option like that would be useful, it's technically quite complicated. Although the database is stored in SQLite format it's abstracted away by Core Data, which handles the database for DVDpedia. Core Date a great technology but it has it's limitations. One of those limitations is that it does not handle raw SQL commands. All smart searches are constructed using Cocoa NSPredicate objects that are also not simple to display to the user for customization. If your interested in more details about Core Data, there was an interesting article written by the developer of NetNewsWire of why he switched away from Core Data to SQL access directly for his iPhone version (mainly to do large updates without bringing objects into memory).

Re: SQL Smart Folder?

Posted: Mon Mar 22, 2010 5:15 pm
by noisyscott
Ah, I see. Well thanks for letting me know about that Conor. I had no idea...

Re: SQL Smart Folder?

Posted: Tue Mar 23, 2010 7:08 am
by Conor
I'll keep it in mind for the future, as Core Data is always improving and it might become possible.