SnowSQL
Introduction
Section titled “Introduction”SnowSQL is a command-line client for Snowflake that allows you to interact with the Snowflake service using SQL commands. SnowSQL provides a wide range of features, such as executing SQL statements, loading data, unloading data, and more.
The Snowflake emulator supports SnowSQL, allowing you to interact with the Snowflake emulator using the same commands and syntax as the Snowflake service. You can use SnowSQL to connect to the Snowflake emulator, execute SQL commands, and manage Snowflake resources locally, such as databases, schemas, tables, stages, and more.
Configuring SnowSQL
Section titled “Configuring SnowSQL”In this guide, you will learn how to configure SnowSQL to interact with the Snowflake emulator.
Install SnowSQL
Section titled “Install SnowSQL”To install SnowSQL, follow the instructions in the official SnowSQL documentation.
Start SnowSQL
Section titled “Start SnowSQL”To start SnowSQL, execute the following command:
export SNOWSQL_PWD=testsnowsql \ -a test \ -u test \ -h snowflake.localhost.localstack.cloud \ -p 4566 \ -d test \ -w test \ -r test \ -s testIn the above command:
-aspecifies the account name.-uspecifies the username.-hspecifies the host name.-pspecifies the port number.-dspecifies the database name.-wspecifies the warehouse name.-rspecifies the role name.-sspecifies the schema name.
After a successful configuration, you can use SnowSQL to interact with the Snowflake emulator.
* SnowSQL * v1.2.32Type SQL statements or !helptest#test@test.test>Run SQL commands
Section titled “Run SQL commands”You can execute SQL commands using SnowSQL. For example, to create a new database, execute the following command:
CREATE DATABASE test_db;+----------------------------------------+| status ||----------------------------------------|| Database TEST_DB successfully created. |+----------------------------------------+0 Row(s) produced. Time Elapsed: 0.198s