Returns the name of the default registry for the engine. Most engines just inherit the default value, sqitch, but some must do more munging, such as specifying a file name, to determine the default registry name.

The name and version of the database driver to use with the engine, returned as a string suitable for passing to use. Used internally by use_driver() to use the driver and, if it dies, to display an appropriate error message. Must be overridden by subclasses.

Returns the version of the registry understood by this release of Sqitch. The needs_upgrade() method compares this value to that returned by registry_version() to determine whether the target's registry needs upgrading.

Returns the name of the registry database. In other words, the database in which Sqitch's own data is stored. It will usually be the same as target(), but some engines, such as SQLite, may use a separate database. Used internally to name the target when the registration tables are created.

Get, set, and clear engine variables. Variables are defined as key/value pairs to be passed to the engine client in calls to deploy and revert, if the client supports variables. For example, the PostgreSQL and Vertica engines pass all the variables to their psql and vsql clients via the --set option, while the MySQL engine engine sets them via the SET command and the Oracle engine engine sets them via the SQL*Plus DEFINE command.

Deploys changes to the target database, starting with the current deployment state, and continuing to $to_change. $to_change must be a valid change specification as passable to the index_of() method of App::Sqitch::Plan. If $to_change is not specified, all changes will be applied.

The second argument specifies the reversion mode in the case of deployment failure. The allowed values are:

In the event of failure, revert all deployed changes to the last successfully-applied tag. If no tags were applied during this deployment, all changes will be reverted to the pint at which deployment began.

Validates that all dependencies will be met for all changes to be deployed, starting with the currently-deployed change up to the specified index, or to the last change in the plan if no index is passed. If any of the changes to be deployed would conflict with previously-deployed changes or are missing any required changes, an exception will be thrown. Used internally by deploy() to ensure that dependencies will be satisfied before deploying any changes.

Validates that the list of changes to be reverted, which should be passed in the order in which they will be reverted, are not depended upon by other changes. If any are depended upon by other changes, an exception will be thrown listing the changes that cannot be reverted and what changes depend on them. Used internally by revert() to ensure no dependencies will be violated before revering any changes.

Returns the App::Sqitch::Plan::Change object representing the earliest applied change. With the optional $offset argument, the returned change will be the offset number of changes following the earliest change.

Returns the App::Sqitch::Plan::Change object representing the latest applied change. With the optional $offset argument, the returned change will be the offset number of changes before the latest change.

Searches the deployed changes for a change corresponding to the specified key, which should be in a format as described in sqitchchanges. Throws an exception if the key matches more than one changes. Returns undef if it matches no changes.

Searches the deployed changes for a change corresponding to the specified key, which should be in a format as described in sqitchchanges, and returns the change's ID. Throws an exception if the key matches more than one changes. Returns undef if it matches no changes.

Searches the list of deployed changes for a change corresponding to the specified key, which should be in a format as described in sqitchchanges. Throws an exception if the key matches multiple changes.

This method is called just before a change is deployed or reverted. It should create a lock to prevent any other processes from making changes to the database, to be freed in finish_work or rollback_work.

Registers the current project plan in the registry database. The implementation should insert the project name and URI if they have not already been inserted. If a project with the same name but different URI already exists, an exception should be thrown.

Returns a list of hash references representing currently deployed changes that require the passed change. When this method returns one or more hash references, the change should not be reverted. Each hash reference should contain the following keys:

Returns the ID of the earliest applied change from the current project. With the optional $offset argument, the ID of the change the offset number of changes following the earliest change will be returned.

Returns a list of hash references, each representing a change from the current project deployed after the specified change. The keys in the hash references should be the same as for those returned by deployed_changes().

Returns the name of the change identified by the ID argument. If a tag was applied to a change after that change, the name will be returned with the tag qualification, e.g., app_user@beta. This value should be suitable for uniquely identifying the change, and passing to the get or index_of methods of App::Sqitch::Plan.

Returns a hash reference representing the current project deployment state of the database, or undef if the database has no changes deployed. If a project name is passed, the state will be returned for that project. Otherwise, the state will be returned for the local project.

The hash contains information about the last successfully deployed change, as well as any associated tags. The keys to the hash should include:

Returns a code reference that iterates over a list of the currently deployed changes in reverse chronological order. If a project name is not passed, the current project will be assumed. Each change is represented by a hash reference containing the following keys:

Returns a code reference that iterates over a list of the currently deployed tags in reverse chronological order. If a project name is not passed, the current project will be assumed. Each tag is represented by a hash reference containing the following keys:

Searches the deployment event log and returns an iterator code reference with the results. If no parameters are provided, a list of all events will be returned from the iterator reverse chronological order. The supported parameters are:

Given a deployed change ID, loads an returns a hash reference representing the change in the database. The keys should be the same as those in the hash references returned by deployed_changes(). Returns undef if the change has not been deployed.

Given a change ID and an offset, returns a hash reference of the data for a deployed change (with the same keys as defined for deployed_changes()) in the current project that was deployed $offset steps before the change identified by $change_id. If $offset is 0 or undef, the change represented by $change_id should be returned (just like load_change()). Otherwise, the change returned should be $offset steps from that change ID, where $offset may be positive (later step) or negative (earlier step). Returns undef if the change was not found or if the offset is more than the number of changes before or after the change, as appropriate.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.