You can execute the SHOW TABLES statement to query the names of tables in the current database.
Note
For more information about the SHOW TABLES statement, see List mapping table names.
Prerequisites
A Tablestore client is initialized. For more information, see Initialize a Tablestore client.
Example
The following sample code provides an example on how to execute the SHOW TABLES statement to list the names of mapping tables.
def show_tables(client):
query = 'show tables'
rowlist, _, _ = client.exe_sql_query(query)
ret = []
for row in rowlist:
ret.append(row.attribute_columns)
print(ret)
The following output is returned:
Note
The instance_name parameter in the response indicates the name of the Tablestore instance. The actual value returned prevails.
[[('Tables_in_instance_name', 'exampletable')],
[('Tables_in_instance_name', 'test_table')]]
该文章对您有帮助吗?