From f0617550c45c69c973f155558adf93cc6a149c6e Mon Sep 17 00:00:00 2001 From: wandalen Date: Wed, 20 Mar 2024 15:13:26 +0200 Subject: [PATCH] more tasks --- module/move/unitore/src/executor/actions/query.rs | 6 +++++- module/move/unitore/src/executor/actions/table.rs | 8 ++++---- module/move/unitore/src/executor/mod.rs | 4 ++-- module/move/unitore/src/lib.rs | 4 +++- module/move/unitore/src/storage/config.rs | 10 ++++++++++ 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/module/move/unitore/src/executor/actions/query.rs b/module/move/unitore/src/executor/actions/query.rs index 4b49bc9c37..84064075a7 100644 --- a/module/move/unitore/src/executor/actions/query.rs +++ b/module/move/unitore/src/executor/actions/query.rs @@ -1,5 +1,6 @@ //! Query command endpoint and report. +// qqq : don't use both use crate::*; use super::*; use gluesql::core::executor::Payload; @@ -86,4 +87,7 @@ impl std::fmt::Display for QueryReport } } -impl Report for QueryReport {} \ No newline at end of file +impl Report for QueryReport {} + +// qqq : good tests for query action +// all tables should be touched by these tests diff --git a/module/move/unitore/src/executor/actions/table.rs b/module/move/unitore/src/executor/actions/table.rs index d22ad6eeff..0c0b6e726d 100644 --- a/module/move/unitore/src/executor/actions/table.rs +++ b/module/move/unitore/src/executor/actions/table.rs @@ -46,7 +46,7 @@ pub async fn list_columns "feed" => { table_description = String::from( "Contains feed items." ); - + for label in columns.get( "feed" ).unwrap() { match label.as_str() @@ -57,7 +57,7 @@ pub async fn list_columns String::from( "Link to feed source, unique identifier for the feed" ), ); } "title" => { columns_desc.insert( label.clone(), String::from( "The title of the feed" ) ); } - "updated" => + "updated" => { columns_desc.insert( label.clone(), String::from ( @@ -166,7 +166,7 @@ impl std::fmt::Display for ColumnsReport { writeln!( f, "Table name: {}", self.table_name )?; writeln!( f, "Description: {}", self.table_description )?; - + if !self.columns.is_empty() { writeln!( f, "Columns:" )?; @@ -293,7 +293,7 @@ impl std::fmt::Display for TablesReport { writeln!( f, "{}", table )?; } - + Ok( () ) } } diff --git a/module/move/unitore/src/executor/mod.rs b/module/move/unitore/src/executor/mod.rs index e83d8c859e..6e72cc69bb 100644 --- a/module/move/unitore/src/executor/mod.rs +++ b/module/move/unitore/src/executor/mod.rs @@ -77,7 +77,7 @@ pub fn execute() -> Result< (), Box< dyn std::error::Error + Send + Sync > > } }) .end() - + .command( "frames.list" ) .long_hint( concat! ( @@ -104,7 +104,7 @@ pub fn execute() -> Result< (), Box< dyn std::error::Error + Send + Sync > > " - `link` : URL for feed source;\n\n", " Example:\n", " [[config]]\n", - " update_period = \"1min\"\n", + " update_period = \"1min\"\n", " link = \"https://feeds.bbci.co.uk/news/world/rss.xml\"\n", )) .subject().hint( "Path" ).kind( Type::Path ).optional( false ).end() diff --git a/module/move/unitore/src/lib.rs b/module/move/unitore/src/lib.rs index e0559bea1b..d871675d0c 100644 --- a/module/move/unitore/src/lib.rs +++ b/module/move/unitore/src/lib.rs @@ -3,4 +3,6 @@ pub mod retriever; pub mod feed_config; pub mod executor; pub mod storage; -pub mod table_display; \ No newline at end of file +pub mod table_display; + +// qqq : src/Readmу.md with file structure please diff --git a/module/move/unitore/src/storage/config.rs b/module/move/unitore/src/storage/config.rs index d4af8e1cc2..5a3770ee8e 100644 --- a/module/move/unitore/src/storage/config.rs +++ b/module/move/unitore/src/storage/config.rs @@ -111,3 +111,13 @@ impl ConfigStore for FeedStorage< SledStorage > Ok( res ) } } + +// qqq : use AbsolutePath newtype from `path_tools` +// qqq : normalize all paths with `path_tools::path::normalize` +// https://docs.rs/proper_path_tools/latest/proper_path_tools/path/fn.normalize.html + +// unitore .query.execute \'SELECT \* FROM feed\' +// qqq : something is broken in this table. also lack of association with config files + +// unitore .query.execute \'SELECT \* FROM x\' +// qqq : it is not obvious where one record ends and another begins