Public Member Functions | |
| (id) | - initWithConnectionProvider:transactionManager:versionManager:delegate: |
| Manages database migration and initialization. | |
| (BOOL) | - migrateAndReturnError: |
| Open a new database connection and allow the PLDatabaseMigrationDelegate to perform any pending migrations. | |
Arbitrary migrations may be supplied via a PLDatabaseMigrationDelegate. The database versioning meta-data is maintained by a supplied PLDatabaseMigrationVersionManager. This class makes no assumptions about the migrations applied or the methods used to retrieve or update database schema versions.
| - (id) initWithConnectionProvider: | (id<PLDatabaseConnectionProvider>) | connectionProvider | ||
| transactionManager: | (id<PLDatabaseMigrationTransactionManager>) | lockManager | ||
| versionManager: | (id<PLDatabaseMigrationVersionManager>) | versionManager | ||
| delegate: | (id<PLDatabaseMigrationDelegate>) | delegate | ||
Manages database migration and initialization.
| connectionProvider | Database conection provider. | |
| lockManager | An object implementing the PLDatabaseMigrationTransactionManager protocol. | |
| versionManager | An object implementing the PLDatabaseMigrationVersionManager protocol. | |
| delegate | An object implementing the formal PLDatabaseMigrationDelegate protocol. |
| - (BOOL) migrateAndReturnError: | (NSError **) | outError |
Open a new database connection and allow the PLDatabaseMigrationDelegate to perform any pending migrations.
If the migration delegate returns success (YES), the PLDatabaseMigrationVersionManager will be used to set the provided version number.
If the delegate returns failure (NO), the database will not be modified in any way (including the addition of a database version number).
A transaction will be opened prior to the delegate being called. The transaction will be committed upon the return of a success value (YES). If this method returns NO, the entire transaction will be aborted.
Failure to open the database, or returning NO from the delegate, will cause database initialization to fail, and this method will return NO.
| outError | A pointer to an NSError object variable. If an error occurs, this pointer will contain an error object indicating why the migration could not be completed. If no error occurs, this parameter will be left unmodified. You may specify NULL for this parameter, and no error information will be provided. |
1.5.9