---
title: "Feature: #79262 - Add possibility to create TRIM expression with Doctrine DBAL"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-79262"
source: "Changelog/8.6/Feature-79262-AddPossibilityToCreateTRIMExpressionWithDoctrineDBAL.rst"
modified: "2026-09-15T10:46:36+00:00"
---

# Feature: #79262 - Add possibility to create TRIM expression with Doctrine DBAL

See [forge#79262](https://forge.typo3.org/issues/79262)

## Description

The possibility to create TRIM expressions using Doctrine DBAL has been integrated.
However, when using this in comparisons, ExpressionBuilder::comparison() has to be
invoked explicitly - otherwise the created TRIM expression would be quoted if e.g.
used with ExpressionBuilder::eq().

```php
$queryBuilder->expr()->comparison(
    $queryBuilder->expr()->trim($fieldName),
    ExpressionBuilder::EQ,
    $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
);
```

The call to `$queryBuilder->expr()-trim()` can be one of the following:

-   `trim('fieldName')`
    results in `TRIM("tableName"."fieldName")`
-   `trim('fieldName', AbstractPlatform::TRIM_LEADING, 'x')`
    results in `TRIM(LEADING "x" FROM "tableName"."fieldName")`
-   `trim('fieldName', AbstractPlatform::TRIM_TRAILING, 'x')`
    results in `TRIM(TRAILING "x" FROM "tableName"."fieldName")`
-   `trim('fieldName', AbstractPlatform::TRIM_BOTH, 'x')`
    results in `TRIM(BOTH "x" FROM "tableName"."fieldName")`
