App-Sqitch
view release on metacpan or search on metacpan
lib/App/Sqitch/Engine/pg.pm view on Meta::CPAN
$ENV{PGDATABASE}
|| $self->username
|| $ENV{PGUSER}
|| $self->sqitch->sysuser
);
return $uri->as_string;
}
# DBD::pg and psql use fallbacks consistently, thanks to libpq. These include
# environment variables, system info (username), the password file, and the
# connection service file. Best for us not to second-guess these values,
# though we admittedly try when setting the database name in the destination
# URI for unnamed targets a few lines up from here.
sub _def_user { }
sub _def_pass { }
has _psql => (
is => 'ro',
isa => ArrayRef,
lazy => 1,
default => sub {
engine.mysql.registry=meta
engine.mysql.variables.prefix=foo_
engine.pg.client=/opt/local/pgsql/bin/psql
engine.pg.registry=meta
engine.pg.target=mydb
engine.sqlite.client=/opt/local/bin/sqlite3
engine.sqlite.registry=meta
engine.sqlite.target=devdb
foo.BAR.baz=hello
foo.BAR.yep
guess.Yes.No.calico=false
guess.Yes.No.red=true
revert.count=2
revert.revision=1.1
revert.to=gamma
target.devdb.uri=db:sqlite:
target.mydb.plan_file=t/plans/dependencies.plan
target.mydb.uri=db:pg:mydb
user.email=michael@example.com
user.name=Michael Stonebraker
'
]], 'Should have emitted the merged config';
bundle.from=gamma
bundle.tags_only=true
core.engine=pg
core.extension=ddl
core.pager=less -r
core.top_dir=migrations
core.uri=https://github.com/sqitchers/sqitch/
engine.pg.client=/usr/local/pgsql/bin/psql
foo.BAR.baz=hello
foo.BAR.yep
guess.Yes.No.calico=false
guess.Yes.No.red=true
revert.count=2
revert.revision=1.1
revert.to=gamma
'
]], 'Should have emitted the system config list';
@emit = ();
$config = TestConfig->from(
system => file(qw(t sqitch.conf)),
user => file(qw(t user.conf)),
t/configuration.t view on Meta::CPAN
client => "/usr/local/pgsql/bin/psql",
}, 'get_section("engine.pg") should work';
# Make sure it works with irregular casing.
is_deeply $config->get_section(section => 'foo.BAR'), {
baz => 'hello',
yep => undef,
}, 'get_section() whould work with capitalized subsection';
# Should work with multiple subsections and case-preserved keys.
is_deeply $config->get_section(section => 'guess.Yes.No'), {
red => 'true',
Calico => 'false',
}, 'get_section() whould work with mixed case subsections';
t/sqitch.conf view on Meta::CPAN
count = 2
revision = 1.1
[bundle]
from = gamma
tags_only = true
dest_dir = _build/sql
[foo "BAR"]
baz = hello
yep
[guess "Yes.No"]
red = true
Calico = false
( run in 1.464 second using v1.01-cache-2.11-cpan-702932259ff )