# Table

**Kind:** Class

**Source:** `Pams/Web/Pams.WebApp/Client/app/models/dashboard/data-source-schema/table.model.ts` (line 6)

**Part of:** [Pams](subsystem-pams)

`Table` represents a table entry in the dashboard data-source schema model layer. Its `clone()` method creates a separate `Table` instance for workflows that need to preserve the original schema object.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `clone` | `clone(model: Table)` | `void` |

## Properties

| Property | Type |
|---|---|
| `ConString` | `string` |
| `ConName` | `string` |
| `Id` | `string` |
| `Name` | `string` |
| `TableID` | `string` |
| `Schema` | `string` |
| `NameSpace` | `string` |
| `Columns` | `Column[]` |
| `Data` | `any` |

## Where it refuses work

- `Table` stops the work with an early return when `model == null`.

## Diagram

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

## Usage

```ts
import { Table } from './models/dashboard/data-source-schema/table.model';

function prepareTableForEditing(sourceTable: Table): Table {
  const editableTable = sourceTable.clone();

  return editableTable;
}
```

## AI Coding Instructions

- Use `clone()` before modifying a `Table` when the original schema object must remain unchanged.
- Keep `Table` instances within the dashboard data-source schema model layer.
- Do not assume whether `clone()` performs shallow or deep copying; check its implementation before mutating nested values.
- Pass cloned instances through existing schema-processing code rather than rebuilding `Table` objects manually.

## Relationships

- IMPORTS → `Column`
- IMPORTS → `GetColumnPrameter`

## Used by

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

### Imported by (3)

- `DataSourceService` — `Pams/Web/Pams.WebApp/Client/app/services/dashboard/data-source.service.ts`:1
- `DashboardWidget` — `Pams/Web/Pams.WebApp/Client/app/models/dashboard/dashboard-widget.model.ts`:11
- `DataSourceConnection` — `Pams/Web/Pams.WebApp/Client/app/models/dashboard/data-source-schema/data-source-connection.model.ts`:4
