Skip to content

Snowflake CLI

The standard Snowflake command-line tool works with Embucket through its Snowflake-compatible REST API.

Before you begin, make sure you have the following:

  • Python 3.8 or later installed on your system.

  • Snowflake CLI installed:

    Terminal window
    python -m pip install snowflake-cli
  • A running Embucket instance. Start one locally with Docker or deploy to AWS Lambda.

  1. Find your configuration file

    Run the following command to locate your Snowflake CLI configuration file:

    Terminal window
    snow --info

    Open the configuration file and add the following connection block:

    [connections.local]
    host = "localhost"
    region = "us-east-2"
    port = 3000
    protocol = "http"
    database = "embucket"
    schema = "public"
    warehouse = "em.wh"
    account = "acc.local"
    user = "embucket"
    password = "embucket"
  2. Test the connection

    Verify that the Snowflake CLI can reach your Embucket instance:

    Terminal window
    snow connection test -c local

    A successful connection produces the following output:

    +--------------------------------------------------------+
    | key | value |
    |-----------------+--------------------------------------|
    | Connection name | local |
    | Status | OK |
    | Host | localhost |
    | Account | acc.local |
    | User | embucket |
    | Role | |
    | Database | embucket |
    | Warehouse | em.wh |
    +--------------------------------------------------------+
  3. Run a query

    Execute a SQL query through the Snowflake CLI:

    Terminal window
    snow sql -c local -q "SELECT 1 AS ok"

    The query returns the following result:

    +----+
    | OK |
    |----|
    | 1 |
    +----+
ProblemSolution
Protocol or TLS (Transport Layer Security) errorsSet protocol = "http" in your connection block. Embucket doesn’t require TLS for local connections.
Authentication failuresUse embucket for both the user and password fields.
Connection refusedConfirm that your Docker container runs and listens on port 3000.
No data returnedConfigure a metastore so Embucket can access your data. See Configuration for details.