Skip to content

Commit

Permalink
feat: adding a subset of missing parameters (#1828)
Browse files Browse the repository at this point in the history
* adding new parameters

* adding a test for parameter

---------

Co-authored-by: Adam Healy <adam.healy@booking.com>
  • Loading branch information
adamhealy and Adam Healy authored May 30, 2023
1 parent f508129 commit 6d1a572
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/resources/account_parameter_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,19 @@ func TestAcc_AccountParameter_PREVENT_LOAD_FROM_INLINE_URL(t *testing.T) {
},
})
}

func TestAcc_AccountParameter_CLIENT_METADATA_USE_SESSION_DATABASE(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
Providers: providers(),
CheckDestroy: nil,
Steps: []resource.TestStep{
{
Config: accountParameterBasic("CLIENT_METADATA_USE_SESSION_DATABASE", "true"),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("snowflake_account_parameter.p", "key", "CLIENT_METADATA_USE_SESSION_DATABASE"),
resource.TestCheckResourceAttr("snowflake_account_parameter.p", "value", "true"),
),
},
},
})
}
34 changes: 34 additions & 0 deletions pkg/snowflake/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ func ParameterDefaults() map[string]ParameterDefault {
return nil
},
},
"CLIENT_METADATA_USE_SESSION_DATABASE": {
TypeSet: []ParameterType{ParameterTypeSession, ParameterTypeAccount},
DefaultValue: false,
Validate: validateBoolFunc,
},
"CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX": {
TypeSet: []ParameterType{ParameterTypeSession, ParameterTypeAccount},
DefaultValue: false,
Validate: validateBoolFunc,
},
"CLIENT_RESULT_COLUMN_CASE_INSENSITIVE": {
TypeSet: []ParameterType{ParameterTypeSession, ParameterTypeAccount},
DefaultValue: false,
Validate: validateBoolFunc,
},
"ENABLE_INTERNAL_STAGES_PRIVATELINK": {
TypeSet: []ParameterType{ParameterTypeAccount},
DefaultValue: false,
Expand Down Expand Up @@ -109,6 +124,20 @@ func ParameterDefaults() map[string]ParameterDefault {
return nil
},
},
"MULTI_STATEMENT_COUNT": {
TypeSet: []ParameterType{ParameterTypeSession, ParameterTypeAccount},
DefaultValue: 1,
Validate: func(value string) (err error) {
v, err := strconv.ParseInt(value, 10, 64)
if err != nil {
return fmt.Errorf("%v cannot be cast to an integer", value)
}
if v < 0 {
return fmt.Errorf("%v must be a positive integer", v)
}
return nil
},
},
"NETWORK_POLICY": {
TypeSet: []ParameterType{ParameterTypeAccount, ParameterTypeObject},
DefaultValue: "none",
Expand Down Expand Up @@ -258,6 +287,11 @@ func ParameterDefaults() map[string]ParameterDefault {
return nil
},
},
"QUOTED_IDENTIFIERS_IGNORE_CASE": {
TypeSet: []ParameterType{ParameterTypeSession, ParameterTypeAccount},
DefaultValue: false,
Validate: validateBoolFunc,
},
"ROWS_PER_RESULTSET": {
TypeSet: []ParameterType{ParameterTypeSession},
DefaultValue: 0,
Expand Down

0 comments on commit 6d1a572

Please sign in to comment.