From: Eric Bollengier Date: Sun, 23 Sep 2007 16:58:39 +0000 (+0000) Subject: ebl Merge sql backend with brestore. X-Git-Tag: Release-3.0.0~2481 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=eb947621ecb038bfc93e2fc619b806456005ab3f;p=bacula%2Fbacula ebl Merge sql backend with brestore. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5625 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/gui/bweb/lib/Bweb.pm b/gui/bweb/lib/Bweb.pm index e73ae94751..4b365cd012 100644 --- a/gui/bweb/lib/Bweb.pm +++ b/gui/bweb/lib/Bweb.pm @@ -1134,6 +1134,23 @@ sub dbh_selectrow_hashref return $self->{dbh}->selectrow_hashref($query) ; } +sub dbh_strcat +{ + my ($self, @what) = @_; + if ($self->{conf}->{connection_string} =~ /dbi:mysql/i) { + return 'CONCAT(' . join(',', @what) . ')' ; + } else { + return join(' || ', @what); + } +} + +sub dbh_prepare +{ + my ($self, $query) = @_; + $self->debug($query, up => 1); + return $self->{dbh}->prepare($query); +} + # display Mb/Gb/Kb sub human_size { @@ -1221,14 +1238,14 @@ sub connect_db sub new { my ($class, %arg) = @_; - my $self = bless { + my $self = bless ({ dbh => undef, # connect_db(); info => { dbi => '', # DBI:Pg:database=bacula;host=127.0.0.1 user => 'bacula', password => 'test', }, - } ; + },$class) ; map { $self->{lc($_)} = $arg{$_} } keys %arg ;