---
title: db.query
description: A database query from the Django ORM or SQLAlchemy. Honeybadger skips queries that match exclude_queries.
url: https://docs.honeybadger.io/insights/event-types/python/db.query/
---

A database query from the Django ORM or SQLAlchemy. Honeybadger skips queries that match exclude\_queries.

Category **Database** Fields **5** [honeybadger-python](https://docs.honeybadger.io/lib/python/)

## Fields

| Field        | Type   | Description                                                                         |
| ------------ | ------ | ----------------------------------------------------------------------------------- |
| `event_type` | string | Allowed value: `db.query`.                                                          |
| `query`      | string | SQL query string. Bind parameters may appear as literals, depending on the driver.  |
| `duration`   | number | Query execution duration in milliseconds.                                           |
| `params`     | any    | Query parameters. Only present when include\_params is enabled in insights\_config. |
| `request_id` | string | Request ID from event context, ties this query to the enclosing request.            |

## Example

```json
{
  "event_type": "db.query",
  "query": "SELECT \"users\".* FROM \"users\" WHERE \"users\".\"id\" = %s LIMIT 1",
  "duration": 2.4815,
  "params": [
    123
  ],
  "request_id": "1f9f6f1a-2b3c-4d5e-8f6a-7b8c9d0e1f2a"
}
```

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
