> For the complete documentation index, see [llms.txt](https://myroslavs-organization.gitbook.io/orm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://myroslavs-organization.gitbook.io/orm/api/decorators/table.md).

# Table

**Table Decorator**

The `Table` decorator is used to define a table in the database. It takes a `TableDecoratorInterface` object as a parameter.

**Parameters of `TableDecoratorInterface`**

* **name:**
  * Type: `string`
  * Description: The name of the table in the database.
* **options:**
  * Type: `TableOptionsPostgresqlInterface | TableOptionsMysqlInterface`
  * Description: An object containing additional options for configuring the table.

**Parameters of `TableOptionsPostgresqlInterface` (for PostgreSQL only)**

* **checkConstraint:**
  * Type: `ConstraintInterface | ConstraintInterface[]`
  * Description: Defines CHECK constraint conditions for the table.
* **unique:**
  * Type: `string[][] | string[]`
  * Description: Defines unique groups of columns in the table.
* **primaryKeys:**
  * Type: `string[]`
  * Description: Defines columns that are primary keys.

**Parameters of `TableOptionsMysqlInterface` (for MySQL only)**

* **unique:**
  * Type: `string[][] | string[]`
  * Description: Defines unique groups of columns in the table.
* **primaryKeys:**
  * Type: `string[]`
  * Description: Defines columns that are primary keys.
