src/model/schema/SourceColumn.ts
Represents a column that exists in the database.
Properties |
|
Methods |
|
Accessors |
Public
constructor(name: string, table: SourceTable, dataType: string, schemaNullable: boolean, inferredNullable?: boolean)
|
||||||||||||||||||
Defined in src/model/schema/SourceColumn.ts:6
|
||||||||||||||||||
Parameters :
|
Public dataType |
Type : string
|
Defined in src/model/schema/SourceColumn.ts:10
|
Public Optional inferredNullable |
Type : boolean
|
Defined in src/model/schema/SourceColumn.ts:12
|
Public name |
Type : string
|
Defined in src/model/schema/SourceColumn.ts:8
|
Public schemaNullable |
Type : boolean
|
Defined in src/model/schema/SourceColumn.ts:11
|
Public table |
Type : SourceTable
|
Defined in src/model/schema/SourceColumn.ts:9
|
Public equals | ||||||
equals(other: SourceColumn)
|
||||||
Defined in src/model/schema/SourceColumn.ts:15
|
||||||
Parameters :
Returns :
boolean
|
safeInferredNullable |
getsafeInferredNullable()
|
Defined in src/model/schema/SourceColumn.ts:23
|
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;
}
}