Skip to content

refactor: fine tune config connection manner and errmsgs#38

Merged
tisonkun merged 7 commits into
scopedb:mainfrom
tyranitar-mega:improve-error-connection-set
May 25, 2026
Merged

refactor: fine tune config connection manner and errmsgs#38
tisonkun merged 7 commits into
scopedb:mainfrom
tyranitar-mega:improve-error-connection-set

Conversation

@tyranitar-mega

@tyranitar-mega tyranitar-mega commented May 24, 2026

Copy link
Copy Markdown
Contributor

fixes #37

Main changes:

  1. config set-connection will now create a config file if missed. get-connections will show No connections configured. use-connection and delete-connection will show Connection xxx not found. Users will not be aware of the existence of the config file unless checking the logs (no config file found in [/root/.config/scopeql/config.toml, /root/.scopeql/config.toml]; treating as empty connections)
  2. When the config file is broken, there will be a line that indicates which file was read from the log file like {"timestamp":"2026-05-24T20:48:31.472035+08:00","level":"INFO","target":"scopeql::config","file":"scopeql/src/config.rs","line":70,"message":"loaded config from /root/.config/scopeql/config.toml"}

Example:

$ ./target/debug/scopeql config use-connection cloud
Failed to switch connection: failed to deserialize config on /root/.config/scopeql/config.toml: missing field `auth`
in `connections.cloud`

$ ./target/debug/scopeql config delete-connection cloud
Failed to delete connection: failed to deserialize config on /root/.config/scopeql/config.toml: missing field `auth`
in `connections.cloud`

$ ./target/debug/scopeql config get-connections
Failed to load config: failed to deserialize config on /root/.config/scopeql/config.toml: missing field `auth`
in `connections.cloud`

@tyranitar-mega tyranitar-mega changed the title feat: init config file in set-connection and change auth to optional feat: init config file in set-connection and improve error messages May 25, 2026
Yagami Light and others added 3 commits May 25, 2026 12:37
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun tisonkun enabled auto-merge (squash) May 25, 2026 04:58
@tisonkun tisonkun disabled auto-merge May 25, 2026 04:58
@tisonkun tisonkun changed the title feat: init config file in set-connection and improve error messages refactor: fine tune config connection manner and errmsgs May 25, 2026
@tisonkun tisonkun enabled auto-merge (squash) May 25, 2026 04:58
@tisonkun tisonkun merged commit 57d9135 into scopedb:main May 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some user experience issues of the current config subcommand

2 participants