Skip to main content

# ConstraintOptions

`Object`

An object used to define additional constraints for a column within a 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​

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

## Properties​

### .primary​

→ Boolean

Whether this column should be the primary one.

### .index​

→ Boolean

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

### .null​

→ Boolean

Whether this column is null per default

### .unique​

→ Boolean

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

### .default​

→ String

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

### .auto_increment​

→ Boolean

Whether this column should be numerical incremented on new insertions.

### .unsigned​

→ Boolean

Warning

This option is only valid on numerical columns.

Whether this column should be unsigned.