```php
return (isset($params['dbname']))
    ? $params['dbname']
    : $conn->query('SELECT CURRENT_DATABASE()')->fetchColumn();
```