Skip to main content

Class: Dataset

Defined in: src/entities/datasets.ts Dataset entity for working with dataset metadata and content.

Constructors

Constructor

Defined in: src/entities/datasets.ts

Parameters

datasetDb
DatasetDBType

Returns

Dataset

Properties

columnNames

Defined in: src/entities/datasets.ts

createdAt

Defined in: src/entities/datasets.ts

createdByUser

Defined in: src/entities/datasets.ts

currentVersionIndex

Defined in: src/entities/datasets.ts

draft

Defined in: src/entities/datasets.ts

id

Defined in: src/entities/datasets.ts

name

Defined in: src/entities/datasets.ts

numRows

Defined in: src/entities/datasets.ts

projectCount

Defined in: src/entities/datasets.ts

updatedAt

Defined in: src/entities/datasets.ts

Accessors

content

Get Signature

Defined in: src/entities/datasets.ts Gets the cached content without making an API call.
Returns
null | DatasetRow[] The cached dataset rows or null if not loaded.

Methods

addRows()

Defined in: 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()

Defined in: src/entities/datasets.ts Gets the content of the dataset and caches it locally.

Returns

Promise<DatasetRow[]> A promise that resolves to the rows of the dataset.

getVersionHistory()

Defined in: src/entities/datasets.ts Gets the version history of this dataset.

Returns

Promise<DatasetVersionHistory> A promise that resolves to the version history for this dataset.

listProjects()

Defined in: 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[]> A promise that resolves to the list of projects that use this dataset.

loadVersion()

Defined in: 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> A promise that resolves to the content of the specified version.

toDatasetDB()

Defined in: src/entities/datasets.ts Returns the underlying dataset database representation.

Returns

DatasetDBType The dataset database object.