From 76482cc1b2ce846057994944a0b1eec088df1314 Mon Sep 17 00:00:00 2001 From: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:24:16 +0100 Subject: [PATCH] Move `stor` commands to category `Database` (#11315) Fixes #11309 --- crates/nu-command/src/database/commands/query_db.rs | 2 +- crates/nu-command/src/database/commands/schema.rs | 2 +- crates/nu-command/src/stor/create.rs | 2 +- crates/nu-command/src/stor/delete.rs | 2 +- crates/nu-command/src/stor/export.rs | 2 +- crates/nu-command/src/stor/import.rs | 2 +- crates/nu-command/src/stor/insert.rs | 2 +- crates/nu-command/src/stor/open.rs | 2 +- crates/nu-command/src/stor/reset.rs | 2 +- crates/nu-command/src/stor/stor_.rs | 2 +- crates/nu-command/src/stor/update.rs | 2 +- crates/nu-protocol/src/signature.rs | 2 ++ 12 files changed, 13 insertions(+), 11 deletions(-) diff --git a/crates/nu-command/src/database/commands/query_db.rs b/crates/nu-command/src/database/commands/query_db.rs index a0779d33c..401962aac 100644 --- a/crates/nu-command/src/database/commands/query_db.rs +++ b/crates/nu-command/src/database/commands/query_db.rs @@ -24,7 +24,7 @@ impl Command for QueryDb { SyntaxShape::String, "SQL to execute against the database", ) - .category(Category::Custom("database".into())) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/database/commands/schema.rs b/crates/nu-command/src/database/commands/schema.rs index edbc108c1..8a2c97f85 100644 --- a/crates/nu-command/src/database/commands/schema.rs +++ b/crates/nu-command/src/database/commands/schema.rs @@ -17,7 +17,7 @@ impl Command for SchemaDb { fn signature(&self) -> Signature { Signature::build(self.name()) .input_output_types(vec![(Type::Any, Type::Any)]) - .category(Category::Custom("database".into())) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/create.rs b/crates/nu-command/src/stor/create.rs index 69f5fd695..2f2099477 100644 --- a/crates/nu-command/src/stor/create.rs +++ b/crates/nu-command/src/stor/create.rs @@ -31,7 +31,7 @@ impl Command for StorCreate { Some('c'), ) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/delete.rs b/crates/nu-command/src/stor/delete.rs index d918e8b7b..242d54c79 100644 --- a/crates/nu-command/src/stor/delete.rs +++ b/crates/nu-command/src/stor/delete.rs @@ -31,7 +31,7 @@ impl Command for StorDelete { Some('w'), ) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/export.rs b/crates/nu-command/src/stor/export.rs index 75f0d5e29..f91bde774 100644 --- a/crates/nu-command/src/stor/export.rs +++ b/crates/nu-command/src/stor/export.rs @@ -25,7 +25,7 @@ impl Command for StorExport { Some('f'), ) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/import.rs b/crates/nu-command/src/stor/import.rs index 37405ff10..94b184905 100644 --- a/crates/nu-command/src/stor/import.rs +++ b/crates/nu-command/src/stor/import.rs @@ -25,7 +25,7 @@ impl Command for StorImport { Some('f'), ) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/insert.rs b/crates/nu-command/src/stor/insert.rs index 3332f1e4f..6fda24933 100644 --- a/crates/nu-command/src/stor/insert.rs +++ b/crates/nu-command/src/stor/insert.rs @@ -31,7 +31,7 @@ impl Command for StorInsert { Some('d'), ) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/open.rs b/crates/nu-command/src/stor/open.rs index 628256412..0888e52e2 100644 --- a/crates/nu-command/src/stor/open.rs +++ b/crates/nu-command/src/stor/open.rs @@ -20,7 +20,7 @@ impl Command for StorOpen { Type::Custom("sqlite-in-memory".into()), )]) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/reset.rs b/crates/nu-command/src/stor/reset.rs index d5c455dff..97603bf00 100644 --- a/crates/nu-command/src/stor/reset.rs +++ b/crates/nu-command/src/stor/reset.rs @@ -17,7 +17,7 @@ impl Command for StorReset { Signature::build("stor reset") .input_output_types(vec![(Type::Nothing, Type::Table(vec![]))]) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-command/src/stor/stor_.rs b/crates/nu-command/src/stor/stor_.rs index 4d7eefded..a359cb9f0 100644 --- a/crates/nu-command/src/stor/stor_.rs +++ b/crates/nu-command/src/stor/stor_.rs @@ -15,7 +15,7 @@ impl Command for Stor { fn signature(&self) -> Signature { Signature::build("stor") - .category(Category::Strings) + .category(Category::Database) .input_output_types(vec![(Type::Nothing, Type::String)]) } diff --git a/crates/nu-command/src/stor/update.rs b/crates/nu-command/src/stor/update.rs index b7861bc58..15769163f 100644 --- a/crates/nu-command/src/stor/update.rs +++ b/crates/nu-command/src/stor/update.rs @@ -37,7 +37,7 @@ impl Command for StorUpdate { Some('w'), ) .allow_variants_without_examples(true) - .category(Category::Math) + .category(Category::Database) } fn usage(&self) -> &str { diff --git a/crates/nu-protocol/src/signature.rs b/crates/nu-protocol/src/signature.rs index 20ed72c87..e17f47c35 100644 --- a/crates/nu-protocol/src/signature.rs +++ b/crates/nu-protocol/src/signature.rs @@ -46,6 +46,7 @@ pub enum Category { Conversions, Core, Custom(String), + Database, Date, Debug, Default, @@ -78,6 +79,7 @@ impl std::fmt::Display for Category { Category::Conversions => "conversions", Category::Core => "core", Category::Custom(name) => name, + Category::Database => "database", Category::Date => "date", Category::Debug => "debug", Category::Default => "default",