Skip to content

Commit

Permalink
Add missing S3_STAGE_VPCE_DNS_NAME session parameter
Browse files Browse the repository at this point in the history
References: #2653
  • Loading branch information
sfc-gh-asawicki committed Mar 26, 2024
1 parent 2924866 commit 0ea4ef0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/sdk/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ const (
AccountParameterQueryTag AccountParameter = "QUERY_TAG"
AccountParameterQuotedIdentifiersIgnoreCase AccountParameter = "QUOTED_IDENTIFIERS_IGNORE_CASE"
AccountParameterRowsPerResultset AccountParameter = "ROWS_PER_RESULTSET"
AccountParameterS3StageVpceDnsName AccountParameter = "S3_STAGE_VPCE_DNS_NAME"
AccountParameterSimulatedDataSharingConsumer AccountParameter = "SIMULATED_DATA_SHARING_CONSUMER"
AccountParameterStatementTimeoutInSeconds AccountParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
AccountParameterStrictJSONOutput AccountParameter = "STRICT_JSON_OUTPUT"
Expand Down Expand Up @@ -409,6 +410,7 @@ const (
SessionParameterQueryTag SessionParameter = "QUERY_TAG"
SessionParameterQuotedIdentifiersIgnoreCase SessionParameter = "QUOTED_IDENTIFIERS_IGNORE_CASE"
SessionParameterRowsPerResultset SessionParameter = "ROWS_PER_RESULTSET"
SessionParameterS3StageVpceDnsName SessionParameter = "S3_STAGE_VPCE_DNS_NAME"
SessionParameterSimulatedDataSharingConsumer SessionParameter = "SIMULATED_DATA_SHARING_CONSUMER"
SessionParameterStatementTimeoutInSeconds SessionParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
SessionParameterStrictJSONOutput SessionParameter = "STRICT_JSON_OUTPUT"
Expand Down Expand Up @@ -480,6 +482,7 @@ const (
UserParameterQueryTag UserParameter = "QUERY_TAG"
UserParameterQuotedIdentifiersIgnoreCase UserParameter = "QUOTED_IDENTIFIERS_IGNORE_CASE"
UserParameterRowsPerResultset UserParameter = "ROWS_PER_RESULTSET"
UserParameterS3StageVpceDnsName UserParameter = "S3_STAGE_VPCE_DNS_NAME"
UserParameterSimulatedDataSharingConsumer UserParameter = "SIMULATED_DATA_SHARING_CONSUMER"
UserParameterStatementTimeoutInSeconds UserParameter = "STATEMENT_TIMEOUT_IN_SECONDS"
UserParameterStrictJsonOutput UserParameter = "STRICT_JSON_OUTPUT"
Expand Down Expand Up @@ -619,6 +622,7 @@ type SessionParameters struct {
QueryTag *string `ddl:"parameter,single_quotes" sql:"QUERY_TAG"`
QuotedIdentifiersIgnoreCase *bool `ddl:"parameter" sql:"QUOTED_IDENTIFIERS_IGNORE_CASE"`
RowsPerResultset *int `ddl:"parameter" sql:"ROWS_PER_RESULTSET"`
S3StageVpceDnsName *string `ddl:"parameter,single_quotes" sql:"S3_STAGE_VPCE_DNS_NAME"`
SimulatedDataSharingConsumer *string `ddl:"parameter,single_quotes" sql:"SIMULATED_DATA_SHARING_CONSUMER"`
StatementTimeoutInSeconds *int `ddl:"parameter" sql:"STATEMENT_TIMEOUT_IN_SECONDS"`
StrictJSONOutput *bool `ddl:"parameter" sql:"STRICT_JSON_OUTPUT"`
Expand Down Expand Up @@ -700,6 +704,7 @@ type SessionParametersUnset struct {
QueryTag *bool `ddl:"keyword" sql:"QUERY_TAG"`
QuotedIdentifiersIgnoreCase *bool `ddl:"keyword" sql:"QUOTED_IDENTIFIERS_IGNORE_CASE"`
RowsPerResultset *bool `ddl:"keyword" sql:"ROWS_PER_RESULTSET"`
S3StageVpceDnsName *bool `ddl:"keyword" sql:"S3_STAGE_VPCE_DNS_NAME"`
SimulatedDataSharingConsumer *bool `ddl:"keyword" sql:"SIMULATED_DATA_SHARING_CONSUMER"`
StatementTimeoutInSeconds *bool `ddl:"keyword" sql:"STATEMENT_TIMEOUT_IN_SECONDS"`
StrictJSONOutput *bool `ddl:"keyword" sql:"STRICT_JSON_OUTPUT"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/sdk/parameters_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func (sessionParameters *SessionParameters) setParam(parameter SessionParameter,
return fmt.Errorf("ROWS_PER_RESULTSET session parameter is an integer, got %v", value)
}
sessionParameters.RowsPerResultset = Pointer(v)
case SessionParameterS3StageVpceDnsName:
sessionParameters.S3StageVpceDnsName = &value
case SessionParameterSimulatedDataSharingConsumer:
sessionParameters.SimulatedDataSharingConsumer = &value
case SessionParameterStatementTimeoutInSeconds:
Expand Down
1 change: 1 addition & 0 deletions pkg/sdk/parameters_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestSessionParameters_setParam(t *testing.T) {
{parameter: SessionParameterQueryTag, value: "some", expectedValue: "some", accessor: func(sp *SessionParameters) any { return *sp.QueryTag }},
{parameter: SessionParameterQuotedIdentifiersIgnoreCase, value: "true", expectedValue: true, accessor: func(sp *SessionParameters) any { return *sp.QuotedIdentifiersIgnoreCase }},
{parameter: SessionParameterRowsPerResultset, value: "1", expectedValue: 1, accessor: func(sp *SessionParameters) any { return *sp.RowsPerResultset }},
{parameter: SessionParameterS3StageVpceDnsName, value: "some", expectedValue: "some", accessor: func(sp *SessionParameters) any { return *sp.S3StageVpceDnsName }},
{parameter: SessionParameterSimulatedDataSharingConsumer, value: "some", expectedValue: "some", accessor: func(sp *SessionParameters) any { return *sp.SimulatedDataSharingConsumer }},
{parameter: SessionParameterStatementTimeoutInSeconds, value: "1", expectedValue: 1, accessor: func(sp *SessionParameters) any { return *sp.StatementTimeoutInSeconds }},
{parameter: SessionParameterStrictJSONOutput, value: "true", expectedValue: true, accessor: func(sp *SessionParameters) any { return *sp.StrictJSONOutput }},
Expand Down

0 comments on commit 0ea4ef0

Please sign in to comment.