mariadb-cli 0.1.1

One-shot agent-native command line client for MariaDB servers
Documentation
//! The commands that answer without reaching anywhere.
//!
//! # Why the split is here and not somewhere tidier
//!
//! The table outgrew its file and had to be cut. The cut could have gone
//! anywhere — alphabetically, or halfway down — and this one follows who
//! CHECKS each entry: everything here is held by `command_contract.rs`, which
//! runs on any machine, and everything in the sibling file is held by
//! `payload_shape_server.rs`, which runs only where a destination is declared.
//!
//! So the file a reader opens tells them what it would take to verify what they
//! find in it, which is the one thing a split by size would have destroyed.

use super::Fields;

/// The published fields of every command that needs no destination.
pub(super) const SHAPES: &[(&str, Fields)] = &[
    (
        "config doctor",
        &[
            ("clean", "boolean, whether the diagnosis found nothing wrong"),
            ("exists", "boolean, whether the settings file is there"),
            ("path", "string, the settings file this diagnosis is about"),
            ("rows", "array, one entry per finding, each with kind, subject, detail and remedy"),
        ],
    ),
    (
        "config get",
        &[
            ("about", "string, what this setting is for"),
            ("domain", "string, the values this setting accepts"),
            ("key", "string, the setting asked about"),
            ("origin", "string, the layer the value in force came from"),
            ("value", "the value in force; a credential is never shown"),
        ],
    ),
    (
        "config list",
        &[(
            "rows",
            "array, one entry per setting, carrying about, domain, key, origin and value; \
             a setting that could not be read carries about, key and problem instead",
        )],
    ),
    (
        "config path",
        &[
            ("directory", "string, the directory the settings live in"),
            ("exists", "boolean, whether the settings file is there yet"),
            ("path", "string, the settings file itself"),
        ],
    ),
    (
        "config set",
        &[
            ("key", "string, the setting written"),
            ("path", "string, the file it was written into"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
            ("value", "the value now in force; a credential is never shown"),
        ],
    ),
    (
        "config unset",
        &[
            ("key", "string, the setting cleared"),
            ("origin", "string, the layer the value now in force comes from"),
            ("removed", "boolean, whether anything was actually stored to remove"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
            ("value", "the value that takes over; a credential is never shown"),
        ],
    ),
    (
        "conn add",
        &[
            ("created", "boolean, whether a profile was written"),
            ("is_default", "boolean, whether this profile is now the one chosen by default"),
            ("profile", "object, the profile as stored, carrying the same fields `conn show` answers with"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
        ],
    ),
    (
        "conn default",
        &[
            ("changed", "boolean, whether the choice actually moved"),
            ("default", "string, the profile now chosen when none is named"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
        ],
    ),
    (
        "conn edit",
        &[
            ("changed", "boolean, whether anything was actually rewritten"),
            ("profile", "object, the profile as it now stands, carrying the same fields `conn show` answers with"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
        ],
    ),
    (
        "conn list",
        &[
            ("default", "string, the profile chosen when none is named, or the absence marker"),
            ("rows", "array, one entry per stored profile"),
        ],
    ),
    (
        "conn remove",
        &[
            ("default", "string, the profile chosen after the removal, or the absence marker"),
            ("name", "string, the profile removed"),
            ("removed", "boolean, whether a profile was actually there to remove"),
            ("secret_removed", "boolean, whether a stored credential went with it"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
        ],
    ),
    (
        "conn show",
        &[
            ("auth_method", "string, how the server is asked to authenticate this user"),
            ("ca", "string, the authority the server certificate is checked against"),
            ("client_cert", "string, the certificate this side presents"),
            ("client_key", "string, the key belonging to that certificate"),
            ("database", "string, the database entered on connecting"),
            ("host", "string, the machine the server answers on"),
            ("is_default", "boolean, whether this profile is chosen when none is named"),
            ("name", "string, the profile asked about"),
            ("pin_database", "boolean, whether the statement may leave that database"),
            ("port", "number, the port the server answers on"),
            ("read_only", "boolean, whether this profile refuses to carry a change"),
            ("require_tls", "boolean, whether an unencrypted channel is refused"),
            (
                "secret",
                "string, the redaction mark when a credential is stored and null when none is; \
                 the credential itself never travels, whichever layer decided it",
            ),
            ("session_setup", "array, the session settings declared for this profile"),
            ("socket", "string, the local channel used instead of the network"),
            ("user", "string, the user the server is asked to authenticate"),
        ],
    ),
    (
        "meta commands",
        &[
            ("globals", "array, the flags that belong to every command equally"),
            ("rows", "array, one entry per published command"),
        ],
    ),
    (
        "meta completions",
        &[
            ("script", "string, the completion script itself"),
            ("shell", "string, the shell the script was written for"),
        ],
    ),
    (
        "meta manual",
        &[
            ("format", "string, the format the page is written in"),
            ("page", "string, the manual page itself"),
        ],
    ),
    (
        "meta version",
        &[
            ("crypto_provider", "string, the cryptography this build carries"),
            ("crypto_provider_audited", "boolean, whether that cryptography has been formally audited"),
            ("encrypted_channel_available", "boolean, whether this build can open an encrypted channel"),
            ("envelope_schema_version", "number, the version of the envelope every answer travels in"),
            ("name", "string, the product name"),
            ("version", "string, the product version"),
        ],
    ),
    (
        "query lineage",
        &[("rows", "array, one entry per column, naming the table it really comes from")],
    ),
    (
        "query named list",
        &[("rows", "array, one entry per stored statement")],
    ),
    (
        "query named remove",
        &[
            ("name", "string, the statement removed"),
            ("removed", "boolean, whether a statement was actually there to remove"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
        ],
    ),
    (
        "query named save",
        &[
            ("name", "string, the name the statement was stored under"),
            ("stored", "boolean, whether the statement was written"),
            ("simulated", "boolean, whether this described the change instead of making it; `--dry-run` answers with everything the real call would answer and writes nothing"),
        ],
    )];