> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart with Cockroach Continuum

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

In this tutorial, you will create your first cluster in a Cockroach Continuum organization, connect to it, and run your first SQL queries.

## Before you begin

You need a Cockroach Continuum organization and a running cluster. If you do not have them yet, complete the following steps:

1. <InternalLink path="create-a-continuum-organization">Create a Continuum organization</InternalLink>. New CockroachDB Cloud organizations use Continuum by default and receive free trial credits.
2. <InternalLink path="create-a-cluster">Create a cluster</InternalLink>. The Standard edition is recommended for an evaluation cluster. To compare editions, refer to <InternalLink path="editions-and-add-ons">Editions and Add-Ons</InternalLink>.

To connect and run queries, you also need one of the following clients:

* The CockroachDB CLI (`cockroach`). Continuum clusters run v26.3 or later. To install the CLI, select your operating system in the **Download the latest CockroachDB Client** section of the Cloud Console's **Connect** dialog, then run the provided command on your command line.
* Any PostgreSQL-compatible client, such as `psql`.

## Step 1. Connect to your cluster

Connect from your terminal with the CockroachDB CLI, or from your browser with the Cloud Console SQL Shell. The command line is the primary path; the SQL Shell is a browser alternative that needs no local client.

<Tabs>
  <Tab title="Command line">
    1. In the Cloud Console, select your cluster, then select **Connect** and copy the general connection string. The connection string embeds credentials, so treat it as a secret and never commit it or paste it into examples.

    2. In your terminal, store the connection string in an environment variable so it stays out of your shell history. Replace `<your-connection-string>` in the following command with the value you copied in the previous step:

       ```bash theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       export CONTINUUM_CONNECTION_URL="<your-connection-string>"
       ```

    3. Open the CockroachDB SQL shell:

       ```bash theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       cockroach sql --url "$CONTINUUM_CONNECTION_URL"
       ```

       The terminal displays the SQL shell welcome banner and a prompt that ends with the current database:

       ```
       #
       # Welcome to the CockroachDB SQL shell.
       # All statements must be terminated by a semicolon.
       # To exit, type: \q.
       #
       # Server version: CockroachDB CCL v26.3.0
       # Cluster ID: <cluster-id>
       #
       # Enter \? for a brief introduction.
       #
       <user>@<host>:26257/defaultdb>
       ```

       The `Cluster ID`, user, and host shown are specific to your cluster.

    4. Confirm the connection:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       SELECT 1 AS connected;
       ```

       ```
         connected
       -------------
                 1
       (1 row)
       ```
  </Tab>

  <Tab title="Cloud Console">
    <Note>
      The Cloud Console SQL Shell is in preview and requires the Cluster Admin role. It runs statements as the SQL user `root`, and each statement runs in its own transaction, so transaction control statements (`BEGIN`/`COMMIT`), `SET CLUSTER SETTING`, and `CALL` are not supported. The SQL Shell is not available on Mission Critical clusters that have security add-ons configured.
    </Note>

    1. In the Cloud Console, select your cluster, then open its **SQL Shell** page. You connect in the browser as the SQL user `root`; no connection string or local client is required.
    2. Confirm the connection. Enter the following in the input field, then click **Run**:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       SELECT 1 AS connected;
       ```

       The statement status changes to **Succeeds** and the results show a single row with `connected` set to `1`.
  </Tab>
</Tabs>

## Step 2. Run your first queries

Create a small table, write to it, and read it back, using the SQL shell you opened in the previous step.

<Tabs>
  <Tab title="Command line">
    1. Create a table:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       CREATE TABLE roaches (id INT PRIMARY KEY, name STRING);
       ```

       ```
       CREATE TABLE
       ```

    2. Insert rows:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       INSERT INTO roaches (id, name) VALUES (1, 'Roach One'), (2, 'Roach Two'), (3, 'Roach Three');
       ```

       ```
       INSERT 0 3
       ```

    3. Read the rows back:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       SELECT id, name FROM roaches ORDER BY id;
       ```

       ```
         id |    name
       -----+--------------
          1 | Roach One
          2 | Roach Two
          3 | Roach Three
       (3 rows)
       ```

    4. Remove the table, then exit the shell:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       DROP TABLE roaches;
       ```

       ```
       DROP TABLE
       ```

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       \q
       ```
  </Tab>

  <Tab title="Cloud Console">
    In the SQL Shell input field, enter each statement and click **Run** (or press **Enter**). After each statement, the status changes to **Succeeds** or returns an **Error**. You can copy, edit, and re-run any previous statement, and export any results.

    1. Create a table:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       CREATE TABLE roaches (id INT PRIMARY KEY, name STRING);
       ```

       The status changes to **Succeeds**.

    2. Insert rows:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       INSERT INTO roaches (id, name) VALUES (1, 'Roach One'), (2, 'Roach Two'), (3, 'Roach Three');
       ```

       The status changes to **Succeeds**.

    3. Read the rows back:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       SELECT id, name FROM roaches ORDER BY id;
       ```

       The results show three rows: `1, Roach One`; `2, Roach Two`; and `3, Roach Three`.

    4. Remove the table:

       ```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
       DROP TABLE roaches;
       ```

       The status changes to **Succeeds**. The SQL Shell stays open in your browser; there is no shell to exit.
  </Tab>
</Tabs>

You now have a working cluster and a verified connection.

## What's next

* Work through the <InternalLink path="tutorial-migrate-sample-database">Migrate a Sample Database</InternalLink> tutorial to migrate an existing database with the <InternalLink path="migration-assistant-overview">Migration Assistant</InternalLink>.
* Build an application: refer to <InternalLink path="develop-and-connect-overview">Develop and Connect</InternalLink>.
* See where to go at each stage of your Continuum work in <InternalLink path="get-started-with-continuum">Get Started with Cockroach Continuum</InternalLink>.
