> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Dataset

***

# Class: Dataset

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Dataset entity for working with dataset metadata and content.

## Constructors

### Constructor

```ts theme={null}
new Dataset(datasetDb: DatasetDBType): Dataset;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

#### Parameters

##### datasetDb

[`DatasetDBType`](/sdk-api/typescript/reference/types/type-aliases/DatasetDBType)

#### Returns

`Dataset`

## Properties

### columnNames

```ts theme={null}
readonly columnNames: string[];
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### createdAt

```ts theme={null}
readonly createdAt: string;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### createdByUser

```ts theme={null}
readonly createdByUser: UserInfo;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### currentVersionIndex

```ts theme={null}
readonly currentVersionIndex: number;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### draft

```ts theme={null}
readonly draft: boolean;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### id

```ts theme={null}
readonly id: string;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### name

```ts theme={null}
readonly name: string;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### numRows

```ts theme={null}
readonly numRows: number;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### projectCount

```ts theme={null}
readonly projectCount: number;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

***

### updatedAt

```ts theme={null}
readonly updatedAt: string;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

## Accessors

### content

#### Get Signature

```ts theme={null}
get content(): null | DatasetRow[];
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Gets the cached content without making an API call.

##### Returns

`null` | [`DatasetRow`](/sdk-api/typescript/reference/README/type-aliases/DatasetRow)\[]

The cached dataset rows or null if not loaded.

## Methods

### addRows()

```ts theme={null}
addRows(rows: Record<string,
  | null
  | string
  | number
| Record<string, null | string | number>>[]): Promise<Dataset>;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Adds rows to the dataset and refreshes the cached content.

#### Parameters

##### rows

`Record`\<`string`,
\| `null`
\| `string`
\| `number`
\| `Record`\<`string`, `null` | `string` | `number`>>\[]

The rows to append to the dataset.

#### Returns

`Promise`\<`Dataset`>

A promise that resolves to the updated dataset.

***

### getContent()

```ts theme={null}
getContent(): Promise<DatasetRow[]>;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Gets the content of the dataset and caches it locally.

#### Returns

`Promise`\<[`DatasetRow`](/sdk-api/typescript/reference/README/type-aliases/DatasetRow)\[]>

A promise that resolves to the rows of the dataset.

***

### getVersionHistory()

```ts theme={null}
getVersionHistory(): Promise<DatasetVersionHistory>;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Gets the version history of this dataset.

#### Returns

`Promise`\<[`DatasetVersionHistory`](/sdk-api/typescript/reference/types/type-aliases/DatasetVersionHistory)>

A promise that resolves to the version history for this dataset.

***

### listProjects()

```ts theme={null}
listProjects(limit: number): Promise<DatasetProject[]>;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Lists all projects that use this dataset.

#### Parameters

##### limit

`number` = `100`

(Optional) The maximum number of projects to return.

#### Returns

`Promise`\<[`DatasetProject`](/sdk-api/typescript/reference/types/type-aliases/DatasetProject)\[]>

A promise that resolves to the list of projects that use this dataset.

***

### loadVersion()

```ts theme={null}
loadVersion(versionIndex: number): Promise<DatasetContent>;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Loads the content for a specific version of this dataset.

#### Parameters

##### versionIndex

`number`

The index of the version to load.

#### Returns

`Promise`\<[`DatasetContent`](/sdk-api/typescript/reference/README/type-aliases/DatasetContent)>

A promise that resolves to the content of the specified version.

***

### toDatasetDB()

```ts theme={null}
toDatasetDB(): DatasetDBType;
```

Defined in: [src/entities/datasets.ts](https://github.com/rungalileo/galileo-js/blob/main/src/entities/datasets.ts)

Returns the underlying dataset database representation.

#### Returns

[`DatasetDBType`](/sdk-api/typescript/reference/types/type-aliases/DatasetDBType)

The dataset database object.
