App-Sqitch

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

    "Pod::Simple" => "1.41",
    "Template" => 0,
    "Type::Tiny::XS" => "0.010"
  },
  "recursive_test_files" => 1,
  "requires" => {
    "Algorithm::Backoff::Exponential" => "0.006",
    "Clone" => 0,
    "Config::GitLike" => "1.15",
    "DBI" => "1.631",
    "DateTime" => "1.04",
    "DateTime::TimeZone" => 0,
    "Devel::StackTrace" => "1.30",
    "Digest::SHA" => 0,
    "Encode" => 0,
    "Encode::Locale" => 0,
    "File::Basename" => 0,
    "File::Copy" => 0,
    "File::Path" => 0,
    "File::Temp" => 0,
    "Getopt::Long" => 0,
    "Hash::Merge" => 0,

Changes  view on Meta::CPAN

     - Fixed an "uninitialized value" error when creating a registry database
       on Windows. Thanks to Steven C. Buttgereit for the report (Issue #289).
     - Fixed editor selection to prioritize the `core.editor` configuration
       variable over the `$EDITOR` environment variable. The `$SQITCH_EDITOR`
       environment variable still trumps all. Thanks to Jim Nasby for the pull
       request (#296).
     - Added detection of the `$VISUAL` environment variable to Editor
       selection, prioritized after the `core.editor` configuration variable
       and before the `$EDITOR` environment variable. Thanks to Jim Nasby for
       the pull request (#296).
     - Updated the DateTime code to set the locale via `set_locale()` instead
       of `set()`, as the latter may actually change the local time
       unintentionally, and has been deprecated since DateTime v1.04. Thanks
       to Dave Rolsky for the pull request (#304).

0.9994 2016-01-08T19:46:43Z
     - Reduced minimum required MySQL engine from 5.1.0 to 5.0.0. Thanks to
       @dgc-wh for testing it (Issue #251).
     - Fixed floating-point rounding issue with SQLite registry versions on
       Perls with 16-byte doubles. Thanks to H. Merijn Brand for the report
       and testing.
     - Fixed an error when adding an engine with the `engine` command. Thanks
       to Victor Mours for the report and fix!

Changes  view on Meta::CPAN

       command, but it's good to address the inconsistency, done mainly by
       adding the `find_change_id` and `change_id_offset_from_id` methods to
       complement the `find_change` and `change_offset_from_id` methods.
       Thanks to Andrew Dunstan for the spot (Issue #272).
     - Fixed the `flips` table example in the MySQL tutorial. It was
       inappropriately copied from the PostgreSQL tutorial at some point.
       Thanks to Jeff Carpenter for the spot (Issue #254)!

0.9993  2015-08-17T17:55:26Z
     [Bug Fixes]
     - Eliminated test failures due to warnings from DateTime::Locale when
       `LC_TIME` is set to C.UTF-8. Thanks to Shantanu Bhadoria for the report
       and Dave Rolsky for the workaround.
     - Fixed an error checking the registry version when the local uses a
       comma for decimal values. Thanks to Steffen Müller for the report
       (Issue #234).
     - Worked around an error setting the MySQL storage engine using versions
       of DBI prior to 1.631. Thanks to melon-babak for the report!
     - Fixed an error from the Oracle engine when deploying more than 1000
       changes. Thanks to Timothy Procter and Minh Hoang for the report and
       testing the fix.

Changes  view on Meta::CPAN

       are deprecated in favor of the `--dir` option on the `init`, `engine`,
       and `target` command.

0.9992 2015-05-20T23:51:41Z
     - On PostgreSQL, Sqitch now sets the `client_encoding` parameter to
       `UTF8` for its own connection to the database. This ensures that data
       sent to and from the database should always be properly encoded and
       decoded. Users should still set the proper encodings for change scripts
       as appropriate.
     - Fixed test failures due to path differences on Windows.
     - DateTime::TimeZone is now explicitly required in an attempt to head off
       "Cannot determine local time zone" errors.
     - Corrected some typos and thinkos in `sqitchtutorial-oracle`, thanks to
       George Hartzell.
     - Improved the script to upgrade an Oracle registry to v1.0 to support
       versions prior to Oracle 12, thanks to Timothy Procter.
     - Added missing closing parenthesis to the "Nothing to deploy" message.
       Thanks to George Hartzell for the pull request (Issue #226).
     - Replaced the unique constraint on the `script_hash` column in the
       `changes` registry table with a unique constraint on `project` and
       `script_hash`. This is to allow a deploy script to be used in more than

Changes  view on Meta::CPAN

       `rework` commands from `-c` to `-x`. The `-c` option is now used as the
       short variant for `--change` (and `--conflicts` has almost certainly
       never been used, anyway).
     - Added the `engine` and `project` variables to the execution of script
       templates by the `add` command. The default templates now use it to
       make their first lines one of:
       * -- Deploy [% project %]:[% change %] to [% engine]
       * -- Revert [% project %]:[% change %] from [% engine]
       * -- Verify [% project %]:[% change %] on [% engine]
     [Bug Fixes]
     - DateTime::TimeZone::Local::Win32 is now required on Windows.
     - The MySQL engine no longer passes `--skip-pager` on Windows, since
       it is not supported there. Thanks to Gabriel Potkány for the report
       (Issue #213).
     - Fixed "no such table: changes" error when upgrading the SQLite
       registry.
     - Fixed upgrade failure on PostgreSQL 8.4. Thanks to Phillip Smith for
       the report!
     - Fixed an error when the `status` command `show_changes` and `show_tags`
       configuration variables were set. Thanks to Adrian Klaver for the
       report (Issue #219).

Changes  view on Meta::CPAN


0.996  2014-09-05T21:11:00Z
     - Fixed one more test failure due to the introduction of "Negative repeat
       count does nothing" warning in Perl 5.21.1.
     - Fixed "Redundant argument in printf" warning on Perl 5.21.2.
     - Switched from Digest::SHA1, which is deprecated, to Digest::SHA for
       generating SHA-1 IDs.
     - Switched from Mouse and Moose to Moo. Sqitch no longer depends on any
       modules that use Moose, either. This results in an approximately 40%
       startup time speedup.
     - Loading of App::Sqitch::DateTime is now deferred until it's needed.
       This is because DateTime is rather expensive to load. Since a number of
       commands don't need it, it seems silly to load it in those cases.
     - Now recommend Type::Tiny::XS and Class::XSAccessor for improved
       performance.
     - The `check` command now properly fails on a plan parse error, instead
       of blindly continuing on.
     - Fixed a failing test on PostgreSQL due to localization issues. Thanks
       to Sven Schoberf for the report (Issue #171).
     - Added the `revert.prompt_accept`, `rebase.prompt_accept`, and
       `checkout.prompt_accept` boolean configuration variables. Set these
       variables to false to change the default answer to the revert prompt to

Changes  view on Meta::CPAN


0.935 2012-10-02T19:21:05Z
     - Updated `dist/sqitch-pg.spec` to require `postgresql` rather than
       "postgresql91". The version doesn't matter so much.
     - All known Windows issues and failures fixed, with many thanks to Randy
       Stauner for repeatedly running tests and supplying patches:
       - Fixed "'2' is not recognized as an internal or external command,
         operable program or batch file" error on Windows.
       - Fixed multiple errors detecting Windows. The OS name is "MSWin32",
         not "Win32". The test failure thus addressed was the setting of the
         DateTime locale.
       - Fixed failing tests that were incorrectly comparing subprocess errors
         messages on Windows
       - Fixed bug in `bundle` where a file would be re-copied even if the
         source and destination had the same timestamps, as they seem to do
         during tests on Windows. Patch from Randy Stauner.
       - Fixed failing test that failed to include `.exe` in a file name on
         Windows. Patch from Randy Stauner.
     - Added French translation, with thanks to Arnaud (Arhuman) ASSAD!

0.934 2012-09-28T16:43:43Z

Changes  view on Meta::CPAN


0.913  2012-08-28T17:31:29Z
     - Fixed oversight in test that still relied on `$ENV{USER}` instead of
       `Sqitch->sysuser`,

0.912 2012-08-27T21:23:19Z
     - Fall back on `Sqitch->sysuser` when looking for the PostgreSQL user,
       rather than just `$ENV{USER}`. The method does a lot more work to find
       the system user name. This will hopefully also fix test failures on
       systems where `$ENV{USER}` is not set.
     - Use Win32::Locale to set the locale on DateTime objects on Windows.

0.911 2012-08-23T19:19:17Z
     - Fixed more platform-specific test failures in `t/base.t`.
     - Increased liklihood of finding a user's full name on Windows. Thanks to
       H. Merijn Brand for testing.

0.91  2012-08-23T00:37:36Z
     - Moved `requires` and `conflicts` array columns from the `changes` table
       to an new table, `dependencies`, where there is just one per row.
     - Requirements are now checked before reverting a change. If the change

Changes  view on Meta::CPAN

       5.14. Seems that `return` is required for `when` statements meant to
       return a value, and postfix `when` is not supported in Perl 5.10.

0.80  2012-08-01T21:54:00Z
     - Added the `log` command to `sqitchcommands.pod`, which is shown as the
       output of `sqitch help`.
     - Added  `user.name` and `user.email` configuration variables.
     - Now using `user.name` and `user.email`, rather than the system or
       database user name, to log the user committing changes to a database.
     - Database-specific options are now prefixed with `--db-`.
     - Added "raw" format to App::Sqitch::DateTime. It is ISO-8601 format in
       UTC.
     - Modified the "raw" log format to use the raw DateTime format.
     - Added timestamp and planner info to the plan. This is additional
       metadata included in every change and tag: The planner's name and email
       address and the current timestamp. This makes it easier to audit who
       added changes to a plan and when.
     - Added the `--note` option to the `add`, `rework`, and `tag` commands.
     - For consistency throughout, renamed all attributes and options from
       "message" and "comment" to "note", which is shorter and better reflects
       their purpose.
     - The planner's name and email address, as well as the plan time and
       note, are now stored in the database whenever changes or tags are

Changes  view on Meta::CPAN

     - Removed some discussion of VCS integration, since it is not yet
       implemented, and it may be a while before it is.
     - Added `sqitchcommands`, documentation of the most common Sqitch
       commands, and fixed `--help` to show it.
     - Fixed `--man` to show the sqitch command documentation.
     - Fixed error handling for unknown commands, so that it displays a
       message saying the command is unknown, rather than a stack trace.
     - Adding a change after a tag now also inserts a blank line into the plan
       between the tag and the new change, for nicer plan file formatting.
     - Added the `status` command.
     - Added App::Sqitch::DateTime, a DateTime subclass with named formats.

0.51  2012-07-04T18:34:07Z
     - Added Role::HasMessage to the list or requirements in `Build.PL`. Was
       an oversight that it was omitted in v0.50.
     - Removed the `--dry-run` option. It was completely ignored. Maybe it
       will return someday.
     - Removed `fail()`, `bail()`, `unfound()`, and `help()`. It's better for
       commands not to exit, so have them throw exceptions in the appropriate
       places, instead.
     - Replaced all uses of Carp and non-exception handling uses of `die` with

MANIFEST  view on Meta::CPAN

lib/App/Sqitch/Command/rebase.pm
lib/App/Sqitch/Command/revert.pm
lib/App/Sqitch/Command/rework.pm
lib/App/Sqitch/Command/show.pm
lib/App/Sqitch/Command/status.pm
lib/App/Sqitch/Command/tag.pm
lib/App/Sqitch/Command/target.pm
lib/App/Sqitch/Command/upgrade.pm
lib/App/Sqitch/Command/verify.pm
lib/App/Sqitch/Config.pm
lib/App/Sqitch/DateTime.pm
lib/App/Sqitch/Engine.pm
lib/App/Sqitch/Engine/Upgrade/cockroach-1.0.sql
lib/App/Sqitch/Engine/Upgrade/cockroach-1.1.sql
lib/App/Sqitch/Engine/Upgrade/exasol-1.0.sql
lib/App/Sqitch/Engine/Upgrade/exasol-1.1.sql
lib/App/Sqitch/Engine/Upgrade/firebird-1.0.sql
lib/App/Sqitch/Engine/Upgrade/firebird-1.1.sql
lib/App/Sqitch/Engine/Upgrade/mysql-1.0.sql
lib/App/Sqitch/Engine/Upgrade/mysql-1.1.sql
lib/App/Sqitch/Engine/Upgrade/oracle-1.0.sql

META.json  view on Meta::CPAN

            "Class::XSAccessor" : "1.18",
            "Pod::Simple" : "1.41",
            "Template" : "0",
            "Type::Tiny::XS" : "0.010"
         },
         "requires" : {
            "Algorithm::Backoff::Exponential" : "0.006",
            "Clone" : "0",
            "Config::GitLike" : "1.15",
            "DBI" : "1.631",
            "DateTime" : "1.04",
            "DateTime::TimeZone" : "0",
            "Devel::StackTrace" : "1.30",
            "Digest::SHA" : "0",
            "Encode" : "0",
            "Encode::Locale" : "0",
            "File::Basename" : "0",
            "File::Copy" : "0",
            "File::Path" : "0",
            "File::Temp" : "0",
            "Getopt::Long" : "0",
            "Hash::Merge" : "0",

META.yml  view on Meta::CPAN

recommends:
  Class::XSAccessor: '1.18'
  Pod::Simple: '1.41'
  Template: '0'
  Type::Tiny::XS: '0.010'
requires:
  Algorithm::Backoff::Exponential: '0.006'
  Clone: '0'
  Config::GitLike: '1.15'
  DBI: '1.631'
  DateTime: '1.04'
  DateTime::TimeZone: '0'
  Devel::StackTrace: '1.30'
  Digest::SHA: '0'
  Encode: '0'
  Encode::Locale: '0'
  File::Basename: '0'
  File::Copy: '0'
  File::Path: '0'
  File::Temp: '0'
  Getopt::Long: '0'
  Hash::Merge: '0'

dist/cpanfile  view on Meta::CPAN

# This file is generated by Dist::Zilla::Plugin::CPANFile v6.032
# Do not edit this file directly. To change prereqs, edit the `dist.ini` file.

requires "Algorithm::Backoff::Exponential" => "0.006";
requires "Clone" => "0";
requires "Config::GitLike" => "1.15";
requires "DBI" => "1.631";
requires "DateTime" => "1.04";
requires "DateTime::TimeZone" => "0";
requires "Devel::StackTrace" => "1.30";
requires "Digest::SHA" => "0";
requires "Encode" => "0";
requires "Encode::Locale" => "0";
requires "File::Basename" => "0";
requires "File::Copy" => "0";
requires "File::Path" => "0";
requires "File::Temp" => "0";
requires "Getopt::Long" => "0";
requires "Hash::Merge" => "0";

dist/sqitch.spec  view on Meta::CPAN

BuildArch:      noarch
BuildRequires:  perl >= 1:v5.10.0
BuildRequires:  perl(Algorithm::Backoff::Exponential) >= 0.006
BuildRequires:  perl(Capture::Tiny) >= 0.12
BuildRequires:  perl(Carp)
BuildRequires:  perl(Class::XSAccessor) >= 1.18
BuildRequires:  perl(Clone)
BuildRequires:  perl(Config)
BuildRequires:  perl(Config::GitLike) >= 1.15
BuildRequires:  perl(constant)
BuildRequires:  perl(DateTime) >= 1.04
BuildRequires:  perl(DateTime::TimeZone)
BuildRequires:  perl(DBI) >= 1.631
BuildRequires:  perl(Devel::StackTrace) >= 1.30
BuildRequires:  perl(Digest::SHA)
BuildRequires:  perl(Encode)
BuildRequires:  perl(Encode::Locale)
BuildRequires:  perl(File::Basename)
BuildRequires:  perl(File::Copy)
BuildRequires:  perl(File::Find)
BuildRequires:  perl(File::Path)
BuildRequires:  perl(File::Spec)

dist/sqitch.spec  view on Meta::CPAN

BuildRequires:  perl(URI::db) >= 0.20
BuildRequires:  perl(User::pwent)
BuildRequires:  perl(utf8)
BuildRequires:  perl(warnings)
Requires:       perl(Algorithm::Backoff::Exponential) >= 0.006
Requires:       perl(Class::XSAccessor) >= 1.18
Requires:       perl(Clone)
Requires:       perl(Config)
Requires:       perl(Config::GitLike) >= 1.15
Requires:       perl(constant)
Requires:       perl(DateTime) >= 1.04
Requires:       perl(DateTime::TimeZone)
Requires:       perl(Devel::StackTrace) >= 1.30
Requires:       perl(Digest::SHA)
Requires:       perl(Encode)
Requires:       perl(Encode::Locale)
Requires:       perl(File::Basename)
Requires:       perl(File::Copy)
Requires:       perl(File::Path)
Requires:       perl(File::Temp)
Requires:       perl(Getopt::Long)
Requires:       perl(Hash::Merge)

dist/sqitch.spec  view on Meta::CPAN

- Upgrade to v0.9997.

* Wed Jul 19 2017 David E. Wheeler <david.wheeler@iovation.com> 0.9996-2
- Require File::Find and Module::Runtime at build time.
- Remove Moo::sification.

* Mon Jul 17 2017 David E. Wheeler <david.wheeler@iovation.com> 0.9996-1
- Upgrade to v0.9996.

* Wed Jul 27 2016 David E. Wheeler <david.wheeler@iovation.com> 0.9995-1
- Require DateTime v1.04.
- Upgrade to v0.9995.

* Thu Feb 11 2016 David E. Wheeler <david.wheeler@iovation.com> 0.9994-2
- Add perl(Pod::Escapes) to work around missing dependencies in Pod::Simple.
  https://github.com/perl-pod/pod-simple/issues/84.

* Fri Jan 8 2016 David E. Wheeler <david.wheeler@iovation.com> 0.9994-1
- Reduced required MySQL version to 5.0.
- Upgrade to v0.9994.

* Mon Aug 17 2015 David E. Wheeler <david.wheeler@iovation.com> 0.9993-1
- Upgrade to v0.9993.

* Wed May 20 2015 David E. Wheeler <david.wheeler@iovation.com> 0.9992-1
- Upgrade to v0.9992.
- Add perl(DateTime::TimeZone).
- Add Provides.
- Replace requirement for firebird-classic with firebird.
- Replace requirement for vertica-client with /opt/vertica/bin/vsql and
  libverticaodbc.so.

* Tue Mar 3 2015 David E. Wheeler <david.wheeler@iovation.com> 0.9991-1
- Upgrade to v0.9991.
- Reduced required MySQL version to 5.1.

* Thu Feb 12 2015 David E. Wheeler <david.wheeler@iovation.com> 0.999-1

inc/Menlo/Sqitch.pm  view on Meta::CPAN

        Class-XSAccessor
        Clone-Choose
        Config-GitLike
        DBD-Firebird
        DBD-MariaDB
        DBD-ODBC
        DBD-Oracle
        DBD-Pg
        DBD-SQLite
        Data-OptList
        DateTime
        DateTime-Locale
        DateTime-TimeZone
        Devel-Caller
        Devel-LexAlias
        Devel-StackTrace
        Eval-Closure
        Exception-Class
        Exporter-Tiny
        File-ShareDir
        Hash-Merge
        IO-Pager
        IPC-System-Simple

inc/Module/Build/Sqitch.pm  view on Meta::CPAN

    my ( $class, %p ) = @_;
    if ($^O eq 'MSWin32') {
        my $recs = $p{recommends} ||= {};
        $recs->{$_} = 0 for qw(
            Win32
            Win32::Console::ANSI
            Win32API::Net
        );
        $p{requires}{'Win32::Locale'} = 0;
        $p{requires}{'Win32::ShellQuote'} = 0;
        $p{requires}{'DateTime::TimeZone::Local::Win32'} = 0;
    }
    if (eval { require Hash::Merge; 1 } && $Hash::Merge::VERSION eq '0.298') {
        warn join "\n", (
            '**************************************************************',
            '* You have Hash::Merge $Hash::Merge::VERSION, which is broken.',
            "**************************************************************\n",
        );
        $p{requires}{'Hash::Merge'} = '0.299';
    }
    my $self = $class->SUPER::new(%p);

lib/App/Sqitch/Command/log.pm  view on Meta::CPAN

    if ($opt->{oneline}) {
        $opt->{format} ||= 'oneline';
        $opt->{abbrev} //= 6;
    }

    # Determine and validate the date format.
    my $date_format = delete $opt->{date_format} || $config->get(
        key => 'log.date_format'
    );
    if ($date_format) {
        require App::Sqitch::DateTime;
        App::Sqitch::DateTime->validate_as_string_format($date_format);
    } else {
        $date_format = 'iso';
    }

    # Make sure the log format is valid.
    if (my $format = $opt->{format}
        || $config->get(key => 'log.format')
    ) {
        if ($format =~ s/^format://) {
            $opt->{format} = $format;

lib/App/Sqitch/Command/plan.pm  view on Meta::CPAN

    if ($opt->{oneline}) {
        $opt->{format} ||= 'oneline';
        $opt->{abbrev} //= 6;
    }

    # Determine and validate the date format.
    my $date_format = delete $opt->{date_format} || $config->get(
        key => 'plan.date_format'
    );
    if ($date_format) {
        require App::Sqitch::DateTime;
        App::Sqitch::DateTime->validate_as_string_format($date_format);
    } else {
        $date_format = 'iso';
    }

    # Make sure the plan format is valid.
    if (my $format = $opt->{format}
        || $config->get(key => 'plan.format')
    ) {
        if ($format =~ s/^format://) {
            $opt->{format} = $format;

lib/App/Sqitch/Command/status.pm  view on Meta::CPAN

    return $self;
}

sub configure {
    my ( $class, $config, $opt ) = @_;

    # Make sure the date format is valid.
    if (my $format = $opt->{date_format}
        || $config->get(key => 'status.date_format')
    ) {
        require App::Sqitch::DateTime;
        App::Sqitch::DateTime->validate_as_string_format($format);
    }

    # Set boolean options from config.
    for my $key (qw(show_changes show_tags)) {
        next if exists $opt->{$key};
        my $val = $config->get(key => "status.$key", as => 'bool') // next;
        $opt->{$key} = $val;
    }

    my $ret = $class->SUPER::configure( $config, $opt );

lib/App/Sqitch/DateTime.pm  view on Meta::CPAN

package App::Sqitch::DateTime;

use 5.010;
use strict;
use warnings;
use utf8;
use parent 'DateTime';
use DateTime 1.04;
use Locale::TextDomain qw(App-Sqitch);
use App::Sqitch::X qw(hurl);
use List::Util qw(first);
use constant ISWIN => $^O eq 'MSWin32';

our $VERSION = 'v1.5.2'; # VERSION

sub as_string_formats {
    return qw(
        raw

lib/App/Sqitch/DateTime.pm  view on Meta::CPAN

        return $dt->format_cldr( $dt->locale->$meth );
    }
}

1;

__END__

=head1 Name

App::Sqitch::DateTime - Sqitch DateTime object

=head1 Synopsis

  my $dt = App::Sqitch::DateTime->new(%params);
  say $dt->as_string( format => 'iso' );

=head1 Description

This subclass of L<DateTime> provides additional interfaces to support named
formats. These can be used for L<status|sqitch-status> or L<log|sqitch-log>
C<--date-format> options. App::Sqitch::DateTime provides a list of supported
formats, validates that a format string, and uses the formats to convert
itself into the appropriate string.

=head1 Interface

=head2 Class Methods

=head3 C<as_string_formats>

  my @formats = App::Sqitch::DateTime->as_string_formats;

Returns a list of formats supported by the C<format> parameter to
C<as_string>. The list currently includes:

=over

=item C<iso>

=item C<iso8601>

lib/App/Sqitch/DateTime.pm  view on Meta::CPAN


Localized format of the specified length.

=item C<raw>

Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

Show timestamps using an arbitrary C<strftime> pattern. See
L<DateTime/strftime Paterns> for comprehensive documentation of supported
patterns.

=item C<cldr:$string>

Show timestamps using an arbitrary C<cldr> pattern. See L<DateTime/CLDR
Paterns> for comprehensive documentation of supported patterns.

=back

=head3 C<validate_as_string_format>

  App::Sqitch::DateTime->validate_as_string_format($format);

Validates that a format is supported by C<as_string>. Throws an exception if
it's not, and returns if it is.

=head2 Instance Methods

=head3 C<as_string>

  $dt->as_string;
  $dt->as_string( format => $format );

lib/App/Sqitch/Engine.pm  view on Meta::CPAN

=item C<planner_name>

The name of the user who planned the change.

=item C<planner_email>

The email address of the user who planned the change.

=item C<timestamp>

An L<App::Sqitch::DateTime> object representing the time the change was planned.

=item C<tags>

An array reference of the tag names associated with the change.

=back

=head3 C<deployed_changes_since>

  my @change_hashes = $engine->deployed_changes_since($change);

lib/App/Sqitch/Engine.pm  view on Meta::CPAN

=item C<note>

A brief description of the change.

=item C<tags>

An array reference of the names of associated tags.

=item C<committed_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
change was deployed.

=item C<committer_name>

Name of the user who deployed the change.

=item C<committer_email>

Email address of the user who deployed the change.

=item C<planned_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
change was added to the plan.

=item C<planner_name>

Name of the user who added the change to the plan.

=item C<planner_email>

Email address of the user who added the change to the plan.

lib/App/Sqitch/Engine.pm  view on Meta::CPAN

=item C<script_hash>

The deploy script SHA-1 hash.

=item C<change>

The current change name.

=item C<committed_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
change was deployed.

=item C<committer_name>

Name of the user who deployed the change.

=item C<committer_email>

Email address of the user who deployed the change.

=item C<planned_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
change was added to the plan.

=item C<planner_name>

Name of the user who added the change to the plan.

=item C<planner_email>

Email address of the user who added the change to the plan.

lib/App/Sqitch/Engine.pm  view on Meta::CPAN

=item C<tag_id>

The tag ID.

=item C<tag>

The name of the tag.

=item C<committed_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
tag was applied.

=item C<committer_name>

Name of the user who applied the tag.

=item C<committer_email>

Email address of the user who applied the tag.

=item C<planned_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
tag was added to the plan.

=item C<planner_name>

Name of the user who added the tag to the plan.

=item C<planner_email>

Email address of the user who added the tag to the plan.

lib/App/Sqitch/Engine.pm  view on Meta::CPAN

=item C<requires>

An array reference of the names of any changes required by the change.

=item C<conflicts>

An array reference of the names of any changes that conflict with the change.

=item C<committed_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
event was logged.

=item C<committer_name>

Name of the user who deployed the change.

=item C<committer_email>

Email address of the user who deployed the change.

=item C<planned_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
change was added to the plan.

=item C<planner_name>

Name of the user who added the change to the plan.

=item C<planner_email>

Email address of the user who added the change to the plan.

lib/App/Sqitch/Engine/exasol.pm  view on Meta::CPAN

use App::Sqitch::Types qw(DBH Dir ArrayRef);
use App::Sqitch::Plan::Change;
use List::Util qw(first);
use namespace::autoclean;

extends 'App::Sqitch::Engine';

our $VERSION = 'v1.5.2'; # VERSION

sub _dt($) {
    require App::Sqitch::DateTime;
    return App::Sqitch::DateTime->new(split /:/ => shift);
}

sub key    { 'exasol' }
sub name   { 'Exasol' }
sub driver { 'DBD::ODBC 1.59' }
sub default_client { 'exaplus' }

BEGIN {
    # Disable SQLPATH so that we don't read scripts from unexpected places.
    $ENV{SQLPATH} = '';

lib/App/Sqitch/Engine/firebird.pm  view on Meta::CPAN

# connection can fail.
sub finish_work {
    my $self = shift;
    my $dbh = $self->dbh;
    $dbh->commit;
    $dbh->func( 'ib_set_tx_param' );         # reset parameters
    return $self;
}

sub _dt($) {
    require App::Sqitch::DateTime;
    return App::Sqitch::DateTime->new(split /:/ => shift);
}

sub _no_table_error  {
    return $DBI::errstr && $DBI::errstr =~ /^-Table unknown|No such file or directory/m;
}

sub _no_column_error  {
    return $DBI::errstr && $DBI::errstr =~ /^-Column unknown/m;
}

lib/App/Sqitch/Engine/oracle.pm  view on Meta::CPAN

sub _regex_op { 'REGEXP_LIKE(%s, ?)' }

sub _simple_from { ' FROM dual' }

sub _multi_values {
    my ($self, $count, $expr) = @_;
    return join "\nUNION ALL ", ("SELECT $expr FROM dual") x $count;
}

sub _dt($) {
    require App::Sqitch::DateTime;
    return App::Sqitch::DateTime->new(split /:/ => shift);
}

sub _cid {
    my ( $self, $ord, $offset, $project ) = @_;

    return try {
        return $self->dbh->selectcol_arrayref(qq{
            SELECT change_id FROM (
                SELECT change_id, rownum as rnum FROM (
                    SELECT change_id

lib/App/Sqitch/Engine/pg.pm  view on Meta::CPAN

    $dbh->do(
        'DELETE FROM changes where change_id = ?',
        undef, $change->id,
    );

    # Log it.
    return $self->_log_event( revert => $change, $del_tags, $req, $conf );
}

sub _dt($) {
    require App::Sqitch::DateTime;
    return App::Sqitch::DateTime->new(split /:/ => shift);
}

sub _no_table_error  {
    return 0 unless $DBI::state && $DBI::state eq '42P01'; # undefined_table
    my $dbh = shift->dbh;
    return 1 unless $dbh->{pg_server_version} >= 90000;

    # Try to avoid confusion for people monitoring the Postgres error log by
    # sending a warning to the log immediately after the missing relation error
    # to tell log watchers that Sqitch is aware of the issue and will next

lib/App/Sqitch/Engine/snowflake.pm  view on Meta::CPAN

sub _ts2char_format {
    # The colon has to be inside the quotation marks, because otherwise it
    # generates wayward single quotation marks. Bug report:
    # https://support.snowflake.net/s/case/5000Z000010wTkKQAU/
    qq{to_varchar(CONVERT_TIMEZONE('UTC', %s), '"year:"YYYY":month:"MM":day:"DD":hour:"HH24":minute:"MI":second:"SS":time_zone:UTC"')};
}

sub _char2ts { $_[1]->as_string(format => 'iso') }

sub _dt($) {
    require App::Sqitch::DateTime;
    return App::Sqitch::DateTime->new(split /:/ => shift);
}

sub _regex_op { 'REGEXP' } # XXX But not used; see regex_expr() below.

sub _simple_from { ' FROM dual' }

sub _cid {
    my ( $self, $ord, $offset, $project ) = @_;

    my $offset_expr = $offset ? " OFFSET $offset" : '';

lib/App/Sqitch/Engine/vertica.pm  view on Meta::CPAN


sub _no_column_error  {
    return $DBI::state && $DBI::state eq '42703'; # ERRCODE_UNDEFINED_COLUMN
}

sub _unique_error  {
    return $DBI::state && $DBI::state eq '23505'; # ERRCODE_UNIQUE_VIOLATION
}

sub _dt($) {
    require App::Sqitch::DateTime;
    return App::Sqitch::DateTime->new(split /:/ => shift);
}

sub _multi_values {
    my ($self, $count, $expr) = @_;
    return join "\nUNION ALL ", ("SELECT $expr") x $count;
}

sub _dependency_placeholders {
    return 'CAST(? AS CHAR(40)), CAST(? AS VARCHAR), CAST(? AS VARCHAR), CAST(? AS CHAR(40))';
}

lib/App/Sqitch/ItemFormatter.pm  view on Meta::CPAN

                },
                a => sub {
                    hurl format => __x(
                        '{attr} is not a valid change attribute', attr => $_[1]
                    ) unless $_[1] && exists $_[0]->{ $_[1] };
                    my $val = $_[0]->{ $_[1] } // return '';

                    if (ref $val eq 'ARRAY') {
                        return '' unless @{ $val };
                        $val = join ', ' => @{ $val };
                    } elsif (eval { $val->isa('App::Sqitch::DateTime') }) {
                        $val = $val->as_string( format => 'raw' );
                    }

                    my $sp = ' ' x max(9 - length $_[1], 0);
                    return "$_[1]$sp $val\n";
                }
            },
        });
    }
);

lib/App/Sqitch/ItemFormatter.pm  view on Meta::CPAN

=item C<short>

A format length to pass to the system locale's C<LC_TIME> category.

=item C<raw>

Raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

An arbitrary C<strftime> pattern. See L<DateTime/strftime Paterns> for
comprehensive documentation of supported patterns.

=item C<cldr:$pattern>

An arbitrary C<cldr> pattern. See L<DateTime/CLDR Paterns> for comprehensive
documentation of supported patterns.

=back

=item C<color>

Controls the use of ANSI color formatting. The value may be one of:

=over

lib/App/Sqitch/ItemFormatter.pm  view on Meta::CPAN

=item C<requires>

An array reference of the names of any changes required by the change.

=item C<conflicts>

An array reference of the names of any changes that conflict with the change.

=item C<committed_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
event was logged.

=item C<committer_name>

Name of the user who deployed the change.

=item C<committer_email>

Email address of the user who deployed the change.

=item C<planned_at>

An L<App::Sqitch::DateTime> object representing the date and time at which the
change was added to the plan.

=item C<planner_name>

Name of the user who added the change to the plan.

=item C<planner_email>

Email address of the user who added the change to the plan.

lib/App/Sqitch/ItemFormatter.pm  view on Meta::CPAN

=item * C<%{date:iso}c>: commit date, ISO-8601 format

=item * C<%{date:full}c>: commit date, full format

=item * C<%{date:long}c>: commit date, long format

=item * C<%{date:medium}c>: commit date, medium format

=item * C<%{date:short}c>: commit date, short format

=item * C<%{date:cldr:$pattern}c>: commit date, formatted with custom L<CLDR pattern|DateTime/CLDR Patterns>

=item * C<%{date:strftime:$pattern}c>: commit date, formatted with custom L<strftime pattern|DateTime/strftime Patterns>

=item * C<%c>: Change planner name and email address

=item * C<%{name}p>: Change planner name

=item * C<%{email}p>: Change planner email address

=item * C<%{date}p>: plan date (respects C<--date-format>)

=item * C<%{date:rfc}p>: plan date, RFC2822 format

lib/App/Sqitch/ItemFormatter.pm  view on Meta::CPAN

=item * C<%{date:iso}p>: plan date, ISO-8601 format

=item * C<%{date:full}p>: plan date, full format

=item * C<%{date:long}p>: plan date, long format

=item * C<%{date:medium}p>: plan date, medium format

=item * C<%{date:short}p>: plan date, short format

=item * C<%{date:cldr:$pattern}p>: plan date, formatted with custom L<CLDR pattern|DateTime/CLDR Patterns>

=item * C<%{date:strftime:$pattern}p>: plan date, formatted with custom L<strftime pattern|DateTime/strftime Patterns>

=item * C<%t>: Comma-delimited list of tags

=item * C<%{$sep}t>: list of tags delimited by C<$sep>

=item * C<%T>: Parenthesized list of comma-delimited tags

=item * C<%{$sep}T>: Parenthesized list of tags delimited by C<$sep>

=item * C<%s>: Subject (a.k.a. title line)

lib/App/Sqitch/Plan.pm  view on Meta::CPAN

            name => ($type eq 'tag' ? '@' : '') . $params{name},
        )) if exists $reserved{ $params{name} };

        # It must not look like a SHA1 hash.
        $raise_syntax_error->(__x(
            '"{name}" is invalid because it could be confused with a SHA1 ID',
            name => $params{name},
        )) if $params{name} =~ /^[0-9a-f]{40}/;

        # Assemble the timestamp.
        require App::Sqitch::DateTime;
        $params{timestamp} = App::Sqitch::DateTime->new(
            year      => delete $params{yr},
            month     => delete $params{mo},
            day       => delete $params{dy},
            hour      => delete $params{hr},
            minute    => delete $params{mi},
            second    => delete $params{sc},
            time_zone => 'UTC',
        );

        if ($type eq 'tag') {

lib/App/Sqitch/Plan/Change.pm  view on Meta::CPAN

package App::Sqitch::Plan::Change;

use 5.010;
use utf8;
use namespace::autoclean;
use Encode;
use Moo;
use App::Sqitch::Types qw(Str Bool Maybe Change Tag Depend UserEmail DateTime ArrayRef);
use App::Sqitch::Plan::Depend;
use Locale::TextDomain qw(App-Sqitch);
extends 'App::Sqitch::Plan::Line';

our $VERSION = 'v1.5.2'; # VERSION

has _requires => (
    is       => 'ro',
    isa      => ArrayRef[Depend],
    init_arg => 'requires',

lib/App/Sqitch/Plan/Change.pm  view on Meta::CPAN

        my $content = encode_utf8 shift->info;
        require Digest::SHA;
        return Digest::SHA->new(1)->add(
            'change ' . length($content) . "\0" . $content
        )->hexdigest;
    }
);

has timestamp => (
    is       => 'ro',
    isa      => DateTime,
    default  => sub { require App::Sqitch::DateTime && App::Sqitch::DateTime->now },
);

has planner_name => (
    is       => 'ro',
    isa      => Str,
    default  => sub { shift->sqitch->user_name },
);

has planner_email => (
    is       => 'ro',

lib/App/Sqitch/Plan/Change.pm  view on Meta::CPAN

the name and email address of the user who added the change to the plan, and
the timestamp for when the change was added to the plan.

=head3 C<id>

A SHA1 hash of the data returned by C<info()>, which can be used as a
globally-unique identifier for the change.

=head3 C<timestamp>

Returns the an L<App::Sqitch::DateTime> object representing the time at which
the change was added to the plan.

=head3 C<planner_name>

Returns the name of the user who added the change to the plan.

=head3 C<planner_email>

Returns the email address of the user who added the change to the plan.

lib/App/Sqitch/Plan/Tag.pm  view on Meta::CPAN

package App::Sqitch::Plan::Tag;

use 5.010;
use utf8;
use namespace::autoclean;
use Moo;
use App::Sqitch::Types qw(Str Change UserEmail DateTime);
use Encode;

extends 'App::Sqitch::Plan::Line';

our $VERSION = 'v1.5.2'; # VERSION

sub format_name {
    '@' . shift->name;
}

lib/App/Sqitch/Plan/Tag.pm  view on Meta::CPAN


has change => (
    is       => 'ro',
    isa      => Change,
    weak_ref => 1,
    required => 1,
);

has timestamp => (
    is       => 'ro',
    isa      => DateTime,
    default  => sub { require App::Sqitch::DateTime && App::Sqitch::DateTime->now },
);

has planner_name => (
    is       => 'ro',
    isa      => Str,
    default  => sub { shift->sqitch->user_name },
);

has planner_email => (
    is       => 'ro',

lib/App/Sqitch/Plan/Tag.pm  view on Meta::CPAN


=head2 Accessors

=head3 C<change>

Returns the L<App::Sqitch::Plan::Change> object with which the tag is
associated.

=head3 C<timestamp>

Returns the an L<App::Sqitch::DateTime> object representing the time at which
the tag was added to the plan.

=head3 C<planner_name>

Returns the name of the user who added the tag to the plan.

=head3 C<planner_email>

Returns the email address of the user who added the tag to the plan.

lib/App/Sqitch/Role/DBIEngine.pm  view on Meta::CPAN

    return;
}

after use_driver => sub {
    DBI->trace(1) if $_[0]->sqitch->verbosity > 2;
};

sub _dsn { shift->target->uri->dbi_dsn }

sub _dt($) {
    require App::Sqitch::DateTime;
    return App::Sqitch::DateTime->new(split /:/ => shift);
}

sub _log_tags_param {
    join ' ' => map { $_->format_name } $_[1]->tags;
}

sub _log_requires_param {
    join ',' => map { $_->as_string } $_[1]->requires;
}

lib/App/Sqitch/Types.pm  view on Meta::CPAN

    Engine
    Target
    UserName
    UserEmail
    Plan
    Change
    ChangeList
    LineList
    Tag
    Depend
    DateTime
    URI
    URIDB
    File
    Dir
    Config
    DBH
);
use Type::Utils -all;
use Types::Standard -types;
use Locale::TextDomain 1.20 qw(App-Sqitch);

lib/App/Sqitch/Types.pm  view on Meta::CPAN


class_type Sqitch,     { class => 'App::Sqitch'                     };
class_type Engine,     { class => 'App::Sqitch::Engine'             };
class_type Target,     { class => 'App::Sqitch::Target'             };
class_type Plan,       { class => 'App::Sqitch::Plan'               };
class_type Change,     { class => 'App::Sqitch::Plan::Change'       };
class_type ChangeList, { class => 'App::Sqitch::Plan::ChangeList'   };
class_type LineList,   { class => 'App::Sqitch::Plan::LineList'     };
class_type Tag,        { class => 'App::Sqitch::Plan::Tag'          };
class_type Depend,     { class => 'App::Sqitch::Plan::Depend'       };
class_type DateTime,   { class => 'App::Sqitch::DateTime'           };
class_type URIDB,      { class => 'URI::db'                         };
class_type Config      { class => 'App::Sqitch::Config'             };
class_type File        { class => 'Path::Class::File'               };
class_type Dir         { class => 'Path::Class::Dir'                };
class_type DBH         { class => 'DBI::db'                         };

subtype UserName, as Str, where {
    hurl user => __ 'User name may not contain "<" or start with "["'
        if /^[[]/ || /</;
    1;

lib/App/Sqitch/Types.pm  view on Meta::CPAN

A L<Sqitch::App::Plan::LineList> object.

=item C<Tag>

A L<Sqitch::App::Plan::Tag> object.

=item C<Depend>

A L<Sqitch::App::Plan::Depend> object.

=item C<DateTime>

A L<Sqitch::App::DateTime> object.

=item C<URI>

A L<URI> object.

=item C<URIDB>

A L<URI::db> object.

=item C<File>

lib/sqitch-log.pod  view on Meta::CPAN

Show timestamps in the specified format length, using the system locale's
C<LC_TIME> category.

=item C<raw>

Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

Show timestamps using an arbitrary C<strftime> pattern. See
L<DateTime/strftime Paterns> for comprehensive documentation of supported
patterns.

=item C<cldr:$pattern>

Show timestamps using an arbitrary C<cldr> pattern. See
L<DateTime/CLDR Paterns> for comprehensive documentation of supported
patterns.

=back

=item C<--max-count>

=item C<-n>

Limit the number of events to output.

lib/sqitch-log.pod  view on Meta::CPAN

=item * C<%{date:iso}c>: commit date, ISO-8601 format

=item * C<%{date:full}c>: commit date, full format

=item * C<%{date:long}c>: commit date, long format

=item * C<%{date:medium}c>: commit date, medium format

=item * C<%{date:short}c>: commit date, short format

=item * C<%{date:cldr:$pattern}c>: commit date, formatted with custom L<CLDR pattern|DateTime/CLDR Patterns>

=item * C<%{date:strftime:$pattern}c>: commit date, formatted with custom L<strftime pattern|DateTime/strftime Patterns>

=item * C<%c>: Change planner name and email address

=item * C<%{name}p>: Change planner name

=item * C<%{email}p>: Change planner email address

=item * C<%{date}p>: plan date (respects C<--date-format>)

=item * C<%{date:rfc}p>: plan date, RFC2822 format

lib/sqitch-log.pod  view on Meta::CPAN

=item * C<%{date:iso}p>: plan date, ISO-8601 format

=item * C<%{date:full}p>: plan date, full format

=item * C<%{date:long}p>: plan date, long format

=item * C<%{date:medium}p>: plan date, medium format

=item * C<%{date:short}p>: plan date, short format

=item * C<%{date:cldr:$pattern}p>: plan date, formatted with custom L<CLDR pattern|DateTime/CLDR Patterns>

=item * C<%{date:strftime:$pattern}p>: plan date, formatted with custom L<strftime pattern|DateTime/strftime Patterns>

=item * C<%t>: Comma-delimited list of tags

=item * C<%{$sep}t>: list of tags delimited by C<$sep>

=item * C<%T>: Parenthesized list of comma-delimited tags

=item * C<%{$sep}T>: Parenthesized list of tags delimited by C<$sep>

=item * C<%s>: Subject (a.k.a. title line)

lib/sqitch-plan.pod  view on Meta::CPAN

Show timestamps in the specified format length, using the system locale's
C<LC_TIME> category.

=item C<raw>

Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

Show timestamps using an arbitrary C<strftime> pattern. See
L<DateTime/strftime Paterns> for comprehensive documentation of supported
patterns.

=item C<cldr:$pattern>

Show timestamps using an arbitrary C<cldr> pattern. See
L<DateTime/CLDR Paterns> for comprehensive documentation of supported
patterns.

=back

=item C<--max-count>

=item C<-n>

Limit the number of changes to output.

lib/sqitch-plan.pod  view on Meta::CPAN

=item * C<%{date:iso}p>: plan date, ISO-8601 format

=item * C<%{date:full}p>: plan date, full format

=item * C<%{date:long}p>: plan date, long format

=item * C<%{date:medium}p>: plan date, medium format

=item * C<%{date:short}p>: plan date, short format

=item * C<%{date:cldr:$pattern}p>: plan date, formatted with custom L<CLDR pattern|DateTime/CLDR Patterns>

=item * C<%{date:strftime:$pattern}p>: plan date, formatted with custom L<strftime pattern|DateTime/strftime Patterns>

=item * C<%t>: Comma-delimited list of tags

=item * C<%{$sep}t>: list of tags delimited by C<$sep>

=item * C<%T>: Parenthesized list of comma-delimited tags

=item * C<%{$sep}T>: Parenthesized list of tags delimited by C<$sep>

=item * C<%s>: Subject (a.k.a. title line)

lib/sqitch-status.pod  view on Meta::CPAN

Show timestamps in the specified format length, using the system locale's
C<LC_TIME> category.

=item C<raw>

Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

Show timestamps using an arbitrary C<strftime> pattern. See
L<DateTime/strftime Paterns> for comprehensive documentation of supported
patterns.

=item C<cldr:$string>

Show timestamps using an arbitrary C<cldr> pattern. See L<DateTime/CLDR
Paterns> for comprehensive documentation of supported patterns.

=back

=item C<--registry>

  sqitch status --registry registry

The name of the Sqitch registry schema or database in which sqitch stores its
own data.

t/change.t  view on Meta::CPAN


isa_ok my $change = $CLASS->new(
    name => 'foo',
    plan => $plan,
), $CLASS;

isa_ok $change, 'App::Sqitch::Plan::Line';
ok $change->is_deploy, 'It should be a deploy change';
ok !$change->is_revert, 'It should not be a revert change';
is $change->action, 'deploy', 'And it should say so';
isa_ok $change->timestamp, 'App::Sqitch::DateTime', 'Timestamp';

my $tag = App::Sqitch::Plan::Tag->new(
    plan   => $plan,
    name   => 'alpha',
    change => $change,
);

is_deeply [ $change->path_segments ], ['foo.sql'],
    'path_segments should have the file name';
is $change->deploy_dir, $target->deploy_dir,

t/change.t  view on Meta::CPAN

   'planner ' . $change->format_planner,
   'date ' . $change->timestamp->as_string,
), 'Change info should be correct';
is $change->id, do {
    my $content = encode_utf8 $change->info;
    Digest::SHA->new(1)->add(
        'change ' . length($content) . "\0" . $content
    )->hexdigest;
},'Change ID should be correct';

my $date = App::Sqitch::DateTime->new(
    year   => 2012,
    month  => 7,
    day    => 16,
    hour   => 17,
    minute => 25,
    second => 7,
    time_zone => 'UTC',
);

sub dep($) {



( run in 0.553 second using v1.01-cache-2.11-cpan-05444aca049 )