Skip to main content

Create and Connect to a SQL Cluster

Create a SQL Cluster

Prerequisite: Set Up a Lock Provider

Follow these steps to set up a lock provider for your Onehouse project.

Create the Cluster

  1. In the Onehouse console, navigate to the Clusters page.
  2. Click 'Add new Cluster'.
  3. Select 'SQL' as the Cluster type.
  4. After the Cluster is provisioned (which may take a few minutes), you will see a SQL Cluster endpoint in the Onehouse console. sql_endpoint_url

Connect to a SQL Cluster Endpoint

Apache Spark compatibility

SQL Clusters are Apache Spark compatible, so you can connect with any client or tool that supports the Apache Spark JDBC driver, such as beeline, dbt Core, Apache Airflow, or DbVisualizer.

Connect from within the VPC

By default, SQL Clusters only accept traffic from within your VPC. You can submit queries to a SQL Cluster endpoint from clients within your VPC.

To submit queries with SQL clients outside the VPC, such as your local machine, follow these steps to connect through a VPN or bastion host.

See the SQL integrations page for examples of connecting and submitting queries with SQL clients.

Connect cloud tools

By default, SQL Clusters do not accept traffic from outside your VPC. For cloud tools that support SSH tunneling, follow these steps to connect through a bastion host.

If you must connect through a cloud tool outside the VPC that does not support SSH tunneling, such as dbt Cloud, please contact Onehouse support.

Use the Onehouse SQL Editor

Beta Feature

This feature is in beta, and might not yet be available in your project.

Onehouse offers a browser-based SQL editor to submit queries to any active SQL Cluster.

  1. First, ensure you have access to a SQL Cluster in the Running state.
  2. In the Onehouse console, open the SQL Editor page.
  3. Click 'Add New Query'.
    1. Select the Query Type 'SQL'.
    2. Select a SQL Cluster from the dropdown.
  4. Write and run your query.