Skip to main content

Module catalog

Module catalog 

Source
Expand description

Catalogs: named datasets, local or remote, one TOML file each.

A catalog’s top level holds label and description; every table in it is one dataset, keyed by a short id. catalog.toml in the config directory is the user’s own, the one file datui writes (Ctrl+D on home); catalogs = [...] in the config lists others; the examples catalog is bundled. Each is a section of the home screen.

Parsed with toml_edit rather than toml: it keeps the file’s order, which is the order the home screen lists, and the place of every key, which an error names.

Structs§

Broken
A catalog file left out because it has a mistake: shown as its section’s callout, so one broken team file never keeps datui from starting.
Catalog
One catalog file.
CatalogError
A mistake in a catalog file: where, and what to do about it.
ColumnNote
A column’s note: what it means, its unit, and what its codes stand for.
Dataset
One dataset of a catalog: a local path or a remote url, never both.
NewDataset
What Ctrl+D writes for a row.

Enums§

Origin
Where a catalog came from, which decides what datui may do to it.

Constants§

EXAMPLES
The bundled catalog’s id.
FOLDER
The directory beside catalog.toml whose *.toml files are catalogs.
MINE
The id of the user’s own catalog, catalog.toml.
MINE_FILE
The user’s own catalog, in the config directory.
MINE_LABEL
The label of catalog.toml when it gives none.
MINE_TEMPLATE
What a new catalog.toml starts with.
OLD_EXAMPLES_ID
The bundled catalog’s id before 0.4.0: a home.hide naming it is warned about.

Functions§

add
Append dataset to the catalog in file, creating the file when there is none. Returns its id. The rest of the file is kept as written.
bundled
The bundled examples catalog.
bundled_text
The bundled catalog’s text, comments and all.
command
What datui catalog ACTION prints, and its exit code. config is the configuration in effect, or why it could not be read.
forget
Remove the dataset id from the catalog in file: its table and every table under it, and nothing else.
id_for
A dataset id for name, not among taken: lowercase words joined by -.
id_of_file
A listed catalog file’s id: its file name without .toml.
is_object_store_dataset
Whether a dataset URL is in an object store, and so browsed as well as opened.
load
Read the catalog in file, or say what is wrong with it. Ok(None) when there is no such file.
move_places
Add each directory of places to the catalog in file, named by where it is, unless the file lists it already: what Ctrl+D kept in the cache before 0.4.0. Returns how many were added.
parse
Read a catalog’s text. id is what home.hide will name it; file is where a relative path is anchored, and is named by errors.
place_key_of
The place key of a path or URL, as Dataset::place_key makes one.
read
Read the catalog in file. None when there is no such file.