{"record":{"id":"c9df67f0013a2bb0","repo":"atuinsh/atuin","slug":"is-a-table-use-a-dotted-key-like-key-to","errorCode":null,"errorMessage":"'{}' is a table; use a dotted key like '{}.key' to set a value within it","messagePattern":"'(.+?)' is a table; use a dotted key like '(.+?)\\.key' to set a value within it","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/atuin/src/command/client/config.rs","lineNumber":346,"sourceCode":"    // Navigate/create intermediate tables\n    for &part in &parts[..parts.len() - 1] {\n        if !current.contains_key(part) {\n            current.insert(part, Item::Table(Table::new()));\n        }\n        current = current\n            .get_mut(part)\n            .expect(\"just inserted or already exists\")\n            .as_table_like_mut()\n            .ok_or_else(|| eyre::eyre!(\"'{}' exists but is not a table\", part))?;\n    }\n\n    let last = *parts.last().unwrap();\n\n    // Don't silently overwrite a table with a scalar value\n    if let Some(existing) = current.get(last)\n        && (existing.is_table() || existing.is_inline_table())\n    {\n        eyre::bail!(\n            \"'{}' is a table; use a dotted key like '{}.key' to set a value within it\",\n            key,\n            key\n        );\n    }\n\n    if let Some(item) = current.get_mut(last) {\n        let mut value = value;\n        if let Some(old_value) = item.as_value_mut() {\n            // Preserve any commands attached to the old value.\n            std::mem::swap(value.decor_mut(), old_value.decor_mut());\n        }\n        *item = Item::Value(value);\n    } else {\n        current.insert(last, Item::Value(value));\n    }\n\n    Ok(())","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/atuinsh/atuin/blob/900007c48045867e7f44b0f9bc55ad9dbe99ee0d/crates/atuin/src/command/client/config.rs#L328-L364","documentation":"When setting a deep config key, `set_deep_key` refuses to overwrite an existing TOML table (or inline table) with a scalar value. This prevents silently destroying a whole config section — e.g. replacing the entire `[daemon]` table with `daemon = true`.","triggerScenarios":"Running `atuin config set daemon true`, `atuin config set sync true`, or any `set` whose final key segment currently names a table in config.toml while the new value is a scalar.","commonSituations":"Trying to toggle a section rather than a leaf setting; not realizing a key like `daemon` groups sub-options (`daemon.enabled`, `daemon.systemd_socket`); typos where a leaf key was intended.","solutions":["Set a leaf key inside the table instead: `atuin config set daemon.enabled true`.","Inspect the existing structure first (`atuin config` or read config.toml) to find the correct dotted path.","If you truly want to replace the table, edit config.toml by hand.","Re-check the intended config schema — the value you are setting may correspond to a nested option."],"exampleFix":"// before\natuin config set daemon true\n// after\natuin config set daemon.enabled true","handlingStrategy":"validation","validationCode":"# check whether the target key is a table before setting\natuin config get daemon  # if it prints a section, set leaf keys instead\natuin config set daemon.enabled true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Inspect existing config structure before setting keys.","Set leaf keys (dotted paths) rather than section names.","Remember tables like `daemon`, `sync`, `keys` group sub-options.","When replacing whole sections, edit config.toml manually."],"tags":["config","toml","cli"],"backgroundTag":"conflicting-config-options","analyzedSha":"900007c48045867e7f44b0f9bc55ad9dbe99ee0d","analyzedAt":"2026-09-19T12:52:51.491Z","contentChangedAt":"2026-09-19T12:52:51.491Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}