What you will be able to do
- Explain how the Snowflake CLI (snow) differs from the legacy SnowSQL client
- Install snow and define named connections, including key-pair authentication, in config.toml
- Sign in to Snowflake from the VS Code extension, browse objects, and run SQL files without leaving the editor
1.Snowflake CLI versus SnowSQL
Snowflake has two command-line clients, and only one is still developed. Snowflake CLI, run as snow, is the preferred client for new installs and new work. It is open source and built for developer workloads as well as SQL. SnowSQL is the legacy client, for SQL queries, DDL, DML, and loading or unloading data. New features go only into Snowflake CLI. SnowSQL 1.5.x is supported through April 16, 2028, and there is a migration path from SnowSQL to snow.
The two tools differ in scope as well as age. SnowSQL runs SQL. Snowflake CLI also creates, deploys and manages applications. Its top-level commands include streamlit, app for Snowflake Native Apps, spcs for Snowpark Container Services, snowpark for procedures and functions, git, stage, notebook, cortex, and sql for plain queries. That reach is why it fits CI/CD and automated deployment: deployment artifacts are uploaded to stages for you.
| Aspect | Snowflake CLI (snow) | SnowSQL |
|---|---|---|
| Status | Preferred client for new installs and new work | Legacy client, 1.5.x supported through April 16, 2028 |
| Scope | SQL plus Streamlit, Native Apps, Snowpark Container Services, Snowpark, Git, stages | SQL queries, DDL, DML, loading and unloading data |
| New features | All new features and enhancements | None |
| Licence | Open source | Not stated |
Checkpoint 1 of 7· Check yourself
A team is choosing one command-line client for new work. It must run SQL and also deploy Streamlit apps and Snowflake Native Apps from a CI/CD pipeline, and they want a tool that will keep getting new features. What should they pick?
Snowflake CLI is the preferred client and the only one that gets new features. It covers Streamlit, Native Apps, Snowpark and SPCS as well as SQL. SnowSQL is the legacy SQL client. Its support date only means it stays supported until then; it gets no new features.
“SnowSQL is a legacy command-line client. Snowflake will only add new features and enhancements to Snowflake CLI.”Source: docs.snowflake.com
Checkpoint 2 of 7· Exam question
What is the primary distinction between the Snowflake CLI and SnowSQL?
Correct answer: A — Snowflake CLI is a broader developer tool for Streamlit, Native Apps, Snowpark Container Services, and Git, while SnowSQL only runs SQL statements.
- A. Snowflake CLI was purpose-built for developer-centric workloads beyond plain SQL, adding command groups for Streamlit, Native Apps, Snowpark Container Services, and Git repositories, while SnowSQL remains focused on executing SQL statements interactively.
- B. SnowSQL is the older, SQL-only command-line client, not a newer container-focused tool, and Snowflake CLI is not limited to ad-hoc queries, so this reverses the actual relationship between the two tools.
- C. Neither tool is scoped to billing or account administration; both are developer-facing command-line clients for SQL and, in the CLI's case, broader application workloads, so this description misrepresents both tools.
- D. Snowflake CLI, not SnowSQL, is the tool that uses connections.toml, and it supports multiple authentication methods including key-pair and SSO rather than a single hardcoded password, so this reverses and misstates the facts.
2.Installing the snow CLI
Binary installs through a package manager are the recommended method. On macOS, use Homebrew: either the community snowflake-cli formula, which may lag behind the newest release, or Snowflake's own tap, which publishes a pre-built cask with every release. On Linux, install the .deb package (Debian, Ubuntu) or the .rpm package (RHEL, CentOS, Fedora) from the Snowflake CLI repository. AIX is not supported. Whatever the platform, running snow --help afterwards confirms the install and lists the command groups.
brew install snowflake-cliInstalling the binary does not give you access. You also need a Snowflake account with privileges for whatever you plan to do, and a configured connection. If your account requires MFA, expect a prompt for approval on every snow command. MFA caching cuts that to one authentication every four hours. Snowflake CLI also runs code from your project directory and from remote URLs, so only run it against projects and SQL sources you trust.
Checkpoint 3 of 7· Fill the gap
You are installing the actively developed command-line client on macOS with the community Homebrew formula. Which package name completes the command?
brew install ? The Homebrew formula is called snowflake-cli. The tool it installs runs as snow, which is why snow --help confirms the install. SnowSQL is the legacy client and does not get new features.
Sources3
3.Named connections in config.toml
A connection definition is a named block of connection parameters. snow reads these blocks from the [connections] section of config.toml (or from connections.toml). Each block is [connections.<name>]. Besides credentials, the block holds defaults for the session: warehouse, database and schema. This is where the CLI keeps the context that a Snowsight worksheet keeps in its selectors; context itself is covered in Session context and SQL variables.
[connections.myconnection]
account = "myaccount"
user = "jondoe"
password = "password"
warehouse = "my-wh"
database = "my_db"
schema = "my_schema"To choose which connection runs by default, set default_connection_name = "myconnection" at the top of the file. It does not work inside a connection block. You can also skip config files entirely with --temporary-connection. When the same parameter is set in more than one place, snow takes the value from the highest-ranked source in the table below. A password hard-coded in the file, like the one above, is the weakest choice: Snowflake strongly recommends putting it in SNOWFLAKE_CONNECTIONS_<NAME>_PASSWORD or SNOWFLAKE_PASSWORD instead.
| Priority | Source | Example |
|---|---|---|
| 1 | Command-line parameters | --private-key-file on snow connection add |
| 2 | Environment variables overriding a specific config.toml parameter | SNOWFLAKE_CONNECTIONS_MYCONNECTION_PASSWORD |
| 3 | Connections defined in config.toml or connections.toml | [connections.myconnection] |
| 4 | Generic environment variables | SNOWFLAKE_USER |
The authentication method also goes in the connection definition. A CI job cannot type a password or approve an MFA push, so key-pair authentication is the usual fit. Set authenticator = "SNOWFLAKE_JWT" and give the key path in private_key_file, for example [connections.jwt] with private_key_file = "~/sf_private_key.p8". You can also pass --authenticator SNOWFLAKE_JWT --private-key-file to snow connection add. Other supported methods include OAuth, MFA with caching, SSO, an external browser, a programmatic access token, and workload identity federation. They are compared in Authentication: SSO/federated, MFA, OAuth, key-pair.
Checkpoint 4 of 7· Check yourself
In Snowsight you set Settings » Preferences » Default warehouse to ANALYTICS_WH. On your laptop, snow sql runs with the [connections.myconnection] block in config.toml, and that block sets warehouse = "my-wh". No command-line option or environment variable sets a warehouse. Which warehouse does the CLI session use, and why?
A named connection in config.toml holds the session defaults (warehouse, database and schema) as well as credentials. It does the job for the CLI that a worksheet's context selector does in Snowsight. Snowsight preferences and worksheet selectors only apply inside Snowsight.
“A connection definition is a collection of connection-related parameters.”Source: docs.snowflake.com
Sources4
4.Connecting from VS Code with the Snowflake extension
The Snowflake extension for Visual Studio Code lets you write and run Snowflake SQL inside the editor. It also adds debugging, syntax highlighting and SQL autocomplete in Snowpark Python code. Install it from the Visual Studio Marketplace: go to Code > Settings > Extensions, search for Snowflake, check for the Snowflake badge, and select Install. Without marketplace access, download a .vsix file from the extension's Version History tab and choose More (…) > Install from VSIX.
You must sign in before you can do anything. Select the Snowflake icon in the Activity Bar. The first time, enter your account identifier or connection URL. Then pick an auth method: single sign-on, username/password, or key pair. OAuth is set up in the connections.toml file instead. After sign-in, the sidebar shows your account, your default role, the OBJECT EXPLORER and QUERY HISTORY. Use the dropdowns in the Account section to change role, database, schema and warehouse. The current session's role, database, schema and active warehouse are always on display.
The extension can use the same connection files as the command line. Snowflake: Edit Connections File in the Account pane opens connections.toml, so connections you define for snow also appear in VS Code. The extension can also read an older SnowSQL config: set Snowsql Config Path in the extension's user settings. It only reads the connection values from that file and ignores everything else. For new work, Snowflake recommends Snowflake CLI config.toml connections over SnowSQL files.
Checkpoint 5 of 7· Check yourself
When you sign in with the Snowflake extension for VS Code, the Auth Method list offers only Single sign-on, Username/password and Key Pair. Your team already uses OAuth connections with snow. How do you sign in to the extension with OAuth?
You set up OAuth for the extension in connections.toml, not in the sign-in list. The extension shares that file with snow, so your existing OAuth connections work there too. Snowsql Config Path is only for reading connection values from a legacy SnowSQL config file.
“Use OAuth authentication in your connections.toml configuration file.”Source: docs.snowflake.com
Sources5
5.Browsing objects and running SQL in VS Code
The OBJECT EXPLORER brings the database browser into the editor. Expand a database, then a schema, then the object you want. Selecting it shows its properties in the Query Results pane. Open data preview shows up to 100 rows of a table, view or materialized view, and Show SQL shows the object's SQL. Stages appear in the same tree: you can list staged files and manage them, and file uploads work for internal stages only. All other stage operations work on both internal and external stages.
SQL lives in files. Create a file of type Snowflake SQL File, or open an existing .sql file. Execute All Statements runs the whole file. Place the cursor on one statement and select Execute to run just that one, or select several to run them top to bottom. You can cancel a running query from QUERY HISTORY. Results open in the Snowsight results viewer, which shows up to 1 million rows. From there you can sort, hide or freeze columns, or save to CSV or gzip.
Checkpoint 6 of 7· Check yourself
A deployment script runs an INSERT and then calls LAST_QUERY_ID() to log the ID of that INSERT. It logs the right ID when run in a Snowsight worksheet. Run as a Snowflake SQL File through the VS Code extension, it logs a different ID. What explains this?
To display results, the extension runs DESC RESULT '<query_id>' in the background after every query. That hidden statement becomes the most recent query, so LAST_QUERY_ID() points at it rather than at your INSERT.
“the VS Code extension automatically runs DESC RESULT '<query_id>' in the background after every query. This process makes LAST_QUERY_ID() inaccurate.”Source: docs.snowflake.com
Checkpoint 7 of 7· Exam question
A data engineer is writing a Snowpark Python script in Visual Studio Code and wants to browse the target database's schemas, preview up to 100 rows of a table, and inspect its DDL without leaving the editor. What should they use?
Correct answer: A — Use the Snowflake extension's Object Explorer to browse databases and schemas, preview up to 100 rows, and inspect table DDL inline.
- A. The Object Explorer in the Snowflake VS Code extension is built for this exact task: browsing databases and schemas, previewing up to 100 rows of a table, and viewing object DDL, all without leaving the editor.
- B. Switching to a browser tab for Snowsight would work for inspecting the table, but it breaks the requirement of staying inside the editor, making it a less direct fit than the built-in extension feature.
- C. Running SnowSQL commands in a separate terminal also requires leaving the editor context and typing raw SQL manually instead of using the graphical browsing the engineer wants.
- D. The Snowflake CLI can describe objects from a terminal, but it still requires manually typing commands rather than providing the graphical row preview and DDL view the engineer is asking for.
Sources5
Practise it for real
Install the Snowflake CLI, define a named default connection, and run a query through it.
1.Run
brew install snowflake-clion macOS, or install the .deb or .rpm package on Linux.Why: A package-manager binary is the recommended way to install snow.
You should see: The install finishes without errors.
2.Run
snow --help.Why: This checks that the binary is on your PATH and shows the command groups.
You should see: Usage text listing commands such as app, connection, sql, stage and streamlit.
3.In config.toml, add a
[connections.myconnection]block with account, user, warehouse, database and schema, and putdefault_connection_name = "myconnection"at the top of the file.Why: The named block keeps your credentials and session defaults together, and the top-level setting makes it the connection snow uses by default.
You should see: The file has one top-level setting followed by the connection block.
4.Export your password as
SNOWFLAKE_CONNECTIONS_MYCONNECTION_PASSWORDinstead of writing it in the file.Why: Snowflake recommends environment variables for passwords, and this one outranks the value in config.toml.
You should see: The config file contains no plaintext password.
5.Run
snow sql -q "select 42".Why: This proves the default connection authenticates and can run a query on its warehouse.
You should see: A one-row result table showing 42.
Stuck? Get a nudge
If authentication fails in a job with no one at the keyboard, switch the block to authenticator = "SNOWFLAKE_JWT" with a private_key_file path.
Sources
(5)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Snowflake CLI is the preferred command-line client for new installs and new work.”
↩︎ Snowflake CLI versus SnowSQL“across workloads such as Streamlit in Snowflake, the Snowflake Native App Framework, Snowpark Container Services, and Snowpark.”
↩︎ Snowflake CLI versus SnowSQL“Snowflake supports SnowSQL 1.5.x through April 16, 2028.”
↩︎ Snowflake CLI versus SnowSQL“Snowflake will only add new features and enhancements to Snowflake CLI.”
↩︎ Exam trap 1“SnowSQL is a legacy command-line client. Snowflake will only add new features and enhancements to Snowflake CLI.”
↩︎ Checkpoint - 2.
“SnowSQL is a legacy command-line client for SQL queries, DDL, DML, and loading or unloading data.”
↩︎ Snowflake CLI versus SnowSQL - 3.
“Note that Snowflake CLI is not currently available for AIX systems.”
↩︎ Installing the snow CLI“You can use MFA caching to require authentication only once every four hours.”
↩︎ Installing the snow CLI - 4.https://docs.snowflake.com/en/developer-guide/snowflake-cli/connecting/configure-connectionsOfficial docs
“Connection definitions are stored in the [connections] section of the config.toml file”
↩︎ Named connections in config.toml“set the authenticator parameter to SNOWFLAKE_JWT and provide the path to the file with your private key”
↩︎ Named connections in config.toml“You cannot include it within a connection definition.”
↩︎ Exam trap 2 - 5.https://docs.snowflake.com/en/user-guide/vscode-extOfficial docs
“write and execute Snowflake SQL statements directly in VS Code”
↩︎ Connecting from VS Code with the Snowflake extension“You can use the Account section of the Side Bar pane to select roles, databases, schemas, and warehouses.”
↩︎ Connecting from VS Code with the Snowflake extension“For new work, Snowflake recommends Snowflake CLI config.toml connections.”
↩︎ Connecting from VS Code with the Snowflake extension“to display the SQL code associated with the object”
↩︎ Browsing objects and running SQL in VS Code“This supports the display of up to 1 million rows.”
↩︎ Browsing objects and running SQL in VS Code“This process makes LAST_QUERY_ID() inaccurate.”
↩︎ Exam trap 3“only supports uploads for internal stages, all other operations work for both internal and external stages.”
↩︎ Exam trap 4“A connection definition is a collection of connection-related parameters.”
↩︎ Checkpoint“Use OAuth authentication in your connections.toml configuration file.”
↩︎ Checkpoint“to display a preview of up to 100 rows of content associated with a table, view, materialized view, or similar object”
↩︎ Prediction“the VS Code extension automatically runs DESC RESULT '<query_id>' in the background after every query. This process makes LAST_QUERY_ID() inaccurate.”
↩︎ Checkpoint