pub struct SqlFunArgs { /* private fields */ }Expand description
Common sql-fun CLI arguments and environment variables
Implementations§
Source§impl SqlFunArgs
impl SqlFunArgs
Sourcepub fn metadata_format(&self) -> &str
pub fn metadata_format(&self) -> &str
gets metadata format value in args
Sourcepub fn metadata_file_raw(&self) -> Result<&str, SqlFunArgsError>
pub fn metadata_file_raw(&self) -> Result<&str, SqlFunArgsError>
return raw value for --metadata-file
§Errors
Returns SqlFunArgsError::NotSupported if the metadata format is not TOML.
Sourcepub fn metadata_file(&self) -> Result<PathBuf, SqlFunArgsError>
pub fn metadata_file(&self) -> Result<PathBuf, SqlFunArgsError>
search metadata file with same-owner policy
§Errors
Propagates errors when current directory or metadata path resolution fails.
Sourcepub fn schema_file(
&self,
metadata_file: &Path,
) -> Result<PathBuf, SqlFunArgsError>
pub fn schema_file( &self, metadata_file: &Path, ) -> Result<PathBuf, SqlFunArgsError>
Source§impl SqlFunArgs
impl SqlFunArgs
Sourcepub fn sql_fun_home(&self) -> Result<PathBuf, SqlFunArgsError>
pub fn sql_fun_home(&self) -> Result<PathBuf, SqlFunArgsError>
get home dir path
If --sql-fun-home or SQL_FUN_HOME env present : configured value
Else returns ${HOME}/.sql-fun
§Errors
Returns SqlFunArgsError when the home directory cannot be resolved.
Source§impl SqlFunArgs
impl SqlFunArgs
Sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
returns true for builtin subcommand
Sourcepub fn sql_dialect(
&self,
metadata: &SqlFunMetadata,
) -> Result<SqlDialect, SqlFunArgsError>
pub fn sql_dialect( &self, metadata: &SqlFunMetadata, ) -> Result<SqlDialect, SqlFunArgsError>
Sourcepub fn cte_catalog_dir(
&self,
metadata: &SqlFunMetadata,
) -> Result<Option<PathBuf>, SqlFunArgsError>
pub fn cte_catalog_dir( &self, metadata: &SqlFunMetadata, ) -> Result<Option<PathBuf>, SqlFunArgsError>
Sourcepub fn command(&self) -> &Option<CliSubCommand>
pub fn command(&self) -> &Option<CliSubCommand>
get command
Sourcepub fn postgres_version(
&self,
metadata: &SqlFunMetadata,
) -> Result<EngineVersion, SqlFunArgsError>
pub fn postgres_version( &self, metadata: &SqlFunMetadata, ) -> Result<EngineVersion, SqlFunArgsError>
Sourcepub fn postgres_search_path(
&self,
metadata: &SqlFunMetadata,
) -> Result<Vec<String>, SqlFunArgsError>
pub fn postgres_search_path( &self, metadata: &SqlFunMetadata, ) -> Result<Vec<String>, SqlFunArgsError>
Sourcepub fn postgres_extensions(
&self,
metadata: &SqlFunMetadata,
) -> Result<PostgresExtensionsCollection, SqlFunArgsError>
pub fn postgres_extensions( &self, metadata: &SqlFunMetadata, ) -> Result<PostgresExtensionsCollection, SqlFunArgsError>
get postgres extensions
§Errors
Propagates SqlFunArgsError if metadata lookup fails or the extension
configuration is invalid.
Sourcepub fn builtin_info_dir(
&self,
metadata: &SqlFunMetadata,
) -> Result<PathBuf, SqlFunArgsError>
pub fn builtin_info_dir( &self, metadata: &SqlFunMetadata, ) -> Result<PathBuf, SqlFunArgsError>
get builtin schema directory path
§Errors
Returns SqlFunArgsError if the builtin directory cannot be resolved.
Sourcepub fn postgres_extensions_dir(
&self,
metadata: &SqlFunMetadata,
) -> Result<PathBuf, SqlFunArgsError>
pub fn postgres_extensions_dir( &self, metadata: &SqlFunMetadata, ) -> Result<PathBuf, SqlFunArgsError>
set directory path of extensions
§Errors
Returns SqlFunArgsError when the path components cannot be derived.
Sourcepub fn environments(&self) -> Result<HashMap<String, String>, SqlFunArgsError>
pub fn environments(&self) -> Result<HashMap<String, String>, SqlFunArgsError>
get environemnts for child process
§Errors
Returns SqlFunArgsError if metadata fails to load or env generation
encounters an error.
Sourcepub fn term_color(&self) -> TerminalColor
pub fn term_color(&self) -> TerminalColor
get terminal color value
Sourcepub fn highlighter_theme(&self) -> Result<HighlighterTheme, SqlFunArgsError>
pub fn highlighter_theme(&self) -> Result<HighlighterTheme, SqlFunArgsError>
get syntax highlighter theme
when Self::term_color is never, returns HighlighterTheme::default
when Self::highlighter_theme is None, returns ${SQL_FUN_HOME}/highlighter/default.toml
when Self::highlighter_theme is Some and relative path,
returns ${SQL_FUN_HOME}/highlighter/specified-path
when Self::highlighter_theme is Some and absolute path,
returns load from absolute path
§Errors
Returns SqlFunArgsError if faild load theme.
Source§impl SqlFunArgs
impl SqlFunArgs
Sourcepub fn parse_args() -> Self
pub fn parse_args() -> Self
Initialize and parse arguments
Sourcepub fn try_from_env() -> Result<Self, SqlFunArgsError>
pub fn try_from_env() -> Result<Self, SqlFunArgsError>
Trait Implementations§
Source§impl Args for SqlFunArgs
impl Args for SqlFunArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for SqlFunArgs
impl Clone for SqlFunArgs
Source§fn clone(&self) -> SqlFunArgs
fn clone(&self) -> SqlFunArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CommandFactory for SqlFunArgs
impl CommandFactory for SqlFunArgs
Source§impl Debug for SqlFunArgs
impl Debug for SqlFunArgs
Source§impl<'de> Deserialize<'de> for SqlFunArgs
impl<'de> Deserialize<'de> for SqlFunArgs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl FromArgMatches for SqlFunArgs
impl FromArgMatches for SqlFunArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for SqlFunArgs
impl Parser for SqlFunArgs
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for SqlFunArgs
impl RefUnwindSafe for SqlFunArgs
impl Send for SqlFunArgs
impl Sync for SqlFunArgs
impl Unpin for SqlFunArgs
impl UnwindSafe for SqlFunArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more