Using SQLiteObject

For each table that you have, you create a subclass of SQLiteObject. You need to do at lest four things:

Add SQLiteKit.h and .m to your project and create a subclass

Add properties

Override +tableName

Override +tableKey

Adding Properties

You can add as many properties to the subclass as you'd like. To have the object recognize a property as one that is stored in the database, you synthesize that property to be the same name as the db variable plus an underscore at the end, for example:

@synthesizedb_prop=db_prop_;

This makes the object automatically read and write the db_prop property from/to the database on hydrate: and dehydrate.

Overriding tableName and tableKey

You override these class methods to tell the objects to which table they belong, like so:

Reading from the database

Using the kit

The rest of the kit provides ways to create and update your SQLite database. it can read database structures from an XML file and create a database that represents this schema, and even update existing databases to match the schema, within the constraints of SQLite. Remember, SQLite can not rename or delete table columns.