snow helpers import-snowsql-connections

SnowSQL 구성에서 기존 연결을 가져옵니다.

구문

snow helpers import-snowsql-connections
  --snowsql-config-file <custom_snowsql_config_files>
  --default-connection-name <default_cli_connection_name>
  --format <format>
  --verbose
  --debug
  --silent
  --enhanced-exit-codes
  --decimal-precision <decimal_precision>

인자

없음

선택 사항

--snowsql-config-file FILE

사용자 지정 SnowSQL 구성에 대한 파일 경로를 지정합니다. 이 옵션을 여러 번 사용하여 둘 이상의 파일을 지정할 수 있습니다.

--default-connection-name TEXT

SnowSQL 에서 가져온 기본 연결에 Snowflake CLI 에 지정된 이름을 지정합니다. 기본값: default.

--format [TABLE|JSON| JSON_EXT|CSV]

출력 형식을 지정합니다. 기본값: TABLE.

--verbose, -v

로그 수준 정보 이상에 대한 로그 항목을 표시합니다. 기본값: False.

--debug

로그 수준 디버그 이상에 대한 로그 항목을 표시하며, 디버그 로그에는 추가 정보가 포함됩니다. 기본값: False.

--silent

콘솔로의 중간 출력을 끕니다. 기본값: False.

--enhanced-exit-codes

실패 유형에 따라 종료 오류 코드를 차별화하십시오. 기본값: False.

--decimal-precision INTEGER

Number of decimal places to display for decimal values. Uses Python’s default precision if not specified. [env var: SNOWFLAKE_DECIMAL_PRECISION].

--help

이 명령에 대한 도움말 텍스트를 표시합니다.

사용법 노트

snow helpers import-snowsql-connections 명령은 SnowSQL 에서 기존 연결 정의를 :codenowrap:`config.toml ` 구성 파일로 가져옵니다.

기본적으로 이 명령은 SnowSQL 구성하기 항목에서 설명한 순서대로 SnowSQL 구성 파일을 읽습니다. 이러한 구성 중 둘 이상의 구성이 동일한 연결을 정의하는 경우 이 명령은 이전에 가져온 연결 정의를 가장 최근의 연결 정의로 덮어씁니다. 예를 들어, 동일한 [connections.example] 연결이 다음 위치에서 다른 매개 변수로 정의되어 있다고 가정합니다.

구성 파일의 위치

연결 정의

/etc/snowsql.cnf

[connections]

[connections.example]
username=user1

<HOME_DIR>/.snowsql/config

[connections]

[connections.example]
username=user2
password=<my-pwd>

명령을 실행하면 Snowflake CLI config.toml 파일에 다음 [connections.example] 정의가 포함됩니다(우선순위가 더 높은 파일에서).

[connections]

[connections.example]
username=user2
password=<my-pwd>

--snowsql-config-file 옵션을 사용하면 이 기본 동작을 재정의하고 대신 하나 이상의 특정 SnowSQL 구성 파일에서 가져올 수 있습니다.

snow helpers import-snowsql-connections 명령은 명명된 연결이 아닌 SnowSQL 의 기본 연결도 가져옵니다. 구성 파일의 [connections] 섹션에 직접 정의되어 있습니다. Snowflake CLI 는 모든 연결에 이름을 지정해야 하므로 이 명령은 [default] 라는 이름의 연결을 정의합니다. 기본 연결에 다른 이름을 사용하려면 --default-connection-name 옵션을 사용하여 지정할 수 있습니다.

SnowSQL 연결이 기존 Snowflake CLI 연결의 이름과 일치하는 경우 기존 연결을 덮어쓸 것인지 아니면 SnowSQL 연결 가져오기를 건너뛸 것인지 묻는 명령 프롬프트가 표시됩니다.

예

다음은 표준 구성 파일 위치에서 SnowSQL 연결을 가져오는 예입니다.

snow helpers import-snowsql-connections

이 명령은 SnowSQL 구성 파일을 처리할 때 진행 상황을 표시하고 Snowflake CLI config.toml 파일에 이미 같은 이름의 연결이 정의되어 있는 경우 확인 메시지를 표시합니다.

SnowSQL config file [/etc/snowsql.cnf] does not exist. Skipping.
SnowSQL config file [/etc/snowflake/snowsql.cnf] does not exist. Skipping.
SnowSQL config file [/usr/local/etc/snowsql.cnf] does not exist. Skipping.
Trying to read connections from [/Users/<user>/.snowsql.cnf].
Reading SnowSQL's connection configuration [connections.connection1] from [/Users/<user>/.snowsql.cnf]
Trying to read connections from [/Users/<user>/.snowsql/config].
Reading SnowSQL's default connection configuration from [/Users/<user>/.snowsql/config]
Reading SnowSQL's connection configuration [connections.connection1] from [/Users/<user>/.snowsql/config]
Reading SnowSQL's connection configuration [connections.connection2] from [/Users/<user>/.snowsql/config]
Connection 'connection1' already exists in Snowflake CLI, do you want to use SnowSQL definition and override existing connection in Snowflake CLI? [y/N]: Y
Connection 'connection2' already exists in Snowflake CLI, do you want to use SnowSQL definition and override existing connection in Snowflake CLI? [y/N]: n
Connection 'default' already exists in Snowflake CLI, do you want to use SnowSQL definition and override existing connection in Snowflake CLI? [y/N]: n
Saving [connection1] connection in Snowflake CLI's config.
Connections successfully imported from SnowSQL to Snowflake CLI.