# DbSummaryRenderer

> Renders request-wide Database totals independently of adapter grid widgets.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Db](/docs/extensions/debug-core/reference/panel/db/index.md) › DbSummaryRenderer

| final class | `PHPForge\Debug\Panel\Db\DbSummaryRenderer` |
| --- | --- |
| Source | [`src/Panel/Db/DbSummaryRenderer.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Db/DbSummaryRenderer.php#L17) |

Renders request-wide Database totals independently of adapter grid widgets.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`render()`](#method-render) static | Renders the grid summary header with the request-wide totals and the optional page-size selector. | `DbSummaryRenderer` |
| [`toolbarTitle()`](#method-toolbarTitle) static | Builds the toolbar chip title, reporting the executed query count or the active warning sentences. | `DbSummaryRenderer` |

## Method details

### render() <span id="method-render"></span>

```php
public static function render(PHPForge\Debug\Panel\Db\DbSummary $summary, string|null $pageSize = null): string
```

Renders the grid summary header with the request-wide totals and the optional page-size selector.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$summary` | [`DbSummary`](/docs/extensions/debug-core/reference/panel/db/dbsummary/index.md) | Request-wide Database metrics. |
| `$pageSize` | `string\|null` | Rendered page-size selector appended after the totals, or `null` to omit it. |

**Returns**

`string`: Summary header markup.

### toolbarTitle() <span id="method-toolbarTitle"></span>

```php
public static function toolbarTitle(PHPForge\Debug\Panel\Db\DbSummary $summary, int|null $criticalQueryThreshold, int|null $excessiveCallerThreshold): string
```

Builds the toolbar chip title, reporting the executed query count or the active warning sentences.

Warnings replace the count entirely: the critical-count sentence comes first, the excessive-caller sentence
second, and both are joined by a newline when they apply together.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$summary` | [`DbSummary`](/docs/extensions/debug-core/reference/panel/db/dbsummary/index.md) | Request-wide Database metrics. |
| `$criticalQueryThreshold` | `int\|null` | Query count above which the request is critical, or `null` to disable. |
| `$excessiveCallerThreshold` | `int\|null` | Statements per call site that flag it, or `null` to disable. |

**Returns**

`string`: Warning sentences when a threshold is exceeded, otherwise the executed-query count.