Snowflake CLI
The standard Snowflake command-line tool works with Embucket through its Snowflake-compatible REST API.
Prerequisites
Section titled “Prerequisites”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.
Set up the connection
Section titled “Set up the connection”-
Find your configuration file
Run the following command to locate your Snowflake CLI configuration file:
Terminal window snow --infoOpen the configuration file and add the following connection block:
[connections.local]host = "localhost"region = "us-east-2"port = 3000protocol = "http"database = "embucket"schema = "public"warehouse = "em.wh"account = "acc.local"user = "embucket"password = "embucket" -
Test the connection
Verify that the Snowflake CLI can reach your Embucket instance:
Terminal window snow connection test -c localA 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 |+--------------------------------------------------------+ -
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 |+----+
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| Protocol or TLS (Transport Layer Security) errors | Set protocol = "http" in your connection block. Embucket doesn’t require TLS for local connections. |
| Authentication failures | Use embucket for both the user and password fields. |
| Connection refused | Confirm that your Docker container runs and listens on port 3000. |
| No data returned | Configure a metastore so Embucket can access your data. See Configuration for details. |