File

src/model/types/BasicColumn.ts

Description

Containes the necessary information to display an object as a column in the schema graph

Index

Properties

Properties

dataType
dataType: string
Type : string
dataTypeString
dataTypeString: string
Type : string
name
name: string
Type : string
nullable
nullable: boolean
Type : boolean
export default interface BasicColumn {
  name: string;
  dataType: string;
  nullable: boolean;
  dataTypeString: string;
}

export function surrogateKeyColumn(name: string): BasicColumn {
  return {
    name: name,
    dataType: 'integer',
    nullable: false,
    dataTypeString: '(integer, not null)',
  };
}

export function newBasicColumn(
  name: string,
  dataType: string,
  nullable: boolean
): BasicColumn {
  return {
    name: name,
    dataType: dataType,
    nullable: nullable,
    dataTypeString: `(${dataType}, ${nullable ? 'null' : 'not null'})`,
  };
}

results matching ""

    No results matching ""