Cube is a headless BI platform that makes data accessible and consistent across every application. It provides data modeling, access control, caching, and a variety of APIs (SQL, GraphQL, and REST) on top of any data warehouse, database, or query engine, including Materialize.

In this guide, we’ll cover how to connect and configure a Cube Cloud deployment to Materialize.


Create and configure Cube

  1. Login to Cube and create a deployment

    Match the regions to improve latency.

  2. Set up the Cube project

    You will have the following options to build the project:
    • CLI
    • Github repository
    • Create from scratch

    Click on the create from scratch option to be align with this guide.

  3. Configure the connection to Materialize

    Use Cube’s connector for Materialize and fill in the fields.

    Field Value
    Host Materialize host name.
    Port 6875
    Database username Materialize user.
    Database password App-specific password.
  4. Configure the default database

    Configure the database name as follows:
    i. Access Settings
    ii. Click on Configuration
    iii. Add CUBEJS_DB_NAME as an environment variable with materialize as a value.

Set and use the schema

  1. Build the schema

    You can rely on Cube to infer the schema or do it manually. Cube will figure out Materialize’s schema and try to obtain the dimensions, measures, primary keys, and joins.

  2. You are all set!

    Head to the Playground and start interacting with Materialize.

Back to top ↑