> For the complete documentation index, see [llms.txt](https://prisma-util.gitbook.io/stable/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prisma-util.gitbook.io/stable/optional-features/schema-improvements/custom-attribute-functions.md).

# Custom Attribute Functions

Define functions for default values.

{% hint style="warning" %}

## Project Toolchain Usage

This feature makes use of these Project Toolchain APIs: **Middleware**, **Extensions**. Because of this usage, it defines the following modules:

### customAttributeFunctions

This module defines the following middleware and extensions identifiers that can be imported via Project Toolchain, along with their descriptions:

* **attributeFunctions** - Remove empty OR blocks from queries.
  {% endhint %}

To enable this optional feature, add the `customAttributeFunctions` element to your [optionalFeatures](/stable/api-documentation/configuration-reference/optional-features.md) array, then use the generated middleware or extension inside of your code.

## Feature Effect

Whenever you attempt a create operation on a model, all fields that have a default function defined in the [defaultFunctions](/stable/api-documentation/configuration-reference/default-functions.md) configuration property will have their value set to the result of those functions.
