---
sidebar_position: 2
---

# ConstraintOptions

`Object`

An object used to define additional constraints for a column within a [Structure](../classes/structure).

:::info
All keys within this object are __optional__.

You only need to define the keys for the settings you want to enable.

Default values are always `false` on __Booleans__ or `""` on __Strings__
:::

## Example structure

```js
{
    "primary": true,
    "index": true,
    "null": true,
    "unique": true,
    "default": "Some default text",
    "auto_increment": false,
    "unsigned": true
}
```

## Properties

### .primary
&rarr; __Boolean__

Whether this column should be the primary one.

***

### .index
&rarr; __Boolean__

Whether this column should be indexable (Faster query, slower insertion)

***

### .null
&rarr; __Boolean__

Whether this column is null per default

***

### .unique
&rarr; __Boolean__

Whether this column data should be unique and block duplicate data.

***

### .default
&rarr; __String__

Sets the default data for this column that gets inserted if no data was given on insertion.

***

### .auto_increment
&rarr; __Boolean__

Whether this column should be numerical incremented on new insertions.

***

### .unsigned
&rarr; __Boolean__

:::danger Warning
This option is only valid on numerical columns.
:::

Whether this column should be unsigned.

***