# Transform Data with dbt

The `dbt-singlestore` adapter can be used to connect with your SingleStore Helios database to build data transformation pipelines using dbt. dbt provides a development environment to create transformation workflows on data that is already in SingleStore Helios, which dbt turns into tables and views through `SELECT` statements. See [dbt documentation](https://docs.getdbt.com/docs/introduction) for more information.

## Prerequisites

Refer to the [dbt-singlestore](https://github.com/memsql/dbt-singlestore?tab=readme-ov-file#testing-and-supported-versions) GitHub repository for the compatibility matrix between SingleStore and dbt.

## Download and Install the SingleStore dbt Adapter

You can [download](https://pypi.org/project/dbt-singlestore/#files) the `dbt-singlestore` adapter from the Python Package Index repository (PyPI). Run the following command to install the adapter available on PyPI:

```shell
pip install dbt-singlestore
```

You can also install the package from GitHub:

```shell
pip install git+https://github.com/memsql/dbt-singlestore.git
```

## Configure the SingleStore Profile

dbt uses the **profiles.yml** file as a standard profile for SQL data sources. Here's a sample configuration:

```YAML
default:
  outputs:
    dev:
      type: singlestore
      host: <database_host>  
      port: <database_port>  
      user: <database_user>  
      password: <database_user_password>
      database: <database_name>  # required
      schema: <name_for_dbt_internal_processing>  # required
      threads: <number of threads>  # default: 1
  target: dev
```

> **📝 Note**: Always specify the `type` as `singlestore`. You must include the `type` either in **profiles.yml** or **dbt\_project.yml**.

| Configuration | Description                                                                                                                                                                                                                                                   | Required |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| `host`        | The IP address or the hostname of theSingleStore Heliosworkspace.Refer to[SingleStore Helios Endpoints](https://docs.singlestore.com/cloud/connect-to-singlestore/singlestore-helios-endpoints.md)to determine the endpoint (`host:port`) of your deployment. | No       |
| `user`        | TheSingleStore Heliosdatabase username.                                                                                                                                                                                                                       | No       |
| `password`    | Password of theSingleStore Heliosuser.                                                                                                                                                                                                                        | No       |
| `database`    | The name of theSingleStore Heliosdatabase. If you are using custom database names in your model configuration, you must create them before running the models.                                                                                                | Yes      |
| `schema`      | Refer to[Schema and Concurrent Development](https://docs.singlestore.com/#section-idm4573377319940832872801277635.md).                                                                                                                                        | Yes      |
| `threads`     | The number of threads available to dbt.                                                                                                                                                                                                                       | No       |

## Schema and Concurrent Development

In SingleStore Helios, database and schema denote the same concepts. In dbt, a schema refers to a namespace within a database. Therefore, you must specify the `schema` in **profile.yml** for dbt to work with the project metadata.

To support concurrent development, prefix the table names that dbt is building within the database with `schema`. The following macro prefixes the table names with `schema`:

```
{% macro generate_alias_name(custom_alias_name=none, node=none) -%}
    {%- if custom_alias_name is none -%}
        {{ node.schema }}__{{ node.name }}
    {%- else -%}
        {{ node.schema }}__{{ custom_alias_name | trim }}
    {%- endif -%}
{%- endmacro %}
```

For example, if you have a model named `customers` and `schema` is set to `dev`, without this macro, dbt creates a table named `customers` in the database. When this macro is added to the project, dbt creates a table named `dev__customers`.

Refer to [SingleStore Profile](https://docs.getdbt.com/reference/warehouse-profiles/singlestore-profile#schema-and-concurrent-development) for more information.

***

Modified at: October 24, 2025

Source: [/cloud/load-data/integrate-with-singlestore-helios/transform-data-with-dbt/](https://docs.singlestore.com/cloud/load-data/integrate-with-singlestore-helios/transform-data-with-dbt/)

(An index of the documentation is available at /llms.txt)
