import { ColumnMetadata } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/metadata/ColumnMetadata.ts";
This metadata contains all information about entity's column.
Constructors
Properties
Column type in the case if this column is in the closure table. Column can be ancestor or descendant in the closure tables.
Gets full path to this column database name (including column database name). Full path is relevant when column is used in embeds (one or multiple nested). For example it will return "counters.subcounters.likes". If property is not in embeds then it returns just database name of the column.
Embedded metadata where this column metadata is. If this column is not in embed then this property value is undefined.
Entity metadata where this column metadata is.
For example for @Column() name: string in Post, entityMetadata will be metadata of Post entity.
Array of possible enumerated values.
postgres
and mysql
store enum values as strings but we want to keep support
for numeric and heterogeneous based typescript enums, so we need (string|number)[]
Specifies generation strategy if this column will use auto increment.
Database name set by entity metadata builder, not yet passed naming strategy process and without embedded prefixes.
Return type of HSTORE column. Returns value as string or as object.
Indicates if column is discriminator. Discriminator columns are not mapped to the entity.
Indicates if this column is materialized path's path column. Used only in tree entities with materialized path type.
Indicates if this column is nested set's left column. Used only in tree entities with nested-set type.
Indicates if this column is nested set's right column. Used only in tree entities with nested-set type.
Indicates if column is tree-level column. Tree-level columns are used in closure entities.
The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum number of digits that are stored for the values.
Same as property path, but dots are replaced with '_'. Used in query builder statements.
Gets full path to this column property (including column property name). Full path is relevant when column is used in embeds (one or multiple nested). For example it will return "counters.subcounters.likes". If property is not in embeds then it returns just property name of the column.
If this column is foreign key then it references some other column, and this property will contain reference to this column.
If column is a foreign key of some relation then this relation's metadata will be there. If this column does not have a foreign key then this property value is undefined.
The scale for a decimal (exact numeric) column (applies only for decimal column), which represents the number of digits to the right of the decimal point and must not be greater than precision.
Target class where column decorator is used. This may not be always equal to entity metadata (for example embeds or inheritance cases).
Specifies a value transformer that is to be used to (un)marshal this column when reading or writing to the database.
The database type of the column.
Methods
Creates entity id map from the given entity ids array.
Extracts column value from the given entity. If column is in embedded (or recursive embedded) it extracts its value from there.
Extracts column value and returns its column name with this value in a literal object. If column is in embedded (or recursive embedded) it returns complex literal object.
Examples what this method can return depend if this column is in embeds. { id: 1 } or { title: "hello" }, { counters: { code: 1 } }, { data: { information: { counters: { code: 1 } } } }
Sets given entity's column value. Using of this method helps to set entity relation's value of the lazy and non-lazy relations.