public static function getConnection($dsn)
    {
        if (!is_array($dsn)) {
            $dsn = self::parseDsn($dsn);
        }
        if (!isset($dsn['adapter'])) {
            throw new Exception("database adapter is missing for " . json_encode($dsn));
        }
        $class = 'Phalcon\Db\Adapter\Pdo\\' . ucfirst($dsn['adapter']);
        $conn = new $class($dsn);
        return Mixin::create($conn, new self);
    }