# Class TableConstraint

TableConstraint class

#### Hierarchy

- TableConstraint

- Defined in saltcorn-data/models/table_constraints.ts:24

#####
Index

### Constructors

constructor

### Properties

configuration
id?
table?
table_id?
type

### Accessors

toJson
type_options

### Methods

delete
create
delete_field_constraints
find
findOne

## Constructors

### constructor

- new TableConstraint(o): TableConstraint

- #### Parameters

  - ##### o: TableConstraintCfg

  #### Returns TableConstraint

  - Defined in saltcorn-data/models/table_constraints.ts:33

## Properties

### configuration

configuration: any

- Defined in saltcorn-data/models/table_constraints.ts:28

### `Optional` id

id?: null | number

- Defined in saltcorn-data/models/table_constraints.ts:27

### `Optional` table

table?: Table

- Defined in saltcorn-data/models/table_constraints.ts:29

### `Optional` table_id

table_id?: number

- Defined in saltcorn-data/models/table_constraints.ts:25

### type

type: "Unique" | "Index" | "Formula"

- Defined in saltcorn-data/models/table_constraints.ts:26

## Accessors

### toJson

- get toJson(): {
  configuration: any;
  type: "Unique" | "Index" | "Formula";
  }

- #### Returns {
  configuration: any;
  type: "Unique" | "Index" | "Formula";
  }

  - ##### configuration: any

  - ##### type: "Unique" | "Index" | "Formula"

  - Defined in saltcorn-data/models/table_constraints.ts:48

### `Static` type_options

- get type_options(): ("Unique" | "Index" | "Formula")[]

- #### Returns ("Unique" | "Index" | "Formula")[]

  - Defined in saltcorn-data/models/table_constraints.ts:187

## Methods

### delete

- delete(): Promise<void>

- #### Returns Promise<void>

  - Defined in saltcorn-data/models/table_constraints.ts:142

### `Static` create

- create(f): Promise<TableConstraint>

- #### Parameters

  - ##### f: TableConstraintCfg

  #### Returns Promise<TableConstraint>

  - Defined in saltcorn-data/models/table_constraints.ts:81

### `Static` delete_field_constraints

- delete_field_constraints(table, field): Promise<void>

- #### Parameters

  - ##### table: Table

  - ##### field: Field

  #### Returns Promise<void>

  - Defined in saltcorn-data/models/table_constraints.ts:171

### `Static` find

- find(where, selectopts?): Promise<TableConstraint[]>

- #### Parameters

  - ##### where: Where

  - ##### `Optional` selectopts: SelectOptions

  #### Returns Promise<TableConstraint[]>

  - Defined in saltcorn-data/models/table_constraints.ts:60

### `Static` findOne

- findOne(where): Promise<null | TableConstraint>

- #### Parameters

  - ##### where: Where

  #### Returns Promise<null | TableConstraint>

  - Defined in saltcorn-data/models/table_constraints.ts:72

Generated using TypeDoc