List tables

tables_list(
  database_id = NULL,
  schema = NULL,
  name = NULL,
  search = NULL,
  limit = NULL,
  page_num = NULL,
  order = NULL,
  order_dir = NULL
)

Arguments

database_id

integer optional. The ID of the database.

schema

string 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").

name

string 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").

search

string 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.

limit

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

page_num

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

order

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

order_dir

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

Value

An array containing the following fields:

id

integer, The ID of the table.

databaseId

integer, The ID of the database.

schema

string, The name of the schema containing the table.

name

string, Name of the table.

description

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

isView

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

rowCount

integer, The number of rows in the table.

columnCount

integer, The number of columns in the table.

sizeMb

number, The size of the table in megabytes.

owner

string, The database username of the table's owner.

distkey

string, The column used as the Amazon Redshift distkey.

sortkeys

string, The column used as the Amazon Redshift sortkey.

refreshStatus

string, 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.

lastRefresh

string, The time of the last statistics refresh.

refreshId

string, The ID of the most recent statistics refresh.

lastRun

list, A list containing the following elements:

  • id integer,

  • state string,

  • createdAt string, The time that the run was queued.

  • startedAt string, The time that the run started.

  • finishedAt string, The time that the run completed.

  • error string, The error message for this run, if present.