<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@datashaper/schema](./schema.md) &gt; [Constraints](./schema.constraints.md)

## Constraints interface

Validation constraints for a field.

<b>Signature:</b>

```typescript
export interface Constraints 
```

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [enum?](./schema.constraints.enum.md) |  | string\[\] | <i>(Optional)</i> Strict list of allowed values in the column. |
|  [maximum?](./schema.constraints.maximum.md) |  | number | <i>(Optional)</i> For numbers or dates, this is the maximum allowed value. |
|  [maxLength?](./schema.constraints.maxlength.md) |  | number | <i>(Optional)</i> For strings or arrays, this is the maximum allowed length of values. |
|  [minimum?](./schema.constraints.minimum.md) |  | number | <i>(Optional)</i> For numbers or dates, this is the minimum allowed value. |
|  [minLength?](./schema.constraints.minlength.md) |  | number | <i>(Optional)</i> For strings or arrays, this is the minimum allowed length of values. |
|  [pattern?](./schema.constraints.pattern.md) |  | string | <i>(Optional)</i> RegExp pattern that string values must match. |
|  [required?](./schema.constraints.required.md) |  | boolean | <i>(Optional)</i> Indicates that this field is required (not nullable). |
|  [unique?](./schema.constraints.unique.md) |  | boolean | <i>(Optional)</i> Indicates that every value in this column must be unique. |

