> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# export_to_snowflake

> Export data to Snowflake. 

## Usage

The following examples show how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      Export dataset to a Snowflake table

      ```stan theme={null}
      export_to_snowflake(ds, {"integration": "MY_SNOWFLAKE_INTEGRATION", "database": "ANALYTICS", "schema": "PUBLIC", "table_name": "survey_results"})
      ```
    </Tab>

    <Tab title="Example 2">
      Append rows to an existing Snowflake table

      ```stan theme={null}
      export_to_snowflake(ds, {"integration": "MY_SNOWFLAKE_INTEGRATION", "database": "ANALYTICS", "schema": "RAW", "table_name": "daily_imports", "if_exists": "append"})
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      export_to_snowflake(ds: dataset, {
          "param": value,
          ...
      })
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="ds" type="dataset" required>
    Dataset to be exported.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket" />

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="integration" type="string" required>
    Identifier of the integration to use.
  </ParamField>

  <ParamField path="table_name" type="string" required>
    The name of the table you want to upload data to.
  </ParamField>

  <ParamField path="database" type="string" required>
    The name of the database you want to upload data to.
  </ParamField>

  <ParamField path="schema" type="string" required>
    The name of the schema within the database you want to upload data to.
  </ParamField>

  <ParamField path="if_exists" type="string" default="fail">
    The preferred method for handling existing tables.

    * 'Fail' if there is another table with the same name. The default value is 'fail' to prevent you from accidentally losing your data or compromising a table's structure in your database.
    * 'Replace' if you want to override the existing table. Keep in mind this option deletes your previous data.
    * 'Append' if you want to append the dataset's rows to the table.

    Values must be one of the following:

    * `fail`
    * `replace`
    * `append`
  </ParamField>
</Accordion>
