List tables in a database

async AsyncCogniteClient.raw.tables.list(
db_name: str,
limit: int | None = 25,
) TableList

List tables.

Parameters:
  • db_name (str) – The database to list tables from.

  • limit (int | None) – Maximum number of tables to return. Defaults to 25. Set to -1, float(“inf”) or None to return all items.

Returns:

List of requested tables.

Return type:

raw.TableList

Examples

List the first 5 tables:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> table_list = client.raw.tables.list("db1", limit=5)

Iterate over tables, one-by-one:

>>> for table in client.raw.tables(db_name="db1"):
...     table  # do something with the table

Iterate over chunks of tables to reduce memory load:

>>> for table_list in client.raw.tables(db_name="db1", chunk_size=25):
...     table_list  # do something with the tables