Coming soon: We’re working on a brand new, revamped Community experience. Want to receive updates? Sign up now!
You can create a "SQL query" recipe with the public API using the `SQLQueryRecipeCreator` object. However, there isn't an equivalent object for a "SQL script" recipe. How can I create a SQL script recipe using the public API?
There is no specific API to create an SQL Script recipe, but you can use the generic SingleOutputRecipeCreator to do it.
Here is an example to create such a recipe:
from dataikuapi.dss.recipe import SingleOutputRecipeCreator
# Create an SQL script recipe
builder = SingleOutputRecipeCreator('sql_script', "my_sql_script_recipe_name", project)
builder = builder.with_input("my_input_ds")
builder = builder.with_output("my_output_ds")
recipe = builder.build()
# Update the SQL script recipe to set its script
recipe_def = recipe.get_definition_and_payload()
recipe_def.set_payload('CREATE TABLE ...')