Get database name.

@return  string
541603
public function getDatabaseName()
    {
        if ($this->isSlave() && ! $this->database_name) {
            return $this->_master->getDatabaseName();
        }

        // sqlite data file
        if ($this->driver instanceof SqliteDriver) {
            if ($this->isUseMemory()) {
                return ':memory:';
            }
            if ($this->database_dir && $this->database_name[0] !== '/') {
                return $this->database_dir . '/' . $this->database_name;
            }
        }
        
        return $this->database_name;
    }
31526
protected function getMySQLDatabaseByName($databases, $database_name)
    {
        $database_found = collect($databases)->filter(function ($database) use ($database_name) {
            return $database['name'] === $database_name;
        })->first();

        if ($database_found) {
            return $database_found;
        }
        return null;
    }
1229736
public String getDatabaseProductName() throws SQLException {
    if (urlParser.getOptions().useMysqlMetadata) {
      return "MySQL";
    }
    if (connection.getProtocol().isServerMariaDb()
            && connection.getProtocol().getServerVersion().toLowerCase(Locale.ROOT).contains("mariadb")) {
      return "MariaDB";
    }
    return "MySQL";
  }
1321164
public function getName(): string
    {
        if (!empty($this->name)) {
            return $this->name;
        }

        $name = ($this->isUnique() ? 'unique_' : 'index_') . join('_', $this->getColumns());

        return strlen($name) > 64 ? md5($name) : $name;
    }
543930
public function getDbTableName(): string
    {
        // Name set in class
        if ($this->db_table) {
            return $this->db_table;
        }

        $db_table_from_class = mb_strtolower(Converter::fromCamelCase(str_replace([self::CLASS_RELATION_NAME_ENTITY, self::CLASS_RELATION_NAME_REPOSITORY], '', $this->getUnqualifiedShortClassName()))) . 's';

        // Check DB in system tables
        $this->db_table = 'cms_' . $db_table_from_class;
        if (!SQL::getInstance()->tableExists($this->db_table)) {
            // Or in module tables
            $this->db_table = 'm_' . $db_table_from_class;
        }

        return $this->db_table;
    }
658011
protected function _getResourceName()
	{
		if( $this->_resourceName === null ) {
			$this->_resourceName = $this->_context->getConfig()->get( 'resource/default', 'db' );
		}

		return $this->_resourceName;
	}
841432
public function getTableName()
    {
        if ($this->_tableName === null) {
            $this->_tableName = $this->model->tableName();
        }
        
        return $this->_tableName;
    }
111601
public function getPlatformName()
    {
        static $name = null;
        if (!$name) {
            $name = $this->connection->getDatabasePlatform()->getName();
        }
        return $name;
    }
582033
public function driver_name()
	{
		// Make sure the database is connected
		$this->_connection or $this->connect();

		// Getting driver name
		return $this->_connection->getAttribute(\PDO::ATTR_DRIVER_NAME);
	}
1365001
public function getName()
    {
        if ($this->database instanceof AbstractDatabase
            && $this->database->getName() !== $this->db->getCurrentDatabase()) {
            return $this->database->getName() . '.' . $this->name;
        }

        return $this->name;
    }
483518
public function getDatabases(): array
    {
        $names = array_unique(array_merge(array_keys($this->databases), array_keys($this->config->getDatabases())));

        $result = [];
        foreach ($names as $name) {
            $result[] = $this->database($name);
        }

        return $result;
    }
441709
public function listDatabases()
    {
        $json = (string) $this->client->request('GET', '/_all_dbs')->getBody();
        $databases = JSONEncoder::decode($json);

        return $databases;
    }
336124
public function getTableName()
    {
        if (is_null($this->_tableName)) {
            $this->_tableName = $this->getDescriptor()->getEntity()
                ->getTableName();
        }
        return $this->_tableName;
    }
915793
public static function get_alternative_database_name()
    {
        // Ignore if disabled
        if (!Config::inst()->get(static::class, 'alternative_database_enabled')) {
            return false;
        }
        // Skip if CLI
        if (Director::is_cli()) {
            return false;
        }
        // Skip if there's no request object yet
        if (!Injector::inst()->has(HTTPRequest::class)) {
            return null;
        }
        /** @var HTTPRequest $request */
        $request = Injector::inst()->get(HTTPRequest::class);
        // Skip if the session hasn't been started
        if (!$request->getSession()->isStarted()) {
            return null;
        }

        $name = $request->getSession()->get(self::ALT_DB_KEY);
        if (self::valid_alternative_database_name($name)) {
            return $name;
        }

        return false;
    }
1373380
public function getTableName()
    {
        if (!$this->through) {
            $parts = [
                TableNameResolver::getTableName($this->getTable()),
                TableNameResolver::getTableName($this->getRelatedTable()),
            ];
            sort($parts);

            return '{{%'.implode('_', $parts).'}}';
        }

        return call_user_func([$this->through, 'tableName']);
    }
886742
public function getTableName()
    {
        if (null == $this->tableName) {
            $this->tableName = $this->determineTableName();
        }
        return $this->tableName;
    }
1319514
public function getDatabase()
    {
        if (self::$database === null) {
            self::$database = self::mongo(self::getConfig()->Database);
        }

        return self::$database;
    }