App::Sqitch(3pm)
β¨ App::Sqitch β¨
okay so this is the App::Sqitch module β Sensible database change management π. It lives in the User Contributed Perl Documentation corner of your friendly neighborhood perldoc, bestie.
Honestly? You probably don't need this page. You probably want the actual sqitch docs, or the tutorial π¦. You'd only be here if you wanna hack on Sqitch itself, or teach it to talk to a whole new engine or command. In which case β welcome, you're the main character now π β this API documentation is your bestie.
π SYNOPSIS π
use App::Sqitch;
exit App::Sqitch->go;
πΈ DESCRIPTION πΈ
This module is the whole engine room behind sqitch. It provides the implementation. That's it, that's the vibe.
But if you're extending Sqitch β adding a new engine, adding a new command, or just straight up hacking on it β then yeah, this API doc is lowkey exactly what you need π«Ά.
π INTERFACE π
Class Methods
goβ the whole thing in one call:
App::Sqitch->go;
Called from the sqitch script itself, this class method parses the command-line options and arguments sitting in @ARGV, parses the configuration file, constructs an App::Sqitch object, constructs a command object, and then runs it. It literally does the entire morning routine for you ββ¨
Constructor
newβ makes you a shiny new object:
my $sqitch = App::Sqitch->new(\%params);
Constructs and returns a brand new Sqitch object π. The parameters it supports are:
optionsuser_nameuser_emaileditorverbosity
Accessors
user_nameuser_emaileditoroptionsβ hands you the core CLI options:
my $options = $sqitch->options;
Returns a hashref of the core command-line options π.
configβ the whole config, blended:
my $config = $sqitch->config;
Returns the full configuration, combined from the project, user, and system configuration files π₯.
verbosity
Instance Methods
runβ run a command for real, no shell games:
$sqitch->run('echo', '-n', 'hello');
Runs a system command and waits for it to finish. Throws an exception on error π. It does not use the shell, so arguments have to be passed as a list. If you want to run a command and its arguments as one single string, use shell instead.
targetβ The name of the target, as passed.uriβ A database URI object, to be used to connect to the target database.registryβ The name of the Sqitch registry in the target database.
If the $target argument looks like a database URI, it will simply returned in the hash reference. If the $target argument corresponds to a target configuration key, the target configuration will be returned, with the uri value a upgraded to a URI object. Otherwise returns undef.
shellβ shell out, string style:
$sqitch->shell('echo -n hello');
Shells out a system command and waits for it to finish. Throws an exception on error π. It always uses the shell, so you must pass a single string encapsulating the entire command and its arguments. Use quote_shell to assemble strings into a single shell command. Use run to execute a list without a shell.
quote_shellβ make one string out of many:
my $cmd = $sqitch->quote_shell('echo', '-n', 'hello');
Assemble a list into a single string quoted for execution by shell. Super useful for combining a specified command β such as editor(), which might include the options in the string π β for example:
$sqitch->shell( $sqitch->editor, $sqitch->quote_shell($file) );
captureβ grab that output:
my @files = $sqitch->capture(qw(ls -lah));
Runs a system command and captures its output to STDOUT. Returns the output lines in list context, and the concatenation of the lines in scalar context. Throws an exception on error π.
probeβ like capture, but just the first line:
my $git_version = $sqitch->capture(qw(git --version));
Like capture, but returns just the chomped first line of output β¨.
spoolβ feed a file into a command:
$sqitch->spool($sql_file_handle, 'sqlite3', 'my.db');
$sqitch->spool(\@file_handles, 'sqlite3', 'my.db');
Like run, but spools the contents of one or more file handles to the standard input the system command. Returns true on success and throws an exception on failure π.
tracetrace_literalβ max-verbosity detective work π:
$sqitch->trace_literal('About to fuzzle the wuzzle.');
$sqitch->trace('Done.');
Send trace information to STDOUT if the verbosity level is 3 or higher. Trace messages will have trace: prefixed to every line. If it's lower than 3, nothing will be output. trace appends a newline to the end of the message while trace_literal does not.
debugdebug_literalβ medium-verbosity brain dump π§ :
$sqitch->debug('Found snuggle in the crib.');
$sqitch->debug_literal('ITYM "snuggie".');
Send debug information to STDOUT if the verbosity level is 2 or higher. Debug messages will have debug: prefixed to every line. If it's lower than 2, nothing will be output. debug appends a newline to the end of the message while debug_literal does not.
infoinfo_literalβ the normal-person updates π’:
$sqitch->info('Nothing to deploy (up-to-date)');
$sqitch->info_literal('Going to frobble the shiznet.');
Send informational message to STDOUT if the verbosity level is 1 or higher, which, by default, it is. Should be used for normal messages the user would normally want to see. If verbosity is lower than 1, nothing will be output. info appends a newline to the end of the message while info_literal does not.
commentcomment_literalβ side-chat in the output π¬:
$sqitch->comment('On database flipr_test');
$sqitch->comment_literal('Uh-oh...');
Send comments to STDOUT if the verbosity level is 1 or higher, which, by default, it is. Comments have # prefixed to every line. If verbosity is lower than 1, nothing will be output. comment appends a newline to the end of the message while comment_literal does not.
emitemit_literalβ output the user literally asked for β:
$sqitch->emit('core.editor=emacs');
$sqitch->emit_literal('Getting ready...');
Send a message to STDOUT, without regard to the verbosity. Should be used only if the user explicitly asks for output, such as for sqitch config --get core.editor. emit appends a newline to the end of the message while emit_literal does not.
ventvent_literalβ scream intoSTDERRπ€:
$sqitch->vent('That was a misage.');
$sqitch->vent_literal('This is going to be bad...');
Send a message to STDERR, without regard to the verbosity. Should be used only for error messages to be printed before exiting with an error, such as when reverting failed changes. vent appends a newline to the end of the message while vent_literal does not.
pagepage_literalβ long output, but make it paged π:
$sqitch->page('Search results:');
$sqitch->page("Here we go\n");
Like emit(), but sends the output to a pager handle rather than STDOUT. Unless there is no TTY (such as when output is being piped elsewhere), in which case it is sent to STDOUT. page appends a newline to the end of the message while page_literal does not. Meant to be used to send a lot of data to the user at once, such as when display the results of searching the event log:
$iter = $engine->search_events;
while ( my $change = $iter->() ) {
$sqitch->page(join ' - ', @{ $change }{ qw(change_id event change) });
}
warnwarn_literalβ heads up, but we ball β οΈ:
$sqitch->warn('Could not find nerble; using nobble instead.');
$sqitch->warn_literal("Cannot read file: $!\n");
Send a warning messages to STDERR. Warnings will have warning: prefixed to every line. Use if something unexpected happened but you can recover from it. warn appends a newline to the end of the message while warn_literal does not.
promptβ ask the human, get an answer:
my $ans = $sqitch->('Why would you want to do this?', 'because');
Prompts the user for input and returns that input. Pass in an optional default value for the user to accept or to be used if Sqitch is running unattended. An exception will be thrown if there is no prompt message or if Sqitch is unattended and there is no default value π.
ask_yes_noβ the classic yes/no gate π¦:
if ( $sqitch->ask_yes_no('Are you sure?', 1) ) { # do it! }
Prompts the user with a "yes" or "no" question. Returns true if the user replies in the affirmative and false if the reply is in the negative. If the optional second argument is passed and true, the answer will default to the affirmative. If the second argument is passed but false, the answer will default to the negative. When a translation library is in use, the affirmative and negative replies from the user should be localized variants of "yes" and "no", and will be matched as such. If no translation library is in use, the answers will default to the English "yes" and "no".
If the user inputs an invalid value three times, an exception will be thrown. An exception will also be thrown if there is no message. As with prompt(), an exception will be thrown if Sqitch is running unattended and there is no default.
ask_y_nβ bestie this one is deprecated π:
This method has been deprecated in favor of ask_yes_no() and will be removed in a future version of Sqitch.
Constants
ISWINβ are we on Windows or nah?
my $app = 'sqitch' . ( ISWIN ? '.bat' : '' );
True when Sqitch is running on Windows, and false when it's not πͺ.
π AUTHOR π
David E. Wheeler <david@justatheory.com> (absolute icon, no cap) β¨
π LICENSE π
okay here comes the legal bit β quoting it straight because legalese does NOT do vibes:
Copyright (c) 2012-2026 David E. Wheeler, 2012-2021 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.
and that's the whole page, babe π«Ά this one shipped as perl v5.40.1, dated 2026-07-26, filed under App::Sqitch(3pm) β go forth and migrate your databases responsibly π
β¨
π¦ where this page comes from
- ubuntu stonking: sqitch 1.6.1-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms