snow connection add¶
添加与配置文件的连接。
语法¶
snow connection add
--connection-name <connection_name>
--account <account>
--user <user>
--password <password>
--role <role>
--warehouse <warehouse>
--database <database>
--schema <schema>
--host <host>
--port <port>
--region <region>
--authenticator <authenticator>
--private-key <private_key_file>
--token-file-path <token_file_path>
--default
--no-interactive
--format <format>
--verbose
--debug
--silent
实参¶
无
选项¶
--connection-name, -n TEXT
新连接的名称。
-a, --account, --accountname TEXT
使用 Snowflake 进行身份验证时使用的账户名。
-u, --user, --username TEXT
连接到 Snowflake 的用户名。
-p, --password TEXT
Snowflake 密码。
-r, --role, --rolename TEXT
在 Snowflake 上使用的角色。
-w, --warehouse TEXT
在 Snowflake 上使用的仓库。
-d, --database, --dbname TEXT
在 Snowflake 上使用的数据库。
-s, --schema, --schemaname TEXT
在 Snowflake 上使用的架构。
-h, --host TEXT
连接尝试连接到 Snowflake 的主机名。
-P, --port INTEGER
主机上要与之通信的端口。
--region, -R TEXT
如果不是默认 Snowflake 部署,则使用区域名称。
-A, --authenticator TEXT
如果不是基于密码,则选择身份验证器。
--private-key, -k, --private-key-file, --private-key-path TEXT
包含私钥的文件路径。
-t, --token-file-path TEXT
连接到 Snowflake 时应使用的带有 OAuth 令牌的文件路径。
--default
如果提供,连接将配置为默认连接。默认值:False。
--no-interactive
禁用提示。默认值:False。
--format [TABLE|JSON]
指定输出格式。默认:TABLE。
--verbose, -v
显示日志级别
info
及更高级别的日志条目。默认值:False。--debug
显示日志级别
debug
及更高级别的日志条目;调试日志包含其他信息。默认值:False。--silent
关闭到控制台的中间输出。默认值:False。
--help
显示此命令的帮助文本。
使用说明¶
snow connection add
命令会将连接添加到默认 config.toml
文件中。有关更多信息,请参阅 配置 Snowflake CLI 和连接到 Snowflake。
示例¶
要添加连接,请运行以下命令:
snow connection add
Enter connection name: <connection_name>
Enter account: <account>
Enter user: <user-name>
Enter password: <password>
Enter role: <role-name>
Enter warehouse: <warehouse-name>
Enter database: <database-name>
Enter schema: <schema-name>
Enter host: <host-name>
Enter port: <port-number>
Enter region: <region-name>
Enter authenticator: <authentication-method>
Enter private key file: <path-to-private-key-file>
Enter token file path: <path-to-mfa-token>
Do you want to configure key pair authentication? [y/N]: y
Key length [2048]: <key-length>
Output path [~/.ssh]: <path-to-output-file>
Private key passphrase: <key-description>
Wrote new connection <connection-name> to config.toml
Wrote new connection my_conn to <user-home>/.snowflake/config.toml