Options
All
  • Public
  • Public/Protected
  • All
Menu

Class which holds helper tools when working with schema.

export
class

SchemaUtil

Hierarchy

  • SchemaUtil

Index

Methods

circularRelationIsArray

  • Checks if a circular reference is array.

    Parameters

    • source: Table

      source table

    • column: Column

      column which references another table

    • schema: Schema

      whole schema

    Returns boolean

    true if a circular reference is array

circularRelationIsRequired

  • Checks if a circular reference is required.

    Parameters

    • source: Table

      source table

    • column: Column

      column which references another table

    • schema: Schema

      whole schema

    Returns boolean

    true if a circular reference is required

convertValues

getNormalizedTableByType

  • getNormalizedTableByType(schema: Schema, type: string): Table | undefined
  • Get normalized schema by type

    Parameters

    • schema: Schema

      collection of tables

    • type: string

      data type normalized (E.g: User, Account)

    Returns Table | undefined

    table from schema that matches type.

getRelatedTablesForTable

isCircularRelation

  • Checks if a circular reference exists between the source and target table.

    Parameters

    • source: Table

      source table

    • column: Column

      column which references another table

    • schema: Schema

      whole schema

    Returns boolean

    true if a circular reference exists in the target table

relationIsAlias

  • relationIsAlias(column: Column): boolean
  • Checks if a given column is an alias.

    Parameters

    Returns boolean

    returns true if column name and referenced type are aliases.

valuesToRamlDataType

  • valuesToRamlDataType(values: string[]): string
  • Convert array of values to raml values

    Parameters

    • values: string[]

      ['Yes', 'No']

    Returns string

    • 'Yes | No'

Generated using TypeDoc