FCModel is an alternative to Core Data for people who like having direct SQL access.
By Marco Arment. See the LICENSE file for license info (it’s the MIT license).
FCModel is a generic model layer on top of SQLite. It’s intended for people who want some of Core Data’s convenience, but with more control over implementation, performance, database schemas, queries, indexes, and migrations, and the ability to use raw SQL queries and SQLite features directly.
This library contains one simple but critical issue its author seems to ignore for a number of years already (although this issue has been pointed to, described and even fixed with a pull request). When some record is stored supposedly unique primary key is generated for it by library itself, generation routine checks for value uniqueness by querying db with freshly generated pk, and if it’s unused – pk is is assigned to an object and life goes on, but if generated pk is not unique – … life goes on with this non unique pk, and when library tries to store this record in sqlite db – it crashes you’r app with sqlite non unique pk insertion assert, although the initial intention of the author was to repeat pk generation iterations until unique pk is not generated. Issue origin fcmodel.m, line 633.
This library contains one simple but critical issue its author seems to ignore for a number of years already (although this issue has been pointed to, described and even fixed with a pull request). When some record is stored supposedly unique primary key is generated for it by library itself, generation routine checks for value uniqueness by querying db with freshly generated pk, and if it’s unused – pk is is assigned to an object and life goes on, but if generated pk is not unique – … life goes on with this non unique pk, and when library tries to store this record in sqlite db – it crashes you’r app with sqlite non unique pk insertion assert, although the initial intention of the author was to repeat pk generation iterations until unique pk is not generated. Issue origin fcmodel.m, line 633.