public static function create($dialect, SqlInterface $sql)
    {
        if (array_key_exists($dialect, static::$_map)) {
            return static::_createDialect(static::$_map[$dialect], $sql);
        }

        if (class_exists($dialect)) {
            if (
                in_array(static::DIALECT_INTERFACE, class_implements($dialect))
            ) {
                return static::_createDialect($dialect, $sql);
            }
            $interface = static::DIALECT_INTERFACE;
            throw new InvalidArgumentException(
                "The class {$dialect} does not implements the " .
                "{$interface} interface."
            );
        }

        throw new InvalidArgumentException(
            "Trying to create an unknown dialect. '{$dialect}' is" .
            " not recognized."
        );
    }