private function _parseDsn($dsn)
    {
        $dsn = parse_url($dsn);
        $cfg = [];

        //
        // Some drivers (a.k.a. PDO_PGSQL) complains if the port is set
        // without a value, even NULL
        if (isset($dsn['port'])) {
            $cfg['port'] = $dsn['port'];
        }

        return $cfg + [
            'dbname'    => isset($dsn['path']) ? trim($dsn['path'], '/') : null,
            'host'      => isset($dsn['host']) ? $dsn['host']            : null,
            'password'  => isset($dsn['pass']) ? $dsn['pass']            : null,
            'username'  => isset($dsn['user']) ? $dsn['user']            : null,
        ];
    }