client.databases.get_schemas_tables

A method of the Databases endpoint.

get_schemas_tables(id: int, schema_name: str, table_name: str, *, credential_id: int = None) Response

Show basic table info

API URL: GET /databases/{id}/schemas/{schema_name}/tables/{table_name}

import civis
client = civis.APIClient()
response = client.databases.get_schemas_tables(...)
Parameters:
idint

The ID of the database

schema_namestr

The name of the schema

table_namestr

The name of the table

credential_idint, optional

If provided, schemas will be filtered based on the given credential.

Returns:
civis.Response
  • 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.

  • data_updated_atstr (date-time)

    The last time that Civis Platform captured a change in this table.Only applicable for Redshift tables; please see the Civis help desk for more info.

  • schema_updated_atstr (date-time)

    The last time that Civis Platform captured a change to the table attributes/structure.Only applicable for Redshift tables; please see the Civis help desk for more info.

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

  • primary_keysList[str]

    The primary keys for this table.

  • last_modified_keysList[str]

    The columns indicating an entry’s modification status for this table.

  • table_tagsList[civis.Response]

    The table tags associated with this table.

    • idint

      Table Tag ID

    • namestr

      Table Tag Name

  • ontology_mappingcivis.Response

    The ontology-key to column-name mapping. See /ontology for the list of valid ontology keys.

  • columnsList[civis.Response]
    • namestr

      Name of the column.

    • civis_data_typestr

      The generic data type of the column (ex. “string”). Since this is database-agnostic, it may be helpful when loading data to R/Python.

    • sql_typestr

      The database-specific SQL type of the column (ex. “varchar(30)”).

    • sample_valuesList[str]

      A sample of values from the column.

    • encodingstr

      The compression encoding for this columnSee: http://docs.aws.amazon .com/redshift/latest/dg/c_Compression_encodings.html

    • descriptionstr

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

    • orderint

      Relative position of the column in the table.

    • min_valuestr

      Smallest value in the column.

    • max_valuestr

      Largest value in the column.

    • avg_valuefloat (float)

      This parameter is deprecated.

    • stddevfloat (float)

      This parameter is deprecated.

    • value_distribution_percentcivis.Response

      A mapping between each value in the column and the percentage of rows with that value.Only present for tables with fewer than approximately 25,000,000 rows and for columns with fewer than twenty distinct values.

    • coverage_countint

      Number of non-null values in the column.

    • null_countint

      Number of null values in the column.

    • possible_dependent_variable_typesList[str]

      Possible dependent variable types the column may be used to model. Null if it may not be used as a dependent variable.

    • useable_as_independent_variablebool

      Whether the column may be used as an independent variable to train a model.

    • useable_as_primary_keybool

      Whether the column may be used as an primary key to identify table rows.

    • value_distributioncivis.Response

      An object mapping distinct values in the column to the number of times they appear in the column

    • distinct_countint

      Number of distinct values in the column. NULL values are counted and treated as a single distinct value.

  • joinsList[civis.Response]
    • id : int

    • left_table_id : int

    • left_identifier : str

    • right_table_id : int

    • right_identifier : str

    • on : str

    • left_join : bool

    • created_at : str (time)

    • updated_at : str (time)

  • multipart_key : List[str]

  • enhancementsList[civis.Response]
    • type : str

    • created_at : str (time)

    • updated_at : str (time)

    • join_id : int

  • view_def : str

  • table_def : str

  • outgoing_table_matchesList[civis.Response]
    • source_table_idint

      Source table

    • target_typestr

      Target type

    • target_idint

      Target ID

    • targetcivis.Response
      • name : str

    • jobcivis.Response
      • id : int

      • name : str

      • type : str

      • from_template_id : int

      • statestr

        Whether the job is idle, pending, scheduled, queued, running, succeeded, failed or cancelled.

      • created_at : str (date-time)

      • updated_at : str (date-time)

      • last_run_updated_at : str (date-time)

      • runsList[civis.Response]

        Information about the most recent runs of the job.

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

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

      • hiddenbool

        The hidden status of the item.

      • match_optionscivis.Response
        • max_matches : int

        • threshold : str