From eb947621ecb038bfc93e2fc619b806456005ab3f Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 23 Sep 2007 16:58:39 +0000 Subject: [PATCH] ebl Merge sql backend with brestore. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5625 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/lib/Bweb.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) 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 ; -- 2.39.5