> ## 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.

# Datasets

***

# Class: Datasets

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

Service class for dataset operations used by dataset utilities.

## Constructors

### Constructor

```ts theme={null}
new Datasets(): Datasets;
```

#### Returns

`Datasets`

## Methods

### create()

```ts theme={null}
create(options: object): Promise<Dataset>;
```

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

Creates a new dataset with optional project association.
Utility function createDataset() delegates to this method.

#### Parameters

##### options

The options used to create the dataset.

###### filePath

`string`

The path to the dataset file.

###### format

[`DatasetFormat`](/sdk-api/typescript/reference/README/type-aliases/DatasetFormat)

The format of the dataset file.

###### name

`string`

The name of the dataset.

###### projectId?

`string`

(Optional) The ID of the project that will use the dataset.

###### projectName?

`string`

(Optional) The name of the project that will use the dataset.

#### Returns

`Promise`\<[`Dataset`](/sdk-api/typescript/reference/README/classes/Dataset)>

A promise that resolves to the created dataset.

***

### delete()

```ts theme={null}
delete(options: object): Promise<void>;
```

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

Deletes a dataset with optional project validation.
Utility function deleteDataset() delegates to this method.

#### Parameters

##### options

The options used to locate the dataset.

###### id?

`string`

(Optional) The ID of the dataset.

###### name?

`string`

(Optional) The name of the dataset.

###### projectId?

`string`

(Optional) The ID of the project to validate against.

###### projectName?

`string`

(Optional) The name of the project to validate against.

#### Returns

`Promise`\<`void`>

A promise that resolves when the dataset has been deleted.

***

### extend()

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

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

Extends a dataset with synthetically generated data.
Utility function extendDataset() delegates to this method.

#### Parameters

##### params

[`SyntheticDatasetExtensionRequest`](/sdk-api/typescript/reference/README/type-aliases/SyntheticDatasetExtensionRequest)

Configuration for synthetic data generation.

#### Returns

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

A promise that resolves to the generated dataset rows.

***

### get()

```ts theme={null}
get(options: object): Promise<null | Dataset>;
```

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

Gets a dataset by ID or name with optional content loading and project validation.
Utility function getDataset() delegates to this method.

#### Parameters

##### options

The options used to locate the dataset.

###### id?

`string`

(Optional) The ID of the dataset.

###### name?

`string`

(Optional) The name of the dataset.

###### projectId?

`string`

(Optional) The ID of the project to validate against.

###### projectName?

`string`

(Optional) The name of the project to validate against.

###### withContent?

`boolean`

(Optional) Whether to load the dataset content.

#### Returns

`Promise`\<`null` | [`Dataset`](/sdk-api/typescript/reference/README/classes/Dataset)>

A promise that resolves to the dataset, or null if it is not found.

***

### getVersion()

```ts theme={null}
getVersion(options: object): Promise<DatasetContent>;
```

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

Gets a specific version of a dataset.
Utility function getDatasetVersion() delegates to this method.

#### Parameters

##### options

The options used to locate the dataset version.

###### datasetId?

`string`

(Optional) The ID of the dataset.

###### datasetName?

`string`

(Optional) The name of the dataset.

###### versionIndex

`number`

The version index to retrieve.

#### Returns

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

A promise that resolves to the dataset content at the specified version.

***

### getVersionHistory()

```ts theme={null}
getVersionHistory(options: object): 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 a dataset.
Utility function getDatasetVersionHistory() delegates to this method.

#### Parameters

##### options

The options used to locate the dataset.

###### datasetId?

`string`

(Optional) The ID of the dataset.

###### datasetName?

`string`

(Optional) The name of the dataset.

#### Returns

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

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

***

### list()

```ts theme={null}
list(options?: object): Promise<Dataset[]>;
```

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

Lists datasets with optional filtering and pagination.
Utility function getDatasets() delegates to this method.

#### Parameters

##### options?

(Optional) Options for listing datasets.

###### limit?

`number`

(Optional) The maximum number of datasets to return.

###### projectId?

`string`

(Optional) The ID of the project that uses the datasets.

###### projectName?

`string`

(Optional) The name of the project that uses the datasets.

#### Returns

`Promise`\<[`Dataset`](/sdk-api/typescript/reference/README/classes/Dataset)\[]>

A promise that resolves to the list of datasets.

***

### listProjects()

```ts theme={null}
listProjects(options: object): 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 a dataset.
Utility function listDatasetProjects() delegates to this method.

#### Parameters

##### options

The options used to locate the dataset.

###### datasetId?

`string`

(Optional) The ID of the dataset.

###### datasetName?

`string`

(Optional) The name of the dataset.

###### limit?

`number`

(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 the dataset.
