Go SDK 可列出當前執行個體中的所有資料表。
前提條件
安裝Tablestore Go SDK並初始化用戶端。
功能說明
調用 ListTable 查詢當前執行個體中的所有資料表名稱。該方法不需要請求參數。
func (tableStoreClient *TableStoreClient) ListTable() (*ListTableResponse, error)
以下樣本列出當前執行個體中的所有資料表。
response, err := client.ListTable()
if err != nil {
log.Fatal(err)
}
for _, tableName := range response.TableNames {
fmt.Println(tableName)
}
傳回值
ListTableResponse 包含以下商務資訊。
|
欄位 |
類型 |
說明 |
|
|
|
當前執行個體中的資料表名稱列表。 |