---
title: "D1StatementObserver"
description: "Called after each statement the driver executes."
url: "https://pitlane.tools/package/data-table-d1/type/D1StatementObserver"
---

# D1StatementObserver

```ts
import type { D1StatementObserver } from "@pitlane/data-table-d1";
```

```ts
type D1StatementObserver = (report: D1StatementReport) => void;
```

Called after each statement the driver executes.

D1 bills on rows read and written, and its analytics report per database rather than per query, so these numbers are the only way to attribute cost to the query or the request that caused it. They ride along on responses the driver already reads, so observing them costs no extra statement and no extra billable operation.

It runs on the hot path, once per statement, so keep it cheap.

## Parameters

### report

[`D1StatementReport`](https://pitlane.tools/package/data-table-d1/interface/D1StatementReport.md)

## Returns

`void`
