Skip to content

Connect with Snowflake command-line tool

Learn how to connect Snowflake command-line tool to Embucket. Run SQL queries with familiar Snowflake commands. Leverage your existing Snowflake workflows while accessing Embucket’s data processing capabilities.

This guide covers snowflake-cli configuration to connect to a local Embucket instance and execute SQL queries through the Snowflake-compatible API. This guide covers local development setup only. Production deployments, advanced authentication, and performance optimization remain outside this scope.

  • Set up Snowflake command-line tool for local development
  • Configure connection parameters specific to Embucket’s API
  • Test connectivity with sample data operations

Prerequisites: you need Python 3.8+, Docker, and a running Embucket container.

Install snowflake-cli through Python’s package manager:

Terminal window
pip install snowflake-cli
  1. Create a connection profile

    Add a connection profile—a saved set of connection parameters—for your Embucket instance:

    Terminal window
    snow connection add --connection-name embucket --account local-dev.embucket --user embucket --password embucket --host localhost --port 3000 --region us-east-1
  2. Locate your configuration file

    Find your Snowflake command-line tool configuration file:

    Terminal window
    snow --info

    /Users/[USERNAME]/Library/Application Support/snowflake/config.toml

  3. Update the configuration

    Edit your configuration file. Add the HTTP protocol setting under [connections.embucket]:

    [connections.embucket]
    host = "localhost"
    region = "us-east-1"
    port = 3000
    protocol = "http"
    database = "embucket"
    schema = "public"
    warehouse = "compute-wh"
    password = "embucket"
    account = "local-dev.embucket"
    user = "embucket"

Launch the Embucket container:

Terminal window
docker run --name embucket --rm -p 8080:8080 -p 3000:3000 embucket/embucket
  1. Open the SQL shell

    Connect to Embucket with your configured profile:

    Terminal window
    snow sql -c embucket

    The snowflake-cli shows its interactive shell prompt.

  2. Create sample data

    Test your connection. Create a table and insert sample data:

    CREATE TABLE employees (
    id INT,
    name STRING,
    department STRING,
    salary DECIMAL(10,2)
    );
    INSERT INTO employees VALUES
    (1, 'Alice Johnson', 'Engineering', 95000.00),
    (2, 'Bob Smith', 'Marketing', 75000.00),
    (3, 'Carol Davis', 'Engineering', 98000.00);
  3. Query your data

    Run a query to verify the connection works:

    SELECT * FROM employees;

    Expected output:

    +---------------------------------------------+
    | id | name | department | salary |
    |----+---------------+-------------+----------|
    | 1 | Alice Johnson | Engineering | 95000.00 |
    | 2 | Bob Smith | Marketing | 75000.00 |
    | 3 | Carol Davis | Engineering | 98000.00 |
    +---------------------------------------------+
  • Connection refused or timeout errors: Verify Embucket container runs on ports 3000 and 8080
  • Protocol errors: Check that you set protocol = "http" in your configuration file
  • Authentication failures: Use exactly embucket for both username and password
  • SQL execution errors: Check that you use Snowflake-compatible SQL syntax

Execute advanced workflows with snowflake-cli and Embucket:

  • Execute complex analytical queries with familiar Snowflake SQL dialect syntax
  • Manage databases and schemas through snowflake-cli commands
  • Integrate Embucket into existing Snowflake-based workflows
  • Test Snowflake queries locally before production deployment