git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5625
91ce42f0-d328-0410-95d8-
f526ca767f89
return $self->{dbh}->selectrow_hashref($query) ;
}
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
{
# display Mb/Gb/Kb
sub human_size
{
sub new
{
my ($class, %arg) = @_;
sub new
{
my ($class, %arg) = @_;
dbh => undef, # connect_db();
info => {
dbi => '', # DBI:Pg:database=bacula;host=127.0.0.1
user => 'bacula',
password => 'test',
},
dbh => undef, # connect_db();
info => {
dbi => '', # DBI:Pg:database=bacula;host=127.0.0.1
user => 'bacula',
password => 'test',
},
map { $self->{lc($_)} = $arg{$_} } keys %arg ;
map { $self->{lc($_)} = $arg{$_} } keys %arg ;