Skip to content

Commit 12d91b6

Browse files
authored
RAI-12190 Fix unintended change to DB link commands (#63)
1 parent e324ebc commit 12d91b6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

rai/cmds.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,8 @@ func createSnowflakeDatabaseLink(cmd *cobra.Command, args []string) {
851851
database := action.getStringEnv("database", "SNOWSQL_DATABASE")
852852
schema := action.getStringEnv("schema", "SNOWSQL_SCHEMA")
853853
role := action.getStringEnv("role", "SNOWSQL_ROLE")
854-
username := action.getString("username")
855-
password := action.getString("password")
854+
username := action.getStringEnv("username", "SNOWSQL_USER")
855+
password := action.getStringEnv("password", "SNOWSQL_PWD")
856856
creds := rai.SnowflakeCredentials{Username: username, Password: password}
857857
name := fmt.Sprintf("%s.%s", database, schema)
858858
action.Start("Create Snowflake database link '%s' (%s)", name, integration)
@@ -883,8 +883,8 @@ func deleteSnowflakeDatabaseLink(cmd *cobra.Command, args []string) {
883883
database := action.getStringEnv("database", "SNOWSQL_DATABASE")
884884
schema := action.getStringEnv("schema", "SNOWSQL_SCHEMA")
885885
role := action.getStringEnv("role", "SNOWSQL_ROLE")
886-
username := action.getString("username")
887-
password := action.getString("password")
886+
username := action.getStringEnv("username", "SNOWSQL_USER")
887+
password := action.getStringEnv("password", "SNOWSQL_PWD")
888888
creds := rai.SnowflakeCredentials{Username: username, Password: password}
889889
name := fmt.Sprintf("%s.%s", database, schema)
890890
action.Start("Delete Snowflake database link '%s' (%s)", name, integration)
@@ -923,8 +923,8 @@ func createSnowflakeDataStream(cmd *cobra.Command, args []string) {
923923
dataStream := args[2]
924924
role := action.getStringEnv("role", "SNOWSQL_ROLE")
925925
warehouse := action.getStringEnv("warehouse", "SNOWSQL_WAREHOUSE")
926-
username := action.getStringEnv("username", "SNOWSQL_USER")
927-
password := action.getStringEnv("password", "SNOWSQL_PWD")
926+
username := action.getString("username")
927+
password := action.getString("password")
928928
raiDatabase := action.getString("rai-database")
929929
relation := action.getString("rai-relation")
930930

@@ -947,8 +947,8 @@ func deleteSnowflakeDataStream(cmd *cobra.Command, args []string) {
947947
dbLink := args[1]
948948
dataStream := args[2]
949949
role := action.getStringEnv("role", "SNOWSQL_ROLE")
950-
username := action.getStringEnv("username", "SNOWSQL_USER")
951-
password := action.getStringEnv("password", "SNOWSQL_PWD")
950+
username := action.getString("username")
951+
password := action.getString("password")
952952
var creds *rai.SnowflakeCredentials
953953
if username == "" && password == "" {
954954
creds = nil

0 commit comments

Comments
 (0)