sub sqlOpenDB {
my ( $db, $type, $user, $pass, $no_fail ) = @_;
+ my $attr = {};
# this is a mess. someone fix it, please.
if ( $type =~ /^SQLite(2)?$/i ) {
$db = "dbname=$db.sqlite";
$db = "dbname=$db";
$type = 'Pg';
}
+ elsif ($type =~ /mysql/) {
+ $attr->{mysql_enable_utf8mb4} = 1;
+ }
my $dsn = "DBI:$type:$db";
my $hoststr = '';
}
# SQLite ignores $user and $pass
- $dbh = Bloot::DBI->new( DBI->connect( $dsn, $user, $pass ) );
+ $dbh = Bloot::DBI->new( DBI->connect( $dsn, $user, $pass, $attr ) );
if ( $dbh && !$dbh->err ) {
&status("Opened $type connection$hoststr");