> 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/primarygeneratedcolumn.md).

# PrimaryGeneratedColumn

**PrimaryGeneratedColumn Decorator**

The `PrimaryGeneratedColumn` decorator is used to create a primary key with automatic value incrementing. It takes a `PrimaryGeneratedColumnDecoratorInterface` object as a parameter.

**Parameters of `PrimaryGeneratedColumnDecoratorInterface`**

* **type:**
  * Type: `AutoIncrementColumnTypesPostgresType | AutoIncrementColumnTypesMysqlType`
  * Description: The type of automatic increment value, depending on the database type.
* **startWith:**
  * Type: `number`
  * Description: The starting value for auto-increment.
* **incrementBy:**
  * Type: `number`
  * Description: The value by which the field increments for each new record.
* **minValue:**
  * Type: `number`
  * Description: The minimum value for the field.
* **maxValue:**
  * Type: `number`
  * Description: The maximum value for the field.
* **isCycle:**
  * Type: `boolean`
  * Description: Indicates whether the value will restart after reaching the maximum value.
* **cache:**
  * Type: `number`
  * Description: Defines the number of values cached for faster auto-incrementing.
* **ownedBy:**
  * Type: `string`
  * Description: Specifies which column owns the auto-increment.
* **restartWith:**
  * Type: `number`
  * Description: The value at which auto-increment will restart (PostgreSQL only).
* **noOrder:**
  * Type: `boolean`
  * Description: Disables ordering of auto-increment values (PostgreSQL only).
