Skip to content

Commit

Permalink
RAI-12190 Fix unintended change to DB link commands (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
wienleung committed May 31, 2023
1 parent e324ebc commit 12d91b6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rai/cmds.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ func createSnowflakeDatabaseLink(cmd *cobra.Command, args []string) {
database := action.getStringEnv("database", "SNOWSQL_DATABASE")
schema := action.getStringEnv("schema", "SNOWSQL_SCHEMA")
role := action.getStringEnv("role", "SNOWSQL_ROLE")
username := action.getString("username")
password := action.getString("password")
username := action.getStringEnv("username", "SNOWSQL_USER")
password := action.getStringEnv("password", "SNOWSQL_PWD")
creds := rai.SnowflakeCredentials{Username: username, Password: password}
name := fmt.Sprintf("%s.%s", database, schema)
action.Start("Create Snowflake database link '%s' (%s)", name, integration)
Expand Down Expand Up @@ -883,8 +883,8 @@ func deleteSnowflakeDatabaseLink(cmd *cobra.Command, args []string) {
database := action.getStringEnv("database", "SNOWSQL_DATABASE")
schema := action.getStringEnv("schema", "SNOWSQL_SCHEMA")
role := action.getStringEnv("role", "SNOWSQL_ROLE")
username := action.getString("username")
password := action.getString("password")
username := action.getStringEnv("username", "SNOWSQL_USER")
password := action.getStringEnv("password", "SNOWSQL_PWD")
creds := rai.SnowflakeCredentials{Username: username, Password: password}
name := fmt.Sprintf("%s.%s", database, schema)
action.Start("Delete Snowflake database link '%s' (%s)", name, integration)
Expand Down Expand Up @@ -923,8 +923,8 @@ func createSnowflakeDataStream(cmd *cobra.Command, args []string) {
dataStream := args[2]
role := action.getStringEnv("role", "SNOWSQL_ROLE")
warehouse := action.getStringEnv("warehouse", "SNOWSQL_WAREHOUSE")
username := action.getStringEnv("username", "SNOWSQL_USER")
password := action.getStringEnv("password", "SNOWSQL_PWD")
username := action.getString("username")
password := action.getString("password")
raiDatabase := action.getString("rai-database")
relation := action.getString("rai-relation")

Expand All @@ -947,8 +947,8 @@ func deleteSnowflakeDataStream(cmd *cobra.Command, args []string) {
dbLink := args[1]
dataStream := args[2]
role := action.getStringEnv("role", "SNOWSQL_ROLE")
username := action.getStringEnv("username", "SNOWSQL_USER")
password := action.getStringEnv("password", "SNOWSQL_PWD")
username := action.getString("username")
password := action.getString("password")
var creds *rai.SnowflakeCredentials
if username == "" && password == "" {
creds = nil
Expand Down

0 comments on commit 12d91b6

Please sign in to comment.