Skip to main content

Interface: ColumnOptions

Defined in: service-core/src/decorators/PersistenceDecorators.ts:27

The set of options available when declaring a persisted column/property via the @Column decorator.

Properties

isObjectId?

optional isObjectId?: boolean

Defined in: service-core/src/decorators/PersistenceDecorators.ts:35

Set to true if the column stores a MongoDB ObjectId value.


name?

optional name?: string

Defined in: service-core/src/decorators/PersistenceDecorators.ts:29

The name of the column in the datasource. Defaults to the property name.


nullable?

optional nullable?: boolean

Defined in: service-core/src/decorators/PersistenceDecorators.ts:31

Set to true if the column may store null/undefined values.


primary?

optional primary?: boolean

Defined in: service-core/src/decorators/PersistenceDecorators.ts:33

Set to true if the column is a primary key.


type?

optional type?: string | Function

Defined in: service-core/src/decorators/PersistenceDecorators.ts:42

Explicitly declares the SQL column type, overriding the type that would otherwise be inferred from TypeScript's reflected property type. Required whenever the design-time type cannot be reliably inferred, such as nullable/union-typed properties (which TypeScript reflects as Object) or properties whose value is a complex/nested structure that has no direct SQL column equivalent (e.g. "simple-json").