A base data source definition. Configured for postgres by default.

Constructors

Properties

entities: Newable<BaseEntity>[]
migrations: Newable<Migration>[] = []

All migrations that belong to this data source.

options: OmitStrict<DataSourceOptions, "entities">

Methods

  • Normalizes the provided column.

    Parameters

    • column: {
          isArray: undefined | boolean;
          length: undefined | string | number;
          precision: undefined | null | number;
          scale: undefined | number;
          type: undefined | string & {} | ColumnType;
      }

    Returns string

    When the data source has not been initialized yet.

  • Transforms the property on the given entity class to typeorm column options.

    Type Parameters

    Parameters

    • entity: Newable<T>

      The entity class which property should be transformed.

    • property: keyof T

      The key of the actual property that should be transformed.

    Returns TableColumnOptions

    Typeorm column options.

    When no data source has been provided or no column metadata could be found.