List Postgres Gateway Tables
- async AsyncCogniteClient.postgres_gateway.tables.list(
- username: str,
- include_built_ins: Literal['yes', 'no'] | None = 'no',
- limit: int | None = 25,
-
List all tables in a given project.
- Parameters:
username (str) – The name of the username (a.k.a. database) to be managed from the API
include_built_ins (Literal['yes', 'no'] | None) – Determines if API should return built-in tables or not
limit (int | None) – Limits the number of results to be returned.
- Returns:
Foreign tables
- Return type:
pg.TableList
Examples
List tables:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> custom_table_list = client.postgres_gateway.tables.list("myUserName", limit=5)
Iterate over tables, one-by-one:
>>> for table in client.postgres_gateway.tables(): ... table # do something with the custom table
Iterate over chunks of tables to reduce memory load:
>>> for table_list in client.postgres_gateway.tables(chunk_size=25): ... table_list # do something with the custom tables