列出数据表

本文介绍如何通过Go SDK列出实例下的数据表名称。

前提条件

初始化Tablestore Client

方法说明

func (tableStoreClient *TableStoreClient) ListTable() (*ListTableResponse, error)

示例代码

以下示例代码用于查询实例下的数据表列表并打印表名称。

func ListTableSample(client *tablestore.TableStoreClient){
    tables, err := client.ListTable()
    if err != nil {
        fmt.Println("Failed to list table with error:", err)
    } else {
        for _, table := range (tables.TableNames) {
            fmt.Println(table)
        }
    }
}

相关文档

列出时序表