client.tables.list

A method of the Tables endpoint.

list(*, database_id: int = None, schema: str = None, name: str = None, search: str = None, table_tag_ids: List[int] = None, credential_id: int = None, limit: int = None, page_num: int = None, order: str = None, order_dir: str = None, iterator: bool = None) ListResponse | PaginatedResponse

List tables

API URL: GET /tables

import civis
client = civis.APIClient()
response = client.tables.list(...)
Parameters:
database_idint, optional

The ID of the database.

schemastr, optional

If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “schema=%census%” will return both “client_census.table” and “census_2010.table”).

namestr, optional

If specified, will be used to filter the tables returned. Substring matching is supported with “%” and “*” wildcards (e.g., “name=%table%” will return both “table1” and “my table”).

searchstr, optional

If specified, will be used to filter the tables returned. Will search across schema and name (in the full form schema.name) and will return any full name containing the search string.

table_tag_idsList[int], optional

If specified, will be used to filter the tables returned. Will search across Table Tags and will return any tables that have one of the matching Table Tags.

credential_idint, optional

If specified, will be used instead of the default credential to filter the tables returned.

limitint, optional

Number of results to return. Defaults to 50. Maximum allowed is 1000.

page_numint, optional

Page number of the results to return. Defaults to the first page, 1.

orderstr, optional

The field on which to order the result set. Defaults to schema. Must be one of: schema, name, search, table_tag_ids, credential_id.

order_dirstr, optional

Direction in which to sort, either asc (ascending) or desc (descending) defaulting to asc.

iteratorbool, optional

If True, return a generator (specifically, a civis.PaginatedResponse object) to iterate over all responses. Use it when more results than the maximum allowed by ‘limit’ are needed. When True, ‘page_num’ is ignored. If False, return a civis.ListResponse object (= a list of civis.Response objects), whose size is determined by ‘limit’. Defaults to False.

Returns:
civis.ListResponse | civis.PaginatedResponse
  • idint

    The ID of the table.

  • database_idint

    The ID of the database.

  • schemastr

    The name of the schema containing the table.

  • namestr

    Name of the table.

  • descriptionstr

    The description of the table, as specified by the table owner

  • is_viewbool

    True if this table represents a view. False if it represents a regular table.

  • row_countint

    The number of rows in the table.

  • column_countint

    The number of columns in the table.

  • size_mbfloat (float)

    The size of the table in megabytes.

  • ownerstr

    The database username of the table’s owner.

  • distkeystr

    The column used as the Amazon Redshift distkey.

  • sortkeysstr

    The column used as the Amazon Redshift sortkey.

  • refresh_statusstr

    How up-to-date the table’s statistics on row counts, null counts, distinct counts, and values distributions are. One of: refreshing, stale, or current.

  • last_refreshstr (date-time)

    The time of the last statistics refresh.

  • refresh_idstr

    The ID of the most recent statistics refresh.

  • last_runcivis.Response
    • id : int

    • statestr

      The state of the run. One of queued, running, succeeded, failed or cancelled.

    • created_atstr (time)

      The time that the run was queued.

    • started_atstr (time)

      The time that the run started.

    • finished_atstr (time)

      The time that the run completed.

    • errorstr

      The error message for this run, if present.

  • table_tagsList[civis.Response]

    The table tags associated with this table.

    • idint

      Table Tag ID

    • namestr

      Table Tag Name