> For the complete documentation index, see [llms.txt](https://docs.soda.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.soda.io/onboard-data-sources-and-datasets/via-soda-core.md).

# Via Soda Core

> Go to the [data source reference for Soda Core](/reference/data-source-reference-for-soda-core.md) for more in-depth details about supported data sources and connection parameters.

**A data source can be partially onboarded** programmatically via Soda Core. Once a data source is fully onboarded via Soda Cloud, the engineering team can onboard datasets programmatically.

In a nutshell, a dataset is pushed onto Soda Cloud by:

1. Creating a contract YAML that points to that dataset
2. Pushing the results of the contract onto Soda Cloud

{% hint style="warning" %}
**Soda does not support pushing a full data source configuration programmatically**. This flow will create an empty data source that needs to be configured later in Soda Cloud.
{% endhint %}

## Partially onboard a data source via CLI

This flow shows how to partially onboard a data source programmatically in order to finish setting it up in Soda Cloud.

{% stepper %}
{% step %}

#### Set up your connections

Follow the [CLI reference](/reference/cli-reference.md) to:

1. Perform [**installation**](/reference/cli-reference.md#installation) **steps**
2. [**Connect to Soda Cloud**](/reference/cli-reference.md#connect-to-soda-cloud)
3. [**Configure a data source**](/reference/cli-reference.md#configure-a-data-source)
   {% endstep %}

{% step %}

#### Create a contract

Run the following:

{% code overflow="wrap" %}

```shellscript
soda contract create --dataset datasource/db/schema/table --file contract.yaml --data-source ds_config.yml --soda-cloud sc_config.yml
```

{% endcode %}

{% hint style="warning" %}
Unlike the `create` command in the CLI reference, to push a data source via CLI **you must not use the `--use-runner` flag**.

**The `--use-runner` flag** would attempt to find the data source in Soda Cloud, which has not been yet set up in your environment at this time.
{% endhint %}

**When should I use the `--use-runner` flag?**

In some organizations, the data source Admin can create the data source connection in Soda Cloud without onboarding any datasets. Then, **engineers can create and publish new contracts to onboard datasets via CLI**. Since the data source exists already in Soda Cloud, the `--use-runner` flag should be used so that the datasets are pushed from Soda Core onto the existing data source through the Runner.
{% endstep %}

{% step %}

#### Test, verify & publish the contract

1. **Test that the contract is correct**

   ```shellscript
   soda contract test --contract contract.yaml
   ```
2. **Verify the contract**

   ```shellscript
   soda contract verify --contract contract.yaml --data-source ds_config.yml
   ```
3. **Publish the contract**

   ```shellscript
   soda contract publish --contract contract.yaml --soda-cloud sc_config.yml
   ```

{% endstep %}
{% endstepper %}

<i class="fa-octagon-check">:octagon-check:</i> After successfully publishing the contract, you will see a success output:

```
  __|  _ \|  \   \\
\__ \ (   |   | _ \\
____/\___/___/_/  _\\ CLI v4.0.4b24
Fetching datasets configurations from Soda Cloud for datasets '[DatasetIdentifier(data_source='CLI_testing', prefixes=['postgres', 'aldi_local'], dataset='retail_orders')]'
Verifying contract 📜 contract.yaml 🤞

### Contract results for CLI_testing/postgres/aldi_local/retail_orders
+-----------------+-----------------------------------+-------------------------------+-----------+---------------+   
| Column          | Check                             | Threshold                     | Outcome   | Diagnostics   |   
+=================+===================================+===============================+===========+===============+   
| [dataset-level] | Schema matches expected structure | level: fail                   | ✅ PASSED |               |   
|                 |                                   | must be less than or equal: 0 |           |               |   
+-----------------+-----------------------------------+-------------------------------+-----------+---------------+   
# Summary:
|----------------|---|----|
| Checks         | 1 |    |
| Passed         | 1 | ✅ |
| Failed         | 0 | ✅ |
| Warned         | 0 | ✅ |
| Not Evaluated  | 0 | ✅ |
| Excluded       | 0 | ✅ |
| Runtime Errors | 0 | ✅ |

👌 Results sent to Soda Cloud
To view the dataset on Soda Cloud, see https://cloud.us.soda.io/o/<datasetID>/datasets/ab1bc55d-c49a-441e-a0dc-c01857c71b21
Updating post processing stage 'diagnosticWarehouse' to state 'completed' for scan <scanID>
Updated post processing stage 'diagnosticWarehouse' to state 'completed' for scan <scanID>

```

## Complete onboarding via Soda Cloud

{% hint style="info" %}
A data source **must be connected to Soda Runner** to access contract verification in Soda Cloud. Connection to Soda Runner is performed via Soda Cloud.
{% endhint %}

* If you attempt to use contract verification, you will find the following warning:

  <figure><img src="/files/ipx2SnmxC4YS2RDbByDu" alt=""><figcaption></figcaption></figure>
* If you attempt to access Metric Monitoring capabilities in Soda Cloud, you will find the following warning:

  <figure><img src="/files/DBw8zkcj8lg1i59F8LYD" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**In order to finish the onboarding,** [**complete the connection in Soda Cloud**](/onboard-data-sources-and-datasets/onboard-datasets-on-soda-cloud.md#connect-a-data-source-onboarded-with-soda-core-to-an-agent)**.**
{% endhint %}

***

{% if visitor.claims.plan === 'datasetStandard' %}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Dataset Standard license** documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).
{% endhint %}
{% endif %}

{% if visitor.claims.plan === 'enterprise' %}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Team license** documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).
{% endhint %}
{% endif %}

{% if visitor.claims.plan === 'enterpriseUserBased' %}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Enterprise license** documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).
{% endhint %}
{% endif %}

{% if !(visitor.claims.plan === 'enterprise' || visitor.claims.plan === 'enterpriseUserBased' || visitor.claims.plan === 'datasetStandard') %}
{% hint style="info" %}
You are **not logged in to Soda** and are viewing the default public documentation. Learn more about [Documentation access & licensing](/reference/documentation-access-and-licensing.md).

If you do have a Soda license, make sure to **log in to Soda Cloud in this same browser**.
{% endhint %}
{% endif %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.soda.io/onboard-data-sources-and-datasets/via-soda-core.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
