List Only BD.

@param $database

@return mixed
506022
public function listOnlyBD($database)
    {
        $this->returnCode = 'no';
        $listBd = $this->send('v-list-database', $this->userName, $database, 'json');
        $data = json_decode($listBd, true);

        return $data;
    }
1055660
public function addDatabase($database)
    {
        if ($database instanceof Database) {
            $platform = null;
            $database->setParentSchema($this);
            if (null === $database->getPlatform()) {
                if ($config = $this->getGeneratorConfig()) {
                    $platform = $config->getConfiguredPlatform(null, $database->getName());
                }

                $database->setPlatform($platform ? $platform : $this->platform);
            }
            $this->databases[] = $database;

            return $database;
        }

        // XML attributes array / hash
        $db = new Database();
        $db->setParentSchema($this);
        $db->loadMapping($database);

        return $this->addDatabase($db);
    }
55341
private function command($database)
    {
        $mysqldumpPath = $this->config->get('backup::config')['BACKUP_MYSQLDUMP_PATH'];
        $mysqldumpOptions = ' \
            --quote-names \
            --quick \
            --add-drop-table \
            --add-locks \
            --allow-keywords \
            --disable-keys \
            --extended-insert \
            --single-transaction \
            --create-options \
            --comments \
            --net_buffer_length=16384';
        $host = $this->config->get('backup::config')['BACKUP_MYSQL_HOST'];
        $user = $this->config->get('backup::config')['BACKUP_MYSQL_USER'];
        $password = $this->config->get('backup::config')['BACKUP_MYSQL_PASSWORD'];
        $folder = storage_path($this->config->get('backup::config')['BACKUP_STORAGE_PATH']);
        $file = $database.'-backup.sql.gz';

        return $mysqldumpPath.$mysqldumpOptions.' --host='.$host.' --user='.$user.' --password='.$password.' '.
            $database.' | gzip > '.$folder.$file;
    }
1090756
public function selectDatabase($database)
    {
        $mysqli = $this->_mysqli();

        if(!$mysqli->select_db($database))
            throw new Exception($mysqli->error, $mysqli->errno);

        $this->_selectedDatabase = $database;

        return $this;
    }
623891
private function _checkdatabase($database)
    {

        if (count($this->_collection) == 0) {
            $this->_collection[$database] = new $database();

            return $this->_collection[$database];
        }

        $new = false;
        foreach ($this->_collection as $db) {
            if ($db === $database) continue;
            $new = true;
        }

        if ($new === true) {
            $this->_collection[$database] = new $database();
        }

        return false;
    }
475097
public function hasChildReturnStatementType($statement)
    {
        if (!isset($statement['statements']) || !\is_array($statement['statements'])) {
            return false;
        }

        if ('if' == $statement['type']) {
            $ret = false;

            $statements = $statement['statements'];
            foreach ($statements as $item) {
                $type = isset($item['type']) ? $item['type'] : null;
                if ('return' == $type || 'throw' == $type) {
                    $ret = true;
                } else {
                    $ret = $this->hasChildReturnStatementType($item);
                }
            }

            if (!$ret || !isset($statement['else_statements'])) {
                return false;
            }

            $statements = $statement['else_statements'];
            foreach ($statements as $item) {
                $type = isset($item['type']) ? $item['type'] : null;
                if ('return' == $type || 'throw' == $type) {
                    return true;
                } else {
                    return $this->hasChildReturnStatementType($item);
                }
            }
        } else {
            $statements = $statement['statements'];
            foreach ($statements as $item) {
                $type = isset($item['type']) ? $item['type'] : null;
                if ('return' == $type || 'throw' == $type) {
                    return true;
                } else {
                    return $this->hasChildReturnStatementType($item);
                }
            }
        }

        return false;
    }
942220
public function getSchemaYAMLFile($database)
    {
        $dir = $this->loader->find($this->application->config('directory.database.schema'))->first();
        return $dir . DS . $this->schemaYAMLFileNameStrategy($database);
    }
370381
public function getFirst($sql = null)
    {
        if ($sql) {
            $this->setLastQuery($sql);

            try {
                $result = $this->db->query($sql);
            } catch (\PDOException $e) {
                throw new DatabaseException($e->getMessage() . '<br>' . $this->getLastQuery()[0]);
            }

            $data = $this->fetchAssoc($result);

            if (isset($data[0])) {
                return $data[0];
            }

            return null;
        }

        return $this->limit(1)->query()->fetchAssoc();
    }
565812
def list_databases(self, instance, limit=None, marker=None):
        """"""
        return instance.list_databases(limit=limit, marker=marker)
601660
public function getBackupInstance($database = null)
	{
		$configuration = array_merge($this->getConfig('database'), $this->getConfig('backup::config'));
		$this->backupInstance = $this->backupFactory->build($configuration, $database);

		return $this->backupInstance;
	}
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;
    }
935072
def list_databases(self, limit=None, marker=None):
        """"""
        return self._database_manager.list(limit=limit, marker=marker)
796201
public function showCategoriesTable(DatabaseManager $database)
    {
        $categories = Category::query()
            ->leftJoin('items')
            ->addSelect($database->raw('COUNT(items.item_id) as item_count'))
            ->groupBy('categories.category_id');

        $table = new AdminCategories($categories);

        $table->with('parent');

        return view('mustard::admin.categories', [
            'table'      => $table,
            'categories' => $table->paginate(),
        ]);
    }
705690
public function getSchemaFile($database)
    {
        $dir = $this->loader->find($this->application->config('directory.database.schema'))->first();
        return $dir . DS . $this->schemaFileNameStrategy($database);
    }
1310915
public static function getDatabaseConfig($database)
    {
        $cached = self::$cache[$database] ?? null;
        if ($cached !== null) {
            return $cached;
        }

        if (self::$config === null) {
            throw new \BadMethodCallException('Config was not loaded');
        }
        if (!array_key_exists($database, self::$config['databases'])) {
            throw new \LogicException("Unknown database '$database'");
        }

        $data = self::$config['databases'][$database];
        if (is_string($data)) {
            $data = ['database_name' => $data];
        }

        $server = $data['server'] ?? 'default';
        $servers = self::$config['servers'] ?? [];
        if (array_key_exists($server, $servers)) {
            unset($data['server']);
            $data = array_merge($servers[$server], $data);
        }

        self::$cache[$database] = $data;
        return $data;
    }
525434
public function db($db = null)
    {
        if (is_null($db)) {
            return $this->dbName;
        } else {
            $this->dbName = $db;
        }
        return null;
    }
1261217
protected function getIDListFromDB() : array
    {
        if ($this->sValue == ProductListStore::SORT_PRICE_ASC) {
            $arElementIDList = $this->getByPriceASC();
        } elseif ($this->sValue == ProductListStore::SORT_PRICE_DESC) {
            $arElementIDList = $this->getByPriceDESC();
        } elseif ($this->sValue == ProductListStore::SORT_NEW) {
            $arElementIDList = $this->getNewProductList();
        } elseif ($this->sValue == ProductListStore::SORT_NO) {
            $arElementIDList = $this->getProductList();
        } elseif (preg_match('%^'.ProductListStore::SORT_PRICE_ASC.'\|.+%', $this->sValue)) {
            $arElementIDList = $this->getByPriceTypeASC();
        } elseif (preg_match('%^'.ProductListStore::SORT_PRICE_DESC.'\|.+%', $this->sValue)) {
            $arElementIDList = $this->getByPriceTypeDESC();
        } else {
            $arElementIDList = $this->getCustomSortingList();
        }

        return $arElementIDList;
    }