protected static function getAdapterFromPdo(\PDO $resource)
    {
        $driver = mb_strtolower($resource->getAttribute(\PDO::ATTR_DRIVER_NAME));
        switch ($driver) {
            case 'mysql':
                $adapter = new Adapter\PdoMysqlAdapter($resource);
                break;
            case 'sqlite':
                $adapter = new Adapter\PdoSqliteAdapter($resource);
                break;
            default:
                $msg = "Driver 'PDO_$driver' is not currently supported.";
                throw new Exception\UnsupportedDriverException($msg);
        }

        return $adapter;
    }