Pepper
view release on metacpan or search on metacpan
lib/Pepper/DB.pm view on Meta::CPAN
# make the connection - fail and log if cannot connect
# can support Mysql/MariaDB
$dsn = 'DBI:mysql:database='.$self->{current_database}.';host='.$self->{database_server}.';port=3306';
$self->{dbh} = DBI->connect($dsn, $self->{config}{database_username}, $self->{config}{database_password},{
PrintError => 0,
RaiseError => 0,
AutoCommit => 0,
ShowErrorStatement => 1,
HandleError => \&dbi_error_handler,
mysql_enable_utf8 => 8
});
# let's automatically reconnect if the connection is timed out
$self->{dbh}->{mysql_auto_reconnect} = 1;
# note that this doesn't seem to work too well
# let's use UTC time in DB saves
$self->do_sql(qq{set time_zone = '+0:00'});
# Set Long to 1000000 for long text...may need to adjust this
( run in 0.229 second using v1.01-cache-2.11-cpan-00829025b61 )