Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 41 lines (32 sloc) 0.793 kB
#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use Quelology::Config qw/config/;
my ($action, $mode) = @ARGV;
my %commands = (
shell => ['psql'],
dump => [qw/pg_dump --clean --exclude-table=user_*/],
full_dump => ['pg_dump', '--clean'],
);
if (!$action || !$commands{$action}) {
die <<"USAGE";
Usage: $0 action [mode]
action can be:
shell start a psql shell
dump dump the database to STDOUT, excluding user/login data
full_dump dump the full database to STDOUT
USAGE
}
if ($mode) {
$ENV{QUELOLOGY_RUNMODE} = $mode;
$Quelology::RunMode = $mode;
}
my @cmd = @{ $commands{$action} };
push @cmd, (
'-h', config('dbhost'),
'-U', config('dbuser'),
config('dbname'),
);
exec @cmd;
# vim: ft=perl
Jump to Line
Something went wrong with that request. Please try again.