File

src/model/schema/SourceColumn.ts

Description

Represents a column that exists in the database.

Index

Properties
Methods
Accessors

Constructor

Public constructor(name: string, table: SourceTable, dataType: string, schemaNullable: boolean, inferredNullable?: boolean)
Parameters :
Name Type Optional
name string No
table SourceTable No
dataType string No
schemaNullable boolean No
inferredNullable boolean Yes

Properties

Public dataType
Type : string
Public Optional inferredNullable
Type : boolean
Public name
Type : string
Public schemaNullable
Type : boolean
Public table
Type : SourceTable

Methods

Public equals
equals(other: SourceColumn)
Parameters :
Name Type Optional
other SourceColumn No
Returns : boolean

Accessors

safeInferredNullable
getsafeInferredNullable()

Use this instead of inferredNullable to avoid having errors because of missing database connection.

import SourceTable from './SourceTable';

/**
 * Represents a column that exists in the database.
 */
export default class SourceColumn {
  public constructor(
    public name: string,
    public table: SourceTable,
    public dataType: string,
    public schemaNullable: boolean,
    public inferredNullable?: boolean
  ) {}

  public equals(other: SourceColumn): boolean {
    if (this == other) return true;
    return this.name == other.name && this.table.equals(other.table);
  }

  /**
   * Use this instead of inferredNullable to avoid having errors because of missing database connection.
   */
  public get safeInferredNullable() {
    return this.inferredNullable ?? this.schemaNullable;
  }
}

results matching ""

    No results matching ""