X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=script%2Fdblookup.pl;h=2346fde421fb58f85ec318749f082ee2a00ff759;hb=378de72495d704d9de710a0b9c6cfec146de7886;hp=a7a6c4d688684c5ec63c7f1c26b11a78521d9efa;hpb=041d760cbcf2aca8b26586ef3bf6af7a846f94e2;p=scpubgit%2Fstemmatology.git diff --git a/script/dblookup.pl b/script/dblookup.pl index a7a6c4d..2346fde 100755 --- a/script/dblookup.pl +++ b/script/dblookup.pl @@ -11,17 +11,22 @@ use Text::Tradition::Directory; binmode( STDOUT, ':utf8' ); binmode( STDERR, ':utf8' ); -my( $name, $delete, $list, $dsn ) = - ( undef, undef, 1, 'dbi:SQLite:dbname=db/traditions.db' ); +my( $name, $delete, $dbuser, $dbpass ); +my( $list, $dsn ) = ( 1, 'dbi:SQLite:dbname=stemmaweb/db/traditions.db' ); GetOptions( 'r|rename=s' => \$name, 'd|delete' => \$delete, 'dsn=s' => \$dsn, + 'u|user=s' => \$dbuser, + 'p|pass=s' => \$dbpass, ); my @uuids = @ARGV; # UUID is whatever is left over -my $kdb = Text::Tradition::Directory->new( 'dsn' => $dsn ); +my %dbargs = ( 'dsn' => $dsn ); +$dbargs{'extra_args'} = { 'user' => $dbuser } if $dbuser; +$dbargs{'extra_args'}->{'password'} = $dbpass if $dbpass; +my $kdb = Text::Tradition::Directory->new( %dbargs ); $list = !$delete; if( $delete ) {