Sqitch

sqitch

Name

sqitch - Sensible database change management

Synopsis

sqitch <command> [options] [command-options] [args]

Description

Sqitch is a database change management application. What makes it different from your typical migration-style approaches? A few things:

Ready to get started? Here’s where:

Terminology

Options

-C --chdir --cd DIR       Change to directory before performing any actions.
   --etc-path             Print path to etc directory and exit.
   --no-pager             Do not pipe output into a pager.
   --quiet                Quiet mode with non-error output suppressed.
-V --verbose              Increment verbosity.
   --version              Print version number and exit.
   --help                 Show a list of commands and exit.
   --man                  Print introductory documentation and exit.

Options Details

Sqitch Commands

Configuration

Sqitch configuration can be set up on a project, user, or system-wide basis. The format of the configuration file, named sqitch.conf, is the same as for git.

Here’s an example of a configuration file that might be useful checked into a VCS for a project that deploys to PostgreSQL and stores its deployment scripts with the extension ddl under the migrations directory. It also wants bundle to be created in the _build/sql directory, and to deploy starting with the “gamma” tag:

[core]
    engine    = pg
    top_dir   = migrations
    extension = ddl

[engine "pg"]
    target    = widgetopolis

[revert]
    to        = gamma

[bundle]
    from      = gamma
    tags_only = yes
    dest_dir  = _build/sql

[target "widgetopolis"]
    uri       = db:pg:widgetopolis

And here’s an example of useful configuration in ~/.sqitch/sqitch.conf, to point to system-specific engine information:

[user]
    name      = Marge N. O’Vera
    email     = marge@example.com

[engine "pg"]
    client    = /usr/local/pgsql/bin/psql

[engine "mysql"]
    client    = /usr/local/mysql/bin/mysql

[engine "oracle"]
    client    = /usr/local/instantclient_11_2/sqlplus

[engine "sqlite"]
    client    = /usr/local/bin/sqlite3

Various commands read from the configuration file and adjust their operation accordingly. See sqitch-config for a list.

See Also

The original design for Sqitch was sketched out in a number of blog posts:

Other tools that do database change management include:

Author

David E. Wheeler david@justatheory.com

License

Copyright © 2012-2018 iovation Inc.

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.