Skip to main content

Interface: ColumnOptions

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

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:34

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


name?

optional name?: string

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

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


nullable?

optional nullable?: boolean

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

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


primary?

optional primary?: boolean

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

Set to true if the column is a primary key.


type?

optional type?: string | Function

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

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").