David E. Wheeler > App-Sqitch > sqitch-init


Annotate this POD


View/Report Bugs

Name ^

sqitch-init - Create a new Sqitch project

Synopsis ^

  sqitch [options] init project
  sqitch [options] init --uri uri project

Description ^

This command creates an new Sqitch project -- basically a sqitch.conf file, a sqitch.plan file, and a sql directory with deploy, revert, and verify subdirectories.

Running sqitch init in an existing repository is safe. It will not overwrite things that are already there.

Options ^


Optional URI to associate with the project. If present, the URI will be written to the project plan and used for added uniqueness in hashed object IDs.

Configuration ^

The most important thing sqitch init does is create the project plan file, sqitch.conf. While the init command has no options of its own, it relies on several of the options to sqitch to determine what to write to this file:


Sets the core.plan_file configuration variable.


Determines the top-level directory to use when writing the plan and thecore.deploy_dir, core.revert_dir, and core.verify_dir variables -- unless they are overridden by their more-specific options, detailed below.


Sets the core.deploy_dir configuration variable.


Sets the core.revert_dir configuration variable.


Sets the core.verify_dir configuration variable.


Sets the core.extension configuration variable.


Sets the core.engine configuration variable.

As a general rule, you likely won't need any of them except for --engine, since your project can have only one engine at a time, and specifying it on the command-line forever after would be annoying.

These variables will only be written if their corresponding options are specified. Otherwise, they get written as comments with user or system configuration settings, or, failing any values from those locations, from their default values. If no defaults are specified, they will still be written, commented out, with a bar = and no value. This allows one to know what sorts of things are available to edit.

Relatedly, one engine-specific sqitch option, --db-client will also be used to write the engine-specific variable core.$engine.client. Again, if this option is not specified, the engine-specific option will still be written out, but as a comment with the user or system configuration value, or a default value.

Examples ^

Start a new Sqitch project using the SQLite engine, setting the default database file to /var/db/widgets.db

  sqitch --engine --db-name /var/db/widgets.db sqlite init

Start a new Sqitch project using the PostgreSQL engine, with the default database name "widgets", the default user name "postgres", and a version-specific client:

  sqitch --engine pg \
  --db-name   widgets \
  --db-user   postgres \
  --db-client /opt/pgsql-9.1/bin/psql init

Sqitch ^

Part of the sqitch suite.

syntax highlighting: