client.queries.put_scripts

A method of the Queries endpoint.

put_scripts(id: int, script_id: int) → Response

Update the query’s associated script

API URL: PUT /queries/{id}/scripts/{script_id}

import civis
client = civis.APIClient()
response = client.queries.put_scripts(...)
Parameters:
idint

The query ID.

script_idint

The ID of the script associated with this query.

Returns:
civis.Response
  • idint

    The query ID.

  • databaseint

    The database ID.

  • sqlstr

    The SQL to execute.

  • credentialint

    The credential ID.

  • result_rowsList[List]

    A preview of rows returned by the query.

  • result_columnsList[str]

    A preview of columns returned by the query.

  • errorstr

    The error message for this run, if present.

  • started_atstr (date-time)

    The start time of the last run.

  • finished_atstr (date-time)

    The end time of the last run.

  • statestr

    The state of the last run. One of idle, pending, scheduled, queued, running, succeeded, failed or cancelled.

  • script_idint

    The ID of the script associated with this query.

  • exceptionstr

    Deprecated and not used.

  • created_at : str (time)

  • updated_at : str (time)

  • last_run_idint

    The ID of the last run.

  • hiddenbool

    The hidden status of the item.

  • archivedbool

    The archival status of the requested item(s).

  • namestr

    The name of the query.

  • read_onlybool

    Whether to run the SQL on a read-only database session [default: false]. When true, the SQL must be a single SELECT, or a WITH … SELECT, or the request is rejected. PostgreSQL and Redshift also refuse any write the SELECT still makes, such as one in a WITH clause or a function. BigQuery has no read-only session, so there it relies on the credential’s permissions.

  • authorcivis.Response
    • idint

      The ID of this user.

    • namestr

      This user’s name.

    • usernamestr

      This user’s username.

    • initialsstr

      This user’s initials.

    • onlinebool

      Whether this user is online.

  • report_idint

    The ID of the report associated with this query.