---
title: "Get database query execution details by ID"
method: GET
path: "/database/queryExecution/{id}"
tags: ["DatabaseQueryExecution"]
---

# Get database query execution details by ID

`GET /database/queryExecution/{id}`

Get database query execution details and results URI

## Path parameters

- `id` string, required

## Response `200`

Database execution details

- DatabaseQueryExecution
  - `id` string — DatabaseQueryExecution ID
  - `workspace_id` string — Workspace ID
  - `database_connection_id` string — Database connection ID
  - `environment_id` string — Environment ID
  - `execution_command` 'get_schema' | 'test_connection' — Command to run against database
  - `snippet_id` string — ID of reusable SQL query to execute
  - `query` string — Base64 encoded SQL query to execute
  - `query_parameters` DatabaseQueryParameter[] — Runtime query parameters to apply
    - `id` string — Parameter ID
    - `type` 'String' | 'Number' | 'Boolean' — Parameter datatype. Defaults to string if not provided. (optional)
    - `value` string — String value of provided parameter
  - `status` 'scheduled' | 'running' | 'complete' | 'failure' — Current status of query execution
  - `results_metadata` DatabaseQueryResultMetadata
    - `status` 'success' | 'failed' | 'error' — Query results status
    - `duration` integer — Duration of query in milliseconds
    - `message` string — Message returned from database on a successful query, if any
    - `error_message` string — Error message returned from database query, if any
    - `row_count` integer — Row count in result set
    - `column_count` integer — Columns count in result set
    - `rows_affected` integer — Count of rows affacted count by query
    - `additional_properties` object — Key value map for additional properties
  - `results_uri` string — GCS storage bucket location of the query results
  - `test_context_id` string — The test run id if the query is being executed during a cloud run or the user's id for a local run
  - `created_time` integer
  - `created_by_id` string
  - `last_updated_time` integer
  - `last_updated_by_id` string
  - `completed_time` integer

## Other responses

- `401` — User not authenticated
- `403` — User not authorized
- `404` — Entity not found
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
