marcoarment / FCModel

An alternative to Core Data for people who like having direct SQL access.
MIT License
1.65k stars 173 forks source link

Added +deleteAll for clearing a table without enumerating through it #61

Closed harry-isaac closed 10 years ago

harry-isaac commented 10 years ago

I'm implementing FCModel in an RSS reader and batch deleting articles when removing an account is very useful.

marcoarment commented 10 years ago

Thanks, but I'm going to decline this for now. FCModel already supports this with a one-liner:

[model executeUpdateQuery:@"DELETE FROM $T"];

I suspect delete-all is a rare enough call that it doesn't warrant a custom call, notification, etc. beyond what FCModel already includes. Much of FCModel's power over Core Data is this executeUpdateQuery: capability, and I think it makes sense to direct people to it instead of making custom calls like deleteAll or e.g. deleteWhere:, updateAllSet:, or updateAllSet:where: that just call this one-liner in their implementations.