Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Column

Implements

Index

Constructors

constructor

  • new Column(__namedParameters: object): Column
  • Parameters

    • __namedParameters: object
      • dbType: any
      • defaultValue: any
      • foreignKey: undefined | true | false
      • index: undefined | true | false
      • name: undefined | string
      • notNullable: undefined | true | false
      • relatedTable: undefined | string
      • size: undefined | number
      • unique: undefined | true | false

    Returns Column

Properties

Optional dbType

dbType: DBtype

Optional defaultValue

defaultValue: any

Optional foreignKey

foreignKey: undefined | true | false

Optional index

index: undefined | true | false

Optional name

name: undefined | string

Optional notNullable

notNullable: undefined | true | false

Optional relatedTable

relatedTable: undefined | string

Optional size

size: undefined | number

Optional unique

unique: undefined | true | false

Methods

createColumn

  • createColumn(table: TableBuilder | any): any
  • Create table columns based in column properties

    Parameters

    • table: TableBuilder | any

    Returns any

createColumnsRelation

  • createColumnsRelation(table: TableBuilder): void
  • Creates foreign key relation between two columns in two tables Column 1: primary key column ('id') Column 2: foreign key column (_id) Table 1: table Table 2: this.relatedTable Note: ColumnAction = 'Cascade' by default. Not configurable by now

    Parameters

    • table: TableBuilder

    Returns void

isForeignKey

  • isForeignKey(): boolean

Static Private addIndex

  • addIndex(newColumn: any, tableBuilder: TableBuilder | any, colType: DBtype, colName: string): TableBuilder
  • Parameters

    • newColumn: any
    • tableBuilder: TableBuilder | any
    • colType: DBtype
    • colName: string

    Returns TableBuilder

Static Private addUniqueConstraint

  • addUniqueConstraint(newColumn: any, tableBuilder: TableBuilder | any, colType: DBtype, colName: string): TableBuilder
  • Parameters

    • newColumn: any
    • tableBuilder: TableBuilder | any
    • colType: DBtype
    • colName: string

    Returns TableBuilder

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc