Skip to content

ColumnDataType

reference
1 min readUpdated

Kind: Class

Source: Pams/Web/Pams.WebApp/Client/app/models/dashboard/data-source-schema/column-data-type.model.ts (line 2)

Part of: Pams

ColumnDataType represents type-related information for a column in the dashboard data-source schema. Its clone() method creates a separate instance so schema type data can be copied before it is changed.

Methods

MethodSignatureReturns
cloneclone(model: ColumnDataType)void

Properties

PropertyType
SQLTypestring
DotNetTypestring
CSharpTypestring
VBTypestring
JavaTypestring
LanguageSpecificTypestring

Where it refuses work

  • ColumnDataType stops the work with an early return when model == null.

Diagram

mermaid
graph LR
    Schema[Data-source schema] --> Column[ColumnDataType]
    Column --> Clone[clone()]
    Clone --> Copy[Copied ColumnDataType]

Usage

ts
import { ColumnDataType } from './models/dashboard/data-source-schema/column-data-type.model';

function createEditableType(sourceType: ColumnDataType): ColumnDataType {
  const editableType = sourceType.clone();

  // Apply changes to editableType without changing sourceType.
  return editableType;
}

AI Coding Instructions

  • Call clone() before changing column type data that may also be referenced by the original schema.
  • Keep copied instances independent from the source instance when adding or updating class fields.
  • Update clone() when new mutable properties are added to ColumnDataType.
  • Pass ColumnDataType instances through dashboard schema code rather than replacing them with untyped objects.

Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (2)

  • DataSourceServicePams/Web/Pams.WebApp/Client/app/services/dashboard/data-source.service.ts:1
  • ColumnPams/Web/Pams.WebApp/Client/app/models/dashboard/data-source-schema/column.model.ts:2

Was this page helpful?

Download as PDF