/// Creates a recipe from a set of SQL queries in a string (e.g., read from a file).
/// Note that the recipe is not backed by a Soup data-flow graph until `activate` is called on
/// it.
// crate viz for tests
Creates a recipe from a set of SQL queries in a string .
Note that the recipe is not backed by a Soup data-flow graph until `activate` is called on
it.
crate viz for tests
Creates a recipe from a set of SQL queries in a string . Note that the recipe is not backed by a Soup data - flow graph until ` activate ` is called on it . crate viz for tests
pub(crate) fn from_str(recipe_text: &str, log: Option<slog::Logger>) -> Result<Recipe, String> {
        // remove comment lines
        let lines: Vec<String> = recipe_text
            .lines()
            .map(str::trim)
            .filter(|l| !l.is_empty() && !l.starts_with('#') && !l.starts_with("--"))
            .map(String::from)
            .collect();
        let cleaned_recipe_text = lines.join("\n");
        // parse and compute differences to current recipe
        let parsed_queries = Recipe::parse(&cleaned_recipe_text)?;
        Ok(Recipe::from_queries(parsed_queries, log))
    }
pub ( crate ) fn from_str ( recipe_text : & str , log : Option < slog :: Logger > ) -> Result < Recipe , String > { // remove comment lines let lines : Vec < String > = recipe_text . lines ( ) . map ( str :: trim ) . filter ( | l | ! l . is_empty ( ) && ! l . starts_with ( '#' ) && ! l . starts_with ( " " ) ) . map ( String :: from ) . collect ( ) ; let cleaned_recipe_text = lines . join ( " \n " ) ; // parse and compute differences to current recipe let parsed_queries = Recipe :: parse ( & cleaned_recipe_text ) ? ; Ok ( Recipe :: from_queries ( parsed_queries , log ) ) }
Creates a recipe from a set of SQL queries in a string (e.g., read from a file).
Creates a recipe from a set of SQL queries in a string ( e . g . read from a file ) .
recipe_text
&str
log
Option<slog::Logger>