> ## 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_tinybird

> Export data to Tinybird. 

## 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 Tinybird datasource

      ```stan theme={null}
      export_to_tinybird(ds, {"integration": "MY_TINYBIRD_INTEGRATION", "datasource": "user_events"})
      ```
    </Tab>

    <Tab title="Example 2">
      Replace an existing Tinybird datasource

      ```stan theme={null}
      export_to_tinybird(ds, {"integration": "MY_TINYBIRD_INTEGRATION", "datasource": "user_events", "if_exists": "replace"})
      ```
    </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_tinybird(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>
    Tinybird Integration to be used.
  </ParamField>

  <ParamField path="datasource" type="string" required>
    Data Source.
  </ParamField>

  <ParamField path="if_exists" type="string" default="fail">
    Configures this step's behaviour in case the datasource already exists.
    If you want to override the existing datasource you can use `replace`, but keep in mind this deletes your previous data.
    Otherwise if your desired outcome is to append the dataset's rows to the datasource you can use `append`.

    The default value is set to `fail` to prevent you from accidentally losing data or compromising a datasource's structure.

    Values must be one of the following:

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