### Create Runner and Run Test File Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/index.html Create a `Runner` instance with a factory function that returns your database implementation. Use `run_file` to execute tests from a specified file. ```rust let mut tester = sqllogictest::Runner::new(|| async { let db = MyDatabase { // fields }; Ok(db) }); let _res = tester.run_file("../tests/slt/basic.slt"); ``` -------------------------------- ### Get trial name Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Trial.html The `name` method returns the name of the trial. ```rust pub fn name(&self) -> &str ``` -------------------------------- ### Type ID Implementation for Generic Types Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.TestErrorKind.html Gets the `TypeId` of a type, applicable to any type that implements `Any`. ```rust fn type_id(&self) -> TypeId ``` -------------------------------- ### Trial Configuration Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Trial.html Methods to configure the properties of a Trial instance. ```APIDOC ## Trial Configuration ### with_kind Sets the "kind" of this test/benchmark, which is printed in brackets before the name. - **kind** (impl Into) - Required ### with_ignored_flag Sets whether or not this test is considered "ignored". - **is_ignored** (bool) - Required ``` -------------------------------- ### Runner Initialization and Configuration Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.Runner.html Methods for creating and configuring a new test runner instance. ```APIDOC ## Runner API ### `Runner::new` #### Description Creates a new test runner instance. #### Method `new` #### Parameters - `make_conn` (M): A connection maker that implements `MakeConnection`. ### `Runner::add_label` #### Description Adds a label for conditional test execution (`skipif`, `onlyif`). #### Method `add_label` #### Parameters - `label` (&str): The label to add. ### `Runner::set_var` #### Description Sets a local variable for substitution within test scripts. #### Method `set_var` #### Parameters - `key` (String): The variable key. - `value` (String): The variable value. ### `Runner::with_normalizer` #### Description Configures a normalizer for test output. #### Method `with_normalizer` #### Parameters - `normalizer` (Normalizer): The normalizer to use. ### `Runner::with_validator` #### Description Configures a validator for test output. #### Method `with_validator` #### Parameters - `validator` (Validator): The validator to use. ### `Runner::with_column_validator` #### Description Configures a column type validator for test output. #### Method `with_column_validator` #### Parameters - `validator` (ColumnTypeValidator): The column type validator to use. ### `Runner::with_partitioner` #### Description Sets the partitioner for the runner. This is used for parallel test execution. #### Method `with_partitioner` #### Parameters - `partitioner` (impl Partitioner + 'static): The partitioner to use. ### `Runner::with_hash_threshold` #### Description Sets the hash threshold for the runner. #### Method `with_hash_threshold` #### Parameters - `hash_threshold` (usize): The hash threshold value. ``` -------------------------------- ### Deprecated Error Cause for TestErrorKind Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.TestErrorKind.html Deprecated method for getting the cause of the error. Replaced by `Error::source`. ```rust fn cause(&self) -> Option<&dyn Error> ``` -------------------------------- ### Get Argument Group ID Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Arguments.html Reports the `ArgGroup::id` for this set of arguments, used in argument parsing. ```rust fn group_id() -> Option ``` -------------------------------- ### Color and Style Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.TestError.html Methods for setting foreground and background colors at runtime or via RGB values, and applying styles. ```APIDOC ## fn color(&self, color: Color) ### Description Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. ## fn on_color(&self, color: Color) ### Description Set the background color at runtime. Only use if you do not know what color to use at compile-time. ## fn fg_rgb(&self) ### Description Set the foreground color to a specific RGB value. ## fn bg_rgb(&self) ### Description Set the background color to a specific RGB value. ## fn truecolor(&self, r: u8, g: u8, b: u8) ### Description Sets the foreground color to an RGB value. ## fn on_truecolor(&self, r: u8, g: u8, b: u8) ### Description Sets the background color to an RGB value. ## fn style(&self, style: Style) ### Description Apply a runtime-determined style. ``` -------------------------------- ### Get trial kind Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Trial.html The `kind` method returns the kind of the trial. Returns an empty string if no kind was set. ```rust pub fn kind(&self) -> &str ``` -------------------------------- ### Color and Style Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.LetError.html Methods for applying dynamic foreground/background colors and styles to terminal output. ```APIDOC ## fn color(&self, color: Color) ### Description Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. ### Parameters #### Request Body - **color** (DynColor) - Required - The color to apply at runtime. ## fn on_color(&self, color: Color) ### Description Set the background color at runtime. Only use if you do not know what color to use at compile-time. ### Parameters #### Request Body - **color** (DynColor) - Required - The background color to apply at runtime. ## fn fg_rgb(&self) ### Description Set the foreground color to a specific RGB value. ## fn bg_rgb(&self) ### Description Set the background color to a specific RGB value. ## fn style(&self, style: Style) ### Description Apply a runtime-determined style. ``` -------------------------------- ### Arguments Implementations Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Arguments.html Provides methods for creating and managing Arguments, including parsing from command-line arguments. ```APIDOC ### impl Arguments #### pub fn from_args() -> Arguments Parses the global CLI arguments given to the application. If the parsing fails, an error is shown and the application exits. If help is requested, a help message is shown and the application exits. #### pub fn from_iter(iter: I) -> Arguments where Arguments: Sized, I: IntoIterator, ::Item: Into + Clone, Like `from_args()`, but operates on an explicit iterator and not the global arguments. Note that the first element is the executable name! ``` -------------------------------- ### Deprecated Error Description for TestErrorKind Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.TestErrorKind.html Deprecated method for getting a string description of the error. Use the `Display` implementation or `to_string()` instead. ```rust fn description(&self) -> &str ``` -------------------------------- ### Styling Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Condition.html Methods for configuring foreground and background colors and applying styles to elements. ```APIDOC ## fn bg_rgb(&self) -> BgColorDisplay<'_, CustomColor, Self> ### Description Set the background color to a specific RGB value using const generics. ## fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self> ### Description Sets the foreground color to an RGB value. ## fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self> ### Description Sets the background color to an RGB value. ## fn style(&self, style: Style) -> Styled<&Self> ### Description Apply a runtime-determined style. ``` -------------------------------- ### Ignore unreadable paths Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/fn.glob.html This example demonstrates how to filter out unreadable paths when iterating through glob matches, using `filter_map` with `Result::ok`. ```rust use glob::glob; use std::result::Result; for path in glob("/media/pictures/*.jpg").unwrap().filter_map(Result::ok) { println!("{}", path.display()); } ``` -------------------------------- ### Get TestError Location Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.TestError.html The `location` method returns the source location (e.g., file and line number) where the error originated. This is crucial for debugging. ```rust pub fn location(&self) -> Location ``` -------------------------------- ### OwoColorize Color Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Trial.html Methods for applying foreground and background colors to text in the terminal. ```APIDOC ## Color Methods ### Description These methods allow for setting the foreground (fg) or background (bg) color of text. Specific methods exist for standard colors (black, red, green, yellow, blue, magenta, cyan, white) and their bright variants. ### Methods - **fg(&self)**: Set the foreground color generically. - **bg(&self)**: Set the background color generically. - **[color](&self)**: Set foreground color to [color]. - **on_[color](&self)**: Set background color to [color]. - **bright_[color](&self)**: Set foreground color to bright [color]. - **on_bright_[color](&self)**: Set background color to bright [color]. ``` -------------------------------- ### Set foreground and background colors at runtime Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/struct.ParseError.html Use these methods when the color is not known at compile-time. Prefer compile-time methods like OwoColorize::fg for constant colors. ```rust fn color(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self> where Color: DynColor, ``` ```rust fn on_color(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self> where Color: DynColor, ``` -------------------------------- ### Display TestError with Color Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.TestError.html Use the `display` method to get a colored representation of the TestError. This is useful for providing user-friendly error messages in the terminal. ```rust pub fn display(&self, colorize: bool) -> TestErrorDisplay<'_> ``` -------------------------------- ### Display Error Kind with Color Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.TestErrorKind.html Use the `display()` method on a `TestErrorKind` instance to get a colored representation of the error message, useful for user-facing output. ```rust self.display() ``` -------------------------------- ### Runtime Color Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.RecordOutput.html Methods for setting text and background colors dynamically at runtime. ```APIDOC ## fn color(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self> ### Description Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either `OwoColorize::fg` or a color-specific method, such as `OwoColorize::green`. ### Method N/A (Method on a type) ### Endpoint N/A ### Parameters - **color** (Color) - Description: The color to set as foreground. ### Request Example None ### Response None ## fn on_color(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self> ### Description Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either `OwoColorize::bg` or a color-specific method, such as `OwoColorize::on_yellow`. ### Method N/A (Method on a type) ### Endpoint N/A ### Parameters - **color** (Color) - Description: The color to set as background. ### Request Example None ### Response None ``` -------------------------------- ### Color and Style Chaining Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.DBOutput.html Demonstrates how to chain color and style modifications. ```APIDOC ## Chaining Colors and Styles ### Description This API allows for chaining multiple color and style modifications together for complex text formatting. ### Example Usage ```rust // Example of chaining foreground color, background color, and style // let styled_text = "Hello, World!".fg_rgb::<100, 200, 50>().on_bright_blue().bold(); ``` ### Note Specific examples for chaining are often found within the usage documentation of individual methods. ``` -------------------------------- ### Get Lower-Level Error Source Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.TestError.html The `source` method, part of the Error trait, returns the underlying error that caused this TestError, if any. This is essential for understanding the root cause of failures. ```rust fn source(&self) -> Option<&(dyn Error + 'static)> ``` -------------------------------- ### Macros Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/all.html List of all macros available in the sqllogictest crate. ```APIDOC ## Macros ### `harness` ``` -------------------------------- ### Get TestError Kind Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.TestError.html The `kind` method returns the specific type of error that occurred, represented by the `TestErrorKind` enum. This allows for programmatic handling of different error scenarios. ```rust pub fn kind(&self) -> TestErrorKind ``` -------------------------------- ### Build Clap Command for Arguments Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Arguments.html Builds a `Command` object that can be used to instantiate `Arguments`. ```rust fn command<'b>() -> Command ``` -------------------------------- ### Define a basic test trial Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Trial.html Use `Trial::test` to create a non-benchmark test. The runner function should return `Ok(())` for success or `Err(Failed)` for failure. Ensure the runner is `Send + 'static`. ```rust pub fn test(name: impl Into, runner: R) -> Trial where R: FnOnce() -> Result<(), Failed> + Send + 'static, ``` -------------------------------- ### Trait Implementations Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Arguments.html Documentation for core trait implementations including data conversion and subscriber management. ```APIDOC ## Style Trait ### Method fn style(&self, style: Style) -> Styled<&Self> ### Description Apply a runtime-determined style to the object. ## ToOwned Trait ### Methods - fn to_owned(&self) -> T: Creates owned data from borrowed data. - fn clone_into(&self, target: &mut T): Uses borrowed data to replace owned data. ## TryFrom / TryInto Traits ### Description Provides mechanisms for fallible type conversions. ### Methods - fn try_from(value: U) -> Result: Performs the conversion from U to T. - fn try_into(self) -> Result: Performs the conversion from T to U. ## WithSubscriber Trait ### Description Attaches subscribers to types for dispatching. ### Methods - fn with_subscriber(self, subscriber: S) -> WithDispatch: Attaches the provided Subscriber. - fn with_current_subscriber(self) -> WithDispatch: Attaches the current default Subscriber. ``` -------------------------------- ### CloneToUninit Implementation (Nightly) Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Connection.html Performs copy-assignment from self to an uninitialized memory location. This is an experimental nightly-only API. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### Terminal Color and Style Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.TestErrorDisplay.html Methods for setting foreground and background colors, as well as applying text styles like bold, italic, and underline. ```APIDOC ## Terminal Styling Methods ### Description These methods allow for the dynamic styling of terminal text, including foreground/background color changes and text formatting. ### Methods - **on_default_color**: Change background to terminal default. - **bright_[color]**: Change foreground color to bright variant. - **on_bright_[color]**: Change background color to bright variant. - **bold**: Make text bold. - **dimmed**: Make text dim. - **italic**: Make text italicized. - **underline**: Make text underlined. - **blink**: Make text blink. - **blink_fast**: Make text blink fast. - **reversed**: Swap foreground and background colors. - **hidden**: Hide the text. - **strikethrough**: Cross out the text. ### Dynamic Styling - **color(color: Color)**: Set foreground color at runtime. - **on_color(color: Color)**: Set background color at runtime. - **fg_rgb()**: Set foreground to specific RGB value. - **bg_rgb()**: Set background to specific RGB value. - **truecolor(r, g, b)**: Set foreground to RGB value at runtime. - **on_truecolor(r, g, b)**: Set background to RGB value at runtime. - **style(style: Style)**: Apply a runtime-determined style. ``` -------------------------------- ### Create New Runner Instance Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.Runner.html Instantiates a new test runner with a provided connection maker. ```rust pub fn new(make_conn: M) -> Self ``` -------------------------------- ### OwoColorize Terminal Styling Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.ParseErrorKind.html Methods for applying foreground and background colors to terminal output. ```APIDOC ## fn fg(&self) ### Description Set the foreground color generically. ## fn bg(&self) ### Description Set the background color generically. ## Color Methods - **black() / on_black()**: Set color to black. - **red() / on_red()**: Set color to red. - **green() / on_green()**: Set color to green. - **yellow() / on_yellow()**: Set color to yellow. - **blue() / on_blue()**: Set color to blue. - **magenta() / on_magenta()**: Set color to magenta. - **purple() / on_purple()**: Set color to magenta. - **cyan() / on_cyan()**: Set color to cyan. - **white() / on_white()**: Set color to white. - **default_color() / on_default_color()**: Set color to terminal default. - **bright_[color]() / on_bright_[color]()**: Set color to bright variants for black, red, green, yellow, blue, magenta, purple, and cyan. ``` -------------------------------- ### Execute sqllogictest with test function Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/fn.test.html Runs a test file using the provided connection factory. Requires a path to the test file and an implementation of the MakeConnection trait. ```rust pub fn test( filename: impl AsRef, make_conn: impl MakeConnection, ) -> Result<(), Failed> ``` -------------------------------- ### Color Formatting Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.StatementExpect.html Methods for setting foreground and background colors, including standard colors, bright variants, and custom RGB values. ```APIDOC ## Foreground Color Methods ### magenta Change the foreground color to magenta. ### purple Change the foreground color to purple. ### cyan Change the foreground color to cyan. ### white Change the foreground color to white. ### default_color Change the foreground color to the terminal default. ### bright_black Change the foreground color to bright black. ### bright_red Change the foreground color to bright red. ### bright_green Change the foreground color to bright green. ### bright_yellow Change the foreground color to bright yellow. ### bright_blue Change the foreground color to bright blue. ### bright_magenta Change the foreground color to bright magenta. ### bright_purple Change the foreground color to bright purple. ### bright_cyan Change the foreground color to bright cyan. ### bright_white Change the foreground color to bright white. ## Background Color Methods ### on_magenta Change the background color to magenta. ### on_purple Change the background color to purple. ### on_cyan Change the background color to cyan. ### on_white Change the background color to white. ### on_default_color Change the background color to the terminal default. ### on_bright_black Change the background color to bright black. ### on_bright_red Change the background color to bright red. ### on_bright_green Change the background color to bright green. ### on_bright_yellow Change the background color to bright yellow. ### on_bright_blue Change the background color to bright blue. ### on_bright_magenta Change the background color to bright magenta. ### on_bright_purple Change the background color to bright purple. ### on_bright_cyan Change the background color to bright cyan. ### on_bright_white Change the background color to bright white. ## Dynamic Color Methods ### color Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either `OwoColorize::fg` or a color-specific method, such as `OwoColorize::green`. ### on_color Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either `OwoColorize::bg` or a color-specific method, such as `OwoColorize::on_yellow`. ### fg_rgb Set the foreground color to a specific RGB value. ``` -------------------------------- ### Trial::bench Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Trial.html Creates a new benchmark test with a specified name and runner function. ```APIDOC ## Trial::bench ### Description Creates a benchmark with the given name and runner. If `test_mode` is true, the runner should execute without measuring; if false, it should perform the benchmark and return a Measurement. ### Parameters - **name** (impl Into) - Required - The name of the benchmark. - **runner** (FnOnce(bool) -> Result, Failed> + Send + 'static) - Required - The function to execute for the benchmark. ``` -------------------------------- ### OwoColorize Background Color Implementation Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Connection.html Sets the background color for colored output. ```rust fn bg(&self) -> BgColorDisplay<'_, C, Self> where C: Color, ``` -------------------------------- ### Styling and Color API Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/struct.RetryConfig.html Methods for applying background colors and runtime styles to display types. ```APIDOC ## fn on_truecolor ### Description Sets the background color to an RGB value. ### Parameters - **r** (u8) - Required - Red component - **g** (u8) - Required - Green component - **b** (u8) - Required - Blue component ## fn style ### Description Apply a runtime-determined style. ### Parameters - **style** (Style) - Required - The style to apply ``` -------------------------------- ### Terminal Styling Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Arguments.html Methods for applying foreground and background colors, as well as text effects like bold, italic, and underline. ```APIDOC ## Terminal Styling Methods ### Description Methods to apply standard terminal colors and text effects to strings. ### Methods - **cyan()**: Change foreground to cyan. - **on_cyan()**: Change background to cyan. - **white()**: Change foreground to white. - **on_white()**: Change background to white. - **default_color()**: Reset foreground to terminal default. - **on_default_color()**: Reset background to terminal default. - **bold()**: Make text bold. - **dimmed()**: Make text dim. - **italic()**: Make text italicized. - **underline()**: Make text underlined. - **blink()**: Make text blink. - **blink_fast()**: Make text blink fast. - **reversed()**: Swap foreground and background colors. - **hidden()**: Hide the text. - **strikethrough()**: Cross out the text. ``` -------------------------------- ### Function run Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/fn.run.html Runs all given trials (tests & benchmarks). This is the central function of this crate. It provides the framework for the testing harness. It does all the printing and house keeping. The returned value contains a couple of useful information. See `Conclusion` for more information. If `--list` was specified, a list is printed and a dummy `Conclusion` is returned. ```APIDOC ## Function run ### Description Runs all given trials (tests & benchmarks). This is the central function of this crate. It provides the framework for the testing harness. It does all the printing and house keeping. The returned value contains a couple of useful information. See `Conclusion` for more information. If `--list` was specified, a list is printed and a dummy `Conclusion` is returned. ### Signature ```rust pub fn run(args: &Arguments, tests: Vec) -> Conclusion ``` ``` -------------------------------- ### Style Application Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.QueryExpect.html Applies a style to the text at runtime. ```APIDOC ## POST /api/style ### Description Applies a runtime-determined style. ### Method POST ### Endpoint /api/style ### Parameters #### Request Body - **style** (Style) - Required - The style to apply. ### Request Example ```json { "style": "bold" } ``` ### Response #### Success Response (200) - **styled** (Styled) - A styled object. #### Response Example ```json { "styled": "..." } ``` ``` -------------------------------- ### Terminal Styling Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.ExpectedError.html Methods for applying foreground/background colors and text styles to terminal output. ```APIDOC ## Terminal Styling Methods ### Description These methods allow for the modification of terminal text appearance. Foreground colors are set via methods like `red()`, `blue()`, etc., while background colors are set via `on_red()`, `on_blue()`, etc. Text styles such as `bold()`, `italic()`, and `strikethrough()` are also available. ### Methods - **Color Methods**: `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `purple`, `cyan`, `white`, `default_color` (and their `on_` variants for background). - **Bright Color Methods**: `bright_black`, `bright_red`, `bright_green`, `bright_yellow`, `bright_blue`, `bright_magenta`, `bright_purple`, `bright_cyan`, `bright_white` (and their `on_` variants). - **Style Methods**: `bold`, `dimmed`, `italic`, `underline`, `blink`, `blink_fast`, `reversed`, `hidden`, `strikethrough`. ``` -------------------------------- ### Color and Style Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.ParallelTestError.html Methods for applying runtime colors and styles to text. ```APIDOC ## fn on_color(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self> ### Description Set the background color at runtime. Only use if you do not know what color to use at compile-time. ### Parameters #### Request Body - **color** (DynColor) - Required - The color to apply to the background. ## fn fg_rgb(&self) -> FgColorDisplay<'_, CustomColor, Self> ### Description Set the foreground color to a specific RGB value. ## fn bg_rgb(&self) -> BgColorDisplay<'_, CustomColor, Self> ### Description Set the background color to a specific RGB value. ## fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self> ### Description Sets the foreground color to an RGB value. ## fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self> ### Description Sets the background color to an RGB value. ## fn style(&self, style: Style) -> Styled<&Self> ### Description Apply a runtime-determined style. ``` -------------------------------- ### Conversion Traits Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.Runner.html Implementations for `TryFrom`, `TryInto`, and `VZip` traits. ```APIDOC ## Conversion Traits ### `impl TryFrom for T` #### `type Error = Infallible` #### `fn try_from(value: U) -> Result>::Error>` ### `impl TryInto for T` #### `type Error = >::Error` #### `fn try_into(self) -> Result>::Error>` ### `impl VZip for T` #### `fn vzip(self) -> V ``` -------------------------------- ### Run testing harness Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/fn.run.html Executes all provided trials and returns a Conclusion. This function manages test output and internal housekeeping. ```Rust pub fn run(args: &Arguments, tests: Vec) -> Conclusion ``` -------------------------------- ### Style Application Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Connection.html Methods for applying styles to text at runtime. ```APIDOC ## POST /api/style ### Description Applies a runtime-determined style to the text. ### Method POST ### Endpoint /api/style ### Parameters #### Request Body - **style** (Style) - Required - The style to apply. ### Request Example ```json { "style": "bold" } ``` ### Response #### Success Response (200) - **Styled** (object) - An object representing the styled text. #### Response Example ```json { "style_type": "Styled", "style": "bold" } ``` ``` -------------------------------- ### OwoColorize Implementations for RecordKind Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.RecordKind.html Provides methods for adding ANSI color codes to RecordKind for terminal output. Includes foreground and background color setting for various colors. ```rust fn fg(&self) -> FgColorDisplay<'_, C, Self> where C: Color, ``` ```rust fn bg(&self) -> BgColorDisplay<'_, C, Self> where C: Color, ``` ```rust fn black(&self) -> FgColorDisplay<'_, Black, Self> ``` ```rust fn on_black(&self) -> BgColorDisplay<'_, Black, Self> ``` ```rust fn red(&self) -> FgColorDisplay<'_, Red, Self> ``` ```rust fn on_red(&self) -> BgColorDisplay<'_, Red, Self> ``` ```rust fn green(&self) -> FgColorDisplay<'_, Green, Self> ``` ```rust fn on_green(&self) -> BgColorDisplay<'_, Green, Self> ``` ```rust fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self> ``` ```rust fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self> ``` ```rust fn blue(&self) -> FgColorDisplay<'_, Blue, Self> ``` ```rust fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self> ``` ```rust fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self> ``` ```rust fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self> ``` ```rust fn purple(&self) -> FgColorDisplay<'_, Magenta, Self> ``` ```rust fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self> ``` ```rust fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self> ``` ```rust fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self> ``` -------------------------------- ### RGB Color Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/enum.RecordOutput.html Methods for setting foreground and background colors using RGB values. ```APIDOC ## fn fg_rgb( &self, ) -> FgColorDisplay<'_, CustomColor, Self> ### Description Set the foreground color to a specific RGB value. ### Method N/A (Method on a type) ### Endpoint N/A ### Parameters None (RGB values are const generic parameters) ### Request Example None ### Response None ## fn bg_rgb( &self, ) -> BgColorDisplay<'_, CustomColor, Self> ### Description Set the background color to a specific RGB value. ### Method N/A (Method on a type) ### Endpoint N/A ### Parameters None (RGB values are const generic parameters) ### Request Example None ### Response None ## fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self> ### Description Sets the foreground color to an RGB value. ### Method N/A (Method on a type) ### Endpoint N/A ### Parameters - **r** (u8) - Description: Red component of the RGB color. - **g** (u8) - Description: Green component of the RGB color. - **b** (u8) - Description: Blue component of the RGB color. ### Request Example None ### Response None ## fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self> ### Description Sets the background color to an RGB value. ### Method N/A (Method on a type) ### Endpoint N/A ### Parameters - **r** (u8) - Description: Red component of the RGB color. - **g** (u8) - Description: Green component of the RGB color. - **b** (u8) - Description: Blue component of the RGB color. ### Request Example None ### Response None ``` -------------------------------- ### Terminal Styling Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.ResultMode.html Methods for applying foreground/background colors and text effects to terminal output. ```APIDOC ## Terminal Styling Methods ### Description These methods allow for the modification of terminal text appearance, including color settings and text formatting styles. ### Methods - **on_blue**: Change the background color to blue. - **magenta**: Change the foreground color to magenta. - **on_magenta**: Change the background color to magenta. - **purple**: Change the foreground color to purple. - **on_purple**: Change the background color to purple. - **cyan**: Change the foreground color to cyan. - **on_cyan**: Change the background color to cyan. - **white**: Change the foreground color to white. - **on_white**: Change the background color to white. - **default_color**: Change the foreground color to the terminal default. - **on_default_color**: Change the background color to the terminal default. - **bold**: Make the text bold. - **dimmed**: Make the text dim. - **italic**: Make the text italicized. - **underline**: Make the text underlined. - **blink**: Make the text blink. - **blink_fast**: Make the text blink fast. - **reversed**: Swap the foreground and background colors. - **hidden**: Hide the text. - **strikethrough**: Cross out the text. ### Dynamic and Custom Color Methods - **color(color: Color)**: Set the foreground color at runtime. - **on_color(color: Color)**: Set the background color at runtime. - **fg_rgb()**: Set the foreground color to a specific RGB value. ``` -------------------------------- ### Terminal Styling Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/struct.RetryConfig.html Methods for applying foreground and background colors, as well as text formatting effects to terminal output. ```APIDOC ## Terminal Styling Methods ### Description These methods allow for the modification of terminal text appearance, including color settings and text decorations. ### Methods - **purple()**: Change foreground to purple. - **on_purple()**: Change background to purple. - **cyan()**: Change foreground to cyan. - **on_cyan()**: Change background to cyan. - **white()**: Change foreground to white. - **on_white()**: Change background to white. - **default_color()**: Reset foreground to terminal default. - **on_default_color()**: Reset background to terminal default. - **bold()**: Make text bold. - **dimmed()**: Make text dim. - **italic()**: Make text italicized. - **underline()**: Make text underlined. - **blink()**: Make text blink. - **blink_fast()**: Make text blink fast. - **reversed()**: Swap foreground and background colors. - **hidden()**: Hide the text. - **strikethrough()**: Cross out the text. ### Dynamic and RGB Methods - **color(color: Color)**: Set foreground color at runtime. - **on_color(color: Color)**: Set background color at runtime. - **fg_rgb()**: Set foreground to specific RGB value. - **bg_rgb()**: Set background to specific RGB value. - **truecolor(r, g, b)**: Set foreground to RGB value at runtime. ``` -------------------------------- ### Color and Style Manipulation Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Failed.html Methods for setting foreground and background colors using RGB values, and applying runtime-determined styles. ```APIDOC ## fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self> ### Description Sets the foreground color to an RGB value. ### Method N/A (Method within an impl block) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) N/A #### Response Example None ``` ```APIDOC ## fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self> ### Description Sets the background color to an RGB value. ### Method N/A (Method within an impl block) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) N/A #### Response Example None ``` ```APIDOC ## fn style(&self, style: Style) -> Styled<&Self> ### Description Apply a runtime-determined style. ### Method N/A (Method within an impl block) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) N/A #### Response Example None ``` -------------------------------- ### Type Conversion and Ownership Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Failed.html Implementations for type conversion using `TryFrom` and `TryInto`, and methods for handling ownership with `ToOwned`. ```APIDOC ## impl ToOwned for T ### Description Provides methods for creating owned data from borrowed data. #### type Owned = T ### Description The resulting type after obtaining ownership. #### fn to_owned(&self) -> T ### Description Creates owned data from borrowed data, usually by cloning. #### fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ``` ```APIDOC ## impl TryFrom for T ### Description Provides a way to perform fallible conversions from one type to another. #### type Error = Infallible ### Description The type returned in the event of a conversion error. #### fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ``` ```APIDOC ## impl TryInto for T ### Description Provides a way to perform fallible conversions into another type. #### type Error = >::Error ### Description The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ``` -------------------------------- ### Run SQL Query Method Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/trait.DB.html This is a required method for the DB trait. It executes a SQL query against the database and returns the result or an error. ```rust fn run( &mut self, sql: &str, ) -> Result, Self::Error> ``` -------------------------------- ### OwoColorize Green Background Implementation Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Connection.html Changes the background color to green. ```rust fn on_green(&self) -> BgColorDisplay<'_, Green, Self> ``` -------------------------------- ### Structs Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/all.html List of all structs available in the sqllogictest crate. ```APIDOC ## Structs ### `harness::Arguments` ### `harness::Failed` ### `harness::Trial` ### `parser::Location` ### `parser::ParseError` ### `parser::RetryConfig` ### `runner::ParallelTestError` ### `runner::ParallelTestErrorDisplay` ### `runner::Runner` ### `runner::TestError` ### `runner::TestErrorDisplay` ### `runner::TestErrorKindDisplay` ``` -------------------------------- ### Set background color at runtime Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/runner/struct.ParallelTestError.html Use this method when the color is not known at compile-time. For constant colors, prefer OwoColorize methods. ```rust fn on_color(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self> where Color: DynColor, ``` -------------------------------- ### Color and Style Manipulation Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Record.html Methods for setting background color and applying styles. ```APIDOC ## fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self> ### Description Sets the background color to an RGB value. ### Method N/A (Method within an impl block) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) N/A #### Response Example None ``` ```APIDOC ## fn style(&self, style: Style) -> Styled<&Self> ### Description Apply a runtime-determined style. ### Method N/A (Method within an impl block) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) N/A #### Response Example None ``` -------------------------------- ### OwoColorize Red Background Implementation Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Connection.html Changes the background color to red. ```rust fn on_red(&self) -> BgColorDisplay<'_, Red, Self> ``` -------------------------------- ### Type Conversion and Ownership Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Control.html Utilities for type conversion, ownership management, and cloning. ```APIDOC ## POST /api/type/try_from ### Description Performs a conversion from one type to another, returning a `Result`. ### Method POST ### Endpoint /api/type/try_from ### Parameters #### Request Body - **value** (U) - Required - The value to convert. ### Request Example ```json { "value": "some_string" } ``` ### Response #### Success Response (200) - **result** (Result) - The result of the conversion. `T` is the target type and `Error` is the conversion error type. #### Response Example ```json { "result": { "Ok": "converted_value" } } ``` ## POST /api/type/try_into ### Description Performs a conversion into another type, returning a `Result`. ### Method POST ### Endpoint /api/type/try_into ### Parameters #### Request Body - **self** (T) - Required - The value to convert. ### Request Example ```json { "self": "some_value" } ``` ### Response #### Success Response (200) - **result** (Result) - The result of the conversion. `U` is the target type and `Error` is the conversion error type. #### Response Example ```json { "result": { "Ok": "converted_value" } } ``` ## POST /api/type/to_owned ### Description Creates owned data from borrowed data, usually by cloning. ### Method POST ### Endpoint /api/type/to_owned ### Parameters #### Request Body - **borrowed_data** (T) - Required - The borrowed data to create an owned version from. ### Request Example ```json { "borrowed_data": "some_borrowed_string" } ``` ### Response #### Success Response (200) - **owned_data** (T) - The owned data created from the borrowed data. #### Response Example ```json { "owned_data": "owned_string" } ``` ## POST /api/type/clone_into ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method POST ### Endpoint /api/type/clone_into ### Parameters #### Request Body - **borrowed_data** (T) - Required - The borrowed data to clone. - **target** (T) - Required - The owned data to be replaced. ### Request Example ```json { "borrowed_data": "new_data", "target": "old_data" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Dynamic and RGB Color Methods Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Failed.html Methods for setting colors at runtime or using specific RGB values. ```APIDOC ## Dynamic and RGB Color Methods ### Description Advanced methods for setting foreground and background colors dynamically or via RGB values. ### Methods - **color(color: Color)**: Set the foreground color at runtime. - **on_color(color: Color)**: Set the background color at runtime. - **fg_rgb()**: Set the foreground color to a specific RGB value. - **bg_rgb()**: Set the background color to a specific RGB value. ``` -------------------------------- ### Define a benchmark trial Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/struct.Trial.html Use `Trial::bench` to create a benchmark. The runner function receives a `test_mode` boolean. When `test_mode` is true, run code once without measuring. When false, perform actual benchmarking and return a `Measurement` or `Err(Failed)`. ```rust pub fn bench(name: impl Into, runner: R) -> Trial where R: FnOnce(bool) -> Result, Failed> + Send + 'static, ``` -------------------------------- ### Function: test Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/harness/fn.test.html Executes a SQL logic test file using the provided database connection factory. ```APIDOC ## Function: test ### Description Executes a SQL logic test file against a database connection created by the provided factory. ### Signature `pub fn test(filename: impl AsRef, make_conn: impl MakeConnection) -> Result<(), Failed>` ### Parameters - **filename** (impl AsRef) - Required - The path to the sqllogictest file to be executed. - **make_conn** (impl MakeConnection) - Required - A factory object that implements the MakeConnection trait to provide database connections for the test. ``` -------------------------------- ### OwoColorize Black Background Implementation Source: https://docs.rs/sqllogictest/0.29.1/sqllogictest/parser/enum.Connection.html Changes the background color to black. ```rust fn on_black(&self) -> BgColorDisplay<'_, Black, Self> ```