protected function setupDriver(string $type)
    {
        // A full namespaced class name may be provided
        $driver = null;
        $driver_class = null;
        if (is_a($type, Driver::class, true))
        {
            $driver_class = $type;
            $driver = new $type($this);
        }
        else
        {
            // Or the name of one of the included drivers
            $driver_class = "Wedeto\\DB\\Driver\\" . $type;
            if (is_a($driver_class, Driver::class, true))
            {
                $driver = new $driver_class($this);
            }
        }

        if ($driver === null)
            throw new DriverException("No driver available for database type $type");

        $actual_class = get_class($driver);
        if (strcmp($driver_class, $actual_class) != 0)
        {
            // Warn if the case doesn't match the actual classname
            self::$logger->warning(
                "WARNING: Configurated class {} does not match actual "
                    . "classname: {}. This may cause issues with "
                    . "autoloading.",
                [$driver_class, $actual_class]
            );
        }
        return $driver;
    }