Skip to content

Commit

Permalink
fix: change_enforce_network_policy_parameter_to_ddl_parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
yuukiyamanaka committed Jan 18, 2025
1 parent 61ee1bd commit c3356b1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/sdk/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ type AccountParameters struct {
EnableTriSecretAndRekeyOptOutForImageRepository *bool `ddl:"parameter" sql:"ENABLE_TRI_SECRET_AND_REKEY_OPT_OUT_FOR_IMAGE_REPOSITORY"`
EnableTriSecretAndRekeyOptOutForSpcsBlockStorage *bool `ddl:"parameter" sql:"ENABLE_TRI_SECRET_AND_REKEY_OPT_OUT_FOR_SPCS_BLOCK_STORAGE"`
EnableUnhandledExceptionsReporting *bool `ddl:"parameter" sql:"ENABLE_UNHANDLED_EXCEPTIONS_REPORTING"`
EnforceNetworkRulesForInternalStages *bool `ddl:"keyword" sql:"ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES"`
EnforceNetworkRulesForInternalStages *bool `ddl:"parameter" sql:"ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES"`
EventTable *string `ddl:"parameter,single_quotes" sql:"EVENT_TABLE"`
ExternalOAuthAddPrivilegedRolesToBlockedList *bool `ddl:"parameter" sql:"EXTERNAL_OAUTH_ADD_PRIVILEGED_ROLES_TO_BLOCKED_LIST"`
// InitialReplicationSizeLimitInTB is a string because values like 3.0 get rounded to 3, resulting in an error in Snowflake.
Expand Down
15 changes: 15 additions & 0 deletions pkg/sdk/parameters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ func TestUnSetObjectParameterNetworkPolicyOnUser(t *testing.T) {
})
}

func TestSetAccountParameterEnforceNetworkRulesForInternalStages(t *testing.T) {
opts := &AlterAccountOptions{
Set: &AccountSet{
Parameters: &AccountLevelParameters{
AccountParameters: &AccountParameters{
EnforceNetworkRulesForInternalStages: Bool(true),
},
},
},
}
t.Run("Set Enforce Network Rules for Internal Stages", func(t *testing.T) {
assertOptsValidAndSQLEquals(t, opts, "ALTER ACCOUNT SET ENFORCE_NETWORK_RULES_FOR_INTERNAL_STAGES = true")
})
}

func TestToAccountParameter(t *testing.T) {
type test struct {
input string
Expand Down

0 comments on commit c3356b1

Please sign in to comment.