Skip to main content

Class: Dataset

Defined in: Dataset entity for working with dataset metadata and content.

Constructors

Constructor

Defined in:

Parameters

datasetDb
DatasetDBType

Returns

Dataset

Properties

columnNames

Defined in:

createdAt

Defined in:

createdByUser

Defined in:

currentVersionIndex

Defined in:

draft

Defined in:

id

Defined in:

name

Defined in:

numRows

Defined in:

projectCount

Defined in:

updatedAt

Defined in:

Accessors

content

Get Signature

Defined in: 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: 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: 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: Gets the version history of this dataset.

Returns

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

listProjects()

Defined in: 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: 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: Returns the underlying dataset database representation.

Returns

DatasetDBType The dataset database object.