Generated columns with Typorm in PostgreSQL


I want to generate a column with typeorm but it’s not working,
I am using PostgreSQL and I followed this article, it’s said that is supported by typeorm

this is an example:

import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
class User {
  public id: number;
  public firstName: string;
  public lastName: string;
    generatedType: 'STORED',
    asExpression: `'firstName' || ' ' || 'lastName'`
  fullName: string;

any idea how to do it ?


I found I was using an old version of Typeorm (@0.2.28) and the feature was supported in postgres in the version @0.2.42

Answered By – GisCat

Answer Checked By – Marilyn (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.