showDbTables

@param string $dbname
@param string $where

@return  string
429569
public static function showDbTables($dbname, $where = null)
    {
        $query = static::getQuery();

        return static::build(
            'SHOW',
            'TABLE STATUS FROM',
            $query->quoteName($dbname),
            $where ? new QueryElement('WHERE', $where, 'AND') : null
        );
    }
774481
public function isDbTableExists($tableName)
    {
        $status = false;
        $resultSet = array();

        $query = $this->executeRawQuery("SHOW TABLES LIKE '".trim($tableName)."';");
        if($resultSet)
            $resultSet = $query->toArray();



        if(!empty($resultSet)) {
            $status = true;

        }

        return $status;
    }
344900
public function GetListOfTablesInDatabase() {
        $dbConfig = new \Puzzlout\Framework\Dal\DbStatementConfig(null, \Puzzlout\Framework\Dal\DbExecutionType::SHOWTABLES, new \Puzzlout\Framework\Dal\DbQueryFilters());
        $dbConfig->setQuery("SHOW TABLES;");
        $this->addDbConfigItem($dbConfig);
        return $this->BindParametersAndExecute();
    }
686213
public function useDatabase(string $dbName): bool
    {
        $sql = sprintf('USE %s;', $this->quoter->quoteName($dbName));
        $result = $this->db->exec($sql);

        return (bool)$result;
    }
483162
public function selectValue($tableName, $column, $where = null)
    {
        $stmt = $this->executeSelect($tableName, $column, $where);
        return $stmt->fetchColumn();
    }
158430
public function getFieldByDbName(string $dbFieldName): ?FieldMetadataInterface
    {
        foreach ($this->fieldsMetadata as $fieldMetadata) {
            if ($dbFieldName === $fieldMetadata->getDbFieldName()) {
                return $fieldMetadata;
            }
        }

        return null;
    }
936704
public function getDatabaseRelations(Where $where = null)
    {
        $where = Where::create('n.nspname !~* $*', ['^pg_'])
            ->andWhere('n.nspname != $*', ['information_schema'])
            ->andWhere($where)
            ;

        return $this->getRelations($where);
    }
468864
public static function listDatabases($where = null)
    {
        $where = (array) $where;
        $where[] = 'datistemplate = false';
        $where = new QueryElement('WHERE', $where, ' AND ');

        return 'SELECT datname FROM pg_database ' . $where . ';';
    }
955455
public function listTables($pattern = '/.*/')
    {
        $tables                 = [];
        $lastEvaluatedTableName = null;
        do {
            $args = [
                "Limit" => 30,
            ];
            if ($lastEvaluatedTableName) {
                $args['ExclusiveStartTableName'] = $lastEvaluatedTableName;
            }
            $cmd    = $this->db->getCommand(
                'ListTables',
                $args
            );
            $result = $this->db->execute($cmd);
            if (isset($result['LastEvaluatedTableName'])) {
                $lastEvaluatedTableName = $result['LastEvaluatedTableName'];
            }
            else {
                $lastEvaluatedTableName = null;
            }
            
            foreach ($result['TableNames'] as $tableName) {
                if (preg_match($pattern, $tableName)) {
                    $tables[] = $tableName;
                }
            }
        } while ($lastEvaluatedTableName != null);
        
        return $tables;
    }
132085
public static function count($where)
     {
         $self = self::instance();
         $rows = new ModelArray();
         //
         $sql = 'select count(*) as cnt from '.$self->DBtable." where $where ";
         $data = Database::read($sql, 1);
         //
         return $data[0]['cnt'];
     }
96145
public function create_database($dbhost, $dbuser, $dbpass, $dbname, array $dboptions=null) {
        global $CFG;

        $this->dbhost = $dbhost;
        $this->dbuser = $dbuser;
        $this->dbpass = $dbpass;
        $this->dbname = $dbname;
        $filepath = $this->get_dbfilepath();
        $dirpath = dirname($filepath);
        @mkdir($dirpath, $CFG->directorypermissions, true);
        return touch($filepath);
    }
1166725
public static function findWhere(...$where): array
    {
        $self = static::getInstance();

        $whereParams = [];

        if (\count($where) === 2 && \is_string($where[0])) {
            $whereClause = $where[0];
            $whereParams = (array)$where[1];
        } elseif (\count($where)) {
            $whereOrTerms = [];
            foreach ($where as $keyValueSets) {
                $whereAndTerms = [];
                foreach ($keyValueSets as $keyName => $keyValue) {
                    if (\is_array($keyValue)) {
                        $keyValue = array_map(
                            function ($value) {
                                return DbProxy::quote($value);
                            },
                            $keyValue
                        );
                        $keyValue = implode(',', $keyValue);
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' IN (' . $keyValue . ')';
                    } elseif (null === $keyValue) {
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' IS NULL';
                    } elseif ('%' === $keyValue{0} || '%' === $keyValue{-1}) {
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' LIKE ?';
                        $whereParams[] = $keyValue;
                    } else {
                        $whereAndTerms[] = $self->name . '.' . $keyName . ' = ?';
                        $whereParams[] = $keyValue;
                    }
                    if (!is_scalar($keyValue) && !is_null($keyValue)) {
                        throw new \InvalidArgumentException(
                            "Wrong arguments of method 'findWhere'.\n" .
                            "Please use syntax described at https://github.com/bluzphp/framework/wiki/Db-Table"
                        );
                    }
                }
                $whereOrTerms[] = '(' . implode(' AND ', $whereAndTerms) . ')';
            }
            $whereClause = '(' . implode(' OR ', $whereOrTerms) . ')';
        } else {
            throw new DbException(
                "Method `Table::findWhere()` can't return all records from table"
            );
        }

        return self::fetch($self->select . ' WHERE ' . $whereClause, $whereParams);
    }
168584
public function cuSelectAsArray($tableName, $where = '', $order = '', $limit = '')
    {

        $data_array = [];
        $where      = trim($where);
        $order      = trim($order);
        $limit      = trim($limit);
        if ($where === false) {
            $where = '';
        }
        if ($where !== '') {
            $where = ' WHERE ' . $where;
        }
        if ($order !== '') {
            $order = ' ORDER BY ' . $order;
        }
        if ($limit !== '') {
            $limit = ' LIMIT ' . $limit;
        }

        /** @noinspection SqlNoDataSourceInspection */
        $q      = 'SELECT * FROM `%s` %s %s %s;';
        $q      = sprintf($q, $tableName, $where, $order, $limit);
        $result = $this->query($q);

        if ($result !== false) {
            while ($data = $result->fetch_assoc()) {
                $data_array[] = $data;
            }
        }

        return $data_array;
    }
1283087
function count($table, $where, $where_params = null)
    {
        $sql = "SELECT COUNT(*) FROM " . $table . $this->buildWhere($where);
        $stmt = $this->executeQuery($sql, $where_params);

        return $stmt->fetchColumn();
    }
1365625
public function searchTable(
        string $databaseName,
        string $tableName,
        string $searchTerm
    ): \Generator {
        return $this->search->searchTable($this->connection, $databaseName, $tableName, $searchTerm);
    }
347161
public TResult query(String where, String[] whereArgs) {
		TResult result = userDb.query(getTableName(), table.getColumnNames(),
				where, whereArgs, null, null, null);
		prepareResult(result);
		return result;
	}
1254776
public function selectDB($name)
    {
        $this->dbname = $name;

        if ($this->state !== 1) {
            return $this->query('USE `' . $name . '`');
        }

        return true;
    }