本文介绍如何通过Go SDK列出实例下的数据表名称。
前提条件
方法说明
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)
}
}
}
相关文档
该文章对您有帮助吗?