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.
- Catalog
Error - A mistake in a catalog file: where, and what to do about it.
- Column
Note - A column’s note: what it means, its unit, and what its codes stand for.
- Dataset
- One dataset of a catalog: a local
pathor a remoteurl, 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.tomlwhose*.tomlfiles 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.tomlwhen it gives none. - MINE_
TEMPLATE - What a new
catalog.tomlstarts with. - OLD_
EXAMPLES_ ID - The bundled catalog’s id before 0.4.0: a
home.hidenaming it is warned about.
Functions§
- add
- Append
datasetto the catalog infile, creating the file when there is none. Returns its id. The rest of the file is kept as written. - bundled
- The bundled
examplescatalog. - bundled_
text - The bundled catalog’s text, comments and all.
- command
- What
datui catalog ACTIONprints, and its exit code.configis the configuration in effect, or why it could not be read. - forget
- Remove the dataset
idfrom the catalog infile: its table and every table under it, and nothing else. - id_for
- A dataset id for
name, not amongtaken: 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
placesto the catalog infile, 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.
idis whathome.hidewill name it;fileis where a relativepathis anchored, and is named by errors. - place_
key_ of - The place key of a path or URL, as
Dataset::place_keymakes one. - read
- Read the catalog in
file.Nonewhen there is no such file.