Must return driver specific default value.

@param DriverInterface $driver
@return string
18136
protected function quoteDefault(DriverInterface $driver): string
    {
        $defaultValue = $this->getDefaultValue();
        if ($defaultValue === null) {
            return 'NULL';
        }

        if ($defaultValue instanceof FragmentInterface) {
            return $defaultValue->sqlStatement();
        }

        if ($this->getType() == 'bool') {
            return $defaultValue ? 'TRUE' : 'FALSE';
        }

        if ($this->getType() == 'float') {
            return sprintf('%F', $defaultValue);
        }

        if ($this->getType() == 'int') {
            return strval($defaultValue);
        }

        return strval($driver->quote($defaultValue));
    }
732598
public function getDriver(array $mappingSource): DriverInterface
    {
        if (\array_key_exists('driver', $mappingSource)) {
            $driver = $mappingSource['driver'];

            if (!$driver instanceof DriverInterface) {
                throw new DriverException(\sprintf(
                    'Metadata mapping driver should be of the type %s, %s given',
                    DriverInterface::class,
                    \is_object($driver) ? \get_class($driver) : \gettype($driver)
                ));
            }

            return $driver;
        }

        $supportedKeys = ['type', 'path'];
        if (\count(\array_intersect($supportedKeys, \array_keys($mappingSource))) === \count($supportedKeys)) {
            return $this->getDriverImplementation($mappingSource['type'], (array) $mappingSource['path']);
        }

        throw new DriverException(
            'Mapping must be array with "driver" key or "type" and "path" keys'
        );
    }
657238
protected function _getDriverName() {
		$className = explode('\\', $this->getConnection()->config()['driver']);
		$name = end($className);

		return $name;
	}
552666
public static function checkForPdoDriver($driver)
    {
        if (!extension_loaded('PDO')) {
            throw new \Exception("Required PDO extension is not installed or loaded.");
        }

        // see overrides for specific driver checks
        $drivers = \PDO::getAvailableDrivers();
        if (!in_array($driver, $drivers)) {
            throw new \Exception("Required PDO driver '$driver' is not installed or loaded properly.");
        }
    }
660887
protected function validateDriver($driver)
    {
        $interface = $this->interface();

        if (! (new ReflectionClass($driver))->implementsInterface($interface)) {
            throw new InvalidDriverException(get_class($driver)." does not implement {$interface}");
        }

        return $driver;
    }
216732
public static function getDBHelper(string $driver): string
    {
        $drivers = [
            'pdo_mysql'  => MySQL::class,
            'mysql'      => MySQL::class,
            'mysql2'     => MySQL::class,

            'pdo_pgsql'  => PostgreSQL::class,
            'pgsql'      => PostgreSQL::class,
            'postgres'   => PostgreSQL::class,
            'postgresql' => PostgreSQL::class,

            'pdo_sqlsrv' => SQLServer::class,
            'mssql'      => SQLServer::class,
        ];

        if (!array_key_exists($driver, $drivers)) {
            throw new \InvalidArgumentException("$driver unknown");
        }

        return $drivers[$driver];
    }
1182087
public function getDriver(string $mimetype)
    {
        foreach ($this->byMimetype as $match => $driver) {
            if ($mimetype === $match) {
                return $driver;
            }
        }

        foreach ($this->byMimeStart as $match => $driver) {
            if (strpos($mimetype, $match) === 0) {
                return $driver;
            }
        }

        return 'DefaultDriver';
    }
558745
private function findDriver($driver = '')
    {
        if (isset($this->driverList[$driver])) {
            $driver = $this->driverList[$driver];
        } else {
            throw new DriverNotFoundException(sprintf('%s adında bir sürücü bulunamadı', $driver));
        }

        if (is_string($driver)) {
            $callableName = "create" . ucfirst($driver) . "Driver";
            $response = call_user_func([$this, $callableName]);
        } elseif (is_callable($driver)) {
            $response = $driver();
        }

        return $response;
    }
591208
protected function createDriver($driver)
	{
		$method = 'create'.ucfirst($driver).'Driver';

		// We'll check to see if a creator method exists for the given driver. If not we
		// will check for a custom driver creator, which allows developers to create
		// drivers using their own customized driver creator Closure to create it.
		if (isset($this->customCreators[$driver]))
		{
			return $this->callCustomCreator($driver);
		}
		elseif (method_exists($this, $method))
		{
			return $this->$method();
		}

		throw new \InvalidArgumentException("Driver [$driver] not supported.");
	}
513248
public static function requireDriver($driver)
    {
        if (empty($driver)) {
            throw new \Exception("Database driver name can not be empty.");
        }

        // clients now use indirect association to drivers, dblib can be sqlsrv or sqlanywhere
        if ('dblib' === $driver) {
            $driver = 'sqlsrv';
        }
        $pdoDriver = null;
        switch ($driver) {
            case 'ibm':
                if (!extension_loaded('ibm_db2')) {
                    throw new \Exception("Required extension 'ibm_db2' is not detected, but may be compiled in.");
                }
                $pdoDriver = 'ibm';
                break;
            case 'mysql':
                if (!extension_loaded('mysql') && !extension_loaded('mysqlnd')) {
                    throw new \Exception("Required extension 'mysql' is not detected, but may be compiled in.");
                }
                $pdoDriver = 'mysql';
                break;
            case 'oracle':
                if (!extension_loaded('oci8')) {
                    throw new \Exception("Required extension 'oci8' is not detected, but may be compiled in.");
                }
                break;
            case 'pgsql':
                if (!extension_loaded('pgsql')) {
                    throw new \Exception("Required extension 'pgsql' is not detected, but may be compiled in.");
                }
                $pdoDriver = 'pgsql';
                break;
            case 'sqlanywhere':
                $extension = 'mssql';
                if (!extension_loaded($extension)) {
                    throw new \Exception("Required extension 'mssql' is not detected, but may be compiled in.");
                }
                $pdoDriver = 'dblib';
                break;
            case 'sqlite':
                if (!extension_loaded('sqlite3')) {
                    throw new \Exception("Required extension 'sqlite3' is not detected, but may be compiled in.");
                }
                $pdoDriver = 'sqlite';
                break;
            case 'sqlsrv':
                $pdoDriver = 'sqlsrv';
                $extension = 'sqlsrv';

                if (!extension_loaded($extension)) {
                    $pdoDriver = 'dblib';
                    $extension = 'mssql';
                    if (!extension_loaded($extension)) {
                        throw new \Exception("Required extension '$extension' is not detected, but may be compiled in.");
                    }
                }
                break;
            default:
                throw new \Exception("Driver '$driver' is not supported by this software.");
                break;
        }

        if ($pdoDriver) {
            static::checkForPdoDriver($pdoDriver);
        }

        return true;
    }
1069837
public function getDefaultDriverClass()
    {
        $oDriver          = $this->getDefaultDriver();
        $sDriverNamespace = ArrayHelper::getFromArray('namespace', (array) $oDriver->data);
        $sDriverClass     = ArrayHelper::getFromArray('class', (array) $oDriver->data);
        return '\\' . $sDriverNamespace . $sDriverClass;
    }
71849
public function getCache(string $driverName=''): \Nofuzz\SimpleCache\CacheInterface
  {
    if (empty($driverName)) {
      # Return the 1st Cache in the list
      return (array_values($this->drivers)[0] ?? null);
    } else {
      # Return the Cache for the $driverName
      return $this->drivers[strtolower($driverName)] ?? null;
    }
  }
1237641
public function getDriverManager(): Interfaces\JavaObject
    {
        if ($this->driverManager === null) {
            $this->driverManager = $this->ba->javaClass('java.sql.DriverManager');
        }

        return $this->driverManager;
    }
789659
public static function getInstance(array $config = array(), DriverInterface $driver = null)
    {
        static $instance = null;

        if (null === $instance) {
            $instance = new static();
        }

        if ($config) {
            $instance->config = $config;
        }

        if ($driver) {
            $instance->driver = $driver;
        }

        return $instance;
    }
61971
public function getDriverName(): string {
		$classNameInfo = explode('\\', get_class($this->driver));
		return strtolower(end($classNameInfo));
	}
698077
protected function createDriver($driver)
    {
        // We'll check to see if a creator method exists for the given driver. If not we
        // will check for a custom driver creator, which allows developers to create
        // drivers using their own customized driver creator Closure to create it.
        if (isset($this->customCreators[$driver])) {
            return $this->callCustomCreator($driver);
        } else {
            $method = 'create' . Str::studly($driver) . 'Driver';

            if (method_exists($this, $method)) {
                return $this->$method();
            }
        }
        throw new InvalidArgumentException("Driver [$driver] not supported.");
    }
599468
protected function getDriver(): string
    {
        $driver = $this->argument('driver') ?: $this->getDriverFromConfig();

        if (! empty($driver)) {
            return $driver;
        }

        throw new RuntimeException('Not enough arguments (missing: "driver").');
    }