Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 41 lines (32 sloc) 793 Bytes
#!/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
if ($mode) {
$Quelology::RunMode = $mode;
my @cmd = @{ $commands{$action} };
push @cmd, (
'-h', config('dbhost'),
'-U', config('dbuser'),
exec @cmd;
# vim: ft=perl