Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ModelGenerator

Base class for model generators.

Hierarchy

Index

Constructors

constructor

Properties

Protected columnFormatter

columnFormatter: ColumnFormatter

A ColumnFormatter instance that is used for formatting property names in the generated class entities.

Protected pathHelper

pathHelper: PathHelper

A PathHelper instance for creating the entity directory.

Protected relFormatter

relFormatter: RelationshipFormatter

A RelationshipFormatter instances that is used to format relationship property names.

Protected tableFormatter

tableFormatter: TableFormatter

A TableFormatter instance that is used to format the names of generated class entities.

Methods

Abstract generateModels

  • generateModels(dbName: string, entDir: string): Promise<ModelTable[]>
  • Generate models for the provided database.

    Parameters

    • dbName: string

      A database name. A model will be generated for each table in the database.

    • entDir: string

      A path to which entity files will be saved.

    Returns Promise<ModelTable[]>

    An array of ModelTable. Calling ModelTable.toString will return the entity class definition.

writeModels

  • writeModels(models: ModelTable[], entDir: string): Promise<void>

Generated using TypeDoc