think\db\connector\Pgsql::getTables PHP Метод

getTables() публичный Метод

取得数据库的表信息
public getTables ( string $dbName = '' ) : array
$dbName string
Результат array
    public function getTables($dbName = '')
    {
        $this->initConnect(true);
        $sql = "select tablename as Tables_in_test from pg_tables where  schemaname ='public'";
        // 调试开始
        $this->debug(true);
        $pdo = $this->linkID->query($sql);
        // 调试结束
        $this->debug(false, $sql);
        $result = $pdo->fetchAll(PDO::FETCH_ASSOC);
        $info = [];
        foreach ($result as $key => $val) {
            $info[$key] = current($val);
        }
        return $info;
    }