# orca.views.datasets

> A module of morca's API.

Datasets as their pages read them: the steps that write and read one, and what a rebuild of it would queue (`RebuildPreview`).

## Structs

### `StepUse`

```mojo
struct StepUse
```

A step that writes (or reads) a dataset: declared in its `writes=` (`reads=`), or seen committing to (reading) it; and the newest run that did, or 0.

Implements: `Copyable`, `Movable`

Fields:

- `pipeline: String`
- `step: String`
- `run: Int`

### `RebuildPreview`

```mojo
struct RebuildPreview
```

What a rebuild over a range would queue, level by level, or why it's refused: `plan_rebuild`, which writes nothing.

Implements: `Copyable`, `Movable`

Fields:

- `refused: String`
- `partitions: List[String]`
- `levels: List[List[Tuple[String, String]]]`: Each level's runs: the pipeline and its partitions.

## Functions

### `dataset_steps`

```mojo
def dataset_steps(mut db: State, dataset: String, writes: Bool) -> List[StepUse]
```

### `steps_using`

```mojo
def steps_using(mut h: Html, mut db: State, mut cache: Dict[String, CodeLinks], uses: List[StepUse])
```

Each pipeline, then its steps, each linked to its line at the commit of the newest run that used the dataset.

### `rebuild_preview`

```mojo
def rebuild_preview(mut db: State, dataset: String, keys: String) -> RebuildPreview
```

## Aliases

### `SNAPSHOTS_PAGE`

```mojo
comptime SNAPSHOTS_PAGE = 50
```

Snapshots to a page of a dataset's list.
